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 sharding to mature. At present, the most likely expansion path is Layer 2. Among the various Layer 2 paths, the Rollup series is the most promising technology path.
The Rollup series mainly include ZK Rollup and Optimistic Rollup, and their progress is fairly smooth at present. 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 launched ZK Rollup. The Zeroswap “” 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 the announcement of Matter Labs and Curve, 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.
(Https://zksync.curve.fi)
Layer 2 selection of Curve
Before, Blue Fox Notes also introduced the layer 2 track “” “”, and also introduced the difference between ZK Rollup and Optimistic Rollup “”. 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 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.
The important reason why Curve chose ZK Rollup is its security considerations. Currently, the amount of assets locked on Cuvre exceeds 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 carried out 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, ZK Rollup security depends more on pure mathematics. In addition, Optimistic Rollup has potential security problems. 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 announced 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 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 a 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 Matter Labs’ introduction, 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 cooperate 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. Every transaction will be transferred on the zkSync testnet, and these will be reflected in the block explorer and wallet. Users need to use real testnet ERC20 tokens for transactions.
*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.