What Is a zkEVM?

Polygon Labs
September 27, 2022
Polygon Solutions
What-is-Polygon-ZkEVM
Image source: Dribbble

Zero-knowledge (ZK) tech is one of the most prominent and promising paths to scaling Ethereum. One popular use of ZK proofs to scale Ethereum is what’s known as a zkEVM (zero-knowledge Ethereum Virtual Machine). So what is a zkEVM, and how does it help us make Ethereum cheaper and more efficient to use?

Understanding the Ethereum Virtual Machine

Grasping the power of ZK proofs to scale the Ethereum Virtual Machine (EVM) requires us to first understand what the EVM is. In one sense, the EVM is simple: It’s the mechanism by which the Ethereum blockchain executes transactions. 

Every blockchain needs a set of rules for determining which transactions are valid. In the case of Ethereum, the EVM performs this function. Think of it as the computer running the Ethereum network, tasked with ensuring the integrity of changes to the state of the blockchain.

In the words of the Ethereum Foundation:

The EVM’s physical instantiation can’t be described in the same way that one might point to a cloud or an ocean wave, but it does exist as one single entity maintained by thousands of connected computers running an Ethereum client.

The Ethereum protocol itself exists solely for the purpose of keeping the continuous, uninterrupted, and immutable operation of this special state machine. It's the environment in which all Ethereum accounts and smart contracts live. At any given block in the chain, Ethereum has one and only one 'canonical' state, and the EVM is what defines the rules for computing a new valid state from block to block.

As the above clarifies, the EVM takes the collective input of all individual computers participating in the Ethereum network and creates the conditions in which we can transact and deploy smart contracts. The EVM is thus the supra-computer that gives us the functionality we value from Ethereum. 

But Ethereum, and thus the EVM, has one big problem: It needs to scale! The throughput of Ethereum is too low, and transactions cost too much. So what do we do about that?

The power of the zkEVM

The general approach to using ZK proofs to scale Ethereum is to build what’s known as a ZK rollup. This is a Layer 2 protocol that “rolls up” a large batch of transactions and then uses a ZK proof to verify them to Ethereum. Many transactions become one, which reduces costs and increases throughput. 

The challenge, of course, is that the EVM is a specific environment in which a wide array of activities occur. If you’re a developer used to working within the EVM, any changes to that environment could not only cause you headaches–they could, in the worst case, render your app unusable. So anyone who wants to scale Ethereum while retaining all of its capabilities has to consider how the environment of the EVM might be preserved even as we seek to harness the power of ZK proofs. Such an attempt to keep the workings of the EVM recognizable within a ZK rollup is known as a “zkEVM.”

This is not an easy problem to solve. Vitalik Buterin has laid out the trade-offs involved. They can be summarized in this formulation: The closer a zkEVM is to the EVM in its every detail, the more costly it will be to generate ZK proofs. This is in part because the EVM wasn’t initially designed with ZK scaling in mind, so it’s inherently easier to generate ZK proofs in an environment optimized for doing so. Preserving the EVM must thus be balanced against optimal scaling.

The good news for everyone seeking to build and use zkEVMs is that it is in fact possible to maintain equivalence with the EVM in most senses that matter to developers while still getting the benefits of ZK scaling. The even better news is that Polygon has a balanced approach to addressing this dilemma.

Polygon zkEVM strikes a balance

One approach to scaling the EVM with ZK proofs is being developed by our own ZK teams: Polygon zkEVM. It’s our best attempt at resolving the basic zkEVM dilemma of compatibility versus performance. Within Vitalik’s framework, we are classified as a project that is building towards being what he calls a Type 2 zkEVM. (Important to note that, at the time of his original blog post, we were still a Type 3 zkEVM–that is, less compatible with the EVM than a Type 2.)

According to Vitalik, a Type 2 zkEVM is very close to the EVM itself: “Type 2 ZK-EVMs strive to be exactly EVM-equivalent, but not quite Ethereum-equivalent. That is, they look exactly like Ethereum "from within", but they have some differences on the outside, particularly in data structures like the block structure and state tree.” Polygon is building towards this level of equivalence because we believe that developers and users deserve a zkEVM that looks, feels, and acts like Ethereum, but with the scaling power of ZK proofs.

One of the key ways in which we get there is via the major technical breakthroughs made by our ZK teams. For instance Polygon zkEVM benefits from Plonky2, the fastest ZK proving system yet developed. Created by the Polygon Zero team as well as outside contributors, Plonky2 helps Polygon zkEVM resolve the performance side of the zkEVM dilemma. We can generate fast proofs even as we achieve near-complete equivalence to the EVM.

We hope you can see why Polygon believes zkEVMs are key to the future of Ethereum and why we are committed to building the best one we can.

If you’re interested in learning more about zkEVM and want to talk to our team directly about it please fill out this form. Learn more about Polygon zkEVM, check out the source code on Github and tune into our blog for the latest from the Polygon ecosystem.

Let’s bring the world to Ethereum! 

Website | Twitter | Developer Twitter | Telegram | Reddit | Discord| Instagram | Facebook | LinkedIn

More from blogs