Optimistic Rollups & ZK-Rollups: Explained - Figment

Optimistic Rollups & ZK-Rollups: Explained

“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:

Differences:

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

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

Optimistic rollups advantages:

ZK-rollups advantages:

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.