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

$$ \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:

FIELDCODECTYPEREQUIRED
Transaction TypetypestringYes
SendersndaddressYes
Feefeeuint64Yes
First Valid Roundfvuint64Yes
Last Valid Roundlvuint64Yes
Genesis Hashgh[32]byteYes
Leaselx[32]byteNo
Genesis IdentifiergenstringNo
Groupgrp[32]byteNo
Rekey-torekeyaddressNo
Notenote[32]bytesNo

Transaction Type

The transaction type \( \TxType \) is a short string indicating the type of transaction.

The following transaction types are supported:

CODECDESCRIPTION
payALGO transfers (payment)
keyregConsensus keys registration
acfgAsset creation and configuration
axferAsset transfer
afrzAsset freeze and unfreeze
applApplication calls
stpfState Proof
hbConsensus 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