Part 1 · Chapter 5

Rollups and Scalability

At a Glance

Rollups bundle many transactions, prove or assume their validity, and publish minimal data back to Layer 1. You'll compare optimistic and ZK rollups to see how each scales throughput.

BatchingValidity ProofsData Availability

Who Is This For?

  • Users curious why rollups lower gas costs
  • Builders deciding which L2 architecture to target

Learning Objectives

  1. 01Explain optimistic vs zero-knowledge rollups
  2. 02Identify trade-offs around speed, cost, and security
  3. 03Assess when a rollup is appropriate for your use case
Section 1

Rollup Basics

Rollups process transactions off-chain but keep data on L1. This combination gives you L2 speed with L1 security—the best of both worlds.

The Rollup Flow

📥
1. Collect
Users submit transactions to sequencer
2. Execute
Process off-chain in batches
📦
3. Compress
Bundle into minimal calldata
📤
4. Post
Submit data + proof to L1

Try It: Transaction Batching

See how rollups compress many transactions into minimal L1 calldata. Click "Generate" then "Compress" to see the magic.

Individual Transactions
Click "Generate Transactions" to start
Compressed Batch
Generate transactions first

Sequencer

Orders transactions and submits batches. Usually centralized for now, with decentralization coming.

Data Availability

Transaction data posted to L1 so anyone can reconstruct state and verify correctness.

L1 Settlement

Final state roots anchored on Ethereum. Inherits L1's security guarantees.

Section 2

Optimistic vs ZK Rollups

The key difference is how they prove transactions are valid. Optimistic rollups assume validity and allow challenges. ZK rollups prove it mathematically upfront.

🟡 Optimistic Rollups

Optimistic rollups assume all transactions are valid by default ("optimistic"). During a challenge period, anyone can submit a fraud proof if they detect invalid state transitions.

Simulation: Optimistic Flow

📥
Sequencer collects transactions
📤
Execute & post state root to L1
Challenge period (7 days)
Finalized on L1
Execution Log
Optimistic rollup initialized...
Advantages
  • Full EVM compatibility
  • Mature tooling ecosystem
  • Lower computational overhead
  • Battle-tested (Arbitrum, Optimism)
Trade-offs
  • 7-day withdrawal period
  • Relies on active fraud watchers
  • Slower finality to L1
Examples:ArbitrumOptimismBase

Side-by-Side Comparison

AttributeOptimisticZK
Proof MethodFraud proofs (if challenged)Validity proofs (always)
Withdrawal Time~7 daysMinutes to hours
EVM CompatibilityFullVaries (zkEVM improving)
Proof CostOnly if disputedEvery batch
FinalityAfter challenge periodOnce proof verified
MaturityMore battle-testedRapidly evolving
Section 3

Developer & User Considerations

Choosing a rollup involves weighing fees, finality, and ecosystem maturity. Here's what to consider for your use case.

💰

Fees

  • Lower than L1, but not zero
  • Depend on L1 calldata costs
  • Spike during L1 congestion
  • Compare across rollups
⏱️

Finality

  • Optimistic: UX fast, L1 finality slow
  • ZK: L1 finality once proof posted
  • Consider your withdrawal needs
  • Fast bridges available (with fees)
🛠️

Ecosystem

  • Check wallet support
  • Verify DEX liquidity
  • Test on testnets first
  • Review SDK documentation

Choose Optimistic Rollups When:

  • You need full EVM compatibility today
  • Deploying existing Solidity contracts
  • Ecosystem maturity matters (DeFi integrations)
  • 7-day withdrawals are acceptable

Choose ZK Rollups When:

  • Fast withdrawals are critical
  • Building new applications from scratch
  • Privacy features are needed
  • Willing to adapt to zkEVM differences
Watch Out

Common Mistakes & Gotchas

These misconceptions about rollups can lead to unexpected costs or frustrating experiences.

🔌
Sequencer downtime means my funds are lost
Funds remain safe on L1. You can force-exit through the L1 contract if the sequencer is unresponsive.
💰
Rollup fees are always cheap
Fees depend on L1 calldata costs. During L1 congestion, rollup fees also increase since they post data to L1.
⚙️
All rollups are EVM-compatible
Some ZK rollups use custom VMs (StarkNet's Cairo). Check compatibility before deploying contracts.
Optimistic rollup withdrawals are instant
Withdrawals require waiting through the 7-day challenge period (or using fast bridges that charge fees).

Pro tip: Always test on testnet first. Get free testnet ETH from faucets, try bridging, swapping, and deploying contracts before committing real funds.

Test Yourself

Knowledge Check

Let's see how well you understand rollups. Answer all 5 questions below.

1

What keeps rollup transactions verifiable?

2

How does an optimistic rollup handle fraud?

3

Name one ZK rollup project.

4

Why do ZK rollups have faster withdrawals than optimistic rollups?

5

What role does the sequencer play in a rollup?

Next Steps

Continue learning: “Blockchain Trilemma & Design Trade-offs” — see how scaling choices impact security and decentralization
Hands-on practice: Try a test transaction on Arbitrum Goerli or zkSync testnet using free faucet ETH