Transactions - 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
A transaction defines a state transition of Accounts.
Algorand has 88 transaction types.
Transactions consist of:
- A header (common to any type),
- A body (type-specific).
Important
IMPLEMENTATION:
Transaction package.
Algorand transactions have two execution levels:
- Top Level: transactions are signed and cannot be duplicated in the Ledger,
- Inner Level: transactions are not signed and may be duplicated in the Ledger.
The transaction type is identified with a short string of at most 7 characters:
| TYPE ID | TRANSACTION TYPE |
|---|---|
pay |
Payment (ALGO transfer) |
keyreg |
Consensus participation keys registration and deregistration |
acfg |
Algorand Standard Asset transfer |
axfer |
Algorand Standard Asset creation and reconfiguration |
afrz |
Algorand Standard Asset freeze (whitelisting and blacklisting) |
appl |
Application (Smart Contract) call |
stpf |
Algorand State Proof |
hb |
Consensus heartbeat challenge |
For a formal definition of all transaction fields, refer to the normative section.
Important
IMPLEMENTATION:
The reference implementation also defines the
unknowntransaction type.Transaction types definition.
Important
IMPLEMENTATION:
Transaction types reference implementation.
The transaction header, equal for all transaction types, consists of:
TransactionTypeIdentifies the transaction type and the related body required fields.SenderThat signs the transaction.FeeThe amount paid by the sender to execute the transaction. Fees can be delegated (set to 00) within a transactionGroup.FirstValidRound\rF\rF andLastValidRound\rL\rL The difference (rL−rF)(rL−rF) cannot be greater than 10001000 rounds.Note(Optional) Contains up to 11 kB of arbitrary data.GenesisHashEnsures the transaction targets a specific Ledger (e.g.,wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=for MainNet).GenesisID(Optional) Like the Genesis Hash, it ensures that the transaction targets a specific Ledger (e.g.,mainnet-v1.0for MainNet).Group(Optional) A cryptographic commitment to the group this transaction is part of.Lease(Optional) 32-byte array that enforces mutual exclusion of transactions. If this field is set, it acquires aLease(Sender,Lease), valid until theLastValidRoundrLrL expires. While the transaction maintains theLease, no other transaction with the sameLeasecan be committed.
A typical use case of the
Leaseis a batch of signed transactions, with the sameLease, sent to the network to ensure only one is executed.
RekeyToAn Algorand address (32-byte). If non-zero, the transaction will set theSenderaccount’s spending key to this address as last transaction effect. Therefore, future transactions sent by theSenderaccount must now be signed with the secret key of the address.
The transaction header verification ensures that a transaction:
- Is signed adequately by the
Sender(eitherSingleSig,MultiSig, orLogicSig), - It is submitted to the right Ledger (
GenesisHash); - Pays the
MinFee(10001000 μALGO) orPerByteFee(if network is congested);Feeact as an anti-spam mechanism (grows exponentially if the network is congested or decays if there is spare block capacity);Feeprioritization is not enforced by consensus (although a node does that);- Inner Transaction costs always the
MinFee(regardless of network congestion); Feeare pooled inGrouptransactions;Feeis independent of theTransactionTypeor usage (i.e., no local fee market);
Round’s validity is not expired (10001000 rounds at most);FirstValidRoundcan be delayed in the future;Round’s validity handles transactions’ idempotency, letting Non-Archival nodes participate in consensus;- It is not leased (combination of
SenderandLease) in its validity range.