Table of Contents:
We’ve come a long way from smart contracts to sidechains and rollups before reaching zkEVM technology as the potential solution to the blockchain scalability problem.
This problem has been at the core of most of the blockchain innovation we’ve seen in the past couple of years. Without sacrificing decentralization (a trade-off most L1 blockchains make to scale faster), the current state of blockchain technology simply cannot support applications that reach mass adoption. Because of this, scaling remains in the center of most current blockchain discussions.
Blockchain scalability nightmares
As you can likely recall, Ethereum’s developers and users had crushing experiences on-chain during the DeFi Summer and crypto boom between 2020 and 2021. Gas fees soared to previously unimaginable heights, with network congestion becaming a frequent occurrence. Most importantly, these cycles of network congestion and soaring gas fees keep repeating themselves with every hype cycle, from Crypto Kitties to ICOs, NFTs, DeFi yield farming and dramatic.
Of course, with the risk of fees sky-rocketting after the release of every successful project (which in turn hurts its potential continued success), the incentive to develop and launch a product for a mass market suffers. From rollups to sidechains, various solutions have been built atop the Ethereum network to solve this issue.
Each of the above solution promises to result in lower gas fees and higher network throughput. However, out of all them, rollups can be said to be one of the most promising scaling solutions for Ethereum. Optimistic rollups like Arbitrum and Optimism are popular today because they successfully became scalable blockchain layers built atop Ethereum. Zero-knowledge (ZK) rollups, on the other hand, are fractionally less popular, but many see them as the holy grail of Ethereum scalability.
Let’s take a quick dive into ZK-rollups, as understanding them is vital to wrap your head around zkEVMs.
What’s unique about ZK-rollups?
ZK-rollups are unique in that they execute transactions faster than their optimistic neighbors because they do not have to use the delay period mechanism that optimistic rollups adopted. Instead, ZK-rollups use Ethereum smart contracts to generate cryptographic proofs that verify that their transactions, usually in a batch, were genuine, valid, and completed in accordance with the base layer’s protocol
ZK-rollups also cost far less in terms of gas fees because they do not have to post all transaction data back to Ethereum, only their proof. Sometimes, a proof can prove other proofs, saving additional block space, which is advantageous to both developers and users. Yet, few ZK-rollups could do more than simple transactions (token transfers, atomic swaps, etc.). In the past, those that can support smart contract deployment usually required their developers to depart from the Ethereum framework, as existings ZK-rollups were not EVM (Ethereum Virtual Machine)-compatible.
All of this is changing now. In such a short while, developers in the ZK-rollup ecosystem have made giant strides towards building ZK-rollups that are equally compatible with the EVM.
The EVM is a virtual component that is contained in every Ethereum node which takes in smart contracts (usually written in high-level languages like Solidity) and converts them into EVM bytecode. ZK-rollups with EVM-compatibility require a code execution environment that supports EVM bytecode, therefore enabling Ethereum developers to migrate their smart contracts from Ethereum to rollups without having to write code from scratch.
These specific type of rollups are called zkEVMs...
So, what is a zkEVM?
In full, zkEVM means “zero-knowledge Ethereum Virtual Machine”. They aim to replicate the Ethereum environment as a rollup, allowing developers to build on them like they would on Ethereum.
A zkEVM is a zero-knowledge rollup with the goal of bringing the Ethereum experience fully to Layer-2 blockchains without losing the advantages of rollups. Thanks to this, developers would not need to change their code or abandon their EVM tools (and smart contracts) when writing or porting smart contracts to more scalable solutions that preserve the decentralization and security of L1s.
How does a zkEVM work?
zkEVMs are no different from ZK-rollups, only an upgrade to them.
zkEVMs follow the general workings of zero-knowledge rollups. However, it is essential to note that several ideas surround the ideal structure of a zkEVM and its operations. The truest form of zkEVMs would be fully Ethereum-equivalent, allowing no changes even if they could make proof generation any easier.
Zero-knowledge rollups take and complete transactions off-chain, in batches, and submit a cryptographic report that proves the correctness of these interactions to Ethereum. The zero-knowledge proof does not reveal the details of all the transactions in the batch, but only confirms that they are accurate enough to trigger a transition to the Ethereum state. After that, it provides validity proofs to a smart contract set up on the L1 chain. Once received and confirmed, it verifies the inputs.
To understand how zkEVMs work, we must acknowledge that they are of different types, as shown by the projects currently in the works. Although they all share common goals, they differ in approach.
Type-1 zkEVMs: fully equivalent to Ethereum
zkEVM Type-1s are expected to be fully equivalent to Ethereum, with no changes made to their state or transaction trees, hash codes, or any other logic within their consensus. Type-1 zkEVMs will be fully compatible with all Ethereum-native applications but require more prover time, as no unique reworking is done to make proof generation faster.
Type-2 zkEVMs: EVM (not Ethereum) equivalence
Type-2 zkEVMs will lower the bar a little, aiming for EVM-equivalence instead of Ethereum-equivalence. zkEVM Type-2s would look like Ethereum on the outside but will have slight modifications on the inside to facilitate development and speed up proof generation.
In this kind of rollups, a few applications may be incompatible. However, type-2 zkEVMs will still suffer slower prover times. Type-2.5 zkEVMs could therefore improve prover time by increasing gas costs.
Type-3 zkEVMs: departing from EVM
zkEVM Type-3s would not be fully EVM-equivalent as this type prioritizes the ease of placing an EVM-like system within ZK-rollups. This involves specific changes to make building easier and improve proof generation. While Type-3 zkEVMs could be compatible with most applications, some of them may require rewriting.
Type-4 zkEVMs: close cousins to the EVM
zkEVM Type-4s would be equivalent to high-level languages only, not the EVM itself. Skipping the process of providing zero-knowledge proofs for each stage of EVM execution would therefore reduce costs and encourage decentralization, as well as improve proof-generation time.
However, this would make Type-4 zkEVMs less compatible with several applications. Contract addresses will most likely change when moving applications to the EVM, and it will be impossible to carry over several debugging infrastructures.
Notes on zkEVM categories
In the future, Ethereum will undergo changes that will make it more ZK-SNARK-friendly. These changes will likely upgrade any zkEVM that falls into either of these categories, which means that the categorization scheme here is not absolute. This, as Buterin points out, merely represents a system to reflect the practical difference of real-world products into an intuitive framework.
Top contenders for the zkEVM race
Mere months ago, many thought zkEVMs were years away from becoming functional, but several projects have begun to make considerable headway in their development. Recent social media announcements have added to the hype around the next big thing in crypto, and some of the top names in the space are in a symbolic race to launch the first zkEVM.
Here are some of the top contenders to the zkEVM race:
In 2021, Polygon completed the $250 million purchase of the Hermez Network. The company launched its Ethereum Layer-2 ZK-rollup solution, Polygon Hermez, in mid-2022. Then, in July 2022, Polygon announced they were building a zkEVM, rebranding the Polygon Hermez project to Polygon zkEVM.
Polygon zkEVM is open-source, and adopted the Type-2 zkEVM approach, aiming to be EVM-equivalent but falling short of Ethereum-equivalence. Polygon zkEVM's makeup will require developers to adapt code and EVM tools to the ZK-rollup. Polygon expects its zkEVM to reach 2000 transactions per second and cut transaction costs by up to ninety percent, being far less expensive than the Ethereum Mainnet. A public Testnet is also in the works.
zkSync adopts the Type-4 approach, supporting compatibility with Solidity and Vyper, Ethereum's coding languages. zkSync 1.0 is already live, having processed about four million transactions. zkSync’s new product, zkSync 2.0, is a EVM-compatible ZK rollup powered by a zkEVM, although it falls under EVM compatibility rather than EVM equivalence.
Within zkSync, developers will be able to write Solidity smart contracts, which the protocol will transpile into Yul, another programming language it understands. As a Type-4 zkEVM, zkSync 2.0 experienced quicker proving times but suffers from less application compatibility than its competitors. zkSync 2.0 is currently live on the Ethereum Testnet.
While most zkEVM projects use ZK-SNARKs, Starkware's StarkNET adopts ZK-STARKs, which are more secure than ZK-SNARKs in theory but require more gas, take longer to verify, and occupy more block space. StarkNET has already launched its Alpha version, although it remains limited.
StarkNET, like zkSync 2.0, follows the Type-4 zkEVM approach, which categorizes it as compatible with Solidity or high-level languages. The rollup uses Nethermind's Warp, a transpiler that translates Solidity to Cairo, StarkNET's programming language, to support smart contract deployment. The drawbacks of Type-4 zkEVMs will limit StarkNET.
In collaboration with the Privacy and Scaling Explorations group, which is part of the Ethereum Foundation, Scroll is building a zkEVM solution that angles towards the Type-2 zkEVM class, like Polygon zkEVM. The project is in its pre-alpha stage and is inviting developers and testers to battle-test the network.
Scroll's architecture is similar to that of Polygon zkEVM, but it has a high composability capability, making it less performance-wise compared to zkSync 2.0, Polygon zkEVM, and StarkNET. Scroll aims to build the first genuinely EVM-equivalent zkEVM and prioritize security and transparency.
The Privacy and Scaling Explorations group is also building and doing extensive research into the zero-knowledge EVM concept. Their solution leans towards that Type-1 zkEVM class, although there are no concrete announcements yet.
The race to build the first zkEVM: Polygon vs. Scroll vs. zkSync
Polygon, Scroll, and zkSync recently separately declared that they were building the world's first truly EVM-equivalent zkEVM. The separate declarations have been interpreted as a race, a healthy competitive environment for true innovation to thrive.
An uproar greeted the announcements on Twitter. However, it is essential to note that these Ethereum Layer-2 solutions are different from one another, although none is exactly superior. Here's how they compare to one another, with respect to their core technology, benefits, and limitations:
The present state of the zkEVM ecosystem and timelines
While developers and stakeholders inclined toward privacy and scalability may buzz due to the latest zkEVM announcements, most projects are still far frpm launching finished products.
StarkNET is the only zkEVM that has launched its Alpha, while Polygon only has a Testnet open. Scroll's private Testnet is open, with a public Testnet in the works. zkSync 2.0 is live on the Ethereum Testnet, but nothing concrete may happen till Q4 2022 and all through 2023.
Q3 and Q4 2022 should see some progress from Scroll and StarkNET. In 2023, we expect public alpha launches from most zkEVM projects. However, going live is not the only challenge.
True Ethereum-equivalence is still a long way off, as even genuine EVM-equivalence is yet to be achieved. Changes in Ethereum will help zkEVMs cover more ground, and gradual improvements will follow after most projects launch.
zkEVMs are a welcome development in the crypto space, solving the Ethereum scalability problem like regular ZK-rollups while supporting smart contract deployment and application compatibility.
As projects like Scroll, Polygon, and zkSync race towards launching their zkEVM products, we expect widespread adoption and increased relevance as they soothe a sore pain point in the blockchain world. It’s also worth noting that zkEVMs are still a work in progress and that the pace of innovation in Web3 makes it practically impossible to predict the future.
We might stumble upon more use-cases of zkEVMs and zero-knolwedge proofs in the coming years beyond scalability and privacy, but we should also not discard the solution to blockchain scalability originating from a completely unexpected place.
Panther is a decentralized protocol that enables interoperable privacy in DeFi using zero-knowledge proofs.
Users can mint fully-collateralized, composable tokens called zAssets, which can be used to execute private, trusted DeFi transactions across multiple blockchains.
Panther helps investors protect their personal financial data and trading strategies, and provides financial institutions with a clear path to compliantly participate in DeFi.