## 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

Just as a block represents a transition between two Ledger states, a _transaction_ TxTx 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)Hash(Tx).

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 |

The _transaction type_ TxTypeTxType 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 |

The _sender_ II identifies the account that authorized the transaction.

The _fee_ ff specifies the processing fee the _sender_ pays to execute the transaction, expressed in μALGO.

The _fee_ **MAY** be set to 00 if the transaction is part of a [group](https://specs.algorand.co/ledger/ledger-txn-groups).

The _first valid round_ rfvrfv and _last valid round_ rlvrlv, define a round interval for which the transaction **MAY** be executed.

The _genesis hash_ GenesisHashGenesisHash defines the Ledger for which this transaction is valid.

The _genesis identifier_ GenesisIDGenesisID ( **OPTIONAL**) defines the Ledger for which this transaction is valid.

The _lease_ xx ( **OPTIONAL**) specifies transactions’ mutual exclusion. If x≠0x≠0 (i.e., xx 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 rlvrlv is confirmed.

The _group_ TxGTxG ( **OPTIONAL**) is a commitment whose meaning is described in the [Transaction Groups](https://specs.algorand.co/ledger/ledger-txn-groups) section.

The _rekey to_ RekeyToRekeyTo ( **OPTIONAL**) is an address. If nonzero, the transaction will set the _sender_ account’s _authorization address_ field to this value. If the RekeyToRekeyTo 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_](https://specs.algorand.co/keys/keys-root), while its address remains the same. The account is now controlled by the _authorization address_ (i.e., transaction signatures are checked against this address).

The _note_ NN ( **OPTIONAL**) contains arbitrary data appended to the transaction.
