What is the difference between Optimistic Rollup and ZK Rollup?

Optimistic Rollup and ZK Rollup are two types of Layer 2 scaling solutions for Ethereum that aim to increase transaction throughput and lower costs by moving transactions off the main chain and processing them in batches. However, they have different ways of verifying and securing the transactions on Layer 2. Here are some of the main differences between them:

  • Optimistic Rollup assumes that transactions are valid by default, unless someone challenges them and proves them to be fraudulent. This means that transactions are executed quickly on Layer 2, but they require a waiting period (usually one week) to be finalized on Layer 1. ZK Rollup uses zero-knowledge proofs to prove the validity of transactions on Layer 2, without revealing any details about them. This means that transactions are verified instantly on Layer 1, but they require more computation and data on Layer 2.

  • Optimistic Rollup is fully compatible with the Ethereum Virtual Machine (EVM), which means that any smart contract or dapp that runs on Ethereum can run on Optimistic Rollup without any changes. ZK Rollup is not fully compatible with the EVM, which means that smart contracts or dapps need to be rewritten or adapted to run on ZK Rollup. However, some projects are working on making ZK Rollup more compatible with the EVM, such as zkEVM and StarkNet.

  • Optimistic Rollup can support higher transaction volume and lower fees than ZK Rollup, because it does not need to generate or verify zero-knowledge proofs. However, ZK Rollup can offer higher security and faster finality than Optimistic Rollup, because it does not rely on fraud proofs or challenge periods.

Both Optimistic Rollup and ZK Rollup have their advantages and disadvantages, and they are suitable for different use cases and preferences. Some examples of projects that use Optimistic Rollup are Uniswap V3, Synthetix, Arbitrum, and Optimism. Some examples of projects that use ZK Rollup are Loopring, Immutable X, zkSync, and StarkWare.