## 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 _balances_ are a set of mappings from _addresses_, 256-bit integers, to _balance_ _records_.

A _balance record_ contains the following fields:

- The account _raw balance_ in μALGO,
- The account _status_,
- The block incentive _eligibility_ flag,
- The account _last_proposed_ round,
- The account _last_ heartbeat_ round,
- The account _rewards base_ and _total awarded amount_ in μALGO,
- The account _spending key_,
- The account [participation keys](https://specs.algorand.co/keys/keys-participation).

> In the rest of this section, all references to _Reward calculation_ are with respect to the legacy distribution rewards system. They are kept here for completeness and for backward compatibility.

The account raw balance aIaI is a 64-bit unsigned integer which determines how much μALGO the address has.

The account rewards base a′IaI′ and total-awarded amount a∗IaI∗ are 64-bit unsigned integers.

Combined with the account balance, the reward base and total awarded amount are used to distribute rewards to accounts lazily.

The _account stake_ is a function which maps a given account and round to the account’s balance in that round and is defined as follows:

Stake(r,I)=aI+(Tr−a∗I)⌊aIA⌋Stake(r,I)=aI+(Tr−aI∗)⌊aIA⌋

unless pI=2pI=2 (see below), in which case:

Stake(r,I)=aIStake(r,I)=aI

Units(r)Units(r) is a function that computes the total number of whole _earning_ _units_ present in a system at round rr.

A user owns ⌊aIA⌋⌊aIA⌋ whole earning units,
so the total number of earning units in the system is:

Units(r)=∑I⌊aIA⌋Units(r)=∑I⌊aIA⌋

for the aIaI corresponding to round rr.

In this sum, online and offline accounts are taken into consideration.

The account status pIpI is an 8-bit unsigned integer which is either 0,1,20,1,2:

- A status of 0 corresponds to an _offline_ account,
- A status of 1 corresponds to an _online_ account,
- A status of 2 corresponds to a _non-participating_ account.

Combined with the account stake, the account status determines how much _voting_ _stake_ an account has, which is a 64-bit unsigned integer defined as follows:

- The account balance, if the account is online.
- 0 otherwise.

The account’s _spending key_ determines how transactions from this account must be authorized (e.g., what public key to verify transaction signatures against).

Transactions from this account must have this value (or, if this value zero, the account’s address) as their _authorization address_. This is described in the [Authorization and Signatures](https://specs.algorand.co/ledger/ledger-txn-authorization) section.

The account’s _participation keys_ PartKeyPartKey are defined in Algorand’s [specification of participation keys](https://specs.algorand.co/keys/keys-participation).

The account’s eligibility AeAe is a flag that determines whether the account has elected to receive payouts for proposing blocks (assuming it meets balance requirements at the time of block proposal).

An account’s participation keys and voting stake from a recent round is returned by the RecordRecord procedure in the [Byzantine Agreement Protocol](https://specs.algorand.co/abft/abft).

There exist two special addresses:

- IpoolIpool, the address of the _incentive pool_,
- IfIf, the address of the _fee sink_.

For both of these accounts, pI=2pI=2.
