Account State - Algorand Specifications
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.
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 section.
The account’s participation keys PartKeyPartKey are defined in Algorand’s specification of participation keys.
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.
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.