Curve + zkSync L2: Ethereum's ZK Rollup Smart Contract
Editor's Note: This article comes fromDenglian Community, reprinted by Odaily with authorization.
, reprinted by Odaily with authorization.
>>The Curve and Matter Labs teams are excited to announce a big step toward scaling Ethereum in a secure and decentralized manner: today, together with Curve Finance, we launched the first dapp-resident zkSync L2 smart contract testnet.<<
**Demo demo!**[3]
Zinc Documentation[5]
mdnice editor
Why choose ZK Rollup?"Scalability is a pressing need for Ethereum - there is a light at the end of the tunnel. Vitalik Buterin just announced that Rollup is "the only option" for scaling Ethereum at this stage [6], highlighting its [unique trustless security guarantee](/matter-labs/evaluating-ethereum-l2-scaling-solutions-a- comparison-framework-b6b2f410f955") 。
Unique trustless security guarantee
ZK Rollup (ZKR) is one of two existing versions of Rollup[7], the other being Optimistic Rollup (abbreviated: OR)[8]. Both approaches have their trade-offs (see [9] for a detailed comparison). Here are the main practical differences:
Security - Even with a single validator, ZK Rollups are very secure because they rely on pure mathematics rather than ongoing economic incentives to secure funds. Apart from cryptographic assumptions, ZKR is as secure as underlying L1. This is especially important for protocols dealing with high asset value. Compared to ZKR, Optimistic Rollup has a strong anti-network effect: its security is reduced proportionally to the locked value. In practice, capital caps (in the range of tens of millions of dollars) need to be controlled to be securely placed in a single Optimistic Rollup in order to maintain resistance to highly plausible attacks on L1 [10]. As long as Ethereum remains a PoW chain , it cannot be relieved.
Programmability - Supporting full EVM compatibility with Optimistic Rollup is easier. It is generally considered that the OR method is the only feasible way to introduce existing Ethereum smart contracts into L2 (L2: Layer 2 network). However, this is about to change.
mdnice editor
Until recently, supporting arbitrary user-defined smart contracts in ZK Rollup was an extremely challenging task. But these days, things move fast in the field of zero-knowledge proofs. 2020 brought several breakthroughs that finally made this possible: Matter Labs introduced the Zinc programming language and the SNARK-friendly Zinc VM, and implemented Ethereum’s recursive PLONK proof verification [12]. The combination of these technologies will drive the implementation of smart contracts on zkSync.
mdnice editor
How does the Zinc VM work?
Contracts are written and compiled in the Zinc programming language. The compiler output is twofold: The bytecode of the Zinc virtual machine.
The contract's SNARK verification key.
Therefore, Zinc smart contracts on zkSync inherit the strict security guarantee of proof of validity.
mdnice editor
How to write a smart contract for zkSync?
Zinc is currently in a closed development beta. If you are interested in trying it for your project, please contact us [15].
mdnice editor
How is Zinc different from Solidity/Vyper? Can I port existing source code?
Zinc follows a simplified Rust syntax, but it borrows all of Solidity's smart contract elements and structures. Any experienced Solidity/Vyper developer can pick it up in a matter of days.
Since Zinc is structurally identical to Solidity, existing Solidity code can be easily converted to Zinc. The main challenge is that Zinc is not yet fully Turing complete. This means: recursion and infinite loops are forbidden (limited loops are OK).
Vyper, the second most popular ETH smart contract language, is not Turing complete either. Thus, today any Vyper program can be converted isomorphically to Zinc. This is exactly how Curve on zkSync works: Matter Labs helped the Curve team rewrite the existing Curve contract into a Zinc version. It is almost identical to the original source line by line.
mdnice editor
How composable?
All contracts on the zkSync L2 network will be able to atomically call each other in exactly the same way as on the Ethereum mainnet.
mdnice editor
How to manage user keys?
In Gitcoin Sponsorship Round 7 [17], zkSync was integrated directly into the checkout process, which requires trusting the Gitcoin website. In this demo, the zkSync private key never leaves the scope of connect.zksync.dev[18]. This type of integration is similar to the single sign-on authentication scheme in the Web2 world, which is widely used for Google/Apple/Facebook logins. This effectively means that zkSync can now be used with any Ethereum wallet and any number of completely trustless dapps.
At the same time, we are working with other teams to develop a common Ethereum L2 signature standard, which will make the user experience of interacting around L2 contracts more pleasant.
mdnice editor
What are the limitations of Zinc Alef?
The testnet is fully functional, you can write smart contracts, deploy them to the testnet, test them locally, and generate zero-knowledge proofs of smart contract execution. Every transaction will result in a real token transfer on the zkSync testnet, which will be reflected in block explorers and wallets.


