Voting for ledger alteration
Rationale
In all permission-less blockchains, if a majority of the power (eg. stake in PoS, hashrate in PoW…) decides to fork the blockchain by changing some values (for example the balance of an account) or even break consensus, they can already do it (see 51% Attack: Definition, Who Is At Risk, Example, and Cost ). Proof-of-X algorithms therefore already provide an approach to vote on-chain through hard forks (see Ethereum Classic).
The idea behind this proposal is to streamline voting so that it can be achieved through PoS majority voting without hard forks.
How it would work
A new “ChangeBatchProposal” operation is introduced and contains a batch of proposed ledger changes. Each proposed change within the batch has the following payload fields:
- [target_address]
- type of change:
- BALANCE_UPDATE [new_balance] to change the MAS balance of an account
- DATASTORE_REMOVE [key] to delete a datastore entry of an account
- DATASTORE_UPDATE [key] [value] to update a datastore entry of an account
- BYTECODE_UPDATE [value] to update the bytecode of an account
When this operation is executed, it registers a proposal in the state that expires 15 days later and gets a unique ID for the proposal.
Block headers contain an extra field: proposal_votes
that lists all the active proposal IDs for which the block producer wishes to cast a vote. A maximum of 5 votes (for different proposals) can be cast per block.
Two counters are added to the state for each proposal:
- total number of blocks since the proposal started
- number of blocks that voted for the proposal since it started
At the end of the slot at which a proposal expires (or if it expired before because of a network restart):
- look a the counters: if the majority of the blocks voted for the proposal, apply its changes to the ledger
- delete the proposal from the state
Node runner interface
TODO: how to notify node runners of proposals and show them their contents so that they can choose or not to cast a vote ?
Applications
This system is useful for:
- content moderation
- state fixes for example after a major hack
- preventing hard forks