What is zkEVM? The Ultimate Ethereum Scaling Solution

A zkEVM is a type of EVM-compatible scaling solution for the Ethereum blockchain that aims to enable scalability, security, and decentralization. Learn more.

What is a zkEVM? The Ultimate Guide to the Holy Grail of Ethereum Scaling Solutions - thirdweb Blog

One of the biggest challenges facing the Ethereum blockchain is scalability. With throughput of only 15 transactions per second, the EVM can become easily overloaded as the network gets more popular — leading to slower transaction speeds, higher gas fees, and a less inclusive web3 ecosystem.

Despite this, the Ethereum Foundation has agreed they are not going to sacrifice security & decentralization to improve scalability — prompting solutions like sidechains, layer 2 networks, optimistic rollups, and more as the race to scaling Ethereum heats up.

If that wasn’t already a mouthful, zkEVMs have now entered the chat: the ‘holy grail’ of scaling solutions, and the potential answer to all 3 properties of the blockchain trilemma (scalability, security, and decentralization) — with Polygon, ConsenSys, and zkSync all building their own zkEVM mainnets.

But what is a zkEVM in the first place? Why is it better than other scaling solutions? And how do you use one?

In this blog post, we’ll explain what a zkEVM is, how it works, why it's considered to be the ultimate Ethereum scaling solution, and how you can develop smart contracts on it.

What is a zkEVM?

