## 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 reward state consists of three 64-bit unsigned integers:

- The total amount of money distributed to each earning unit since the genesis state TrTr,
- The amount of money to be distributed to each earning unit at the next round RrRr,
- The amount of money left over after distribution B∗rBr∗.

The reward state depends on:

- The address of the _incentive pool_ IpoolIpool,
- The functions Stake(r,Ipool)Stake(r,Ipool)
- Units(r)Units(r).

These are defined as part of the [Account State](https://specs.algorand.co/ledger/ledger-account-state).

Informally, every ωrωr rounds, the rate RrRr is updated such that rewards given over the next ωrωr rounds will drain the _incentive_ pool_, leaving it with the minimum balance bminbmin.

The _rewards residue_ B∗rBr∗ is the amount of leftover rewards that should have been given in the previous round but could not be evenly divided among all reward units. The residue carries over into the rewards to be given in the next round.

The actual draining of the incentive pool account is described in the [Validity and State Changes](https://specs.algorand.co/ledger/ledger-validation) section.

More formally, let Z=Units(r)Z=Units(r).

Given a reward state (Tr,Rr,B∗r)(Tr,Rr,Br∗), the new reward state is (Tr+1,Rr+1,B∗r+1)(Tr+1,Rr+1,Br+1∗), where:

- Rr+1=⌊Stake(r,Ipool)−B∗r−bminωr⌋Rr+1=⌊Stake(r,Ipool)−Br∗−bminωr⌋ if Rr≡0modωrRr≡0modωr or Rr+1=RrRr+1=Rr otherwise, and
- Tr+1=Tr+⌊RrZ⌋Tr+1=Tr+⌊RrZ⌋ if Z≠0Z≠0 or Tr+1=TrTr+1=Tr otherwise, and
- B∗r+1=(B∗r+Rr)modZBr+1∗=(Br∗+Rr)modZ if Z≠0Z≠0 or B∗r+1=B∗rBr+1∗=Br∗ otherwise.

A valid block’s reward state matches the expected reward state.
