Technical Explainer

Layer 2 Scaling: Rollups, Sidechains, and State Channels Demystified

Understanding how Arbitrum, Optimism, and other L2s process transactions off-chain while inheriting Ethereum's security guarantees.

Ethereum's Scalability Trilemma

Ethereum's base layer is intentionally slow and expensive. Every validator node in the network processes every transaction, stores every state change, and re-executes every smart contract call — a design that guarantees decentralization and security but limits throughput to roughly 15–30 transactions per second. During periods of high demand, this scarcity drives gas fees to hundreds of dollars per transaction, making Ethereum inaccessible for small-value transfers and casual use.

Layer 2 (L2) scaling solutions address this by moving computation off the main chain while inheriting Ethereum's security. Instead of every node executing every transaction, L2 systems execute transactions in bulk off-chain and then post a compact summary — or a cryptographic proof — back to Ethereum Layer 1 (L1). Users get fast, cheap transactions; Ethereum gets its security guarantees preserved.

Rollups: The Dominant Paradigm

Rollups are the leading L2 architecture. The core idea is simple: execute thousands of transactions off-chain, bundle them into a batch, and post that batch to Ethereum. Anyone can reconstruct the L2 state by replaying these batches from the beginning. The two major rollup variants — optimistic and ZK — differ in how they prove that the posted batch is valid.

Optimistic Rollups

Optimistic rollups, used by Arbitrum and Optimism, take a trust-first approach. Batches are posted to Ethereum with no proof of correctness — they are assumed to be valid by default ("optimistically"). To prevent fraud, the system includes a challenge window (typically seven days) during which any observer can submit a fraud proof disputing a specific state transition.

If a fraud proof is submitted, the Ethereum L1 contract runs a bisection game: it narrows the dispute down to a single computational step, then executes that step on-chain to verify whether it was performed correctly. If the sequencer (the entity that batches transactions) cheated, their staked collateral is slashed and the valid state is restored.

The seven-day window is the main user-facing trade-off: withdrawing assets from an optimistic rollup to Ethereum L1 requires waiting through the challenge period unless a liquidity provider fronts the capital early (for a fee).

Data availability: Optimistic rollups post full transaction data to Ethereum, not just the resulting state. This allows anyone to reconstruct the L2 state and submit fraud proofs without trusting the sequencer. After EIP-4844 (blobs), this data is posted in a cheaper format that is available for about 18 days before being pruned — long enough to cover the challenge window.

ZK Rollups

ZK rollups, used by zkSync, StarkNet, Polygon zkEVM, and others, take a proof-first approach. Instead of waiting to be challenged, the sequencer immediately generates a zero-knowledge proof (a validity proof) that cryptographically demonstrates the state transition is correct. This proof is verified by a smart contract on Ethereum L1 before the batch is accepted.

Zero-knowledge proofs allow one party (the prover) to convince another (the verifier) that they know a valid computation was performed, without revealing the inputs. For rollups, the "computation" is the execution of thousands of transactions. The proof is small (typically a few hundred bytes) and fast to verify on-chain, regardless of how many transactions are in the batch.

The key advantage over optimistic rollups: instant finality. Once the proof is verified on L1, withdrawals to L1 can be processed immediately — no seven-day wait. The trade-off is proof generation time (minutes to tens of minutes for large batches) and the engineering complexity of making existing EVM smart contracts compatible with ZK proof systems.

STARK vs SNARK

ZK proofs come in two main flavors with different security and efficiency properties:

  • SNARKs (Succinct Non-interactive Arguments of Knowledge) — used by zkSync Era and Polygon zkEVM. Extremely small proofs (~200 bytes), fast verification, but require a trusted setup ceremony to generate the proving key. If the ceremony is compromised, the system could be forged.
  • STARKs (Scalable Transparent Arguments of Knowledge) — used by StarkNet. Larger proofs (tens of kilobytes), but no trusted setup required — security relies only on hash functions, making them quantum-resistant by design.

State Channels: Bilateral Off-Chain Execution

State channels are the conceptual ancestor of rollups. Two parties lock funds in a smart contract on L1, then exchange signed state updates off-chain directly between themselves. As long as both parties cooperate, updates happen instantly with zero on-chain cost. Only the final state is settled on L1 when the channel is closed.

The Lightning Network on Bitcoin is the most successful implementation of payment channels at scale. On Ethereum, state channels work well for bilateral payment streams but become complex when supporting arbitrary smart contract logic or multiple parties. They fell out of favor as rollups proved more general-purpose, but remain relevant for high-frequency bilateral applications like micropayment streaming.

Plasma: Fraud Proofs for Child Chains

Plasma, introduced by Vitalik Buterin and Joseph Poon in 2017, proposed running "child chains" anchored to Ethereum. The operator of a Plasma chain periodically commits a Merkle root of all child-chain state to Ethereum. If the operator misbehaves (withholds blocks or attempts theft), users can submit fraud proofs to the Ethereum contract and exit their funds.

Plasma was theoretically promising but practically difficult: the data availability problem made it impossible to guarantee users could always access the data needed to construct fraud proofs. This led to complex mass-exit scenarios and user experience problems. Most Plasma projects eventually migrated to rollup architectures, though Polygon's early Proof of Stake chain borrowed heavily from Plasma's commit-chain model.

Data Availability: The Foundational Requirement

All rollup architectures depend critically on data availability — the guarantee that the data needed to reconstruct L2 state and construct fraud/validity proofs is actually accessible. Without this, a malicious sequencer could post a fraudulent state root and then hide the underlying transaction data, preventing anyone from proving the fraud.

Ethereum L1 is the gold standard for data availability: data posted to Ethereum is replicated across thousands of nodes and guaranteed to be available as long as the Ethereum network exists. EIP-4844, deployed in March 2024, introduced blobs — a dedicated data availability lane with cheaper storage (available for ~18 days) separate from calldata. This reduced L2 transaction costs by 10–100x almost immediately after deployment.

Alternative data availability layers — including Celestia, EigenDA, and Avail — offer even cheaper storage by separating data availability from execution and consensus entirely. "Validium" rollups (like Immutable X) use external DA layers rather than Ethereum, trading some security guarantees for dramatically lower costs.

L1 Settlement: Ethereum as the Court of Last Resort

Whatever happens on an L2, Ethereum L1 serves as the ultimate arbiter. The L1 smart contract enforces the rules: it accepts valid ZK proofs or un-challenged optimistic batches, processes forced exits, and holds the locked assets backing L2 tokens. Users who want to exit an L2 can always do so by going directly through L1, even if the L2 sequencer is offline or censoring them.

This settlement layer relationship means L2 security is ultimately bounded by Ethereum's security. An L2 cannot be more trustworthy than the L1 it settles on — but it can be faster and cheaper, which is the entire point.

The Current L2 Landscape

As of 2024, the rollup ecosystem has matured significantly. Arbitrum One and Optimism (now the OP Stack) dominate optimistic rollup TVL. zkSync Era and Polygon zkEVM have demonstrated full EVM compatibility with validity proofs. The "Rollup-Centric Roadmap" that Ethereum Foundation articulated in 2020 has become the de facto standard: Ethereum L1 provides security and data availability, while L2s provide scalable execution.

The remaining engineering frontiers include decentralizing sequencers (most rollups still use a single trusted sequencer today), enabling native cross-rollup composability (calling a contract on Arbitrum from Optimism currently requires bridging), and reducing ZK proof generation times to enable real-time proving for latency-sensitive applications.

Related Stories