Optimistic Rollups & ZK-Rollups: Explained

Published
August 18, 2022
Share

“A blockchain at its core is simply a proof of publication mechanism” — CEO of Celestia Labs Mustafa Al-Bassam

Introduction: What are ‘Rollups’?

A long ranging debate exists about addressing issues covering scalability on Ethereum. Currently, Ethereum’s maximum throughput is roughly 15 transactions per second and the Ethereum community wants to address this bottleneck in multiple different ways. Rollups are one of these methods, allowing a single transaction settled on the parent chain to validate a set of transaction data stored on the rollup.

Rollups are layer 2 scaling solutions which increases Ethereum’s scalability via its throughput preventing network congestion and reducing fees. At their heart, rollups are publication mechanisms with cryptographic assurances that allow for faster transaction finality through compression of transaction data. They are called rollups as they “roll up” transactions into batches to reduce costs, thereby reducing the blockspace necessary to validate transactions on the base chain. This is because every transaction or computational process incurs some kind of gas fee on Ethereum, therefore rollups can be seen as a series of optimizations to reduce computational load and consequently fees. There are two major types: optimistic rollups and ZK-rollups.

What are ZK-rollups?

ZK-rollups are another form of layer 2 scaling solutions on Ethereum. ZK-rollups inherit Etheruem’s security like optimistic rollups and have smart contracts on Ethereum required to verify state changes.

ZK-rollups allow for transactions to be clustered together into a batch and verified simultaneously in what is called a “rollup block” instead of transactions being verified one by one; reducing fees and computational intensity as it is done off-chain.

ZK-rollups can use an operator structure. The main functions of an operator are to submit batched transaction data and also publish validity proofs: succinct, efficient, sound, and complete proofs that ensure transactional validity. Validity proofs provide a cryptographic guarantee that the proposed state changes are indeed true.

Zero-knowledge proofs create both state roots and batch roots, allowing for the verifier to attest to the credibility of the data without requiring this verifier to witness the data that results in the proof. A state root is the root hash of the Merkle tree (known as a Merkle root) of the new state, resulting in a ‘header’ that is posted by the rollup.. This state root is published on chain and provides cryptographic authenticity. Once the validity proof is sent to a verifier contract and authenticated, it then becomes the new state on the rollup.

Validity proofs mainly use two different types of zero-knowledge proofs, zk-SNARKs (Succinct Non-interactive ARguments of Knowledge) and zk-STARKs (Scalable Transparent ARguments of Knowledge), with different benefits. For example, zk-SNARKs can engage in recursive proofs but zk-STARKs lack this feature. ZK-rollups don’t require a fraud proof system like optimistic rollups do and they use validity proofs instead due to their architecture and therefore have a faster transaction finality, in contrast to the arbitration period required by optimistic rollups.

Prominent examples of ZK-rollup platforms include: zkSync, Mir, Loopring and StarkNet.

What are optimistic rollups?

Optimistic rollups are a form of layer 2 scaling solution that batches transactions together off-chain for verification and that uses off-chain computation (for fee reduction). Optimistic rollups also derive their security from Ethereum (by requiring on-chain verification) and have a series of smart contracts tied to Ethereum.

In optimistic rollups, a state root is published by an operator but not checked every time and assumed valid by default. However, if it emerges that an operator has sent an incorrect or falsified state root, other operators and users can point to the falsified block and then revert the blocks and slash the culprit. In this way, fraudulently stated proofs are detected. This is called a fraud proof system. Operators have limited time to challenge transactional validity and produce a fraud proof, as it occurs in a time frame called a challenge period. If no challenge occurs, then off-chain transaction data is published on-chain along the state root.

Optimistic rollups derive their name from the fact that they optimistically presume transactions and state are valid till proven otherwise—to prove that transactions are invalid, fraud proofs are issued by operators in order to contest transactional validity.

Prominent examples of optimistic rollups are Arbitrum and Optimism and the upcoming Boba network from OMG foundation.

What are the similarities and differences between optimistic rollups and ZK-rollups?

Similarities:

