Labs ICT
โญ Pro Login

Blockchain Transactions

How transactions are created, signed, and confirmed

Blockchain Transactions

A blockchain transaction is a signed data package that transfers value or triggers contract logic between addresses. Understanding the anatomy of a transaction helps you debug failures and optimize costs.

Transaction Anatomy


  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚           TRANSACTION STRUCTURE            โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  From:      0x742d35Cc6634C0532...        โ”‚
  โ”‚  To:        0x9876543210abcdef...         โ”‚
  โ”‚  Value:     1.5 ETH                        โ”‚
  โ”‚  Nonce:     42 (transaction count from     โ”‚
  โ”‚             sender)                        โ”‚
  โ”‚  Gas Limit: 21000 (max gas allowed)        โ”‚
  โ”‚  Gas Price: 20 gwei (cost per gas unit)   โ”‚
  โ”‚  Data:      0x (empty for simple transfer) โ”‚
  โ”‚  Chain ID:  1 (Ethereum mainnet)           โ”‚
  โ”‚  Signature: 0x8a3f... (proves ownership)  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Transaction Lifecycle


  1. User creates transaction in wallet
           โ”‚
           โ–ผ
  2. Private key signs the transaction
           โ”‚
           โ–ผ
  3. Signed transaction broadcast to network
           โ”‚
           โ–ผ
  4. Nodes add it to the mempool (pending pool)
           โ”‚
           โ–ผ
  5. Validator picks it up for inclusion
           โ”‚
           โ–ผ
  6. Transaction is executed on-chain
           โ”‚
           โ–ผ
  7. Block is finalized and confirmed

Gas โ€” Transaction Costs

Every operation on Ethereum costs gas. Gas protects the network from spam and compensates validators.


  Gas Calculation:
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Transaction Fee = Gas Used ร— Gas Price โ”‚
  โ”‚                                         โ”‚
  โ”‚  Simple ETH Transfer:                   โ”‚
  โ”‚    Gas Used: 21,000                     โ”‚
  โ”‚    Gas Price: 20 gwei                   โ”‚
  โ”‚    Fee: 21,000 ร— 20 = 420,000 gwei     โ”‚
  โ”‚         = 0.00042 ETH                   โ”‚
  โ”‚                                         โ”‚
  โ”‚  Complex Contract Call:                 โ”‚
  โ”‚    Gas Used: 150,000                    โ”‚
  โ”‚    Gas Price: 30 gwei                   โ”‚
  โ”‚    Fee: 150,000 ร— 30 = 4,500,000 gwei  โ”‚
  โ”‚         = 0.0045 ETH                    โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Gas Limit: Maximum gas you're willing to spend. Unused gas is refunded.

Gas Price: How much you pay per unit of gas. Higher price = faster confirmation.

Transaction Confirmation

After a transaction is included in a block, it receives confirmations as more blocks are added. More confirmations mean greater certainty that the transaction is permanent and irreversible.

๐Ÿงช Quick Quiz

What happens to a transaction once it is confirmed on the blockchain?