Ethereum

What Is Ethereum Layer 2? Arbitrum, Optimism, Base and zkSync Explained

A simple transfer on Ethereum mainnet once cost tens of dollars in fees. On a Layer 2, the same action often costs a few cents. What exactly is Layer 2, how does it get so fast and cheap, and what risks come with using it?

If you used Ethereum around 2021, you probably remember this: you wanted to swap a few tokens on a decentralized exchange, and the fee was higher than the amount you were swapping.

Ethereum mainnet can only process so many transactions. When demand surges, users outbid each other with higher fees. The Ethereum community's answer: process most transactions off mainnet, then post the results back to mainnet for security. That's Layer 2.

Key takeaways

  • Layer 2 networks are built on top of Ethereum. They process transactions in batches off-chain, then post the data and results to mainnet.
  • Most major Layer 2s use rollups, which come in two kinds: optimistic rollups and ZK rollups.
  • The Dencun upgrade in March 2024 introduced blob data, slashing Layer 2 transaction costs.
  • Watch out for bridge risk, centralized sequencers and roughly seven-day withdrawals through some networks' official bridges.
  • Layer 2s vary widely in how decentralized they are. Platforms like L2BEAT publish risk assessments.

Why Ethereum needs Layer 2

Layer 2 is like an elevated expressway built above a congested main road
Layer 2 is like an elevated expressway built above a congested main road

Ethereum mainnet handles only a dozen or so transactions per second. Block space is limited, so when demand outstrips it, gas fees spike. For how gas works, see Ethereum basics: smart contracts, gas and PoS.

Simply making mainnet faster usually means heavier hardware requirements for nodes, which makes running one harder for ordinary people and sacrifices decentralization. Ethereum's approach: mainnet focuses on security and data availability, and Layer 2s handle executing transactions.

Think of mainnet as a congested main road and Layer 2 as an elevated expressway above it. Cars (transactions) move quickly on the expressway, but the final travel records are still filed with the main road.

How rollups work

Rollups bundle hundreds or thousands of transactions into one batch for mainnet
Rollups bundle hundreds or thousands of transactions into one batch for mainnet

The core idea of a rollup is bundling:

  1. Users send transactions on the Layer 2, which executes them quickly.
  2. A sequencer orders and compresses hundreds or thousands of transactions into a batch.
  3. The batch data and the latest state are posted to Ethereum mainnet.
  4. Mainnet stores the data and, through a proof system, ensures the results are correct.

Because many transactions share the cost of a single mainnet submission, each one becomes much cheaper.

In March 2024, Ethereum completed the Dencun upgrade. Its EIP-4844 introduced "blob" data space designed for Layer 2s. Posting data got dramatically cheaper, and fees on many Layer 2s dropped to a few cents or less.

Optimistic rollups vs ZK rollups

The main difference is how each proves that the results it posts are correct.

Optimistic rollupZK rollup
How it's provenResults are assumed valid; anyone can submit a fraud proof during a challenge periodEvery batch includes a mathematical validity proof
Official bridge withdrawalsUsually a roughly seven-day challenge periodFinal once the proof is verified, usually faster
ComplexityMore mature and highly Ethereum-compatibleMore complex; generating proofs takes significant computing power
ExamplesArbitrum, Optimism, BasezkSync, Starknet, Linea, Scroll

The major Layer 2 networks

NetworkTypeNotes
ArbitrumOptimistic rollupOne of the earliest major Layer 2s, with a rich DeFi ecosystem
OptimismOptimistic rollupCreated the open-source OP Stack that several networks build on
BaseOptimistic rollupLaunched by Coinbase on the OP Stack; opened to the public in August 2023
zkSync EraZK rollupOne of the earliest general-purpose ZK rollups
StarknetZK rollupUses its own programming language and virtual machine
Linea, ScrollZK rollupFocus on compatibility with the Ethereum Virtual Machine

Note: each network's architecture, decentralization and ecosystem keep changing. Check official sources and independent assessment platforms for the latest before you use one.

Risks of using Layer 2

  1. Bridge risk: moving assets between mainnet and a Layer 2 requires a bridge, and bridges have long been a prime hacking target. In 2022, the Ronin sidechain bridge used by Axie Infinity lost more than $600 million. Prefer official bridges or long-proven bridging tools.
  2. Centralized sequencers: many Layer 2 sequencers are currently run by the project team. If the sequencer goes down, the network may stop producing blocks, and on less decentralized networks, transactions could be censored.
  3. Upgrade powers: some Layer 2 contracts can be upgraded quickly by a small group, which could in theory be abused. L2BEAT rates networks by decentralization stage (Stage 0, 1 and 2).
  4. Withdrawal delays: withdrawing to mainnet through an optimistic rollup's official bridge usually takes about seven days. Third-party bridges are faster but add risk and fees.
  5. Sending to the wrong network: the same wallet address works across networks, but sending assets to a network your exchange doesn't support can leave them stranded or hard to recover.

FAQ

Are Layer 2 addresses the same as mainnet addresses?

Most EVM-compatible Layer 2s (like Arbitrum, Optimism and Base) use the same address format as mainnet, so one wallet works across them. But balances are separate: funds on one network don't automatically show up on another.

What's the difference between a Layer 2 and a sidechain?

Rollups post transaction data to Ethereum mainnet and rely on it for security. Sidechains have their own consensus and validators, so they don't directly inherit Ethereum's security. That's why rollups are generally considered safer.

Why do Layer 2 withdrawals to mainnet take seven days?

That's an optimistic rollup's challenge period. During that window, anyone can challenge an incorrect result, and the withdrawal only finalizes once it ends. ZK rollups rely on validity proofs and usually don't need such a long wait.

Are my assets safe on a Layer 2?

Rollups are designed to inherit Ethereum's security, but how safe each one is in practice depends on whether its proof system is complete, whether upgrade powers are limited and whether its sequencer is decentralized. Check its risk rating on a platform like L2BEAT before using it.

Summary

Layer 2 is Ethereum's main scaling path: mainnet provides security, and Layer 2s deliver speed and low costs. Optimistic and ZK rollups each have trade-offs, and since the Dencun upgrade, using a Layer 2 has become far cheaper.

Behind the speed and savings, though, sit bridge risk, centralized sequencers and upgrade powers that are worth understanding. To learn how Ethereum staking works, read our Ethereum staking guide. This article is for education only and isn't investment advice.

Related reading