Layer 2 DeFi Internals
Layer 2 networks process transactions off-chain and post compressed data back to Ethereum for security. The result: 10-100x cheaper gas while inheriting L1 security guarantees. With EIP-4844 (blobs), L2 costs dropped another 10x. Understanding how rollups, bridges, and gas economics work is essential for navigating modern DeFi.
? Major L2 Networks
Rollup Types
Optimistic vs ZK rollups - how they batch transactions, submit proofs, and inherit L1 security
Bridging
Canonical bridges, fast bridges, and liquidity networks - tradeoffs between speed, cost, and trust
Gas Savings
Interactive gas cost calculator comparing L1 vs L2 costs, EIP-4844 blob impact, and calldata compression
How L2 DeFi works in 90 seconds
A rollup is an execution environment that inherits Ethereum's consensus security by posting compressed transaction data and state commitments back to L1. Users sign transactions on the L2 the same way they do on Ethereum; the rollup's sequencer orders them, executes them in a dedicated EVM, and publishes a batch - optimistic rollups like Arbitrum, Optimism, and Base publish the raw batch without proofs, while ZK rollups like zkSync, Scroll, and Linea publish a validity proof the L1 verifier checks in a single call.
Cost comes down through two mechanisms. The first is batching: a single L1 commitment amortizes across hundreds of L2 transactions, so a typical batch of 500 transactions with 50% calldata compression on an optimistic rollup pays L1 publication fees once for the entire group. The second is EIP-4844, which introduced a separate blob data space priced per-blob on its own fee market and auto-pruned after about 18 days. Blobs are roughly 10-100x cheaper per byte than calldata, which is why a Uniswap swap on Arbitrum or Base dropped from $0.08 into sub-cent territory when blobs shipped in March 2024.
Bridges connect those L2s to each other and to L1. The canonical bridge for each rollup enforces the rollup's trust model - a 7-day challenge window for optimistic rollups, a validity-proof window for ZK rollups - and charges only gas. Third-party fast bridges like Hop, Across, Stargate, and Circle's CCTP quote 0.04-0.3% fees in exchange for minute-scale finality, fronting liquidity on the destination chain while the canonical bridge settles in the background.
Key concepts
- Optimistic rollup
- Optimistic rollups assume batches are honest and expose a 7-day fraud-proof window during which any full node can replay a disputed transition and force a revert to the last honest state root. Arbitrum (Nitro), Optimism (Bedrock), and Base (OP Stack) dominate TVL in this category. Withdrawals are held until the window closes, which is why fast-bridge liquidity networks exist as a paid-for shortcut.
- ZK rollup
- ZK rollups - zkSync Era, Scroll, Linea, Polygon zkEVM, StarkNet - publish a validity proof alongside every batch. The L1 verifier contract runs the proof check in one transaction; if it passes, finality is cryptographic and withdrawals need no challenge window. The cost is prover complexity: circuits for full EVM compatibility are expensive to generate, which is why ZK rollups only recently caught up to optimistic rollups on per-swap cost.
- EIP-4844 blobs
- EIP-4844 (Proto-Danksharding, shipped March 2024) added a blob data space priced on a separate fee market at roughly 1 gas per equivalent byte versus calldata's 16 gas per non-zero byte. Blobs are auto-pruned after about 18 days - long enough for fraud-proof or validity windows, short enough to avoid permanent L1 storage - and they collapsed L2 data costs 10-100x overnight.
- Sequencer
- Each rollup runs a sequencer that orders user transactions, executes them locally, and publishes batches. Today most sequencers are centralized for latency reasons, but Optimism's OP Stack, Arbitrum BOLD, and Espresso's shared sequencing network are pushing toward decentralized sets. The sequencer controls transaction ordering, which is why sequencer MEV and censorship resistance are open research problems even on rollups otherwise inheriting L1 security.
- Canonical vs fast bridges
- Canonical bridges (Arbitrum's, Optimism's, Base's) use the rollup's own escrow-and-proof contracts on L1 and charge only gas, but inherit the chain's withdrawal window - 7 days for optimistic rollups, minutes to hours for ZK. Fast bridges (Hop, Across, Stargate, CCTP) front liquidity on the destination chain for 0.04-0.3%, delivering funds in 1-20 minutes while the canonical bridge settles underneath.
- L2 gas accounting
- An L2 transaction pays L2 execution gas plus an L1 data-publication component that the rollup passes through to users. With blobs, the L1 share is tiny - a 21,000-gas ETH transfer prices in pennies end-to-end while a 150k-gas Uniswap swap stays under $0.10 on Base or Arbitrum during typical L1 base-fee conditions. Fees spike only during L1 gas storms when the blob fee market heats up along with regular gas.
Why L2 DeFi matters
As of April 2026, more than half of active DeFi users transact primarily on L2s: Arbitrum hosts GMX, Camelot, and Radiant with north of $10B TVL at peak; Base hosts Aerodrome, social-graph dApps, and the densest memecoin activity in DeFi; Optimism and the OP Stack's Superchain (Base, Zora, Mode, Fraxtal) share fraud proofs and governance; zkSync delivers native account abstraction that lets wallets pay gas in ERC-20s. The aggregate effect is that retail DeFi migrated off L1 because a Uniswap swap at $4+ on mainnet simply does not compete with a $0.05-0.15 swap on a rollup.
The tradeoffs are real. Bridge risk is the single largest unresolved failure mode: 2022 alone burned $1.8B across Ronin ($625M), BNB Bridge ($586M), Wormhole ($320M), Nomad ($190M), and Harmony ($100M). Optimistic rollups still owe a 7-day withdrawal to users who do not pay the fast-bridge premium. Sequencers are mostly centralized. Those caveats shape how sophisticated users split funds - keeping a hot balance on one or two rollups for activity, a cold treasury on L1, and a small buffer on alternate L2s to avoid being trapped behind a bridge pause - and they are why L2 DeFi is not a wholesale replacement for L1 but rather the correct venue for retail activity while L1 remains the settlement anchor.
Frequently asked questions
- What is the actual difference between optimistic and ZK rollups?
- Optimistic rollups - Arbitrum, Optimism, Base - assume every batch is honest and publish a 7-day fraud-proof window during which any observer can challenge a bad state root. ZK rollups - zkSync, Scroll, Linea, StarkNet - publish a validity proof alongside every batch, so finality lands in minutes to hours instead of a week. The tradeoff is prover complexity: ZK circuits are expensive to generate, while optimistic rollups get away with much cheaper execution at the cost of that long withdrawal delay.
- How did EIP-4844 blobs change L2 economics?
- Before EIP-4844, rollups posted their batch data as calldata at 16 gas per non-zero byte and 4 gas per zero byte. Blobs introduced a separate data space priced on its own fee market and auto-pruned after roughly 18 days, which brought effective per-byte costs 10-100x below calldata. A typical L2 swap that cost $0.08 on optimistic rollups pre-4844 settled closer to $0.01 after blobs shipped in March 2024, and that single upgrade is why L2 fees collapsed into sub-cent territory during 2024-2025.
- What are the main bridge categories and their fees?
- Canonical bridges (Arbitrum's, Optimism's, Base's) enforce the chain's trust model but inherit a 7-day withdrawal delay for optimistic rollups and gas-only fees. Fast bridges like Hop and Across front liquidity for a 0.04-0.1% fee and clear in 1-20 minutes. Liquidity networks like Stargate and Circle's CCTP settle in seconds to minutes for 0.05-0.3%. Lock-and-mint bridges like LayerZero or Axelar wrap the asset on the destination chain, taking 10-30 minutes and 0.05-0.2% in fees.
- Why are bridges still the riskiest part of L2 DeFi?
- Bridges concentrate collateral across chains and historically have been the largest single-incident losses in crypto. 2022 alone produced Ronin ($625M, March), BNB Bridge ($586M, October), Wormhole ($320M, February), Nomad ($190M, August), and Harmony ($100M, June). Canonical rollup bridges are structurally safer because they inherit L1 security, but any bridge that issues a wrapped token depends on the integrity of its validator set or signer committee, not on Ethereum consensus.
- How is gas actually priced on an L2 transaction?
- An L2 transaction pays two components: L2 execution gas (cheap, priced in the rollup's own fee market) and L1 data-publication cost (historically the dominant share). With EIP-4844 blobs the L1 share is driven by the blob gas market, which means a 21k-gas ETH transfer now prices closer to a few cents end-to-end at typical L1 base fees while a Uniswap swap at ~150k gas runs well under $0.10 on most rollups.
- What does a 7-day challenge period actually protect against?
- Optimistic rollups post state roots without proofs, so during the 7-day window anyone running a full node can submit a fraud proof that replays the disputed batch and forces the rollup to revert to the last honest state. Withdrawals are held until that window closes precisely so a dishonest operator cannot escape with funds before the proof window elapses. Third-party liquidity networks let users skip the wait by buying out the claim at a small discount.
- Is L2 DeFi actually cheaper than L1 for everything?
- For user-facing swaps, NFT mints, and routine DeFi activity, yes - a Uniswap swap that cost $4+ on Ethereum mainnet at 30 gwei now costs roughly $0.05-0.15 on Base or Arbitrum. For large one-shot settlement or treasury movements where bridge fees and the 7-day optimistic withdrawal matter, L1 is often still the right venue. As of April 2026, L2 DeFi dominates retail volume while L1 retains the custody-heavy treasury and CeFi settlement flows.