A zkEVM (which stands for "zero-knowledge Ethereum Virtual Machine) is an Ethereum-compatible software computing environment that offers high scalability to Ethereum-based applications.

Its compatibility with Ethereum means that existing Ethereum dApps can easily migrate to zkEVM for greater speed and scalability, without compromising security or decentralization.

As the name implies, zkEVM ties two breakthrough blockchain technologies together: the Ethereum Virtual Machine (EVM), and zero-knowledge proofs (ZKPs). Let’s unravel these technologies to better understand what exactly zkEVM does, and why it’s important.

What is the Ethereum Virtual Machine (EVM)?

The EVM (or the ‘Ethereum Virtual Machine’) is a software environment that executes smart contracts on the Ethereum blockchain. This is called ‘smart contract computation.’

💡
Developers who deploy smart contracts pay gas fees to execute the code. And the longer and more complicated the contract code, the higher is its gas requirement. This also means that on-chain computation can get very expensive on Ethereum.

The EVM also computes and updates the valid state of the Ethereum chain after executing each smart contract. This is called ‘state computation.’

Besides, the EVM is responsible for enforcing all the rules in the Ethereum network. Executing contract computation on-chain helps the EVM truly know beyond doubt that all smart contract executions happen within the rules of the network.

There are two limitations to this approach:

Firstly, the EVM relies on a decentralized network of thousands of nodes to individually perform the smart contract and state computation on its behalf and reach a consensus. This keeps the network highly decentralized but slows down the computation.

Secondly, every Ethereum block has limited space for transaction data and gas, which means there’s only limited space for computation data on each block.

These factors limit the computational ability of Ethereum within a specified period of time. Consequently, EVM cannot scale beyond a certain limit.

Separating contract computation from Ethereum’s state computation can make the network scalable. But it’s a huge challenge as taking contract computation off-chain means the EVM no more dictates the rules within which the computation happens.

That’s where zero-knowledge proofs come in.

What is a Zero-Knowledge Proof (ZKP)?

A zero-knowledge proof (or ZKP) is a cryptographic technique that allows a person or computer to prove their knowledge of a piece of information or computation without having to reveal any details about it.

After years of research and experimentation, developers have finally found a way to effectively integrate ZKPs to Ethereum without compromising security. That’s what resulted in zkEVMs.

Zero-Knowledge Ethereum Virtual Machines (zkEVMs)

A zkEVM is a virtual machine setup that executes contract and state computations off the Ethereum network. Once the zkEVM moves to a new state, it submits a ZKP of the state transition to Ethereum nodes to prove that the computations happened within the rules of the EVM. And this doesn’t require sharing transaction or computation details with Ethereum nodes.

As a result, the Ethereum nodes only have to process the succinct proof of the computations and state instead of the computation itself. They can then update the state of the Ethereum chain based on minimal, but provably legitimate data.

This massively cuts down the need for computation on the Ethereum network. As a result, zkEVMs deliver unmatched scalability to Ethereum applications while offering lower computation costs and the best security and decentralization.

💡
Note: Different zkEVMs may use different types of zero-knowledge proofs. Here are the ZKPs currently used within blockchains:1. zk-SNARK or Zero-Knowledge Succinct Non-Interactive Argument of Knowledge2. zk-STARK or Zero-Knowledge Scalable Transparent Argument of Knowledge3. Bulletproofs4. SONIC5. Aurora

Now that you know what a zkEVM is and what it does, let’s see how it works!



How does a zkEVM work?

We can divide a zkEVM’s operation into three broad steps:

  1. Off-chain computation
  2. Proof generation
  3. On-chain verification

Here’s what happens in each step:

1. Off-chain computation

A zkEVM has an execution environment where it runs the off-chain computation to execute a smart contract transaction. To do this, the zkEVM takes the current state and the details of the contract transaction to produce a resultant final state

2. Proof generation

Once the computation is complete, the zkEVM uses a proving circuit to identify all the details of the computation to generate a zero-knowledge proof. The proving circuit assesses three elements to create a valid ZKP:

  • Bytecode and opcode: Bytecode is the machine-readable format of the smart contract code and opcodes are very specific individual instructions within the bytecode. Proving circuit checks the authenticity and validity of the bytecode and opcode of the smart contract that was executed.
  • Input and output values: Proving circuit then verifies if the program fetched the right information and value prior to computation. It also verifies if the program recorded the correct values post-computation.
  • Computation: Lastly, it verifies if the opcode execution happened in the right order.

3. On-chain verification

After ZKP generation, the proof along with the data of the initial and final states is submitted to an Ethereum-based verifier contract. This contract then self-executes to run necessary computations on the ZKP to verify its legitimacy. Once verified by the nodes, the EVM updates Ethereum’s state.

But why are zkEVMs better than other scaling solutions? Let's dive into sidechains, rollups, and other types of chains — and how they compare.

Why are zkEVMs ‘better’ vs. other scaling solutions?

zkEVMs are deemed the holy grail of Ethereum scaling solutions. They not only make the network highly scalable and cost-efficient for developers and users — but also keep privacy, security, and decentralization intact.

But there are also many other zkEVM competitors such as rollups and sidechains. So, what makes zkEVMs better?

To understand this, let’s quickly walk through what the other solutions do:

Sidechains

A sidechain is an independent chain with its own rules and consensus mechanisms. But it can communicate with the Ethereum network for data and token transfers.

Rollups

Rollups are layer-2 networks that process transactions on a separate chain and roll them into batches using smart contracts to relay and publish the information on Ethereum. There are two types of rollups:

1. Optimistic Rollups:

These rollups assume that all transactions on layer-2 are legitimate and execute them instantly. Any wrong transaction can be disputed and corrected within a certain period before the records are published on Ethereum.

Validators have incentives to perform according to the rules of the networks and penalties for doing otherwise.

2. ZK Rollups:

These rollups verify every transaction individually on a layer-2 chain, bundle the verified transactions into one and publish it on Ethereum.

They run on proof instead of optimistic assumptions. However, they are restricted to simple payments.

So, what makes zkEVMs better than these solutions?

1. Fast finality: Finalty in a blockchain is when an executed transaction can not be reversed. zkEVMs offer faster finality than other scaling solutions.

2. Security: zkEVMs doesn’t make any security assumptions and instead relies on provably legitimate computation that guarantees better security.

3. Privacy: By generating ZKPs for all transactions, zkEVMs bring a degree of privacy to transactions that is not found in other scaling solutions.

4. Programmability: zkEVMs are fully EVM compatible and offer greater programmability than other scalability counterparts such as ZK rollups.

5. Scalability: By taking computation off-chain, zkEVMs can offer unmatched scalability without compromising security or decentralization. Sidechains and rollups often compromise on one of the three primary features of blockchains.



List of functional zkEVMs

Currently, there are three popular live zkEVMs that offer a promising way to scale the Ethereum network.

Polygon zkEVM

Polygon zkEVM is a decentralized layer 2 network to scale Ethereum. It went live on March 27, 2023.

The network uses cryptographic zero-knowledge proofs while maintaining opcode compatibility with EVM. That means two things:

a. Developers can use existing Ethereum tools and infrastructure to build new contracts and applications on Polygon zkEVM.

b. Everything that can be built on Ethereum can also be built on Polygon zkEVM.

Polygon’s zero-knowledge rollups on top of Ethereum will help roll multiple transactions into one batch and securely broadcast to the Ethereum network. Thus bringing high transaction speeds to Ethereum.

ConsenSys zkEVM

Designed ConsenSyS, the company behind MetaMask, ConsenSys zkEVM is much like Polygon zkEVM. It has 100% EVM bytecode compatibility, offering maximum interoperability with all EVM-compatible chains.

ConsenSys claims that developers can deploy their existing dapps on its zkEVM “in minutes without changes.”

While the chain is still not live, Consensys has scheduled the testnet launch for March 28, 2023.

zkSync zkEVM

Developed by Matter Labs, zkSync is currently leading the zkEVM race. The company launched zkSync Lite Mainnet, the initial version of its zk-powered network, in December 2020. zkSync Lite only supported simple payments.

Matter Labs then opened gates for developers to zkSync Era, its full-fledged zkEVM environment, in October 2022. On March 24, 2023, zkSync Era Mainnet went live for everyone.

How to build a web3 app on zkEVMs

You can get started with building on Polygon, ConsenSys, and other zkEVMs using thirdweb's web3 developer tools, all available for free:

How to Deploy a smart contract to Polygon zkEVM Testnet
Learn how to create and deploy a smart contract to the Polygon zkEVM testnet. Write a smart contract in solidity and deploy using thirdweb.
Deploy a Smart Contract to ConsenSys zkEVM Testnet
This guide will show you how to deploy any smart contract to ConsenSys’ zkEVM testnet, a zero-knowledge-rollup built on top of the Ethereum Mainnet. By the end, you’ll learn how to create a simple ERC1155 Drop smart contract using Solidity, deploy it to the ConsenSys zkEVM network, and mint an


If you have any questions, feel free to join 33,000+ other builders in our Discord community!

Frequently Asked Questions (FAQs)

How does zkEVM differ from other scaling solutions?

zkEVM performs fast computation off-chain and shares a verifiable zero-knowledge proof of the computation with Ethereum without compromising programmability, security, or decentralization. Other scaling solutions compromise on one or more of those features.

Is zkEVM compatible with any chain than Ethereum?

Yes, as zkEVM is EVM-compatible, it can work with any EVM-compatible blockchain.

What is the difference between EVM and zkEVM?

EVM is the native virtual machine of the Ethereum network whereas zkEVM is a newly designed virtual machine that uses zero-knowledge proofs to create an off-chain smart contract computation environment to solve EVM’s scalability challenges.

What are some use cases for zkEVM?

You can use zkEVM to build truly private applications that do not publicly share personal information on a public ledger, as public chains like Ethereum do. Further, you can develop any type of application that you’d otherwise build on Ethereum, only with more scalability.

Concluding thoughts: Are zkEVMs the future?

zkEVMs create a new computing ecosystem that brings greater scalability for the Ethereum network and its applications. The concept compiles many years of research and development into a balanced system such that the learning curve for developers is gentle and they can start building scalable Ethereum-compatible applications almost instantly.

We hope this blog post has helped you better understand what a zkEVM is, how compares to other Ethereum scaling solutions, and why you may consider building blockchain-based apps on a zkEVM.

If you have any questions, join 33,000+ other builders in our Discord community — or reach out to the team directly for more info on how to get started with smart accounts.

And if you want to start building web3 apps with smart accounts, get started with thirdweb’s web3 tools & SDKs — they’re free!