Original title: What is Zk-Rollup? Layer 2 Scalability Technology
Original translation: GaryMa, Wu Talks Blockchain
Summary
The low scalability of blockchains leads to slower speeds, higher transaction fees, and poor user experience. This problem can be potentially fixed through Layer 1 (e.g. sharding) and Layer 2 (e.g. rollups) solutions.
Layer 1 solutions aim to upgrade the blockchain itself, while Layer 2 solutions create a framework on top of an existing chain.
Rollups are a popular Layer 2 solution that bundle transactions off-chain for faster computation.
Zk-rollups are a rollup implementation that uses zero-knowledge proofs.
Zero-knowledge proofs allow verification without revealing the underlying data, ensuring transaction privacy and security.
The race for blockchain scalability
As cryptocurrency becomes more widely used, solving the scalability problem of blockchain networks becomes critical. A congested blockchain leads to slower speeds and higher transaction fees. To solve this problem, we have two main frameworks: Layer 1 and Layer 2 solutions.
Layer 1 solutions: These solutions directly improve the infrastructure of the blockchain to enable the entire system to achieve higher throughput. Sharding is a typical example. By dividing the blockchain into different blocks, it increases the capacity of the system and allows transactions to be processed simultaneously.
Layer 2 Solutions: These solutions run on top of the underlying blockchain. In Layer 2, transactions are processed off-chain and submitted together to the underlying chain. Key technologies include state channels, sidechains, and rollups. Zk-rollups are a form of rollups that utilize zero-knowledge proofs.
What are Zk-Rollups?
To understand Zk-rollups, it is important to understand rollups and zero-knowledge proofs.
What are rollups?
Rollups allow blockchains to package transaction data together and process it off-chain. After processing, the final result is submitted to the underlying chain. Processing so many transactions at the same time eliminates the possibility of blockchain bloat and enables faster and cheaper computation. Rollups are divided into two categories: Optimistic and Zk-rollups.
Optimistic rollups: Optimistic rollups operate under the assumption that all transactions it packages are legitimate. Before these transactions are submitted to the blockchain, they go through a waiting period. During this waiting period, the network raises objections to question suspicious transactions. Optimism, Arbitrum, and opBNB are examples of optimistic rollups.
Zk-rollups: Unlike optimistic rollups, zk-rollups verify each transaction through zero-knowledge proofs. Although more complex to implement, zk-rollups are designed to bypass the dispute resolution period seen in optimistic rollups, theoretically processing transactions faster.
Now, let’s learn about zero-knowledge proofs.
What is Zero-Knowledge Proof?
A zero-knowledge proof (ZKP) is a cryptographic tool that allows one party (the prover) to prove to another party (the verifier) that a statement is true without revealing any details about the statement.
ZKP must have three characteristics:
Completeness: If the statement is true, and both parties are true, the proof will always confirm its truth.
Soundness: An inauthentic prover should not be able to convince an honest verifier that the false statement is valid in even the most insignificant cases.
Zero-knowledge: The most decisive feature. At the end of the process, the verifier can only learn the validity of the statement without any insight into its content.
So, how does ZKP work? The method can be divided into three steps:
Witness: In the first phase, the prover provides a secret piece of information, or a "witness", to the verifier. The idea here is to prove to the verifier that the prover has access to specific data without explicitly mentioning it. The witness establishes a set of questions about the information that only the legitimate prover can answer.
Challenge: In this phase, the verifier challenges the prover by choosing a random question from the set.
Response: The prover successfully answers the verifier’s question to prove their trustworthiness.
Now that we know what rollups and ZKPs are, let’s put them together and understand how zk-rollups work.
How do Zk-Rollups work?
Zk-rollups have two core components:
Smart contracts on the chain: The smart contract defines the operating rules of the zk-rollup protocol. It includes a master contract and a verification contract. The master contract stores rollup blocks, tracks deposits, and makes important updates. The verification contract verifies the generated ZKP.
Off-chain virtual machines: These machines are responsible for handling transaction execution in L2. Off-chain virtual machines operate independently of the Ethereum main chain.
Zk-rollups are tightly intertwined with the Ethereum blockchain, albeit at a distinct layer. They don’t overwhelm Ethereum with the details of every transaction. Instead, they cleverly provide package summaries, ensuring the underlying chain remains clean and efficient.
Pros and Cons of Using Zk-Rollups
So, what are the benefits of using zk-rollups? Let’s take a look.
Advantages of zk-rollups
Increased throughput: zk-rollups move transaction execution from the underlying chain to a more efficient computing environment. Since transactions are not processed one by one on the chain, it improves overall throughput.
Reduced congestion: zk-rollups help achieve efficient Layer 1 operations by reducing blockchain bloat. In addition, full nodes only need to store zero-knowledge proofs instead of the entire data.
Lower fees: zk-rollups help lower overall fees due to reduced congestion.
Safeguards: zk-rollups include safeguards that allow users to withdraw funds in the event of problems with the rollup network, a distinct advantage over sidechains, which could compromise funds during a network failure.
Faster transaction challenge period: With zk-rollups, only the validity proof within the rollups needs to be verified, which speeds up the transaction challenge period.
Disadvantages of zk-rollups
Complexity: The biggest drawback of zk-rollups is their inherent complexity. They are more complex to execute than optimistic rollups.
Limited by the underlying chain: Despite their efficiency, zk-rollups are still limited by the underlying base layer.
Liquidity fragmentation: Any Layer 2 will lead to the fragmentation of liquidity in the ecosystem. Shallow liquidity in the underlying chain protocol can lead to potential problems.
Optimistic Rollups vs Zk-Rollups
Summarize
Scalability is often touted as the “holy grail” of blockchain technology. If a system doesn’t perform optimally, there’s no point in using it. Rollups, both optimistic and zk, offer an elegant solution to this long-standing problem. Zk-Rollups promise greater speed, less traffic, and strong security with their unique approach. Yes, they have complexities, but their potential is enormous. Understanding zk-rollups is essential for anyone who cares about the future of digital currency. As we continue to push for better blockchain performance, now is the time to become familiar with zk-rollups and their promise for the future.