Skip to content
Basis Desk
Tech & Protocols · 7 min read Last reviewed September 28, 2026

Layer 2s and Rollups, Explained: How Blockchains Scale

A comprehensive guide to how Layer 2 networks use Optimistic and Zero-Knowledge rollups to increase transaction throughput and lower fees while relying on a base blockchain for security.

Neutral

Key points

  • Layer 2 networks process transactions off-chain and settle them on a base Layer 1 blockchain to reduce congestion and lower fees.
  • Optimistic rollups assume transactions are valid by default, relying on a challenge period and fraud proofs to catch malicious activity.
  • Zero-Knowledge rollups use cryptographic validity proofs to mathematically verify transactions before they are finalized on the base layer.
  • Sequencers order and batch transactions on Layer 2s, presenting a centralization risk if operated by a single entity.

Layer 2 networks are secondary protocols built on top of a base blockchain to increase transaction capacity and reduce costs 1. They achieve this by processing user activity off-chain and periodically anchoring a compressed summary of those transactions to the main network 1. Rollups are the dominant architecture for these systems, utilizing different cryptographic methods to ensure the off-chain activity remains secure and verifiable 1.

The Base Layer Bottleneck

Base layer blockchains, such as Ethereum ($ETH), prioritize security and decentralization over scalability. To maintain a decentralized network, every participating node must download and verify every transaction. This architectural choice inherently limits throughput; base layers can typically process only a few dozen transactions per second.

When network demand spikes, users must bid higher fees to incentivize miners or validators to include their transactions in the next block. During periods of high congestion, these fees render microtransactions and complex smart contract interactions economically unviable. Layer 2 networks shift the computational burden away from the Layer 1 base chain. By executing transactions in a separate environment, Layer 2s use the base chain solely as a secure data availability layer and a final settlement engine 1.

The Mechanics of Rollups

A rollup executes transactions outside of the Layer 1, bundles dozens or hundreds of them together into a single batch, and then posts that compressed batch back to the base layer 1. By compressing the data, the Layer 1 only needs to store a fraction of the information it would require if it processed each transaction individually.

The Layer 1 smart contract maintains the state root, which represents the current balances of all accounts on the Layer 2. When a new batch of transactions is submitted, the Layer 1 contract updates this state root. The critical security challenge is how the Layer 1 knows the Layer 2 batch is legitimate, ensuring that no entity is fabricating transactions or stealing funds. The industry relies on two primary mechanisms to prove this legitimacy: optimistic assumptions and zero-knowledge cryptography.

Optimistic Rollups and Fraud Proofs

Optimistic rollups operate on the assumption that all submitted transaction batches are valid by default 2. They do not perform heavy computation to verify a batch before accepting it. Instead, they rely on a game-theoretic security model utilizing fraud proofs 2.

When a Layer 2 operator submits a batch of transactions to the Layer 1, the network enters a challenge period, which typically lasts seven days 2. During this window, independent network participants, known as verifiers, run full nodes to monitor the network and check the mathematical state transitions. If a verifier detects an invalid transaction—such as an attempt to spend the same funds twice—they submit a fraud proof to the Layer 1 smart contract 2.

The Layer 1 then executes the disputed transaction on-chain to determine the factual outcome. If the fraud proof is valid, the malicious batch is rejected, the Layer 2 state is rolled back to its previous correct state, and the operator who submitted the bad batch loses a financial deposit, known as a slashable stake 2. The verifier who caught the error receives a portion of that slashed stake as a reward.

If the challenge period passes without any fraud proofs being submitted, the transaction batch is finalized on the Layer 1. This mechanism keeps computational overhead low but introduces a significant delay for users who want to withdraw their assets back to the Layer 1, as they must wait for the challenge period to expire before their funds are released 2.

Zero-Knowledge Rollups and Validity Proofs

Unlike their optimistic counterparts, Zero-Knowledge rollups (ZK rollups) do not assume transactions are valid. Instead, they rely on advanced cryptography to generate validity proofs, commonly structured as ZK-SNARKs or ZK-STARKs 3.

When a ZK rollup batches transactions, specialized hardware nodes called provers run a complex computation to generate a cryptographic proof 3. This proof mathematically guarantees that every transaction in the batch strictly followed the network's rules. The Layer 1 smart contract verifies this proof before accepting the new state 3. Because the proof itself is small and computationally inexpensive for the Layer 1 to verify, the base layer knows with absolute certainty that the batch is valid without needing to process the underlying transactions 3.

This approach eliminates the need for a challenge period. Once the validity proof is accepted by the Layer 1, the transactions are finalized immediately, allowing for instant withdrawals back to the base layer 3. However, generating these cryptographic proofs requires immense computational power off-chain, making ZK rollups more complex and expensive to operate than optimistic systems 3.

The Role of Sequencers

Both types of rollups rely on specialized nodes called sequencers. A sequencer is responsible for receiving transactions from users, ordering them, executing them to calculate the new state, and packaging them into batches to be submitted to the Layer 1 1.

In the current architecture of most major Layer 2 networks, the sequencer is operated by a single entity, often the core development team behind the rollup. This introduces a centralization risk. While a centralized sequencer cannot steal user funds—because the Layer 1 smart contract enforces the rules via fraud or validity proofs—it can censor users by refusing to include their transactions in a batch. Furthermore, if the single sequencer goes offline, the Layer 2 network effectively halts until it is brought back online.

To mitigate this, rollup developers are working toward decentralized sequencer networks, where multiple independent operators take turns ordering transactions based on a consensus mechanism. The degree of sequencer decentralization varies by network and changes as protocols mature.