Although distinct, optimistic rollups and ZK-rollups have many similarities:

  • Both are secured by the Ethereum
  • Both have smart contracts on Ethereum mainnet which verify data
  • Both process transactions off-chain
  • Both batch transactions
  • Both result in a reduction on fees and increased scalability (although not equally so)
  • Both use data compression as an optimization technique to reduce user fees
  • Both us merkle trees and merkle roots to reduce data size
  • Both post (state roots) using Merkle trees
  • Both use the calldata part of Ethereum

Differences: 

Optimistic rollups and ZK-rollups have many major differences overall which impact scalability, privacy and throughput:

  • Optimistic rollups issue fraud proofs but are presumed validity till proven otherwise; ZK-rollups issue validity proofs which prove validity
  • ZK-rollups are more computationally intensive
  • Zk-rollups use a different technology to achieve the same goal, namely zero-knowledge proofs
  • Optimistic rollups need to post all associated off-chain transaction data (even if compressed) on chain and issue a fraud proof to contest transactional validity which is assumed, ZK-rollups only need to publish validity proofs for transactional validity.
  • Due to zero-knowledge proofs’ underlying architecture, no delay is present as transactions are executed as soon as the verification smart contract on Ethereum verifies the proof. Whereas optimistic rollups require a challenge period to contest the validity of transactions and produce a fraud proof.
  • When it comes to privacy, ZK-rollup also has the upper-hand, as ZK-rollups in the future can accommodate private transactions by default whereas optimistic rollups don’t use zero-knowledge protocols and would have to retrofit another privacy persevering protocol to serve this end.
  • ZK-rollups have a securer model than optimistic rollups
  • ZK-rollups have faster transaction finality. ZK-rollup platforms like zkSync have a 10 minute finality and instant TX confirmation, whereas optimistic rollups can take up to a week for the user to receive their tokens. This presents a barrier to adoption and degrades user experience.

What are the advantages and disadvantages of optimistic and ZK-rollups?

Optimistic rollups advantages: 

  • Optimistic rollups are currently dominating the rollup ecosystem with Arbitrum first in overall TVL and Optimism second.
  • Optimistic rollups offer massive cost reduction and scalability benefits—up to x10-100x in terms of scalability and even higher in cost reduction. For example, Optimism saved users x145 in gas fees compared to using the Ethereum mainchain.
  • Optimistic rollups will benefit from Ethereum’s future sharding and this will boost optimistic rollups’ TPS even higher
  • Optimistic rollups are a well understood and currently used technology that is maturing.
  • Optimistic rollups don’t require an activation fee like ZK-rollups such as zkSync which is a one-time fee when you register to pay Ethereum miners.

ZK-rollups advantages:

  • Zero-knowledge proofs allow thousands of transactions to be validated by a singular zero-knowledge proof.
  • ZK-rollups provide low fees compared to Ethereum mainnet, have lower fees than optimistic rollups and enhance general usability
  • Transaction finality is 10 minutes or less. (With zkSync)
  • TX confirmations are near instantaneous
  • Will increase usability due to high TPS
  • No one needs to check for fraud using fraud proof systems like optimistic rollups which allows swift verification and no waiting period.
  • Provides and preserves privacy with zero-knowledge technologies (such as shielded transactions) and therefore improve overall scalability
  • Likely to win out in the long run as it undergoes technological maturation and refinement
  • Massive boost in scalability with at least x100 TPS than the current Ethereum mainnet which has approximately 12 TPS

Conclusion 

Both types of rollups have several advantages and disadvantages but are scaling Ethereum effectively. Even once sharding is completed on Ethereum 2.0, both optimistic rollups and ZK-rollups are poised to continue scaling Ethereum, growing the ecosystem and refining user experience. Rollups and sharding will likely coexist side-by-side and will bring forward the true level of scalability that Ethereum truly requires.

About Figment

Figment is the leading provider of staking infrastructure. Figment provides the complete staking solution for over 700 institutional clients, including asset managers, exchanges, wallets, foundations, custodians, and large token holders, to earn rewards on their digital assets.

The information herein is being provided to you for general informational purposes only. It is not intended to be, nor should it be relied upon as, legal, business, tax or investment advice. Figment undertakes no obligation to update the information herein.

Explore More From Figment

Bring the Complete Staking Solution to Your Organization

Meet with us

This field is hidden when viewing the form

Figment respects your privacy. By submitting this form, you are acknowledging that you have read and agree to our Privacy Policy, which details how we collect and use your information.