$$ \newcommand \Tx {\mathrm{Tx}} \newcommand \TxSeq {\mathrm{TxSeq}} \newcommand \TxTail {\mathrm{TxTail}} \newcommand \TxType {\mathrm{TxType}} \newcommand \TxCommit {\mathrm{TxCommit}} \newcommand \vpk {\mathrm{vpk}} \newcommand \spk {\mathrm{spk}} \newcommand \sppk {\mathrm{sppk}} \newcommand \vf {\mathrm{vf}} \newcommand \vl {\mathrm{vl}} \newcommand \vkd {\mathrm{vkd}} \newcommand \Hash {\mathrm{Hash}} \newcommand \nonpart {\mathrm{nonpart}} \newcommand \RekeyTo {\mathrm{RekeyTo}} \newcommand \FirstValidRound {r_\mathrm{fv}} \newcommand \LastValidRound {r_\mathrm{lv}} \newcommand \Genesis {\mathrm{Genesis}} \newcommand \GenesisID {\Genesis\mathrm{ID}} \newcommand \GenesisHash {\Genesis\Hash} \newcommand \Group {\Tx\mathrm{G}} \newcommand \RekeyTo {\mathrm{RekeyTo}} \newcommand \MaxTxnNoteBytes {T_{m,\max}} $$
Transactions
Just as a block represents a transition between two Ledger states, a transaction \( \Tx \) represents a transition between two account states.
Algorand transactions have different transaction types.
Transaction fields are divided into a:
-
A header, common to any type,
-
A body, which is type-specific.
Transaction fields are REQUIRED unless specified as OPTIONAL.
The cryptographic hash of the transaction fields, including the transaction specific fields of the body, is called the transaction identifier. This is written as \( \Hash(\Tx) \).
Transaction Header
A transaction header contains the following fields:
FIELD | CODEC | TYPE | REQUIRED |
---|---|---|---|
Transaction Type | type | string | Yes |
Sender | snd | address | Yes |
Fee | fee | uint64 | Yes |
First Valid Round | fv | uint64 | Yes |
Last Valid Round | lv | uint64 | Yes |
Genesis Hash | gh | [32]byte | Yes |
Lease | lx | [32]byte | No |
Genesis Identifier | gen | string | No |
Group | grp | [32]byte | No |
Rekey-to | rekey | address | No |
Note | note | [32]bytes | No |
Transaction Type
The transaction type \( \TxType \) is a short string indicating the type of transaction.
The following transaction types are supported:
CODEC | DESCRIPTION |
---|---|
pay | ALGO transfers (payment) |
keyreg | Consensus keys registration |
acfg | Asset creation and configuration |
axfer | Asset transfer |
afrz | Asset freeze and unfreeze |
appl | Application calls |
stpf | State Proof |
hb | Consensus heartbeat |
Sender
The sender \( I \) identifies the account that authorized the transaction.
Fee
The fee \( f \) specifies the processing fee the sender pays to execute the transaction, expressed in μALGO.
The fee MAY be set to \( 0 \) if the transaction is part of a group.
First and Last Valid Round
The first valid round \( \FirstValidRound \) and last valid round \( \LastValidRound \), define a round interval for which the transaction MAY be executed.
Genesis Hash
The genesis hash \( \GenesisHash \) defines the Ledger for which this transaction is valid.
Genesis Identifier
The genesis identifier \( \GenesisID \) (OPTIONAL) defines the Ledger for which this transaction is valid.
Lease
The lease \( x \) (OPTIONAL) specifies transactions’ mutual exclusion. If \( x \neq 0 \) (i.e., \( x \) is set) and this transaction is confirmed, then this transaction prevents another transaction from the same sender and with the same lease from being confirmed until \( \LastValidRound \) is confirmed.
Group
The group \( \Group \) (OPTIONAL) is a commitment whose meaning is described in the Transaction Groups section.
Rekey-to
The rekey to \( \RekeyTo \) (OPTIONAL) is an address. If nonzero, the transaction will set the sender account’s authorization address field to this value. If the \( \RekeyTo \) address matches the sender address, then the authorization address is instead set to zero, and the original spending keys are re-established.
The rekey functionally works as if the account replaces its private spending keys, while its address remains the same. The account is now controlled by the authorization address (i.e., transaction signatures are checked against this address).
Note
The note \( N \) (OPTIONAL) contains arbitrary data appended to the transaction.
- The note byte length MUST NOT exceed \( \MaxTxnNoteBytes \).
Semantic
TODO
Validation
TODO