A zero-knowledge (ZK) rollup is a Layer 2 scaling solution designed to enhance Ethereum's throughput while keeping gas costs low. It achieves this by utilizing ZK proofs to validate the correctness of transaction batches.
In this article, we will explore ZK rollups (and also Succinct rollups), what they are, how they work, and why they are considered the future of Ethereum scaling.
What is a zero-knowledge rollup?
Zero-knowledge (ZK) rollups use zero-knowledge proofs (sometimes referred to as validity proofs) to ensure the correctness of each batch of transactions.
Examples of zk rollup blockchains include zkSync Era and Starkware’s Starknet.
How do ZK rollups work?
When a user submits a transaction on a ZK rollup like zkSync, the process involves the following steps:
- Transaction submission: The user sends their transaction to an “operator”—an entity or node responsible for processing transactions on the rollup such as a validator.
- Batching and compression: The operator collects multiple transactions, processes them, and combines them into a single batch.
- Proof generation: The operator then generates a zero-knowledge proof (ZK proof) for the batch. This proof demonstrates that the transactions in the batch are valid without revealing any specific details about them.
- On-chain submission: The batch, along with the ZK proof, is submitted to the Layer 1 to be verified and finalized.
Validity proofs or zero-knowledge proofs
Zero-knowledge rollup solutions rely on cryptographic proofs known as validity proofs or zero-knowledge proofs. These proofs play a crucial role in ensuring the integrity of transactions:
ZK proofs (validity proofs):
- These cryptographic proofs confirm that the transactions in a batch are valid without exposing any transaction details. They are generated by a “prover” and verified by an Ethereum smart contract called the “verifier.”
- Often, ZK proofs are selected to validate transactions for their ability to provide low-latency cryptographic validation rather than for their 'zero-knowledge' properties. Rollups that do not use the ZK aspect of proofs are referred to as Succinct rollups.
- For each batch of transactions, the prover generates a validity or ZK proof that is submitted to the L1 contract to verify the batch.
Benefits of ZK rollups
ZK Rollups offer several advantages over other scaling solutions:
- Scalability: ZK Rollups significantly increase transaction throughput by processing and compressing multiple transactions into a single batch.
- Lower gas costs: Transactions on ZK Rollups are much cheaper than those directly on Ethereum because transactions are executed off-chain and then batched together.
- Security: ZK Rollups batch, execute, and order transactions off-chain but use Ethereum for security as it confirms the validity of transactions. Additionally, all state data is available to all network participants as
calldata
, which allows others to independently verify the L2 chain's state. If Ethereum experiences issues or undergoes a rollback, the rollup will also be affected. - Fast finality: ZK rollups use Ethereum to finalize transactions when the L1 contract accepts the validity proof. This provides a layer of security, preventing the transactions from being tampered with or reversed once they are finalized on the L1.
- Privacy features: Some ZK Rollups, like Aztec, use ZK proofs to enable computations over private state. This means they can process transactions securely while keeping the details hidden from public view.
Summary
ZK Rollups offer a scalable, secure, and efficient solution to Ethereum's scalability issue.
This article has gone through what ZK rollups are, how they work, and why they are the future of blockchain scalability.
- To learn smart contract security and development, visit Cyfrin Updraft.
- Or request a security review for your smart contract, contact us.