Back to blogs
Written by
Ciara Nightingale
Published on
May 20, 2024

What Are Blockchain Rollups? A Full Guide to ZK and Optimistic Rollups

What are crypto blockchain rollups? Learn everything you need to know about optimistic and zero-knowledge based rollups, how they work, and their differences.

Table of Contents

Blockchain Rollups are an L2 scaling solution that increases the transactions per second on Ethereum without increasing gas costs by “rolling up” multiple off-chain transactions into one.

This article will explain why rollups are needed, what Optimistic and Zero-knowledge (ZK) rollups are, and how they work. We will also compare the different types of crypto rollups and their differences.

Before diving into this article, to better understand why Rollups play a foundational role in solving Blockchain scalability issues, we highly suggest you read our complete guide on what a Layer-2 or L2 blockchain is and how it works.

What Are Optimistic and ZK Rollup?

As explained in our guide on blockchain architectures, blockchain scalability solutions like rollups come from the need to solve the blockchain Trilemma.

The Blockchain Scalability Trilemma

Blockchains aim to have the three following properties:

  • Decentralized: The system is not controlled by a central control.
  • Secure: The system is protected against security vulnerabilities, like 51% attacks ADD LINKS, Sybil attacks, and replay attacks.
  • Scalable: The system can grow without sacrificing speed or running costs.

The blockchain trilemma states that blockchain systems can only ever have two-thirds of their properties. If the system is scalable and secure, decentralization will be sacrificed.

The blockchain trilemma

Ethereum scalability problem

Additionally, Ethereum inherently has a scalability problem. It can only process ~15 transactions per second. As Ethereum gains in popularity, the number of transaction requests increases. The gas price to pay for transactions increases to “jump the queue” and avoid long transaction wait times. If blockchain systems are to reach mainstream adoption, gas prices need to be reduced, even in the face of high transaction volumes.

Rollups aim to solve the trilemma problem by increasing throughput on Ethereum without sacrificing either the decentralization or security of the system. This is done by processing the transactions off of the L1 blockchain.

Image showing how blockchain rollups aggregate transactions on-chain and submit proof to the L1 before the transactions are submitted to the L1
Rollups aggregate transactions on-chain and submit proof to the L1 before the transactions are submitted to the L1

What is a blockchain rollup?

A blockchain rollup is an L2 solution that aims to solve the Ethereum scaling problem. It is an L2 chain that processes transactions off-chain and then bundles, compresses, and posts them to an L1. This means the gas fee is distributed across all people sending transactions in the transaction rollup.

By posting the transactions to the L1, they inherit the security of Ethereum since reverting the rollup would require reverting Ethereum.

There are two main types of rollups, and they differ in how these off-chain transactions are validated to be legitimate rather than fraudulent.

Types of Blockchain Rollups

There are two primary types of rollup:

  • Optimistic rollups
  • Zero-knowledge rollups

What is an Optimistic Blockchain Rollup?

Optimistic blockchain rollups assume the transactions executing on the L2 are valid (how optimistic!) by default. They then allow people to challenge those transactions by submitting a fraud-proof. If a batch of transactions is invalid, the fraud-proof is accepted, and the batch of transactions is reverted.

Examples: Optimism, Arbitrum

What is a Zero-knowledge Blockchain Rollup?

Unlike Optimistic Blockchain rollups, ZK-based blockchain rollup solutions prove each batch of transactions correct by having a validity proof (or zero-knowledge (ZK) proof) submitted on-chain for every batch of transactions.

Examples: zkSync Era, Starkware’s StarkEx

How do Blockchain Rollups work?

When a user submits a transaction on a Blockchain Rollup like zkSync, the operator, a node, a set of components, or an entity responsible for processing the transactions takes over. The operator's job is to combine the transactions, compress them, and submit the block to Ethereum. This process is a key feature of Optimistic and ZK rollups, enabling them to handle transactions efficiently:

  1. The user submits a transaction to an “operator” (node, set of components, or entity responsible for processing the transactions).
  2. The operator combines the transactions, compresses them, and submits the block to Ethereum.

This transaction lifecycle works the same on optimistic and ZK blockchain rollups. The difference lies in how the rollups check the validity of the transactions.

Fraud-Proofs: How do Optimistic Rollups work?

