Skip to content
Hexncoin
Track 2: Layer 1, Layer 2 & RollupsLesson 4 of 5·8 min

Rollups: Optimistic vs ZK

Two different ways rollups prove their off-chain execution was honest.

01

The rollup recipe

A rollup is the most widely used kind of Layer 2. It executes transactions off-chain, compresses the results, and posts both the data and some evidence of correctness back to the Layer 1 - 'rolling up' many transactions into one compact submission.

That evidence of correctness is what separates a rollup from just trusting an operator's word. It's also where the two major rollup designs diverge.

02

Optimistic rollups: trust, but verify

An optimistic rollup posts a batch and assumes it's correct by default. For a set challenge window - commonly around a week - anyone watching can download the data, re-run it, and submit a fraud proof if something's wrong. A successful fraud proof reverts the bad batch and penalizes whoever posted it.

The trade-off is that withdrawals back to the Layer 1 have to wait out that challenge window, since the network needs time to make sure no one disputes the batch.

03

ZK-rollups: prove it up front

A ZK-rollup (zero-knowledge rollup) takes a different approach: it submits a validity proof alongside every batch - a compact cryptographic proof that mathematically guarantees the transactions were executed correctly. There's no need to wait for a challenge window, because the math itself rules out cheating.

The trade-off shifts elsewhere: generating those proofs is computationally heavy, and building a system that can produce valid proofs for arbitrary smart-contract code is a harder engineering problem than an optimistic design.

Remember

'Optimistic' assumes honesty and punishes lies after the fact. 'ZK' proves honesty mathematically before anyone has to ask.

04

Picking a lane

Neither design is strictly better. Optimistic rollups have historically been simpler to build and run general-purpose smart contracts on, at the cost of slower withdrawals. ZK-rollups offer near-instant finality back to the L1, at the cost of harder engineering - though that gap has been closing quickly.

In practice, most users notice the difference mainly as 'how long until my withdrawal to the base layer clears' - fast for ZK, delayed by a challenge window for optimistic.

Self-check

Check your understanding

Try each question before opening the answer.

3 questions
01

What do all rollups have in common?

  1. A.They never post any data to Layer 1
  2. B.They execute transactions off-chain, then post data and correctness evidence back to Layer 1
  3. C.They replace the need for a Layer 1 entirely
  4. D.They only work for token transfers, not smart contracts
Reveal answer

B. They execute transactions off-chain, then post data and correctness evidence back to Layer 1

The rollup pattern is: execute off-chain, compress, then post the data plus proof of correctness back to the base layer.

02

In an optimistic rollup, how is an invalid batch caught?

  1. A.A validity proof rejects it automatically
  2. B.Anyone can submit a fraud proof during a challenge window
  3. C.The sequencer self-reports errors
  4. D.Invalid batches are impossible by design
Reveal answer

B. Anyone can submit a fraud proof during a challenge window

Optimistic rollups rely on watchers submitting fraud proofs during a challenge window if a posted batch turns out to be wrong.

03

What's the main advantage of a ZK-rollup's validity proof over an optimistic rollup's fraud-proof model?

  1. A.It's cheaper to compute in every case
  2. B.Correctness is proven mathematically up front, so there's no challenge-window wait for finality
  3. C.It doesn't require posting any data to L1
  4. D.It works only for simple token transfers
Reveal answer

B. Correctness is proven mathematically up front, so there's no challenge-window wait for finality

Because the validity proof guarantees correctness immediately, ZK-rollups don't need a waiting period before a batch is considered final.

Continue this track