Final core EIP that replaced first-price gas auctions with a protocol-determined base fee (burned) plus a user-set priority fee (tip to the validator). Activated in the London hard fork on Ethereum mainnet and adopted by most EVM L1s/L2s.
- 01transaction fee estimation
- 02wallet UX
- 03MEV-aware tip bidding
- 04L2 fee modeling
- 05burn-based monetary policy
- pnpm add viem
- pnpm add ethers
- pnpm add @ethereumjs/tx
Send Type-2 (`0x02`) transactions populated with `maxFeePerGas` and `maxPriorityFeePerGas`; the chain charges `min(maxFeePerGas, baseFee + maxPriorityFeePerGas)` and burns `baseFee * gasUsed`. Use viem's `estimateFeesPerGas` (or ethers' `getFeeData`) to compute defaults from `eth_feeHistory` percentiles rather than hard-coding gwei. Refresh the base-fee estimate per-block since base fee can change up to 12.5% block-over-block. Reject legacy Type-0 transactions in dapps that need predictable inclusion.
- ⚑Priority-fee bidding behavior: setting `maxPriorityFeePerGas = 0` will land transactions only when blocks are below their gas target — under congestion, your tx stalls indefinitely.
- ⚑`maxFeePerGas` is an absolute ceiling, not a target — under-setting it means the tx is invalid at the next block's higher base fee and silently drops out of the mempool.
- ⚑Base fee can swing ±12.5% per block — quoting a fee at request time and submitting many seconds later routinely misses inclusion; re-fetch right before signing.
- ⚑Some L2s (Optimism, Base) charge an L1 data-availability fee on top of EIP-1559 execution gas — `maxFeePerGas` alone does not bound total cost.
- ⚑Wallets that show 'gas price' as a single number conflate base fee and tip — when integrating, surface `baseFee` and `priorityFee` separately to avoid user confusion.
- ⚑Pre-1559 chains (BSC, some forks) accept Type-2 txs but ignore the base fee semantics — do not assume burn behavior across chains.