Section 2: ZK Rollup & Optimistic Rollup
Last updated
Last updated
ZK Rollup uses cryptographic protocol proofs such as ZK-SNARKs or ZK-STARKs to verify the correctness of the post-state root after executing the batch. No matter how large the calculation amount of L2 is, ZK Rollup can quickly perform verification on the L1 chain.
Another proof method is Optimistic Rollup, which uses fraud proofs. There is a vivid metaphor here. It is like a mother who does not check her son's homework frequently, but as long as the homework is not completed once, he will be severely punished. Under this mechanism, the Rollup contract tracks the complete history of the state root and the hashes of each batch. If someone discovers that the post-state root for a batch is incorrect, they can publish a proof that the batch calculation was incorrect. Other nodes work together to verify the proof and restore the batch and all subsequent batches.
The following figure summarizes the advantages and disadvantages of Optimistic Rollup and ZK Rollup. It is important to note here that ZK Rollup performs well in terms of TPS and has significant advantages in terms of refund cycles. However, its disadvantages are EVM compatibility and L2 layer computational consumption:
Optimistic Rollup projects, such as Optimism and Arbitrum, use OVM and AVM respectively. Their virtual environments are basically the same as EVM, so the L1 layer contracts can be directly migrated to L2 for deployment. However, in ZK Rollup, it is quite difficult to use ZK-SNARK to prove general EVM execution, because EVM is not developed according to the mathematical requirements of ZK proof calculation, so a certain type of EVM client needs to be modified to Use ZK technology to verify transactions and contract operations.
At the same time, even after corresponding conversion, ZK operation still requires a large amount of computing power investment, so the efficiency of ZK Rollup at the L2 layer is not as good as Optimistic Rollup.
ZK Rollup provides better data compression than Optimistic Rollup and therefore is able to submit smaller data on L1.
Since the proof verification process in ZK is faster and has higher batch density, the computational consumption of the L1 layer is lower in ZK Rollup. It can be understood that the node effort on L2 greatly reduces the requirements for L1 nodes, thereby significantly improving the scalability of the L1 layer.
Customized ZK Rollup refers to developers building dedicated circuits ("ASICs") for different DApps, such as Loopring, StarkEx rollup and zkSync 1.0, They support specific types of payments, token exchange, or NFT minting; however, their circuit design requires a high degree of technical knowledge. Taking a specific type of payment data as an example, the node submits the transaction data to the sequencer, which packages it into a batch and gives it to the node that submits the proof as a public input. The proof process has nothing to do with the contract execution process on the virtual machine. ZK is only responsible for proving the rollup calculation and compression process of a specific execution result.