zkSync 2.0 Developer Update

As hot zkSync summer comes to an end, how far are we from the finish line?

astarinmymind
Published in
5 min readAug 30, 2021

--

On March 27, 2021, we announced our plans for zkSync 1.x and 2.0.

We successfully deployed the zkSync 1.x upgrade to mainnet, but did not manage to meet our projections for zkSync 2.0’s launch in August. In this end of summer update, we will discuss the delay, our gradual testnet rollout, and fair launch for mainnet. As a bonus, we also wrote a separate post sharing detailed technical insights of the challenges we have overcome during the R&D process.

Why delay?

Back in March on our biannual company offsite in Dubai, we finalized the design of zkSync 2.0 and made an estimate on how long it would take to build. With gas fees at an all time high, our design prioritized security (always) and time, taking some tradeoffs in efficiency, optimization, and compatibility with Ethereum — adapting circuit environments to zk EVM is not straightforward due to fundamental limitations in a circuit.

However, there was one key decision that did not prioritize time to mainnet: choosing LLVM. While it would have been faster to implement a custom compiler from scratch, in the long term, there is no other alternative than LLVM. Built by engineers working on industrial quality products (LLVM is an integral part of macOS and iOS), LLVM is a state of the art compiler framework that produces industrial grade products, forcing us to think about a debugger, linker, assembler, disassembler, and binary utilities even though we were only trying to quickly ship a compiler (we will ship those other tools one day!). By leveraging LLVM, our compiler has all the classic optimizations, over 20,000 regression tests, and 3,000 integration/executable tests, low maintenance burden, and the ability to program smart contracts in any language that can be translated into LLVM IR.

In May, while our node and zkEVM were ready, there were some unforeseen incompatibilities with our architecture and LLVM that we needed additional time to integrate into the framework. We did not want to open a testnet with one of the three core components missing, but even with its initial overhead, we still stand by our decision to adopt LLVM from the very beginning. Matter Labs will never compromise on security or code quality. Following the best industrial grade practices is slow, but the alternative is programming with technical debt; and debt has to be repaid one day.

Building out zkSync 2.0 is an intense R&D process:

  1. both a snark-friendly zk EVM and a different per-account data availability policy in the same address space has never been done before;
  2. it requires simultaneously solving compiler, zkEVM, and node needs.

Since implementation was highly tied with research, many times we found a better solution to a problem that resulted in lesser costs, better compatibility, or more convenient interfaces:

  • we did a few iterations to make the compiler more efficient, which gave us ideas on how to make our zk EVM more efficient (more details in technical insights post);
  • our API and SDK is very similar to Web3 API and ethers, so we decided to support both out of box with additional zkSync L2 specific functionality;
  • we found a way to remove the limit on the length of transaction execution trace, enabling arbitrary large transactions!

With gas prices averaging 20 gwei in June, July, and August, we felt a somewhat decreased time pressure and we did not want to ship something when we saw a clear way to do it better. Now, we are incorporating all improvements before any release to avoid, as much as possible, any breaking upgrades. The version we are developing now has more features, lower costs, and is more compatible and convenient than the version we announced in March.

However, we do want to be direct and completely honest with you. Targeting August was a very ambitious goal. It’s clear to us now that even if we dropped the improvements in efficiency and Ethereum compatibility, delivering without compromises in quality would not have been possible. Such is the nature of R&D on the edge of technological innovation: any prediction is always a guess around a lot of unknowns.

Status Update

In 6 months time, we have both implemented and tested:

  • The executor node,
  • zkEVM (circuits and execution environment),
  • Solidity and Zinc compiler (compiled and successfully tested Uniswap v2!)

We are finalizing:

  • Web3+ API (Full support of Web3 API out of the box + zkSync L2 specific functionality),
  • Ethers+ SDK,
  • L1 to L2 communication (important for censorship-resistance: funds from zkSync can be withdrawn via an L1 transaction, even if you have to transfer them from a smart contract first!)

In Progress:

  • Integrating circuits/prover and data availability protocol into the executor node,
  • L2 to L1 communication (eg triggering L1 contracts from L2),
  • Vyper Developers: the Vyper team is currently building the Vyper-to-LLVM frontend, and our compiler team is working closely with them to make sure you can seamlessly deploy smart contracts in Vyper on zkSync 2.0!

Testnet Plans

We will open testnet in 3 phases:

Phase 1: North Star

In a couple of weeks, we will start releasing the first version to a set of protocols. We want to work closely with these teams in order to facilitate rapid iterations of feedback and fixes and minimize bugs and challenges when we release our open testnet. If you are interested in this phase, please fill out this form.

Phase 2: Spotlight Search

Then, we would like to open it up to people that are willing to create content. This can range from a tweet thread, to blog posts, to a full developer demo video! The goal is to have a variety of helpful resources readily available when we fully open our testnet, and also serve as an additional round of testing for our system. If you like writing or producing technical content, please fill out this form.

Phase 3: Kindergarten

Testnet is open to everyone!

Mainnet Fair Launch

Matter Labs is committed to building a neutral layer 2 where all protocols and infrastructure can deploy and operate in a fair and equitable manner!

It is therefore critically important to us that our mainnet release is a fair launch: we will provide everyone time to prepare and launch projects on zkSync under equal conditions.

Conclusion

We are nearing the finish line! There are no more big changes expected, and we are working on integrating all the moving parts, implementing convenient SDKs, and writing documentation.

For those that are interested in reading the detailed technical insights into the challenges we have overcome, please head over to this post.

We are hiring! Follow us on Twitter! Join our Discord!

--

--