Bridges and Security Assumptions

To interact with a Layer 2, users must move assets from the Layer 1 to the Layer 2. This process is facilitated by a bridge, which consists of a set of smart contracts deployed on both networks 4. When a user deposits funds into the Layer 1 bridge contract, those funds are locked, and an equivalent amount of representative tokens is minted on the Layer 2 4. When the user withdraws, the Layer 2 tokens are burned, and the Layer 1 contract releases the original assets 4.

The security of a Layer 2 is fundamentally tied to the security of its bridge contract on the Layer 1 4. While rollups inherit the consensus security of the underlying base layer—meaning an attacker would have to compromise the Layer 1 to rewrite the Layer 2's finalized history—they introduce smart contract risk. If there is a vulnerability in the bridge contract code, attackers can drain the locked Layer 1 assets, rendering the corresponding Layer 2 tokens worthless. The security assumption of any rollup is only as strong as the code governing its bridge and the cryptographic proofs it relies on.

The Economics of Fees

Layer 2 networks reduce costs by amortizing the expensive Layer 1 fees across thousands of users. A user's transaction fee on a rollup consists of two primary components: the Layer 2 execution fee and the Layer 1 data fee 1.

The Layer 2 execution fee covers the cost of the sequencer processing the transaction off-chain. The Layer 1 data fee covers the cost of posting the compressed transaction data to the base layer. Base layers are increasingly adapting to provide cheaper, dedicated storage space specifically for Layer 2 data, further driving down this component of the fee.

To illustrate the fee structure, consider the following worked example. Assume a base layer transaction costs $5.00 to execute directly. On a rollup, the sequencer charges a Layer 2 execution fee of $0.01 per transaction. The sequencer batches 2,000 transactions together. The cost to post this compressed batch to the Layer 1 is $10.00. The Layer 1 data cost is divided among the users in the batch, adding $0.005 ($10.00 / 2,000) to each user's fee. The total fee paid by the Layer 2 user is $0.015 ($0.01 execution + $0.005 data). This represents a 99.7% reduction compared to the $5.00 Layer 1 fee. Network fees fluctuate based on base layer congestion and the specific data pricing mechanisms in place at the time of the transaction.

Common Misconceptions

  • Layer 2s are independent blockchains. While Layer 2s have their own block explorers, applications, and ecosystems, they are entirely dependent on their base layer for security and finality. If the Layer 1 ceases to exist, the Layer 2 ceases to exist. They are extensions of the base layer, not competitors to it.
  • Zero-Knowledge rollups provide transaction privacy. The term "zero-knowledge" in the context of rollups refers to the cryptographic method used to prove validity without revealing the underlying data to the verifier during the proof generation. However, the transaction data itself (sender, receiver, amount) is still posted publicly to the Layer 1 to ensure data availability, meaning ZK rollups are generally as transparent as the base layer.
  • Funds on a Layer 2 are identical to funds on a Layer 1. Holding assets on a rollup introduces additional layers of risk, including sequencer downtime, bridge smart contract vulnerabilities, and potential bugs in the fraud or validity proof mechanisms. Users trade a degree of base-layer security for scalability and lower costs.

How This Connects to the Market

The proliferation of rollups represents a fundamental shift toward modular blockchain architecture, where execution, data availability, and consensus are handled by specialized layers rather than a single monolithic chain. This modularity impacts the economic models of base layers. As execution moves to Layer 2s, base layers transition into settlement networks, deriving revenue from rollups paying for block space to post data and proofs.

The market continues to weigh the trade-offs between Optimistic and ZK architectures. Optimistic rollups currently benefit from simpler codebases and easier compatibility with existing smart contracts, leading to faster initial adoption. ZK rollups offer superior finality and rely on mathematics rather than game theory, but face higher computational costs and complex development environments. The ongoing evolution of these systems dictates where developers deploy applications and how capital flows across the broader crypto ecosystem.

Questions this story raises

What is the difference between Layer 1 and Layer 2?
Layer 1 is the base blockchain (like Ethereum or Bitcoin) that provides security and consensus. Layer 2 is a secondary framework built on top of Layer 1 to process transactions faster and cheaper, relying on the Layer 1 for final settlement.
Are Layer 2 networks safe?
Layer 2 networks inherit the consensus security of their base Layer 1, but they introduce new risks, specifically smart contract vulnerabilities in the bridges that connect the two layers and potential bugs in the proof mechanisms.
Why do Optimistic rollups have a withdrawal delay?
Optimistic rollups assume transactions are valid by default. The withdrawal delay (often seven days) is a challenge period that allows network participants time to verify the transactions and submit fraud proofs if they detect malicious activity.
What is a sequencer in crypto?
A sequencer is a specialized node on a Layer 2 network responsible for receiving user transactions, ordering them, and packaging them into batches to be submitted to the Layer 1 blockchain.

References

  1. [1] Optimistic Rollups — Ethereum Foundation
  2. [2] Zero-Knowledge Rollups — Ethereum Foundation
  3. [3] Layer 2 — Ethereum Foundation
  4. [4] Blockchain Bridges — Ethereum Foundation

Evergreen explainer written by Basis Desk's system and checked by an independent model pass for factual errors and advice language. Figures, fees and rules change — the references above are where to verify current specifics. Market figures marked "at the time of writing" come from live exchange data. Report an error: hello@basisdesk.news.

Not financial advice. Basis Desk publishes information, not recommendations. Crypto assets are volatile and you can lose what you invest.