Try it Live
Run Transaction examples in the interactive playground
Legacy Transactions
Original Ethereum transaction format with fixed gas price and EIP-155 replay protection.Overview
Legacy transactions (Type 0) are the original transaction format used since Ethereum genesis. They use a fixedgasPrice and encode chain ID in the v signature component for replay protection (EIP-155).
Type Definition
Creating Legacy Transactions
EIP-155: Chain ID Encoding
EIP-155 adds replay protection by encoding chain ID in thev value.
v Value Calculation
Examples
getChainId
Extract chain ID from v value.Returns
bigint- Chain ID if EIP-155 transactionnull- If pre-EIP-155 transaction (v = 27 or 28)
Usage
Methods
All standard transaction methods work with legacy transactions:RLP Encoding
Legacy transactions encode directly as RLP list (no type prefix):Signing Hash
Legacy signing hash includes chain ID for EIP-155 transactions:Gas Cost Calculation
Legacy transactions use simple gas cost:Limitations
Legacy transactions have several limitations compared to newer types:- No access lists - Cannot pre-declare storage access
- Fixed gas price - No dynamic fee market support
- Chain ID in signature - Wastes space compared to explicit field
- No blob support - Cannot attach L2 data
- No authorization lists - Cannot delegate to contracts
Migration to EIP-1559
Converting legacy to EIP-1559:When to Use
Legacy transactions should be used:- When required by older infrastructure
- On networks without EIP-1559 support
- When interacting with wallets that only support legacy format
- Modern Ethereum mainnet
- Better gas price estimation
- More predictable transaction costs
- Access list optimization

