Try it Live
Run Transaction examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see Transaction API.
What Are Transactions?
Transactions are the only way to modify Ethereum state. Every state change (ETH transfer, contract deployment, function call) requires a transaction. Key properties:- Atomic - Either fully executes or fully reverts
- Cryptographically signed - Proves sender authorization via ECDSA signature
- Immutable - Once mined, cannot be altered
- Ordered - Executed sequentially per account (nonce ordering)
Transaction Types
Ethereum supports 5 transaction types, each adding new capabilities:Legacy (Type 0)
Original transaction format from Ethereum genesis (2015).- Fixed
gasPrice- No automatic fee market vencodes chain ID (EIP-155) - Prevents replay attacks across chains- Simple structure - 9 fields total
- Still widely supported
EIP-2930 (Type 1)
Access list transactions introduced in Berlin hard fork (2021).- Gas savings on repeated storage access
- Explicit contract interaction declaration
- Foundation for later transaction types
EIP-1559 (Type 2)
Dynamic fee market transactions from London hard fork (2021).- Set by protocol, adjusts block-to-block based on block fullness
- Burns to Ethereum (deflationary mechanism)
- Target: 50% block utilization
- Tip to miner/validator
- Incentivizes transaction inclusion
- Goes to block proposer
- Predictable fees - Base fee visible before transaction
- No overpayment - Refund if actual < max
- ETH burn - Reduces supply
EIP-4844 (Type 3)
Blob transactions for L2 data availability from Dencun hard fork (2024).- Size: 128 KB per blob (131,072 bytes)
- Maximum: 6 blobs per transaction
- Pricing: Separate from execution gas, adapts to blob demand
- Availability: Data pruned after ~18 days (not permanent storage)
- Use case: L2 rollups post batch data cheaply
- 10-100x cheaper than CALLDATA for L2s
- Scales Ethereum data availability
- Does not compete with execution gas market
EIP-7702 (Type 4)
EOA delegation transactions from Pectra hard fork (2024).- EOA signs authorization to execute contract logic
- Transaction sender can trigger delegated logic
- EOA retains control (can revoke by incrementing nonce)
- Enables account abstraction without migrating funds
- Batched transactions from EOA
- Sponsored transactions (gasless for user)
- Social recovery
- Multi-sig from EOA
Transaction Lifecycle
Complete Example: Send ETH
Signing Hash Computation
The signing hash is what gets signed by the sender’s private key. It proves the transaction came from that sender.- EIP-1559
- Legacy
Gas Mechanics
Gas is the unit of computational work on Ethereum. Every operation (opcode) costs gas.Gas Limit
Maximum gas you’re willing to consume for the transaction.Gas Price (Legacy)
Max Fee Per Gas (EIP-1559)
Base Fee Adjustment
Base fee adjusts block-to-block based on congestion:Blob Gas (EIP-4844)
Separate gas market for blob data:- Target: 3 blobs per block
- Max: 6 blobs per block
- Same 12.5% adjustment algorithm
Transaction Validation
Transactions must satisfy multiple validation rules:Intrinsic Gas
Minimum gas required before execution:Detecting Transaction Type
Type Detection Rules
Working With Signatures
Sign Transaction
Verify Signature
Assert Signed
Comparing Transaction Types
- Use Cases
- Gas Costs
- Limitations
| Type | Best For |
|---|---|
| Legacy | Compatibility with old tools, simple transfers |
| EIP-2930 | Gas savings on known storage access patterns |
| EIP-1559 | Modern applications, predictable fees |
| EIP-4844 | L2 rollup data posting, batch submissions |
| EIP-7702 | Account abstraction, sponsored transactions |
RLP Serialization
Transactions use Recursive Length Prefix (RLP) encoding:Serialization Format
- Typed Transactions
- Legacy
Resources
- EIP-155 - Replay protection
- EIP-2718 - Typed transaction envelope
- EIP-2930 - Access lists
- EIP-1559 - Fee market change
- EIP-4844 - Blob transactions
- EIP-7702 - EOA delegation
- Ethereum Yellow Paper - Transaction spec (Section 4.2)
Next Steps
- Overview - Type definitions and API reference
- Serialization - Encode/decode transactions
- Hashing - Transaction and signing hashes
- Signing - Signature verification and recovery
- Utilities - Gas calculations and helpers

