Curve chose ZK Rollup mainly based on safety considerations.
Original title: “Curve based on ZK Rollup is coming”
Author: Blue Fox Notes
Under the impact of DeFi in the past few months, the Ethereum network is overwhelmed. Layer 2 and sharding are the path to future scalability of Ethereum. However, it will take many years for the sharding to mature. At present, the most likely expansion path is Layer 2. Among the current various Layer 2 paths, the Rollup series is the most promising technology path.
There are mainly ZK Rollup and Optimistic Rollup in the Rollup series, and their progress is fairly smooth. At the end of September, the Optimism team announced the opening of the first phase of its test network; Fuel is also advancing to the test network; Loopring, zkSync, and Deversifi (based on Starkware technology) have also landed ZK Rollup. The Zeroswap ” ZeroSwap: DEX based on ZK-Rollup ” mentioned in the Blue Fox Notes will also launch the AMM mode DEX based on Zk Rollup. Layer 2 will show vigorous development in the next six months to one year, especially in the DeFi field.
Curve is advancing faster in Layer 2, and now Curve based on ZK Rollup technology is coming soon. According to Matter Labs and Curve’s announcement, with the help of Matter Labs, the Curve team rewrites the existing Curve contract to the Zinc version, which is currently open for testing on the testnet.
Layer 2 selection of Curve
So, why did Curve choose the Layer 2 solution based on ZK Rollup?
Although every Layer 2 technology on the market is offering its own advantages, in the end, every solution has its own balanced choice. Some protocols have lower requirements for security, but higher requirements for performance, such as game projects. Some agreements cannot be compromised in terms of security, such as the DeFi agreement. The total assets locked in the DeFi agreement exceed tens of billions of dollars, and the amount of funds traded on it is as high as billions of dollars. For these protocols, security is the primary consideration.
At present, relatively speaking, in terms of Layer 2, ZK Rollup and Optimistic Rollup have won more DeFi protocols. In particular, ZK Rollup is close to the level of Layer 1 in terms of security, and is therefore regarded as the most promising Layer 2 solution in the future. Of course, in this process, there may also be new and better solutions, which will take time to catalyze.
Curve’s choice of ZK Rollup is very important because of its security considerations. Currently, the amount of assets locked on Cuvre is more than 1.5 billion U.S. dollars, and the recent daily transaction volume is about 150 million U.S. dollars. It already has a considerable scale and cannot be performed on security. Many trade-offs. ZK Rollup can almost reach Layer 1 level of security. This is an important reason why Curve chose ZK Rollup.
Compared with the game model that uses economic incentives, the security of ZK Rollup relies more on pure mathematics. In addition, Optimistic Rollup has potential security issues. As the amount of locked assets increases, its security may decrease instead. Therefore, it has a relatively safe range of assets. If the assets are too large, they may be attacked.
In addition, in terms of finality, ZK Rollup also has certain advantages over Optimistic Rollup. ZK Rollup can achieve finality within a few minutes, and it supports the rapid withdrawal of funds to Layer 1. The Optimistic Rollup has a controversial delay time design, which generally takes at least one week.
Of course, Optimistic Rollup also has its advantages. Compared with ZK Rollup, it is more friendly in terms of programmability, it supports EVM compatibility, and is more convenient in bringing existing Ethereum smart contracts into Layer 2.
In order to solve this shortcoming, Matter Labs claims that it has achieved some breakthroughs on ZK Rollup, especially in supporting arbitrary user-defined smart contracts. Matter Labs introduced the Zinc programming language and the SNARK-friendly Zinc VM, and implemented the recursive PLONK proof verification for Ethereum. The combination of these three will support smart contracts on ZkSync.
Zinc programming language
According to Matter Labs’ announcement, in the current situation, the Zinc VM smart contract must be written in the Zinc programming language. Zinc follows the simplified Rust syntax while drawing on all smart contract elements and structures from Solidity. Zinc is basically the same as solidity in structure, and it is relatively easy to convert existing Solidity codes to Zinc. However, currently it does not support Turing completeness (there will be planned support in the future), so it prohibits recursion and infinite loops. In addition, all current Vyper programs can be isomorphically converted to Zinc. Experienced Solidity/Vyper developers can master it within a few days.
Zinc itself is not Turing complete, but the work on Solidity can be done on it with a few modifications. At present, most DeFi application codes rarely require loops or recursion. In addition, Turing-complete components can also be re-implemented by using transaction-level recursion.
Zinc VM
According to the introduction of Matter Labs, the contract is written and compiled in the Zinc programming language. The Zinc VM bytecode and SNARK verification key can be deployed to the zkSync network without permission.
The contract will be assigned a new address in Layer 2. When the user interacts with the contract, the verifier of zkSync will execute the Zinc VM opcode and generate a zero-knowledge proof of the validity of the transaction. The proof will be recursively verified by the rollup block circuit through the deployed verification key. The block proof is verified by the zkSync smart contract deployed on Ethereum to authorize the state transition. In terms of composability, all zkSync Layer 2 contracts can call each other, just like the Ethereum mainnet.
User key management
According to Matter Labs, zkSync is directly integrated into the checkout process. This integration is similar to the web2.0 single sign-on authentication scheme. Assuming that the zkSync website is hacked, the user’s Ethereum wallet also needs to perform two-factor verification with additional message signatures. The signature is currently verified by its server. To improve the user experience, Matter Labs is planning to work with other teams to develop a common Ethereum Layer 2 signature standard.
Open test
The test net function is complete. Users can write contracts, deploy them on the testnet, conduct local tests, and generate zero-knowledge proofs for smart contract execution. Each transaction will be real token transfer on the zkSync testnet, and these will be reflected in the block explorer and wallet. Users need to trade with real testnet ERC20 tokens.
Current limitations
Currently Zinc VM has not been integrated into the zkSync core. Some important functions in the Zinc programming language may also be missing. This needs further improvement.
Source link: mp.weixin.qq.com