Rollups
What are Rollups?¶
Rollups are a Layer 2 scaling technology. The scaling principle of Rollups is to bundle and compress hundreds of transactions (roll them up) into a single transaction on the base (Layer 1) blockchain. The cost of a single Layer 1 transaction is shared across all Layer 2 transactions, thereby increasing transaction speed and reducing transaction fees.
There are two main types of Rollups: Optimistic Rollups and ZK Rollups.
Optimistic Rollups¶
Optimistic Rollup, often abbreviated as Op Rollup, is a scaling solution based on an "optimistic" mechanism. The system optimistically assumes that off-chain transactions are valid and does not publish validity proofs for transaction batches pushed to the chain. This is the key difference between Op Rollups and ZK Rollups.
Op Rollups rely on a fraud proof scheme to detect cases where transaction computation is incorrect. After a Rollup batch is submitted on Ethereum, there is a time window (called the challenge period, typically 7 days) during which anyone can challenge the results of a Rollup transaction by computing a fraud proof. If the fraud proof succeeds, the Rollup protocol re-executes the transaction and updates the Rollup chain's state accordingly. Another consequence of a successful fraud proof is that the sequencer responsible for including the incorrectly executed transaction in a block is penalized. If a Rollup batch remains unchallenged after the challenge period (meaning all transactions were executed correctly), it is considered valid and accepted on Ethereum. Others can continue building on unconfirmed Rollup blocks, but with a caveat: transaction results will be reversed if they are based on a previously published incorrectly executed transaction.
Typical Op Rollup solutions include Arbitrum One and Optimism, as well as Base. The latter two are built on the OP Stack.
ZK Rollups¶
ZK Rollup (Zero-Knowledge Proof Rollup) similarly improves Ethereum mainnet throughput by moving computation and state storage off-chain. Zero-knowledge Rollups can process thousands of transactions in a single batch while publishing only a minimal amount of summary data to the mainnet. This summary data defines the changes that should be made to the Ethereum state along with cryptographic proofs (validity proofs) certifying the correctness of those changes.
Zero-knowledge proof technology can verify the correctness of off-chain state transitions without re-executing the transactions on Ethereum. These proofs can take the form of ZK-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) or ZK-STARKs (Zero-Knowledge Scalable Transparent Arguments of Knowledge).
Unlike Optimistic Rollups, zero-knowledge Rollups are not directly compatible with the Ethereum Virtual Machine (EVM). Proving general EVM computation in a circuit is significantly more difficult and resource-intensive than proving simple computations (such as the token transfers described earlier).
Typical ZK Rollup solutions include: Starknet, Polygon zkEVM, Scroll, Taiko, zkSync, and Linea.
Starknet builds a general-purpose zkVM virtual machine through ZK-STARK technology to achieve validity proofs, while other projects build Ethereum Virtual Machine-compatible zkEVMs.
Some ZK Rollups address specific needs: Loopring, dYdX v3
Optimistic Rollups vs. ZK Rollups Comparison¶
Here are comparisons from several perspectives:
Security: Zero-knowledge Rollups use smart contracts to verify transaction integrity through ZK validity proofs, offering higher security. In comparison, Optimistic Rollups assume transactions are valid and rely on a penalty-based fraud system, requiring verifiers to flag potentially fraudulent transactions within the challenge period. L2Beat provides a more detailed security comparison of various Rollups.
Transaction Finality: Optimistic Rollups have a challenge period of up to 7 days. Therefore, theoretically, these transactions are not finalized on the main network until this period expires. On the other hand, transactions on ZK Rollups achieve finality on the main network faster than Optimistic Rollups, because finalization of each ZK Rollup batch on the mainnet is instant. This also affects withdrawal times: bridging assets from an Optimistic Rollup network to the mainnet can take up to 7 days, while withdrawals on ZK Rollups can be completed after the transaction batch is submitted and verified on the mainnet, typically taking at most a few hours.
Complexity and Cost: Due to the complexity of validity proof computation, ZK Rollup transactions are relatively heavier and more expensive. Op Rollups have lower complexity and transaction costs, and better EVM compatibility. You can view Layer 2 fee comparisons at https://l2fees.info/. This has also allowed Op Rollup networks to launch earlier, becoming a cheaper and relatively more scalable option for users. The release of Optimism's OP Stack has also made it easier for projects to launch their own Layer 2.
As ZK technology advances, ZK Rollups are expected to prevail across all dimensions.