Transaction Sequence (Payset) - 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

Algorand Specifications

Each block contains a transaction sequence, an ordered sequence of transactions in that block.

The transaction sequence of block rr is denoted TxSeqrTxSeqr.

Each valid block contains a transaction commitment TxCommitrTxCommitr which is a Merkle Tree Commitment to this sequence.

The leaves in the Merkle Tree are hashed as:

Hash(TL,TxID,Hash(STIB))Hash(TL,TxID,Hash(STIB))

Where:

Signed transactions in a block STIBSTIB are encoded in a slightly different way than standalone transactions TxTx, for efficiency:

If a standalone transaction TxTx contains a GenesisIDGenesisID value, then:

Since transactions MUST include a GenesisHashGenesisHash value, the GenesisHashGenesisHash value of each transaction in a block MUST match the block’s GenesisHashGenesisHash, and the GenesisHashGenesisHash value is omitted from the STIBSTIB transaction as encoded in a block.

The transaction commitment (TxCommitTxCommit) for a block covers the transaction encodings with the changes described above.

Individual transaction signatures cover the original encoding of transactions as standalone transactions (TxTx).

In addition to the transaction commitment, each block contains SHA-256 and SHA-512 transaction commitments. They allow a verifier not supporting SHA-512/256 function to verify proof of membership for transactions.

To construct these commitments, we use a Vector Commitment.

The leaves in the Vector Commitment tree are hashed respectively as:

SHA256(TL,SHA256(TxID),SHA256(STIB))SHA256(TL,SHA256(TxID),SHA256(STIB))

and

SHA512(TL,SHA512(TxID),SHA512(STIB))SHA512(TL,SHA512(TxID),SHA512(STIB))

Where:

These Vector Commitments use SHA-256 and SHA-512 for internal nodes as well.

A valid transaction sequence TxSeqTxSeq contains no duplicates: each transaction in the transaction sequence MUST appear exactly once.

We can call the set of these transactions the transaction set (for convenience, we may also write TxSeqrTxSeqr to refer unambiguously to the set in this block).

For a block to be valid, its transaction sequence TxSeqrTxSeqr MUST be valid (i.e., no duplicate transactions may appear there).

All transactions have a size in bytes. The size of the transaction TxTx is denoted |Tx||Tx|.

For a block to be valid, the sum of the sizes of each transaction in a transaction sequence MUST NOT exceed BmaxBmax; in other words:

∑Tx∈TxSeqr|Tx|≤Bmax∑Tx∈TxSeqr|Tx|≤Bmax

The transaction tail TxTailTxTail for a given round rr is a set produced from the union of the transaction identifiers TxIDTxID of each transaction in the last TxTailmaxTxTailmax transaction sets and is used to detect duplicate transactions.

In other words,

TxTailr=⋃r−TxTailmax≤s≤r−1Hash(Tx)|Tx∈TxSeqs.TxTailr=⋃r−TxTailmax≤s≤r−1Hash(Tx)|Tx∈TxSeqs.

As a result, the transaction tail for round r+1r+1 is computed as follows:

TxTailr+1=TxTailr∖Hash(Tx)|Tx∈TxSeqr−Tmax∪Hash(Tx)|Tx∈TxSeqr.TxTailr+1=TxTailr∖Hash(Tx)|Tx∈TxSeqr−Tmax∪Hash(Tx)|Tx∈TxSeqr.

The transaction tail is part of the Ledger state but is distinct from the account state and is not committed to in the block.