ZK-Rollups vs Optimistic Rollups

SolarPath Team
Nov 20, 2022

ZK-Rollups and Optimistic Rollups are both Layer 2 scaling solutions for the Ethereum network that aim to increase transaction throughput while reducing gas fees. While they share the same goal, they differ in their approach to achieving it. In this comparison, we will outline the key differences between ZK-Rollups and Optimistic Rollups.

What is a ZK-Rollup?



A ZK-Rollup is a layer 2 scaling solution for the Ethereum blockchain that uses Zero-Knowledge Proofs (ZKPs) to bundle and compress multiple transfers into a single transaction. By doing so, ZK-Rollups can significantly increase the number of transactions that can be processed on the Ethereum network while minimizing gas costs and reducing the need for expensive computational resources.

In a ZK-Rollup, all transaction data is stored off-chain, and only a cryptographic proof of each transaction is submitted to the Ethereum network. This allows ZK-Rollups to process a large number of transactions more efficiently and at a lower cost than the Ethereum mainnet.

ZK-Rollups have been touted as a promising solution for the Ethereum network's scalability challenges, as they can potentially support thousands of transactions per second while maintaining the security and decentralization of the Ethereum blockchain.

What is an Optimistic Rollup?

An Optimistic Rollup is another type of Layer 2 scaling solution for the Ethereum blockchain. It operates on a similar principle to ZK-Rollups in that it processes transactions off-chain and bundles them together into a single transaction to be submitted to the main chain, reducing congestion and increasing throughput.

However, instead of using zk-SNARKs to prove the validity of transactions, Optimistic Rollups rely on a different type of cryptographic proof called "fraud proofs." Fraud proofs are used to challenge invalid transactions and ensure that only valid transactions are included in the bundle submitted to the main chain.

Optimistic Rollups have a slightly higher gas cost for users than ZK-Rollups because they require the submission of more data to the main chain. However, they have the potential to be more flexible in terms of the types of smart contracts that can be executed on them, as they do not have the same limitations on computation as ZK-Rollups.

ZK-Rollups:
ZK-Rollups use zero-knowledge proofs to bundle multiple transactions into a single proof, which is then submitted to the Ethereum blockchain. The proof verifies the validity of the transactions without the need for the individual transactions to be processed on-chain. This allows ZK-Rollups to achieve a high level of scalability, as the transactions can be processed off-chain and the proof can be submitted to the Ethereum network once it is ready.

Advantages:
- High scalability: ZK-Rollups can achieve a high throughput of up to 3,000 transactions per second (TPS).
- Increased privacy: ZK-Rollups use zero-knowledge proofs, which allow for transactions to be verified without revealing their contents.
- Lower gas fees: By bundling transactions and submitting a single proof to the Ethereum network, ZK-Rollups can reduce gas fees for users.

Disadvantages:
- Higher complexity: Implementing ZK-Rollups requires expertise in zero-knowledge proofs, which may limit their adoption.
- Longer withdrawal times: In ZK-Rollups, users must wait for the proof to be submitted to the Ethereum network before they can withdraw their funds, which can take some time.

Optimistic Rollups:
Optimistic Rollups, on the other hand, process transactions off-chain and then submit a single transaction to the Ethereum network, which contains a compressed version of the off-chain transaction data. This compressed data is then verified on-chain, and the transactions are processed accordingly.

Advantages:
- Relatively simple: Implementing Optimistic Rollups is easier than ZK-Rollups, as it does not require expertise in zero-knowledge proofs.
- Fast withdrawal times: Users can withdraw their funds immediately, without waiting for a proof to be submitted to the Ethereum network.
- Improved scalability: Optimistic Rollups can support a throughput of up to 2,000 TPS.

Disadvantages:
- Limited privacy: The compressed data submitted to the Ethereum network may contain information about the transactions, which could be a concern for users who value privacy.
- Higher gas fees: The compressed data submitted to the Ethereum network requires more on-chain processing than the proofs used in ZK-Rollups, which can result in higher gas fees.

What is being built on ZK-rollups and Optimistic Rollups?

On ZK-Rollups, different types of decentralized applications (dApps) can be built, including DeFi psrotocols, NFT marketplaces, gaming platforms, and more. Meanwhile, Optimistic Rollups can be used for the same types of dApps as ZK-Rollups, but also for more complex dApps such as prediction markets and decentralized exchanges.

For example, ZigZag Exchange is using zk-rollups for their DeFi Exchange platform, while Optimism is using an optimistic rollup architecture to power the Ethereum Virtual Machine (EVM).

Gaming platforms like 0xGames and Axie Infinity are being built on optimistic rollups. ZK-rollups and optimistic rollups are also being explored for various applications including data privacy, security token issuance, and supply chain tracking.



In conclusion, ZK-Rollups and Optimistic Rollups both have their advantages and disadvantages. ZK-Rollups offer higher scalability and privacy, but require more expertise and have longer withdrawal times. Optimistic Rollups are simpler to implement and offer faster withdrawal times, but have limited privacy and higher gas fees. Ultimately, the choice between the two will depend on the specific use case and the priorities of the project.