Skip to main content

Try it Live

Run Transaction examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see Transaction API.
Ethereum transactions are cryptographically signed messages that initiate state transitions on the Ethereum blockchain. This guide teaches transaction fundamentals using Tevm.

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).
Characteristics:
  • Fixed gasPrice - No automatic fee market
  • v encodes 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).
Access Lists: Pre-declare which addresses and storage slots will be accessed. Reduces gas costs for declared access (2100 gas → 100 gas for warm access). Why use EIP-2930?
  • 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).
Fee Mechanics:
Base Fee:
  • Set by protocol, adjusts block-to-block based on block fullness
  • Burns to Ethereum (deflationary mechanism)
  • Target: 50% block utilization
Priority Fee:
  • Tip to miner/validator
  • Incentivizes transaction inclusion
  • Goes to block proposer
Benefits:
  • 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).
Blob Details:
  • 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
Total Cost:
Why blob transactions?
  • 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).
Authorization List: Each authorization temporarily delegates an EOA’s code to a contract:
  • 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
Use cases:
  • 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.
The signing hash does not include the signature fields. This prevents circular dependencies - you need the hash to compute the signature.

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:
This creates automatic fee market adjustment without user intervention.

Blob Gas (EIP-4844)

Separate gas market for blob data:
Blob base fee adjusts independently from execution base fee based on blob usage:
  • 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

TypeBest For
LegacyCompatibility with old tools, simple transfers
EIP-2930Gas savings on known storage access patterns
EIP-1559Modern applications, predictable fees
EIP-4844L2 rollup data posting, batch submissions
EIP-7702Account abstraction, sponsored transactions

RLP Serialization

Transactions use Recursive Length Prefix (RLP) encoding:

Serialization Format

Resources

Next Steps