ZK rollups vs Optimistic rollups - What is the difference

jun 15

There are two different types of rollups - 'Optimistic' and 'Zk-rollups’. Rollup solutions differ in their approach to data validation, namely how they prove to the underlying network - Ethereum, for example - that the computation performed is in fact valid.

​​Rollups are considered one of the safest solutions for scaling Ethereum. This technology increases Ethereum throughput up to ~4800 TPS, or ~85 times. To make this happen, rollups enable third parties, commonly referred to as sequencers, to take calculations to layer 2, shape transactions into batches, and publish them back to the network.

Each batch consists of the data state of the previous batch, the transactions in a highly compressed form, and the updated data state after processing the transactions. These data states are called pre-state root and post-state root.

You can learn more about the rollup architecture and how they deliver data compression in our introductory video on rollups.

But how do sequencers prove to Ethereum that the post-state roots of each batch are valid? The answer to this question illustrates the main difference between Optimistic and ZK-rollups.

ZK-rollups use what is called validity proof. They provide immediate proof to Ethereum that the batches of transactions are correct. To do this, zk-rollups use the concept of ZK-SNARK - a mathematically complex cryptographic proof that all computations in a batch correspond to the post-state root.

Optimistic rollups use the opposite logic, a sort of presumption of innocence, and use the concept of fraud proofs, which means that initially, they assume that all the batches they send to the network are valid. Hence the name - optimistic.

And while zk-rollups rely on cryptographic proofs, optimistic rollups use verifiers to monitor batches coming on-chain and check if they are valid. To be able to submit a batch, a sequencer must put down a large deposit; if that sequencer ever submits a fraudulent batch, that deposit will be partly burned and partly given as a reward to the fraud prover.

Anytime a sequencer publishes a batch, there is a dispute period when any party can present a fraud proof that indicates that the batch is invalid and should be reverted.

How does all this affect the practical application of zk and optimistic rollups? The data verification model determines the amount of time it takes to withdraw assets from rollups back to Ethereum, and the compatibility of rollup networks with Ethereum Virtual Machine, which allows developers to easily migrate their applications from Ethereum to the rollup solution.

The ZK-SNARK proof can be verified by the main network very quickly. That's why if you try to withdraw your funds from a zk-rollup it will be processed right away, while it will take an optimistic rollup about a week or even two because the network participants must be given time to verify the transaction batches.

Because of their mathematical complexity, zk-rollups are not easy to build an application on, let alone make it compatible with Ethereum Virtual Machine. Optimistic rollups, on the other hand, easily allow developers to migrate their applications from layer 1 to rollup almost seamlessly.

While serving the same purpose, different types of rollups are good for different protocols. Optimistic rollups are good for general-purpose EVM computation, while zk-rollups are suitable for simple payments or exchanges. However, assuming that the architecture of zk-rollups will be refined in the future, they are the ones most likely to gain advantage in the long run.

More video explainers:

Latest News