## 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](https://specs.algorand.co/abft/abft-player-state#special-values):

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

1. function SoftVote()
2. lowestObservedHash←∞
3. v←⊥
4. for votep∈V∗ do // The subset of votes corresponding to proposals
5. priorityHash←Priority(votep)
6. if priorityHash<lowestObservedHash then
7. lowestObservedHash←priorityHash
8. v←votep
9. endif
10. endfor
11. if lowestObservedHash<∞ then
12. for a∈A do
13. credentials←Sortition(aI,r,p,soft)
14. if credentialsj>0 then
15. Broadcast(Vote(aI,r,p,soft,v,credentials))
16. if RetrieveProposal(v) then
17. Broadcast(RetrieveProposal(v))
18. endif
19. endif
20. endfor
21. endif
22. 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](https://specs.algorand.co/abft/non-normative/abft-nn-dynamic-filter-timeout) 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’ weight[1](https://specs.algorand.co/abft/non-normative/abft-nn-soft-vote#footnote-1) (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.
