## 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

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 (UnauthenticatedVoteUnauthenticatedVote) has the following fields:

- _Raw Vote_ (RR), an inner struct contains SenderSender, RoundRound, PeriodPeriod, StepStep, and ProposalProposal.

- _Unverified Credential_ (CredCred) contains a single field ProofProof, which is a VRF proof.

- _Signature_ (SignatureSignature), one-time signature of the vote.

> Important
> 
> **IMPLEMENTATION:**
> 
> Unauthenticated vote [reference implementation](https://github.com/algorand/go-algorand/blob/b6e5bcadf0ad3861d4805c51cbf3f695c38a93b7/agreement/vote.go#L42).

Once receiving an unverified vote (UnauthenticatedVoteUnauthenticatedVote) from the network, an Algorand node verifies its VRF selection key by checking the validity of the VRF Proof (in CredCred), 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 CredentialCredential struct, containing the following fields:

- _Unverifed Credential_ (UnauthenticatedCredentialUnauthenticatedCredential), the unverified selection key from the VRF proof.

- _Weight_ (WeightWeight), the weight of the vote.

- _VRF Output_ (VrfOutVrfOut), the cached output of VRF verification.

- _Domain Separation Enabled_ (DomainSeparationEnabledDomainSeparationEnabled, domain separation flag, now must be true by the protocol.

- _Hashable_ (HashableHashable), the original credential.

And this verified credential is wrapped in a VoteVote struct with _Raw Vote_ (RR), _Verified Credential_ (CredentialCredential), and _Signature_ (SignatureSignature).

> Important
> 
> **IMPLEMENTATION:**
> 
> Vote struct [reference implementation](https://github.com/algorand/go-algorand/blob/b6e5bcadf0ad3861d4805c51cbf3f695c38a93b7/agreement/vote.go#L50).
