5/5
## The Complete Lifecycle of an Ethereum Transaction Every time you send ETH, swap a token, or mint an NFT on Ethereum, you initiate a transaction. But what happens between the moment you click "Confirm" in your wallet and when your action becomes a permanent, irreversible part of the blockchain? This lesson unpacks that entire journey, revealing how a simple instruction transforms the global state of Ethereum. At its core, every transaction is a signed message from an account owner instructing the network to perform a specific action. The ultimate goal of this action is to alter the **state** of the blockchain. The "state" is simply the complete record of all account balances and smart contract data at any given moment—think of it as a massive, shared digital ledger. When your transaction successfully executes, it changes that ledger, creating a new, updated state that all participants in the network agree upon. For example, consider a simple transfer: * **Initial State:** Ciara has 1 ETH, and Patrick has 0 ETH. * **Transaction:** Ciara sends 1 ETH to Patrick. * **Final State:** The transaction is processed, leading to a "state change." Ciara's balance is now 0 ETH, and Patrick's is 1 ETH. For this state change to become official, it must go through a multi-step process of creation, validation, and consensus. Let's trace that path step by step. ## Step 1: Creating the Transaction When you initiate an action in a wallet like MetaMask, the software automatically assembles a transaction object in the background. This object is a data structure containing several critical fields that define the instruction: * **Chain ID:** A unique number identifying the target blockchain (e.g., `1` for Ethereum Mainnet, `111555111` for the Sepolia testnet). This crucial field prevents "replay attacks," where a transaction intended for one network could be maliciously re-broadcast on another. * **Nonce:** Short for "Number Used Once," the nonce is a transaction counter for the sending account, starting at 0. Each new transaction from that account must have a nonce exactly one higher than the last. This strict ordering prevents transactions from being processed out of sequence or duplicated. * **Gas Parameters:** These fields define the fee you are willing to pay to have your transaction processed. * **Max Priority Fee Per Gas:** This is the "tip" you offer directly to the validator to incentivize them to include your transaction in the next block. * **Max Fee Per Gas:** This sets the absolute maximum total fee (base fee + tip) you are willing to pay per unit of gas. Any difference between this max fee and the actual fee paid is refunded to you. * **Gas Limit:** The maximum amount of computational work (gas) your transaction is allowed to consume. This acts as a safety measure to prevent buggy smart contracts from accidentally draining your entire account balance. * **Transaction Details:** * **Recipient Address (`to`):** The address of the account or smart contract you are interacting with. * **Value:** The amount of ETH being transferred in the transaction. * **Data:** An optional field used for smart contract interactions. It contains the encoded function and parameters for the specific action you want the contract to perform. * **Access List:** An advanced feature that can reduce gas costs by pre-declaring which addresses and storage slots the transaction will access. ## Step 2: Signing the Transaction Once the transaction object is assembled, it must be authorized. This is where your private key comes into play. The process is a cornerstone of blockchain security: 1. The transaction data is serialized into a standard, structured format. 2. This data is then cryptographically hashed, producing a unique, fixed-length string of characters known as the **Transaction Hash**. This hash serves as the transaction's unique identifier, which you can use to track it on a block explorer like Etherscan. 3. You then use your **private key** to cryptographically sign this transaction hash. This produces a digital signature, which is irrefutable proof that you, the owner of the account, have approved this exact transaction. ## Step 3: Broadcasting the Transaction With a valid signature attached, your wallet sends the signed transaction to an Ethereum node. This communication happens over an **RPC (Remote Procedure Call) endpoint**, which acts like a telephone line connecting your wallet to the Ethereum network. Your wallet "calls up" a node and submits the transaction for processing. ## Step 4: Entering the Mempool When a node receives your transaction, it first performs a series of quick validation checks. It verifies the digital signature is correct and confirms that you have enough ETH in your account to cover both the transaction's value and the maximum potential gas fee. If the transaction passes these checks, the node adds it to its local **Mempool** (short for Memory Pool). The mempool is best understood as a "waiting room" for valid, pending transactions that have not yet been included in a block. The node then broadcasts this transaction to its peers, and they broadcast it to theirs, ensuring it quickly propagates across the entire network. ## Step 5: Being Selected for a Block Every 12 seconds (a period known as a "slot"), the Ethereum protocol selects one validator to be the block producer. This validator's job is to build and propose the next block for the chain. To do this, the validator looks at the transactions waiting in its mempool and selects which ones to include. Validators are economically motivated to prioritize transactions offering the highest **Max Priority Fee Per Gas** (the tip), as they get to keep these fees as a reward. The validator executes the chosen transactions in order, updates its local copy of the blockchain state based on their outcomes, and bundles them into a new block. Finally, the validator signs and broadcasts this proposed block to the rest of the network. ## Step 6: Attestation and Finalization The journey isn't over once the transaction is in a proposed block. The network must reach a consensus on the block's validity. 1. **Attestation:** Other validators, organized into a committee, receive the proposed block. They re-execute the transactions themselves to verify that the resulting state change is correct and that all signatures are valid. If they agree with the proposed block, they broadcast an "attestation" vote in its favor. 2. **Inclusion:** If the block receives attestations from validators representing at least two-thirds of the staked ETH in that committee, it is officially added to the blockchain. At this point, your transaction is considered **confirmed**. 3. **Finalization:** While confirmed is good, **finalized** is better. A block is considered final and irreversible once it has been attested to by a supermajority (2/3) of all active validators on the entire network. This typically happens after two epochs (an epoch is 32 slots, or about 6.4 minutes). Once a block is finalized, it is practically impossible to alter or remove, providing the highest level of security. ## From Pending to Final: Transaction Statuses As your transaction moves through this lifecycle, its status changes. You can track these stages on a block explorer: * **Pending:** The transaction is in the mempool, waiting to be selected by a validator. * **Confirmed (or Success):** The transaction has been included in a block that has been successfully added to the chain. This typically takes about **12 seconds**. * **Finalized:** The block containing your transaction is now considered irreversible. This process takes approximately **12.8 minutes** from the time of submission. * **Reverted (or Failed):** The transaction was included in a block, but its execution failed (e.g., a smart contract check did not pass). The state change is rolled back, but the gas fee is still consumed. * **Dropped:** The transaction was removed from the mempool before ever being included in a block, often due to a very low gas fee or being replaced by another transaction with the same nonce. ## Conclusion: Securing the Digital Ledger This entire, intricate lifecycle applies to transactions initiated by standard user-controlled accounts, known as Externally Owned Accounts (EOAs). Each step, from the cryptographic signature to network-wide attestation, is designed to ensure that every change to Ethereum's shared state is authorized, valid, and permanent. This foundation allows us to explore the second type of account on Ethereum: Smart Contract Accounts. In our next lesson, we will examine how these accounts operate and how they are being revolutionized by a powerful concept called Account Abstraction.
Every time you send ETH, swap a token, or mint an NFT on Ethereum, you initiate a transaction. But what happens between the moment you click "Confirm" in your wallet and when your action becomes a permanent, irreversible part of the blockchain? This lesson unpacks that entire journey, revealing how a simple instruction transforms the global state of Ethereum.
At its core, every transaction is a signed message from an account owner instructing the network to perform a specific action. The ultimate goal of this action is to alter the state of the blockchain. The "state" is simply the complete record of all account balances and smart contract data at any given moment—think of it as a massive, shared digital ledger. When your transaction successfully executes, it changes that ledger, creating a new, updated state that all participants in the network agree upon.
For example, consider a simple transfer:
Initial State: Ciara has 1 ETH, and Patrick has 0 ETH.
Transaction: Ciara sends 1 ETH to Patrick.
Final State: The transaction is processed, leading to a "state change." Ciara's balance is now 0 ETH, and Patrick's is 1 ETH.
For this state change to become official, it must go through a multi-step process of creation, validation, and consensus. Let's trace that path step by step.
When you initiate an action in a wallet like MetaMask, the software automatically assembles a transaction object in the background. This object is a data structure containing several critical fields that define the instruction:
Chain ID: A unique number identifying the target blockchain (e.g., 1
for Ethereum Mainnet, 111555111
for the Sepolia testnet). This crucial field prevents "replay attacks," where a transaction intended for one network could be maliciously re-broadcast on another.
Nonce: Short for "Number Used Once," the nonce is a transaction counter for the sending account, starting at 0. Each new transaction from that account must have a nonce exactly one higher than the last. This strict ordering prevents transactions from being processed out of sequence or duplicated.
Gas Parameters: These fields define the fee you are willing to pay to have your transaction processed.
Max Priority Fee Per Gas: This is the "tip" you offer directly to the validator to incentivize them to include your transaction in the next block.
Max Fee Per Gas: This sets the absolute maximum total fee (base fee + tip) you are willing to pay per unit of gas. Any difference between this max fee and the actual fee paid is refunded to you.
Gas Limit: The maximum amount of computational work (gas) your transaction is allowed to consume. This acts as a safety measure to prevent buggy smart contracts from accidentally draining your entire account balance.
Transaction Details:
Recipient Address (to
): The address of the account or smart contract you are interacting with.
Value: The amount of ETH being transferred in the transaction.
Data: An optional field used for smart contract interactions. It contains the encoded function and parameters for the specific action you want the contract to perform.
Access List: An advanced feature that can reduce gas costs by pre-declaring which addresses and storage slots the transaction will access.
Once the transaction object is assembled, it must be authorized. This is where your private key comes into play. The process is a cornerstone of blockchain security:
The transaction data is serialized into a standard, structured format.
This data is then cryptographically hashed, producing a unique, fixed-length string of characters known as the Transaction Hash. This hash serves as the transaction's unique identifier, which you can use to track it on a block explorer like Etherscan.
You then use your private key to cryptographically sign this transaction hash. This produces a digital signature, which is irrefutable proof that you, the owner of the account, have approved this exact transaction.
With a valid signature attached, your wallet sends the signed transaction to an Ethereum node. This communication happens over an RPC (Remote Procedure Call) endpoint, which acts like a telephone line connecting your wallet to the Ethereum network. Your wallet "calls up" a node and submits the transaction for processing.
When a node receives your transaction, it first performs a series of quick validation checks. It verifies the digital signature is correct and confirms that you have enough ETH in your account to cover both the transaction's value and the maximum potential gas fee.
If the transaction passes these checks, the node adds it to its local Mempool (short for Memory Pool). The mempool is best understood as a "waiting room" for valid, pending transactions that have not yet been included in a block. The node then broadcasts this transaction to its peers, and they broadcast it to theirs, ensuring it quickly propagates across the entire network.
Every 12 seconds (a period known as a "slot"), the Ethereum protocol selects one validator to be the block producer. This validator's job is to build and propose the next block for the chain.
To do this, the validator looks at the transactions waiting in its mempool and selects which ones to include. Validators are economically motivated to prioritize transactions offering the highest Max Priority Fee Per Gas (the tip), as they get to keep these fees as a reward.
The validator executes the chosen transactions in order, updates its local copy of the blockchain state based on their outcomes, and bundles them into a new block. Finally, the validator signs and broadcasts this proposed block to the rest of the network.
The journey isn't over once the transaction is in a proposed block. The network must reach a consensus on the block's validity.
Attestation: Other validators, organized into a committee, receive the proposed block. They re-execute the transactions themselves to verify that the resulting state change is correct and that all signatures are valid. If they agree with the proposed block, they broadcast an "attestation" vote in its favor.
Inclusion: If the block receives attestations from validators representing at least two-thirds of the staked ETH in that committee, it is officially added to the blockchain. At this point, your transaction is considered confirmed.
Finalization: While confirmed is good, finalized is better. A block is considered final and irreversible once it has been attested to by a supermajority (2/3) of all active validators on the entire network. This typically happens after two epochs (an epoch is 32 slots, or about 6.4 minutes). Once a block is finalized, it is practically impossible to alter or remove, providing the highest level of security.
As your transaction moves through this lifecycle, its status changes. You can track these stages on a block explorer:
Pending: The transaction is in the mempool, waiting to be selected by a validator.
Confirmed (or Success): The transaction has been included in a block that has been successfully added to the chain. This typically takes about 12 seconds.
Finalized: The block containing your transaction is now considered irreversible. This process takes approximately 12.8 minutes from the time of submission.
Reverted (or Failed): The transaction was included in a block, but its execution failed (e.g., a smart contract check did not pass). The state change is rolled back, but the gas fee is still consumed.
Dropped: The transaction was removed from the mempool before ever being included in a block, often due to a very low gas fee or being replaced by another transaction with the same nonce.
This entire, intricate lifecycle applies to transactions initiated by standard user-controlled accounts, known as Externally Owned Accounts (EOAs). Each step, from the cryptographic signature to network-wide attestation, is designed to ensure that every change to Ethereum's shared state is authorized, valid, and permanent.
This foundation allows us to explore the second type of account on Ethereum: Smart Contract Accounts. In our next lesson, we will examine how these accounts operate and how they are being revolutionized by a powerful concept called Account Abstraction.
A step-by-step guide to The Complete Lifecycle of an Ethereum Transaction - This lesson traces a transaction's entire journey, from a cryptographically signed message in your wallet to its entry into the network's mempool. Discover how validators, attestation, and finality work together to select, confirm, and permanently secure your transaction on the blockchain.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
What blockchains are and how they work
Key blockchain components: wallets, gas, nodes, consensus
How to send transactions
The role and risks of smart contracts
How blockchains scale with L2 rollups
Real-world use cases like DEXs, RWAs, stablecoins, and NFTs
Blockchain threats like MEV and Sybil attacks
The lifecycle of a blockchain transaction
Security researcher
$49,999 - $120,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on October 17, 2025
Duration: 20min
Duration: 1h 16min
Duration: 50min
Duration: 2h 02min
Duration: 41min
Duration: 36min
Duration: 7min
Certification: Blockchain Basics
This proficiency exam is designed to confirm your understanding of all key concepts and learnings presented in the course material. You will have 45 minutes to answer 30 questions and score 18 to pass and earn a Certificate of Completion.
Course Overview
About the course
What blockchains are and how they work
Key blockchain components: wallets, gas, nodes, consensus
How to send transactions
The role and risks of smart contracts
How blockchains scale with L2 rollups
Real-world use cases like DEXs, RWAs, stablecoins, and NFTs
Blockchain threats like MEV and Sybil attacks
The lifecycle of a blockchain transaction
Security researcher
$49,999 - $120,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on October 17, 2025