Home/Blockchain/Transactions & Nonce/Transaction Structure

📦 Anatomy of a Transaction: Inputs & Outputs

Learn how transactions consume previous outputs and create new ones

🔍 Transaction Structure

Let's dissect an Ethereum transaction to understand every field and what it does. Click on each field to explore!

🎮 Interactive Transaction Explorer

Click on any field to see its purpose and example values:

📄 Raw Transaction Data

⚙️ Gas Calculation

Understanding Gas:

Gas is the "fuel" for executing transactions and smart contracts on Ethereum. Every operation costs gas.

Gas Limit (max units):21,000
Gas Price (Gwei per unit):50
Total Fee:0.00105 ETH

Calculation: 21,000 × 50 Gwei = 1,050,000 Gwei = 0.00105 ETH

📤
Simple Transfer
21,000 gas
🪙
Token Transfer
~50,000 gas
📜
Contract Deploy
~500,000+ gas

🔐 Transaction Signing Process

1
Prepare Transaction Data

Gather all fields: from, to, value, nonce, gas limit, gas price

2
RLP Encode

Serialize transaction into standardized binary format (RLP = Recursive Length Prefix)

3
Hash Transaction

Apply Keccak256 hash to RLP-encoded data

4
Sign with Private Key

Use ECDSA to create signature (v, r, s components)

5
Broadcast Signed Transaction

Send signed transaction to Ethereum network via RPC nodes

📊 Transaction Types Comparison

TypePurposeFieldsExample
Type 0Legacynonce, gasPrice, gasLimit, to, value, dataOriginal Ethereum transactions
Type 1Access List+ accessListPre-declare storage access
Type 2EIP-1559+ maxFeePerGas, maxPriorityFeePerGasDynamic fee market (current)