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

A protocol version vv is a string no more than VmaxVmax bytes long. It corresponds to parameters used to execute some version of the Algorand protocol.

The upgrade vote in each block consists of:

- A protocol version vrvr;
- A 64-bit unsigned integer xrxr which indicates the delay between the acceptance of a protocol version and its execution;
- A single bit bb indicating whether the block proposer supports the given protocol version.

The upgrade state in each block/state consists of:

- The _current_ protocol version v∗rvr∗;
- The _next proposed_ protocol version v′rvr′;
- A 64-bit round number srsr counting the number of votes for the next protocol version;
- A 64-bit round number drdr specifying the deadline for voting on the next protocol version;
- A 64-bit round number x′rxr′ specifying when the next proposed protocol version would take effect, if passed.

An upgrade vote (vr,xr,b)(vr,xr,b) is _valid_ given the upgrade state (v∗r,v′r,sr,dr,x′r)(vr∗,vr′,sr,dr,xr′) if vrvr is the _empty_ string or v′rvr′ is the _empty_ string, δxmin≤xr≤δxmaxδxmin≤xr≤δxmax, and either:

- b=0b=0 or
- b=1b=1 with r<drr<dr and either

- v′rvr′ is not the empty string or
  - vrvr is not the empty string.

If the vote is valid, then the new upgrade state is

(v∗r+1,v′r+1,sr+1,dr+1,xr+1)(vr+1∗,vr+1′,sr+1,dr+1,xr+1)

Where

- v∗r+1vr+1∗ is v′rvr′ if r=x′rr=xr′ and v∗rvr∗ otherwise.

- v′r+1vr+1′ is  
  - the empty string if r=x′rr=xr′ or both r=srr=sr and sr+b<τsr+b<τ,
  - vrvr if v′rvr′ is the empty string, and
  - v′rvr′ otherwise.
- sr+1sr+1 is
  - 00 if r=x′rr=xr′ or both r=srr=sr and sr+b<τsr+b<τ, and  
  - sr+bsr+b otherwise
- dr+1dr+1 is
  - 00 if r=x′rr=xr′ or both r=srr=sr and sr+b<τsr+b<τ,
  - r+δdr+δd if v′rvr′ is the empty string and
    vrvr is not the empty string, and
  - drdr otherwise.
- xr+1xr+1 is
  - 00 if r=x′rr=xr′ or both r=srr=sr and sr+b<τsr+b<τ,
  - r+δd+δr+δd+δ if v′rvr′ is the empty string and vrvr is not  
    the empty string (where δ=δxδ=δx if xr=0xr=0  
    and δ=xrδ=xr if xr≠0xr≠0), and
  - x′rxr′ otherwise.
