Skip to content

Commit

Permalink
Small cleanups to Transactions and states
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLind authored and aptos-bot committed Mar 16, 2022
1 parent 6a82e87 commit 6deceaa
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions developer-docs-site/docs/basics/basics-txns-states.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
title: "Transactions and states"
slug: "basics-txns-states"
---
The two fundamental concepts at the heart of the Aptos Blockchain are
The two fundamental concepts at the heart of the Aptos Blockchain are transactions and states:

* [Transactions](#transactions): Transactions represent the exchange of data and Aptos Coins between any two accounts on the Aptos Blockchain.
* [States](#ledger-state): The ledger state (state) represents the current snapshot of data on the blockchain. At any point in time, the blockchain has a ledger state.
* [Transactions](#transactions): Transactions represent the exchange of data (e.g., Aptos Coins or NFTs) between accounts on the Aptos Blockchain.
* [States](#ledger-state): The state (i.e., current blockchain ledger state) represents a snapshot of the blockchain as it currently stands.

When a submitted transaction is executed, the state of the Aptos Blockchain changes.
When a transaction is executed, the state of the Aptos Blockchain changes.

# Transactions

When an Aptos Blockchain participant submits a transaction, they are requesting the ledger state to be updated with their transaction information.
When an Aptos Blockchain client submits a transaction, they are requesting that the ledger state be updated with their transaction.

A [signed transaction](/reference/glossary#transaction) on the blockchain contains the following information:

- **Signature**: The sender uses a digital signature to verify that they signed the transaction.
- **Signature**: The sender uses a digital signature to verify that they signed the transaction (i.e., authentication).
- **Sender address**: The sender's [account address](/reference/glossary#account-address).
- **Sender public key**: The public authentication key that corresponds to the private authentication key used to sign the transaction.
- **Program**: The program comprises:
Expand All @@ -26,11 +26,11 @@ A [signed transaction](/reference/glossary#transaction) on the blockchain contai
- **Maximum gas amount**: The [maximum gas amount](/reference/glossary#maximum-gas-amount) is the maximum gas units the transaction is allowed to consume.
- **Gas currency code**: The currency code used to pay for gas.
- **Sequence number**: This is an unsigned integer that must be equal to the sender's account [sequence number](/reference/glossary#sequence-number) at the time of execution.
- **Expiration time**: The transaction ceases to be valid after this time.
- **Expiration time**: A timestamp after which the transaction ceases to be valid (i.e., expires).

# Ledger state

The Aptos Blockchain's ledger state or global [state](/reference/glossary#state) comprises the state of all accounts in the blockchain. Each validator node in the blockchain must know the global state of the latest version of the blockchain's distributed database (versioned database) to execute any transaction.
The Aptos Blockchain's ledger state (or global [state](/reference/glossary#state)) comprises the state of all accounts in the blockchain. Each validator node in the blockchain must know the global state of the latest version of the blockchain's distributed database (versioned database) to execute any transaction.

## Versioned database

Expand All @@ -53,7 +53,7 @@ In the figure:
| Name | Description |
| ---- | ----------- |
| Accounts **A** and **B** | Represent Alice's and Bob's accounts on the Aptos Blockchain |
| S<sub>N-1</sub> | Represents the (N-1)th state of the blockchain. In this state, Alice's account A has a balance of 110 Aptos Coins, and Bob's account B has a balance of 52 Aptos Coins. |
| T<sub>N</sub> | This is the n-th transaction executed on the blockchain. In this example, it represents Alice sending 10 Aptos Coins to Bob. |
| **F** | It is a deterministic function. F always returns the same final state for a specific initial state and a specific transaction. If the current state of the blockchain is S<sub>N-1</sub>, and transaction T<sub>N</sub> is executed on state S<sub>N-1</sub>, the new state of the blockchain is always S<sub>N</sub>. The Aptos Blockchain uses the [Move language](https://aptos.github.io/move) to implement the deterministic execution function F. |
| **S<sub>N</sub>** | This is the n-th state of the blockchain. When the transaction T<sub>N</sub> is applied to the blockchain, it generates the new state S<sub>N</sub> (an outcome of applying F to S<sub>N-1</sub> and T<sub>N</sub>). This causes Alice’s account balance to be reduced by 10 to 100 Aptos Coins and Bob’s account balance to be increased by 10 to 62 Aptos Coins. The new state S<sub>N</sub> shows these updated balances. |
| **S<sub>N-1</sub>** | Represents the (**N-1**)th state of the blockchain. In this state, Alice's account **A** has a balance of 110 Aptos Coins, and Bob's account **B** has a balance of 52 Aptos Coins. |
| **T<sub>N</sub>** | This is the **N**th transaction executed on the blockchain. In this example, it represents Alice sending 10 Aptos Coins to Bob. |
| **F** | It is a deterministic function. **F** always returns the same final state for a specific initial state and a specific transaction. If the current state of the blockchain is **S<sub>N-1</sub>**, and transaction **T<sub>N</sub>** is executed on state **S<sub>N-1</sub>**, the new state of the blockchain is always **S<sub>N</sub>**. The Aptos Blockchain uses the [Move language](https://aptos.github.io/move) to implement the deterministic execution function **F**. |
| **S<sub>N</sub>** | This is the **N**th state of the blockchain. When the transaction **T<sub>N</sub>** is applied to the blockchain, it generates the new state **S<sub>N</sub>** (an outcome of applying **F** to **S<sub>N-1</sub>** and **T<sub>N</sub>**). This causes Alice’s account balance to be reduced by 10 to 100 Aptos Coins and Bob’s account balance to be increased by 10 to 62 Aptos Coins. The new state **S<sub>N</sub>** shows these updated balances. |

0 comments on commit 6deceaa

Please sign in to comment.