Soft Vote - Algorand Specifications
Keyboard shortcuts
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
- Auto
- Light
- Dark
Algorand Specifications
The soft vote stage (also known as “filtering”) filters the proposal-value candidates available for the round, selecting the one with the highest priority to vote for.
Let Priority be the function that determines which proposal-value to soft-vote for this round, as defined in the normative section:
Priority(v)=mini∈[0,wj){Hash(VRF.ProofToHash(y)‖Ij‖i)}
Where:
- v is a proposal value for this round,
- Ij is the proposer address identified by the subscript j,
- wj is the weight of the credentials for v by proposer Ij,
- y is the VRF proof as computed by proposer Ij using their VRF secret key.
The function selects the minimum among a set of wj hash values calculated as Hash(VRF.ProofToHash(y)‖Ij‖i), with i∈[0,wj).
The higher the credentials’ weight wj, the larger the set, the higher the chances for the proposer Ij to get the lowest value among all the players for this round.
Algorithm 4: Soft Vote
- function SoftVote()
- lowestObservedHash←∞
- v←⊥
- for votep∈V∗ do // The subset of votes corresponding to proposals
- priorityHash←Priority(votep)
- if priorityHash<lowestObservedHash then
- lowestObservedHash←priorityHash
- v←votep
- endif
- endfor
- if lowestObservedHash<∞ then
- for a∈A do
- credentials←Sortition(aI,r,p,soft)
- if credentialsj>0 then
- Broadcast(Vote(aI,r,p,soft,v,credentials))
- if RetrieveProposal(v) then
- Broadcast(RetrieveProposal(v))
- endif
- endif
- endfor
- endif
- endfunction
The soft vote stage is run after a timeout of DynamicFilterTimeout(p) (where p is the executing period of the node) is observed by the node (see the dynamic filter timeout section for more details).
Let V be the set of all observed votes in the currently executing round. For convenience, we define a subset, V∗, to be all proposals received; that is, V∗={vote∈V: votes=propose}.
With the aid of a priority function, this stage performs a filtering action, selecting the highest priority observed proposal to vote for, defined as the one with the lowest hashed value.
The priority function ( Algorithm 4 Lines 4 to 9) should be interpreted as follows.
Consider every proposal value votep in the subset V∗ and the hash of the VRF proof ProofToHash(y) obtained by its proposer in the sortition.
For each index i in the interval from 0 (inclusive) up to the proposer credentials’ weight1 (exclusive), the node hashes the concatenation of ProofToHash(y), the proposer address Ij and the index i, as Hash(VRF.ProofToHash(y)‖Ij‖i) (where Hash is the node’s general cryptographic hashing function).
Then, the node keeps track of the proposal-value v that minimizes the concatenation hashing ( Algorithm 4 Lines 6 to 8).
After running the filtering algorithm for all proposal votes observed, and assuming there was at least one proposal in V∗, the broadcasting section of the algorithm is executed ( Algorithm 4 Lines 11 to 15).
For every online account (registered on the node), selected to be part of the soft voting committee, a soft vote is broadcast for the previously filtered value v.
If the corresponding full proposal has already been observed and is available in P, it is also broadcast ( Algorithm 4 Lines 16 to 17).
If the previous assumption of non-empty V∗ does not hold, no broadcasting is performed, and the node produces no output in its filtering step.