Skip to content

Commit fd0294f

Browse files
Seulgi Kimmergify[bot]
authored andcommitted
Add spec for ChangeParameters
1 parent 221cd23 commit fd0294f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

spec/Staking.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,39 @@ share of "0xAB..CD" = Math.floor(35 * (1000 / (500 + 1000))) = 23
351351
remaing share (of author) = 110 - (11 + 23) = 76
352352
```
353353

354+
## ChangeParameters
355+
This transaction will change the common parameters when more than half of the stakeholders agree.
356+
It does not change other fields of the scheme file because there are fields related to the genesis block.
357+
358+
It also does not provide a voting feature.
359+
The vote initiator should collect the signatures through the off-chain.
360+
361+
This transaction increases the `seq` of `Metadata` and changes the `params` of `Metadata`.
362+
363+
### Action
364+
`[ 0xFF, metadata_seq, new_parameters, ...signatures ]`
365+
366+
#### metadata_seq
367+
The transaction fails if the metadata_seq is different from the `seq` of `Metadata` and is introduced to prevent replay attacks.
368+
369+
#### new_parameters
370+
```
371+
new_parameters := [ new_parameter(, new_parameter)* ]
372+
new_parameter := [ key, value ]
373+
374+
key := usize
375+
value := usize | u64 | boolean | string
376+
```
377+
It is the list of the fields that the transaction changes.
378+
The stakeholder MUST NOT sign the transaction when the type of value is not a type that the key expected.
379+
380+
The parameters that are not in the new_parameters are kept as the previous value.
381+
382+
#### signatures
383+
`signatures` are the ECDSA signatures of stakeholders.
384+
The stakeholders should send the signature of `blake256(rlp_encode([ 0xFF, metadata_seq, new_parameters ]))` to the vote initiator if they agree to the change.
385+
The transaction is valid only if more than half of the stakeholders agree.
386+
354387
# Revocation
355388

356389
`RequestRevoke` will queue a pending revocation instead of revoking a delegation immediately.

0 commit comments

Comments
 (0)