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

$$ \newcommand \UnauthenticatedVote {\mathrm{UnauthenticatedVote}} \newcommand \UnauthenticatedCredential {\mathrm{UnauthenticatedCredential}} \newcommand \Sender {\mathrm{Sender}} \newcommand \Round {\mathrm{Round}} \newcommand \Period {\mathrm{Period}} \newcommand \Step {\mathrm{Step}} \newcommand \Proposal {\mathrm{Proposal}} \newcommand \VrfOut {\mathrm{VrfOut}} \newcommand \Credential {\mathrm{Credential}} \newcommand \Cred {\mathrm{Cred}} \newcommand \Weight {\mathrm{Weight}} \newcommand \DomainSeparationEnabled {\mathrm{DomainSeparationEnabled}} \newcommand \Hashable {\mathrm{Hashable}} \newcommand \Vote {\mathrm{Vote}} \newcommand \Sig {\mathrm{Signature}} $$

VRF Selection Keys

To check the validity of a voting message, its VRF Selection key needs to be verified. Algorand uses Verifiable Random Function (VRF) to generate selection keys.

More specifically, an unverified vote (\( \UnauthenticatedVote \)) has the following fields:

  • Raw Vote (\( \mathrm{R} \)), an inner struct contains \( \Sender \), \( \Round \), \( \Period \), \( \Step \), and \( \Proposal \).

  • Unverified Credential (\( \Cred \)) contains a single field \( \mathrm{Proof} \), which is a VRF proof.

  • Signature (\( \Sig \)), one-time signature of the vote.

⚙️ IMPLEMENTATION

Unauthenticated vote reference implementation.

Once receiving an unverified vote (\( \UnauthenticatedVote \)) from the network, an Algorand node verifies its VRF selection key by checking the validity of the VRF Proof (in \( \Cred \)), the committee membership parameters that it is conditioned on, and the voter’s voting stake.

If verified, the result of this verification is wrapped in a \( \Credential \) struct, containing the following fields:

  • Unverifed Credential (\( \UnauthenticatedCredential \)), the unverified selection key from the VRF proof.

  • Weight (\( \Weight \)), the weight of the vote.

  • VRF Output (\( \VrfOut \)), the cached output of VRF verification.

  • Domain Separation Enabled (\( \DomainSeparationEnabled \), domain separation flag, now must be true by the protocol.

  • Hashable (\( \Hashable \)), the original credential.

And this verified credential is wrapped in a \( \Vote \) struct with Raw Vote (\( \mathrm{R} \)), Verified Credential (\( \Credential \)), and Signature (\( \Sig \)).

⚙️ IMPLEMENTATION

Vote struct reference implementation.