# Transaction Reference

The tables below describe the fields used in Algorand transactions. Each table includes the field name, indicates if the field is required or optional, shows the type used in the protocol code, displays the codec name that appears in transactions, and provides a description of the field’s purpose. While the protocol types are shown in these tables, the input types may be different when using SDKs.

## Common Fields (Header and Type)

These fields are common to all transactions.

| Field        | Required  | Type       | codec  | Description |
|--------------|-----------|------------|--------|-------------|
| Fee          | _required_ | uint64     | "fee"   | Paid by the sender to the FeeSink to prevent denial-of-service. The minimum fee on Algorand is currently 1000 microAlgos. |
| FirstValid   | _required_ | uint64     | "fv"    | The first round for when the transaction is valid. If the transaction is sent prior to this round it will be rejected by the network. |
| GenesisHash  | _required_ | [32]byte   | "gh"    | The hash of the genesis block of the network for which the transaction is valid. See the genesis hash for MainNet, TestNet, and BetaNet. |
| LastValid    | _required_ | uint64     | "lv"    | The ending round for which the transaction is valid. After this round, the transaction will be rejected by the network. |
| Sender       | _required_ | Address     | "snd"   | The address of the account that pays the fee and amount. |
| TxType       | _required_ | string      | "type"  | Specifies the type of transaction. This value is automatically generated using any of the developer tools. |
| GenesisID    | _optional_ | string      | "gen"   | The human-readable string that identifies the network for the transaction. The genesis ID is found in the genesis block. See the genesis ID for MainNet, TestNet, and BetaNet. |
| Group        | _optional_ | [32]byte    | "grp"   | The group specifies that the transaction is part of a group and, if so, specifies the hash of the transaction group. Assign a group ID to a transaction through the workflow described in the [Atomic Transfers Guide](https://dev.algorand.co/concepts/transactions/atomic-txn-groups). |
| Lease        | _optional_ | [32]byte    | "lx"    | A lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes. |
| Note         | _optional_ | []byte      | "note"  | Any data up to 1000 bytes. |
| RekeyTo      | _optional_ | Address     | "rekey" | Specifies the authorized address. This address will be used to authorize all future transactions. |

## Payment Transaction

Transaction Object Type: `PaymentTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "pay".

| Field               | Required  | Type    | codec  | Description |
|---------------------|-----------|---------|--------|-------------|
| Receiver            | _required_ | Address   | "rcv"  | The address of the account that receives the [amount](https://dev.algorand.co/concepts/transactions/reference/#amount). |
| Amount              | _required_ | uint64   | "amt"  | The total amount to be sent in microAlgos. |
| CloseRemainderTo    | _optional_ | Address   | "close"| When set, it indicates that the transaction is requesting that the [Sender](https://dev.algorand.co/concepts/transactions/reference/#sender) account should be closed, and all remaining funds, after the [fee](https://dev.algorand.co/concepts/transactions/reference/#fee) and [amount](https://dev.algorand.co/concepts/transactions/reference/#amount) are paid, be transferred to this address. |

## Key Registration Transaction

Transaction Object Type: `KeyRegistrationTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "keyreg".

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| VotePk               | _required for online_          | ed25519PublicKey         | "votekey"       | The root participation public key. |
| SelectionPK          | _required for online_          | VrfPubkey               | "selkey"        | The VRF public key. |
| StateProofPk         | _required for online_          | MerkleSignature Verifier (64 bytes) | "sprfkey"       | The 64 byte state proof public key commitment. |
| VoteFirst            | _required for online_          | uint64                   | "votefst"      | The first round that the _participation key_ is valid. |
| VoteLast             | _required for online_          | uint64                   | "votelst"      | The last round that the _participation key_ is valid. |
| VoteKeyDilution      | _required for online_          | uint64                   | "votekd"       | This is the dilution for the 2-level participation key. |
| Nonparticipation      | _optional_                    | bool                     | "nonpart"      | All new Algorand accounts are participating by default. This means that they earn rewards. Mark an account nonparticipating by setting this value to `true`. |

## Asset Configuration Transaction

Transaction Object Type: `AssetConfigTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "acfg".

This is used to create, configure and destroy an asset depending on which fields are set.

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| ConfigAsset          | _required, except on create_   | uint64                   | "caid"         | For re-configure or destroy transactions, this is the unique asset ID. |
| [AssetParams](https://dev.algorand.co/concepts/transactions/reference/#asset-parameters) | _required, except on destroy_ | [AssetParams](https://dev.algorand.co/concepts/transactions/reference/#asset-parameters) | "apar"         | See AssetParams table for all available fields. |

## Asset Parameters

Object Name: `AssetParams`

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| Total                | _required on creation_         | uint64                   | "t"           | The total number of base units of the asset to create. |
| Decimals             | _required on creation_         | uint32                   | "dc"          | The number of digits to use after the decimal point when displaying the asset. |
| DefaultFrozen        | _required on creation_         | bool                     | "df"          | True to freeze holdings for this asset by default. |
| UnitName             | _optional_                    | string                   | "un"          | The name of a unit of this asset. Marc size is 8 bytes. |
| AssetName            | _optional_                    | string                   | "an"          | The name of the asset. Max size is 32 bytes. |
| URL                  | _optional_                    | string                   | "au"          | Specifies a URL where more information about the asset can be retrieved. |
| MetaDataHash         | _optional_                    | []byte                  | "am"          | This field is intended to be a 32-byte hash of some metadata that is relevant to your asset. |
| ManagerAddr          | _optional_                    | Address                   | "m"            | The address of the account that can manage the configuration of the asset. |
| ReserveAddr          | _optional_                    | Address                   | "r"            | The address of the account that holds the reserve units of the asset. |
| FreezeAddr           | _optional_                    | Address                   | "f"            | The address of the account used to freeze holdings of this asset. |
| ClawbackAddr         | _optional_                    | Address                   | "c"            | The address of the account that can clawback holdings of this asset. |

## Asset Transfer Transaction

Transaction Object Type: `AssetTransferTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "axfer".

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| XferAsset            | _required_                    | uint64                   | "xaid"         | The unique ID of the asset to be transferred. |
| AssetAmount          | _required_                    | uint64                   | "aamt"         | The amount of the asset to be transferred. |
| AssetSender          | _required_                    | Address                   | "asnd"         | The sender of the transfer. |
| AssetReceiver        | _required_                    | Address                   | "arcv"         | The recipient of the asset transfer. |
| AssetCloseTo         | _optional_                    | Address                   | "aclose"       | Specify this field to remove the asset holding from the sender account. |

## Asset OptIn Transaction

Transaction Object Type: `AssetTransferTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "axfer".

This is a special form of an Asset Transfer Transaction.

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| XferAsset            | _required_                    | uint64                   | "xaid"         | The unique ID of the asset to opt-in to. |
| Sender               | _required_                    | Address                   | "snd"          | The account which is allocating the asset to their account’s Asset map. |
| AssetReceiver        | _required_                    | Address                   | "arcv"         | The account that is allocating the asset to their account’s Asset map. |

## Asset Clawback Transaction

Transaction Object Type: `AssetTransferTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "axfer".

This is a special form of an Asset Transfer Transaction.

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| Sender               | _required_                    | Address                   | "snd"          | The sender of this transaction must be the clawback account specified in the asset configuration. |
| XferAsset            | _required_                    | uint64                   | "xaid"         | The unique ID of the asset to be transferred. |
| AssetAmount          | _required_                    | uint64                   | "aamt"         | The amount of the asset to be transferred. |
| AssetSender          | _required_                    | Address                   | "asnd"         | The address from which the funds will be withdrawn. |
| AssetReceiver        | _required_                    | Address                   | "arcv"         | The recipient of the asset transfer. |

## Asset Freeze Transaction

Transaction Object Type: `AssetFreezeTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "afrz".

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| FreezeAccount        | _required_                    | Address                   | "fadd"         | The address of the account whose asset is being frozen. |
| FreezeAsset          | _required_                    | uint64                   | "faid"         | The asset ID being frozen. |
| AssetFrozen          | _required_                    | bool                     | "afrz"         | True to freeze the asset. |

## Application Call Transaction

Transaction Object Type: `ApplicationCallTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "appl".

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| Application ID       | _required_                    | uint64                   | "apid"         | ID of the application being configured or empty if creating. |
| OnComplete           | _required_                    | uint64                   | "apan"         | Defines what additional actions occur with the transaction. |
| Accounts             | _optional_                    | []Address                | "apat"         | List of accounts in addition to the sender that may be accessed from the application’s approval-program. |
| Approval Program      | _optional_                    | []byte                    | "apap"         | Logic executed for every application transaction. |
| App Arguments        | _optional_                    | [][]byte                 | "abaa"         | Transaction specific arguments accessed from the application’s approval-program. |
| Clear State Program  | _optional_                    | []byte                    | "apsu"         | Logic executed for application transactions with on-completion set to “clear”. |
| Foreign Apps         | _optional_                    | []uint64                 | "apfa"         | Lists the applications in addition to the application-id whose global states may be accessed. |
| Foreign Assets       | _optional_                    | []uint64                 | "apas"         | Lists the assets whose AssetParams may be accessed. |
| GlobalStateSchema    | _optional_                    |                          | "apgs"         | Holds the maximum number of global state values defined within an object. |
| LocalStateSchema     | _optional_                    |                          | "apls"         | Holds the maximum number of local state values defined within an object. |
| ExtraProgramPages    | _optional_                    | uint64                   | "apep"         | Number of additional pages allocated to the application’s approval and clear state programs. |
| Boxes                | _optional_                    | []BoxRef                | "apbx"         | The boxes that should be made available for the runtime of the program. |
| RejectVersion        | _optional_                    | uint64                   | "aprv"         | If the application being called has a version equal to or greater than the provided reject version, the transaction will be rejected. |
| AccessList           | _optional_                    | [[]Resource]             | "al"           | An array of resources that the application or group can use. |

## Storage State Schema

Object Name: `StateSchema`

The `StateSchema` object is only required for the create application call transaction. The `StateSchema` object must be fully populated for both the `GlobalStateSchema` and `LocalStateSchema` objects.

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| Number Ints         | _required_                    | uint64                   | "nui"         | Maximum number of integer values that may be stored in the application key/value store. |
| Number ByteSlices    | _required_                    | uint64                   | "nbs"         | Maximum number of byte slices values that may be stored in the application key/value store. |

## Signed Transaction

Transaction Object Type: `SignedTxn`

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| Sig                  | _required, if no other sig specified_ | crypto.Signature      | "sig"         |  |
| LogicSig            | _required, if no other sig specified_ | LogicSig              | "lsig"        |  |
| Msig                 | _required, if no other sig specified_ | crypto.MultisigSig    | "msig"        |  |
| Transaction          | _required_                    | Transaction              | "txn"         | [`PaymentTx`](https://dev.algorand.co/concepts/transactions/reference/#payment-transaction), [`KeyRegistrationTx`](https://dev.algorand.co/concepts/transactions/reference/#key-registration-transaction) , [`AssetConfigTx`](https://dev.algorand.co/concepts/transactions/reference/#asset-configuration-transaction), [`AssetTransferTx`](https://dev.algorand.co/concepts/transactions/reference/#asset-transfer-transaction) , [`AssetFreezeTx`](https://dev.algorand.co/concepts/transactions/reference/#asset-freeze-transaction) or [`ApplicationCallTx`](https://dev.algorand.co/concepts/transactions/reference/#application-call-transaction) |

## Heartbeat Transaction

Transaction Object Type: `HeartbeatTx`

Includes all fields in [Header](https://dev.algorand.co/concepts/transactions/reference/#common-fields-header-and-type) and "type" is "hbt".

| Field                | Required                       | Type                        | codec               | Description |
|----------------------|--------------------------------|--------------------------|-------------------|-------------|
| HbAddress            | _required_                    | Address                   | "hbad"         | The account this transaction is proving onlineness for. |
| HbKeyDilution        | _required_                    | uint64                   | "hbkd"         | Must match HbAddress account’s current KeyDilution. |
| HbProof              | _required_                    | HbProofFields            | "hbpf"         | The heartbeat proof fields. |
| HbSeed               | _required_                    | []byte                  | "hbsd"         | Must be the block seed for this transaction’s firstValid block. |
| HbVoteID            | _required_                    | []byte                  | "hbvid"         | Must match the HbAddress account’s current VoteID. |
