Overview
Curated: · Written: · Reviewed:
Layer 2 Scaling & Rollups
In one line
A rollup executes transactions off L1 and posts batch data and state commitments to L1, so it inherits L1's data availability and settlement. Reach for it when you need more execution throughput than L1 offers but still want L1 contracts to enforce withdrawals.
Key definitions
- Batch data: compressed L2 transactions posted to L1 as calldata or blob data.
- Output root (state root): the commitment to L2 state that the L1 bridge checks a withdrawal proof against.
- Derivation: rebuilding L2 blocks from L1 data. When derivation and the sequencer disagree, L1 data wins.
- Challenge window: the period in which an optimistic assertion can be disputed. Withdrawals wait for it.
- Validity proof: a proof that the state transition followed the circuit. The L1 verifier checks it before accepting the root.
- Forced inclusion: an L1 path that pushes a transaction into L2 without sequencer cooperation.
Formulas and complexity
How it works
The sequencer orders and executes transactions and preconfirms them. Preconfirmations only move the unsafe head. The batch submitter posts compressed batch data and the state commitment to L1. The node derives L2 from L1 data, executes it and compares the result to the proposed root. An optimistic root waits out the challenge window. A ZK root is accepted once its validity proof verifies. The bridge releases funds only against an eligible root.
When to use and when not to
| Situation | Fit | What decides it |
|---|---|---|
| More throughput, L1 settlement acceptable | Rollup | DA cost follows blob price, not L2 gas |
| Withdrawals in minutes, not days | ZK validity rollup | Optimistic withdrawals wait the 7-day window |
| Data may be withheld, cheaper DA acceptable | Validium / alt-DA | Withholding breaks reconstruction and exit |
| Need transaction data after about 18 days | Own archive | Blobs are pruned after 4096 epochs |
| Sequencer must never be able to stall users | Rollup with forced inclusion | Delay, L1 cost and queue capacity decide usability |
Traps interviewers probe
- Crediting deposits on a preconfirmation. A 2-second RPC receipt is an unsafe-head event and can reorg. Fix: credit only once the blocks are safe or finalized under the rollup's own rules, and reconcile deposits against derived L1 data.
- Treating blobs as permanent. Blob contents are pruned after 4096 epochs (about 18 days); only the commitments remain. Fix: keep your own archive or depend on a provider that does, and say so.
- "ZK is more secure." The designs rest on different assumptions: a live honest watcher for optimistic, circuit and setup correctness for ZK. Fix: name the assumption and how it fails.
- Trusting a bridge message because it came from the messenger. Fix: authenticate both the messenger and the original L1 sender, record message ids for idempotency, and mark the nonce spent before any external call.
- Assuming a fast bridge removes the challenge period. It fronts liquidity and prices the wait. Fix: state who carries the risk and what repays the provider.
Interview tips
Open with: a rollup moves execution off L1 and inherits L1's data availability and settlement, so the question is what a user can verify and exit with when the sequencer fails.
Expected follow-ups: what happens when the sequencer goes down (users force transactions through L1 and exit; liveness may stop, funds are not lost); why withdrawals take 7 days (the challenge window is a security parameter); ZK versus optimistic; where the fee goes (L2 execution plus a share of L1 data); what caps throughput (the DA layer, about 32 KiB/s at 3 blobs per slot).
30-second outline: (1) define it in one sentence; (2) state which guarantees come from L1 and which do not; (3) walk the withdrawal path and name its assumption; (4) name the failure mode and the escape path.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.