As we said before, as the name suggests, Optimistic blockchain rollups optimistically assume every transaction is valid by default, allowing operators to challenge those transactions by submitting a fraud-proof within a defined time frame:

  • Optimistic rollups assume that the off-chain transactions are valid by default.
  • Operators can propose what they believe to be the current valid state of the roll-up chain.
  • There is a time window known as the “challenge period,” during which operators can - you guessed it - challenge a roll-up transaction.
  • An operator can send a “challenge” by computing fraud-proof if they notice a potentially fraudulent transaction.
  • This fraud-proof involves the disputing operator playing a call-response game with another operator until they narrow the dispute to a single computational step. This computational step is then executed on the L1. If executing that step results in a different outcome, the challenging operator wins the challenge, and the fraud-proof operator succeeds.
  • If the proof succeeds, the rollup will re-execute the transaction batch.
  • The operator responsible for the incorrect transaction inclusion receives a penalty via their staked deposit.
  • If these proposals are not invalidated within the challenge period, then the proposals are assumed to be correct.

Validity Proofs: How do ZK Rollups work?

On the other hand, Zero-Knowledge blockchain rollup solutions prove each batch of transactions correct by having a validity proof (or zero-knowledge (ZK) proof), a complex mathematical cryptographic proof submitted on-chain for every batch of transactions:

  • ZK rollups use ZK proofs (known as validity proofs) to verify transactions.
  • For each transaction batch submitted to the L1, a validity (or ZK) proof is computed by a “prover” and verified by the L1 contract (the “verifier”).
  • A ZK proof confirms the transaction's validity without revealing anything about the transaction.

Types of Rollup Operators

When discussing crypto rollup solutions, different operators typically perform different actions. The term “operator” can refer to a node or entity (such as a set of components).

Different blockchain rollups use operator setups, but some common types of operators are described here:

  • Validators: validators are similar to Ethereum nodes and can propose new rollup blocks. They must provide a stake to deposit into the rollup contract on the L1. The size of this deposit determines their chance of being chosen to produce the next rollup batch. If the validator acts maliciously, their stake can be “slashed” (taken) to incentivize them to post valid blocks.
  • Sequencers: sequencers are used to order and bundle transactions and, in some cases, execute the transactions and submit transaction bundles to the L1. They can be a decentralized (or centralized) network of nodes, a single centralized entity, or, in the case of zkSync Era, a collection of services and functions. The term generally means the entity that orders and bundles transactions.
  • Provers: In ZK Rollup solutions, provers are responsible for generating and submitting zero-knowledge proofs (ZK proofs) that validate the correctness of transaction batches. Provers use cryptographic techniques to create proofs that demonstrate the validity of transactions without revealing sensitive information. The underlying blockchain verifies these proofs to ensure the integrity of the roll-up transactions.
  • Proposers: Proposers, used in rollups such as Scroll and Optimism, propose what they believe to be the current valid state of the rollup chain.
  • Batchers or Aggregators: some rollups, e.g., Optimism, use batches to bundle the transactions together.

For example, Arbitrum uses a whitelisted validator system to check a transaction's validity (or create disputes) and a sequencer to bundle and order off-chain transactions.

zkSync Era, on the other hand, uses a sequencer to order and bundle transactions into a batch and submit them to Ethereum and a prover to generate and submit zk proofs and finalize the batch.

Image showing the lifecycle of a transaction on zkSync, a zk based blockchain rollup solution
Source: zkSync documentation. Lifecycle of a transaction on zkSync

For a specific rollups’ operator system, refer to their technical documentation.

The stages of a Blockchain Rollup

The stage of a rollup is a framework to categorize rollups inspired by Vitalik’s proposed milestones and is an opinionated assessment of the maturity of the rollup by the L2BEAT team. It creates an incentive for projects to work toward decentralization. There are three stages:

  1. Stage 0—Full Training Wheels: The operators predominantly manage the rollup. However, source-available software allows for state reconstruction from L1 data, ensuring transparency and verification.
  2. Stage 1—Enhanced Rollup Governance: The rollup is governed by smart contracts, with a Security Council in place for bug resolution. The rollup has a fully functional proof system with a decentralized fraud/validity proof submission system, and the user can exit without operator coordination in case of an unwanted upgrade.
  3. Stage 2—No Training Wheels: Smart contracts fully manage the rollup. At this point, the fraud/validity proof system is permissionless, and users are given time to exit in the event of unwanted upgrades. The Security Council’s role is strictly confined to addressing errors that can be adjudicated on-chain, and users are protected against governance attacks.

Learn more about the stages of a rollup and the requirements.

Summary

Blockchain Rollups are an Ethereum Layer 2 solution designed to enhance transaction speed without inflating gas costs by bundling multiple off-chain transactions. This article delves into the necessity of rollups, their operational mechanisms, and the comparison between optimistic and zero-knowledge rollup types, outlining their respective workings and benefits.

Secure your protocol today

Join some of the biggest protocols and companies in creating a better internet. Our security researchers will help you throughout the whole process.
Stay on the bleeding edge of security
Carefully crafted, short smart contract security tips and news freshly delivered every week.