The Aptos blockchain stores three types of data:

*   **Transactions**: Transactions represent an intended operation being performed by an account on the blockchain (e.g., transferring assets).
*   **States**: The (blockchain ledger) state represents the accumulation of the output of execution of transactions, the values stored within all [resources](/network/blockchain/resources).
*   [**Events**](/network/blockchain/events): Ancillary data published by the execution of a transaction.

Note

Only transactions can change the ledger state.

## Transactions

[](#transactions)

Aptos transactions contain information such as the sender’s account address, authentication from the sender, the desired operation to be performed on the Aptos blockchain, and the amount of gas the sender is willing to pay to execute the transaction.

### Transaction states

[](#transaction-states)

A transaction may end in one of the following states:

*   Committed on the blockchain and executed. This is considered as a successful transaction.
*   Committed on the blockchain and aborted. The abort code indicates why the transaction failed to execute.
*   Discarded during transaction submission due to a validation check such as insufficient gas, invalid transaction format, or incorrect key.
*   Discarded after transaction submission but before attempted execution. This could be caused by timeouts or insufficient gas due to other transactions affecting the account.

The sender’s account will be charged gas for any committed transactions.

During transaction submission, the submitter is notified of successful submission or a reason for failing validations otherwise.

A transaction that is successfully submitted but ultimately discarded may have no visible state in any accessible Aptos node or within the Aptos network. A user can attempt to resubmit the same transaction to re-validate the transaction. If the submitting node believes that this transaction is still valid, it will return an error stating that an identical transaction has been submitted.

The submitter can try to increase the gas cost by a trivial amount to help make progress and adjust for whatever may have been causing the discarding of the transaction further downstream.

Note

See [Aptos Blockchain Deep Dive](/network/blockchain/blockchain-deep-dive) for a comprehensive description of the Aptos transaction lifecycle.

### Contents of a Transaction

[](#contents-of-a-transaction)

A signed transaction on the blockchain contains the following information:

*   **Signature**: The sender’s digital signature authenticates the transaction. Multi-agent and fee-payer transactions include additional signatures.
*   **Sender address**: The sender’s [account address](/network/blockchain/accounts#account-address).
*   **Sender public key**: The public key that corresponds to the private key used to sign the transaction. The derived authentication key must match the account.
*   **Payload**: The operation to run. Commonly this is an entry function in published Move bytecode. It can also be a [transaction script](/network/glossary#transaction-script), a [multisig payload](/network/blockchain/transaction-payloads#multisig-payload), or (on supporting networks) an [encrypted payload](/network/blockchain/transaction-payloads#encrypted-payload). The payload includes type arguments and inputs. A typical example is transferring APT from the sender to another address.
*   [**Gas unit price**](/network/glossary#gas-unit-price): What the sender pays per unit of gas, in [Octas](/network/glossary#octa). Higher prices raise the chance the next block includes the transaction.
*   [**Maximum gas amount**](/network/glossary#maximum-gas-amount): The [maximum gas units](/network/blockchain/gas-txn-fee#specifying-gas-fees-within-a-transaction) the sender will spend. Execution aborts if computation, IO, and converted storage fees exceed this cap.
*   **Replay protection**: Either a [sequence number](/network/blockchain/accounts#account-sequence-number) that must match the sender’s on-chain sequence number at execution, or an [orderless nonce](/build/guides/orderless-transactions) (AIP-123). Orderless transactions set `sequence_number` to `u64::MAX` and expire within 60 seconds.
*   **Expiration time**: A timestamp after which the transaction is no longer valid.
*   **Chain ID**: Distinguishes Mainnet, Testnet, Devnet, and local networks so a signed transaction cannot be replayed on another chain.

### Types of transaction payloads

[](#types-of-transaction-payloads)

Within a given transaction, the two most common types of payloads include:

*   An entry point
*   [A script (payload)](/build/smart-contracts/scripts)

The official [TypeScript](/build/sdks/ts-sdk), [Python](/build/sdks/python-sdk), [Go](/build/sdks/go-sdk), and [Rust](/build/sdks/rust-sdk) SDKs support both. Examples in this documentation often call `0x1::aptos_account::transfer`.

All operations on the Aptos blockchain should be available via entry point calls. While one could submit multiple transactions calling entry points in series, many such operations may benefit from being called atomically from a single transaction. A script payload transaction can call any entry point or public function defined within any module.

Note

See the tutorial on [Your First Transaction](/build/guides/first-transaction) for generating valid transactions.

Tip

See [Transaction Payloads and BCS](/network/blockchain/transaction-payloads) for the entry function, script, multisig, versioned, and encrypted payload formats and their BCS layouts.

Note

The Aptos REST API supports generating BCS-encoded transactions from JSON. This is useful for rapid prototyping, but be cautious using it in Mainnet as this places a lot of trust on the fullnode generating the transaction.

Tip

See also: [Encrypted Pending Transactions](/build/guides/encrypted-pending-transactions) — submit a transaction whose Move payload stays encrypted while pending, on networks that support the feature (AIP-144).

## States

[](#states)

The Aptos blockchain’s ledger state, or global state, represents the state of all accounts in the Aptos blockchain. Each validator node in the blockchain must know the latest version of the global state to execute any transaction.

Anyone can submit a transaction to the Aptos blockchain to modify the ledger state. Upon execution of a transaction, a transaction output is generated. A transaction output contains zero or more operations to manipulate the ledger state called **write sets** emitting a vector of resulting events, the amount of gas consumed, and the executed transaction status.

### Proofs

[](#proofs)

The Aptos blockchain uses proofs to verify the authenticity and correctness of the blockchain data.

Data within the Aptos blockchain is replicated across the network. Each validator and fullnode’s [storage](/network/blockchain/validator-nodes#storage) is responsible for persisting the agreed upon blocks of transactions and their execution results to the database.

The blockchain is represented as an ever-growing [Merkle tree](/network/glossary#merkle-trees), where each leaf appended to the tree represents a single transaction executed by the blockchain.

All operations executed by the blockchain and all account states can be verified cryptographically. These cryptographic proofs ensure that:

*   The validator nodes agree on the state.
*   The client does not need to trust the entity from which it is receiving data. For example, if a client fetches the last **n** transactions from an account, a proof can attest that no transactions were added, omitted or modified in the response. The client may also query for the state of an account, ask whether a specific transaction was processed, and so on.

### Versioned database

[](#versioned-database)

The ledger state is versioned using an unsigned 64-bit integer corresponding to the number of transactions the system has executed. This versioned database allows the validator nodes to:

*   Execute a transaction against the ledger state at the latest version.
*   Respond to client queries about ledger history at both current and previous versions.

## Transactions change ledger state

[](#transactions-change-ledger-state)

![Signed Transaction Flow](/_astro/transactions-and-state.DnHxozEu.svg) ![Signed Transaction Flow](/_astro/transactions-and-state-dark.ffwcWBtN.svg)

The above figure shows how executing transaction T_i_ changes the state of the Aptos blockchain from S_i-1_ to S_i_.

In the figure:

*   Accounts **A** and **B**: Represent Alice’s and Bob’s accounts on the Aptos blockchain.
*   **S_i-1_** : Represents the (_i-1_)th state of the blockchain. In this state, Alice’s account **A** has a balance of 110 APT, and Bob’s account **B** has a balance of 52 APT.
*   **T_i_** : This is the _i_\-th transaction executed on the blockchain. In this example, it represents Alice sending 10 APT to Bob.
*   **Apply()**: This is a deterministic function that always returns the same final state for a specific initial state and a specific transaction. If the current state of the blockchain is **S_i-1_**, and transaction **T_i_** is executed on the state **S_i-1_**, then the new state of the blockchain is always **S_i_**. The Aptos blockchain uses the [Move language](https://aptos-labs.github.io/move-book/) to implement the deterministic execution function **Apply()**.
*   **S_i_** : This is the \_i\_th state of the blockchain. Applying **T_i_** produces **S_i_** = **Apply(S_i-1_, T_i_)**. Alice’s balance drops by 10 to 100 APT and Bob’s balance rises by 10 to 62 APT.

## Size limits

[](#size-limits)

The gas schedule publishes on-chain limits for [transaction size](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/aptos-gas-schedule/src/gas_schedule/transaction.rs) and execution output. Current genesis defaults:

<table><thead><tr><th>Limit Type</th><th>Current Per Transaction Limit</th></tr></thead><tbody><tr><td>transaction</td><td>64KB</td></tr><tr><td>governance transaction</td><td>1MB</td></tr><tr><td>a single write op</td><td>1MB</td></tr><tr><td>all write ops combined</td><td>10MB</td></tr><tr><td>number of write ops</td><td>8192</td></tr><tr><td>a single event</td><td>1MB</td></tr><tr><td>all events combined</td><td>10MB</td></tr></tbody></table>