Vying for the throne: OP vs. ZK. What is the better Layer2 solution?
The Ethereum mainnet has a long history of network congestion and expensive transaction fees during the bull market. However, in recent years, Layer2 has matured as a scaling solution for Ethereum, lowering the transaction cost and improving the network efficiency.
Various Layer2 projects have sprung up between 2021 and 2023. To date, according to L2Beat data, 13 Layer2 projects have reached a TVL of $10 million or more.
Among different technologies they use, the most discussed are ZK-Rollups, Optimistic Rollup, Validium, and Plasma.
ZK-Rollups: Proposed by Ethereum researchers. All computation happens off-chain, stored on-chain, and the plaintext data is sent to the on-chain contract via calldata, reducing storage costs. The zero-knowledge proof guarantees the correctness of the off-chain computation. ZK-Rollups can greatly improve TPS, and reduce the cost of every single transaction.
Optimistic Rollups: They are divided into Optimistic Rollup (ORU) and Arbitrum Rollup (ARU), both of which ensure security through the challenge mechanism. The difference is that the challenge mechanism of ORU is to challenge a transaction. That is, the EVM must execute a challenged transaction completely. While ARU views the execution of a transaction as an ordered sequence of instructions, and through multiple rounds of interaction, it finds out the problematic instruction for the challenge, making the verification cost very low. Nevertheless, Optimistic Rollups have weaker security assumptions than ZK-Rollups.
Validium: This solution was proposed by StarkWare and has its name endorsed by Vitalik Buterin. The computation is off-chain and guaranteed by zero-knowledge proof algorithm. The verification is on-chain, and the final world state is stored on-chain. For better scalability, this solution also stores transaction data off-chain, and the credible Data Availability Committee (DAC) provides proof of data availability. Compared with the previous two solutions, Validium has less data availability but provides better data scalability.
Plasma: Proposed by Vitalik Buterin, Plasma was earlier than the other three solutions, with computation off-chain, storage on-chain, and transaction data stored off-chain. Users can initiate fraud proofs to prove the operator’s fraudulent behavior, thereby obtaining rewards and punishing the fraudulent operator.
After several years of technical progress and product iterations, Validium and Plasma have been gradually phased out, which is also signified by the data in the screenshot above, and Layer2 has now become the battlefield of Optimistic and ZK-Rollups.
OP-Rollups vs. ZK-Rollups
- Optimistic Rollups
It can be seen that Layer2 networks with the highest TVL have chosen Optimistic Rollups. This is because it has an incomparable advantage: EVM compatibility.
Among them, Arbitrum has the largest market share. Defi protocols on the Ethereum mainnet can be easily migrated to the Arbitrum network. At present, dozens of DEX, lending, insurance, and aggregate transaction Dapps have been deployed on Arbitrum, bringing a total of $2.6 billion TVL.
Arbitrum is an Ethereum Layer2 solution, however, from the users’ perspective, the experience of using Arbitrum is more like a “cross-chain”.
Before using Arbitrum, users need to first add Arbitrum to their MetaMask, then transfer their funds from Ethereum mainnet to Arbitrum through the official cross-chain bridge.
Besides, if they need to withdraw their money, as there is a challenge period for the Optimistic Rollups fraud proofs, they often need to wait for 1 to 2 weeks before their funds finally reach the Ethereum mainnet.
Compared to Arbitrum, the second largest Layer2 project Optimism has a different way of implementing the fraud-proof mechanism.
Optimism uses single-round fraud-proof. It means that Layer1 performs the entire Layer2 transaction on-chain to verify the state root. This makes fraud-proof instant, which is advantageous. However, for every transaction executed, the state roots need to be generated on-chain, resulting in rising costs and security risks.
Arbitrum, on the other hand, uses multiple-round fraud-proof, which only requires generating one state proof for a whole batch of transactions and posting it on-chain. It is more secure than Optimism, but a multiple-round fraud-proof takes longer to complete, resulting in a much longer time for users to withdraw funds.
Both Optimism and the Arbitrum network have taken some centralized steps to improve the cross-chain experience of users, with the majority of users now using CEX for Layer1-Layer2 cross-chain. However, it should be noted that the current validators of Optimism or Arbitrum are completely operated by the official, and there is no fraud-proof mechanism available. That is to say, in the event of official misbehavior, users’ funds on Layer2 will be difficult to secure.
It is said that the following Bedrock upgrade of Optimism will solve this problem. However, once true decentralization is realized, how to prevent private nodes from being fraudulent will become another challenge. All of these have suggested that the thriving OP-Rollups that are currently enjoying EVM-compatibility benefits still have a long way from maturity.
2. ZK-Rollups
ZK-Rollups ensure that the world states change caused by all transactions in a block are correct with zero-knowledge proof algorithm. They process multiple transactions at one time, improving system performance and bringing high TPS.
However, due to circuit size limitations, the improvements that they’ve brought are not as expected, and not sufficient to support the current demand for Layer2. Therefore, an additional technical protocol called Aggregative Proof is needed to improve the overall performance.
The logic of an aggregative proof is simple. In a basic Layer2 solution, one block corresponds to one validity proof, and the on-chain contract verifies the validity of the proofs. With Ethereum Average Block Time now at 12s, if the validity of multiple blocks can be verified at one time, the cost of each transaction will be significantly reduced.
To achieve this, the Aggregative Proof aggregates multiple proofs generated within a period or from a fixed number of blocks, and verifies their validity with zero-knowledge proof. Think of the verification process as another circuit. In this way, one verification on chain can verify multiple block proofs.
According to data from L2fees.info, Optimistic Rollups can reduce Ethereum gas fee to about one-tenth, while ZK-Rollups Layer2 solutions can reduce the gas fee several times more on top of that, offering greater scalability and more space for imagination.
In terms of security, ZK-Rollups Layer2 protocal ZKSpace adopts an active-proof mechanism, submitting all transaction data to Layer1 for confirmation at any time. Users do not need to wait for a long challenge time, nor do they need to worry about the security problems caused by centralized nodes. It only takes 20 to 40 minutes for users to withdraw funds, with the same security as Ethereum mainnet.
ZKSpace is a full-featured Layer2 protocol. In 2 years of research and product iteration, we have launched 4 sub-products: ZKSquare, ZKSwap, ZKSea and ZNS, offering wallet, DEX, NFT, domain name features and more.
(1)ZKSquare
We provide a Layer2 wallet based on the ZKSpace protocol. It allows users to transfer any assets from Ethereum mainnet to their Layer2 wallet, including ERC20 tokens and NFTs, and no platform fee is charged.
As a Layer-2 payment product, ZKSquare makes token transfer between different Layer2 wallets possible. For both ERC20 tokens or NFTs, transfers can be completed in a few seconds with an extremely low gas fee (0.5U). Apart from that, users can withdraw their assets to L1 at any time. It only takes 20 to 40 minutes for their assets to arrive at their L1 account.
(2)ZKSwap
ZKSpace contains the DEX function of ZKSwap V2, allowing users to enjoy cheap and ultra-fast token swaps. Additionally, users can form LP tokens to become market makers and earn transaction fees. ZKSwap also supports unlimited token listing for any ERC20 token without any commission. Gas fee for all Layer2 operations is much lower than Ethereum mainnet.
ZKSwap implements 100% roll-up of transaction data, ensuring the same security as the Ethereum mainnet. After two major iterations of V1 and V2, it has been in stable operation for nearly a year, without any security incidents. Moreover, liquidity mining and trading mining activities are launched from time to time to reward users, with the platform TVL reaching $2 billion at its peak and the daily turnover reaching tens of millions of dollars.
(3)ZKSea
ZKSea is the first ZK-Rollup based NFT platform to support Layer1 and Layer2 NFT transfer. Apart from minting NFTs on Layer2 with an ultra-low gas fee, users can withdraw their NFTs to L1 and backward, fully enjoying the composability of Ethereum ecosystem. ZKSea offers an NFT marketplace where users can freely list and trade NFTs. The NFT auction and mystery box functions are also under iteration, aiming to provide an infrastructure to support Gamefi and Metaverse innovations.
(4)ZNS — ZKSpace Name Service
ZNS is the first Layer2 domain name solution. It allows users to enjoy the same features as ENS, including domain name registration, transfer, renewal, etc. By replacing wallet addresses with .zks names, everything including making payments, buying and selling NFT, or viewing transaction records has become more convenient. It also serves as users’ on-chain identity in the ZKSpace ecosystem.
About the Future: ZK-EVM
ZK-Rollups have more advantages than Op-Rollups in terms of security and scalability. And Vitalik Buterin has mentioned more than once in public that ZK-Rollups scaling is the superior solution and the inevitable choice in the long term.
However, in the short term, the fact that ZK-Rollups do not support EVM makes it impossible for excellent Dapp developers to deploy their innovative applications, and the gap in terms of ecosystem richness between ZK-Rollups and the EVM-compatible OP-Rollups is widening. It is also true that the current user and fund volume of OP-Rollups far exceed ZK-Rollups.
Therefore, project or research teams like ZKSync, Starkware and Sin7Y are exploring ZK-EVM from different directions. For example, the opcode circuit of each existing EVM can be implemented and combined to form the final circuit with zero-knowledge proof, and this approach is adopted by teams such as AppliedZKP, Hermez, and ConsenSys. This solution is Solidity and EVM compatible, ensuring both security and convenience for users. In contrast, there are compiler-based solutions, such as Matterlabs’ ZKSync 2.0 and Starkware’s Starknet. This solution, on the other hand, is easy to implement and can greatly optimize circuit efficiency and achieve higher performance.
The mission of our team is to continuously provide a better blockchain service with ZK-Rollup technique. Therefore, apart from upgrading and iterating the current ZKSpace products, we will also actively explore ZK-EVM solutions, and introduce them when the technology is mature to jointly build a richer Layer2 ecosystem with excellent Dapp developers.
About ZKSpace
The ZKSpace (formerly ZKSwap) platform consists of three main parts: ZKSwap, the first Layer 2 AMM DEX utilizing ZK-Rollups technology, payment service ZKSquare supporting fast and cheap Batch Transfer, and an NFT minting center and marketplace ZKSea. ZKSpace has been running since February 2021 with hundreds of function iterations, and no security incidents have ever occurred. With innovative NFT L1-L2 transfer, unlimited token listing, cheap and smooth deposit & withdrawal, and a Layer 2 domain name system ZNS, ZKSpace aims to implement EVM-compatible ZK-Rollups and bring the community more Layer 2-based products.
Stay Tuned
Website|Web APP|Mobile APP|Twitter|Telegram|Discord | Reddit|Forum|Medium|Mirror|GitHub