Share your feedback on Twitter and claim 5M Free GetBlock Requests

banner image

Zero Knowledge EVMs: What is a zkEVM?

Vance Wood

Vance Wood

September 21, 2023

12 min read

article cover

It’s getting harder to keep up with the latest trends in the blockchain field as we witness accelerating speeds of development. In view of this, you might have missed the emergence of zkEVM, a groundbreaking system and toolset designed to catapult the development in the Web3 space.

In this blog post, we'll delve into the intricacies of what zkEVM is, its significance, and how it's poised to enhance the experience of users accustomed to the Ethereum stack.

zkEVM technology: Highlights

zkEVM is a computing environment integrated within ZK Rollups aimed at resolving Ethereum’s limited transaction processing capabilities and propagating this scalability to decentralized applications.

  • Different projects are pursuing EVM equivalence using varying methods and techniques, balancing performance and compatibility;
  • The main problem zkEVM solves is achieving scalability through rollups and providing compatibility with smart contracts and execution layer operations;
  • zkEVM unlocks the extensive suite of tools worked out by the vibrant Ethereum community and empowers developers to seamlessly migrate EVM-based crypto products and services to a Rollup set;
  • Prominent zkEVM projects include zkSync Era, Polygon zkEVM, Linea, Taiko, and Scroll;

In general, prospective developments in the zkEVM domain may transform Ethereum as we know it today by opening up new possibilities for dApp creators.

zkEVMs and the evolution of ZK Rollups

Known as the most successful scaling technology, Zero-Knowledge (ZK) Rollups serve Layer-1 (L1) chains, Ethereum in particular, by executing transactions for them in bundles and committing the final result of these operations L1. Ultimately, all operations end up being recorded on L1 and validated by ETH nodes but put through rollups almost instantly and at minimal costs.

SEE ALSO: https://getblock.io/blog/top-zk-rollup-projects-of-2023-review/

In attempts to further upgrade rollup solutions, projects behind Layer-2 chains started building EVM technology tied to Zero-Knowledge Proofs.

What is zkEVM?

To better comprehend the core principles of zkEVM, let’s briefly define the actual EVM.

Ethereum Virtual Machine (EVM) is a core component of Ethereum and software adapted to interpret smart contract instructions. More sophisticated codes require more operational steps, meaning more gas will be spent.

zkEVM, in turn, is part of ZK rollups which adds programmability to these Layer-2s by making them EVM compatible, i.e. adding an execution environment to run programs inside ZK-secured solutions.

How does a zkEVM work?

Similar to the Ethereum Virtual Machine, zkEVMs can interact with smart contracts and execute opcodes required to process transactions. However, as part of the rollups, zkEVM handles those transactions in batches and generates proofs confirming the validity of each operation.

To be more precise, the rollup sequencer packs submitted transactions and sends them off-chain to complete the execution. The computation is followed by a proof generation phase, where Zero-Knowledge Proofs (ZKP) are crafted to verify the execution correctness. As a final step, Ethereum nodes independently verify the ZKP authenticity, leading to an update in Ethereum's state.

For an end-user, the process will not bear any differences except for the improved speed and lower gas fee rates.

Exploring zkEVM's key features

Basically, zkEVM appeared as a means to supply ZK Rollups with all the setups necessary to prove not only basic crypto transactions but also EVM operations. To provide exactly that, zero-knowledge EVMs take the best of both tools:

EVM equivalence

Thanks to EVM support, ZK-based protocols can read Ethereum bytecode and execute it natively — a utility that was previously impossible within rollups. On that account, developers can easily migrate existing applications built on Solidity onto ZK rollups and enjoy lower operational costs and faster smart contract executions.

Operating Zero-Knowledge Proofs

Apart from easing the workload of ETH nodes, ZK-secured networks zip transactions into a tiny bit of data saving the precious block space within L1 chains, which in turn involves lower fees for a transacting party. Given that, zkEVMs retain all the merits of Zero-Knowledge Proofs while adding EVM compatibility, which is a game changer for developers.

Generally speaking, zkEVMs provide Web3 developers the ability to stick to familiar toolings and keep using Solidity as a go-to programming language while fostering application scaling for mass adoption.

Benefits of using zkEVM

Emulating the Ethereum Virtual Machine under the ZK Rollups logic is a very fresh notion in cryptography, therefore zkEVM is yet to be proved safe and efficient in practice. Nevertheless, the benefits are undeniable:

  • Smooth developer experience: Web3 experts can apply the exact same tooling ecosystem built around EVM to run programs on top of zk-environments with no modification to a source code; in most cases, it simply takes channeling smart contracts to a different RPC URL introducing minor changes to deployment scripts;
  • Interoperability: another major use case for zkEVM is the possibility to port applications that already run on Ethereum or a variety of EVM-compatible chains like Polygon and Cardano over to zkEVM and expect they will work in the same manner;
  • dApp scalability: Zero-Knowledge Proofs (ZKP) enable more high-frequency transactions than Layer-1, making decentralized applications highly usable;
  • Cheaper transaction fees: since Layer-2 solutions are processing transactions in a compact form, every interaction with the blockchain results in significantly lower costs;
  • Security: aside from inheriting the base chain’s security, rollups can verify computation correctness without downloading the underlying data, which provides the basis for enhanced privacy.

Smooth dApp onboarding to L2s is the most anticipated feature of zkEVMs. Nowadays a handful of rollups powered by zkEVM add on this utility previously considered impossible.

Challenges of EVM equivalence

Before we explore all projects building their own versions of zkEVM, it should be noted that separate teams approach the issue differently.

Vitalik Buterin classified all ZK Rollups into five groups according to their degree of interoperability with Ethereum Virtual Machine, where the main distinction is made between compatibility and equivalen

Five_Types_of_zkEVM_by_Vitalik_Buteri

Image by Vitalik Buterin

The ranking reveals a zkEVM dilemma: striving for better performance will downgrade the compatibility and, conversely, opting for ultimate equivalence will come at a cost of performance.

Accordingly, rollups recreating a moderate level of compatibility would introduce a custom performant virtual machine designed with ZK Rollup properties in mind. This will innately diverge from EVM but include support for high-level languages like Solidity with certain limitations.

Meanwhile, the majority of projects seem to be building towards a full EVM-equivalency. In these circumstances, engineers willing to build on rollups would encounter no challenges reusing the code and tooling, the trade-off being significantly slower operating speeds.

Different companies explore distinct pathways around this problem and use a combination of different approaches and technologies to optimize the developer experience.

Top zkEVM projects in 2023

With that, we’re all prepared to go down the list of rollups adopting zkEVM and actively building in 2023:

# Chain Latest Live Version
1 zkSync Era Alpha Mainnet
2 Polygon zkEVM Mainnet Beta
3 Linea Alpha Mainnet
4 Taiko Alpha-3 Testnet
5 Scroll Testnet

Let’s briefly review every project at their current state, weighing out advantages and inconveniences from a Solidity developer perspective.

zkSync Era

zkSync_zkEVM

Image by zkSync

zkSync team rolled out a native zkEVM in 2022, nearly simultaneously with Polgon and Scroll revealing their versions. The protocol is determined to preserve higher throughputs sacrificing a bit of EVM-equivalence. Developers opting to build on zkSync can still use Solidity and Vyper with a little twist to it.

Matter Labs recommend using a dedicated compiler that “translates” the smart contract code into a native zk language. Additionally, it is required to consult official zkSync documentation to prevent any issues due to some other minor differences with EVM.

Consult our full guide to zkSync Era to dive into a more detailed review of the project.

zkEVM by Polygon

Polygon_zkEVM

Image by Polygon

Polygon zkEVM is a newly launched rollup that exists in parallel to Polygon's Proof-of-Stake (POS) chain. As a type-3 zkEVM, it creates a favorable environment for cheaper interactions with Solidity contracts. The latter, however, will have to undergo certain transformations before landing on the rollup.

The new chain in the Polygon ecosystem attempts to replicate the Ethereum Virtual Machine logic by introducing a zk Assembly (zkAMS) interpreter that internally recompiles the Solidity code. The extra step will not affect the development process but ensures the contract is correctly executed by the zkEVM.

According to Polygon 2.0 development strategy, the POS chain may also embrace zk-tech to become a zkEVM Validium and boast even more scalability than Polygon’s zkEVM.

zkEVM by ConsenSys: Linea

Consensys_zkEVM

Image by Linea

ConsenSys, a software company that has an extensive product suite including MetaMask, Infura, and Truffle is building its own zkEVM of the third type, Linea.

Linea can currently execute Solidity codes without making any changes as all adjustments to provide interoperability are running behind the scenes. Lattice-based prover increases the speeds of proof generation at cut-rate gas fees while supporting highly scalable smart contracts seamlessly.

Taiko, zkEVM in testnet

Taiko_zkEVM

Image by Taiko

The Taiko team led by former Loopring developers strives to launch a Layer-2 powered by a “twin” of EVM after completing the testnet stage. Complete equivalence implies that the protocol will have to sacrifice processing speeds in order to enable a seamless transition of Ethereum-hosted dApps to Taiko’s zkEVM.

The benefits of using Taiko for decentralized application development will be exposure to familiar ETH infrastructure accompanied with zero friction when it comes to deploying precompiled contracts.

Scroll zkEVM

Scroll_zkEVM

Image by Scroll

Scroll is collaborating with the Ethereum Foundation to deliver the L1-analogous experience into a ZK setup. Similar to Taiko, developers would hardly notice any dissimilarity between landing dApps on Layer-1 or Scroll. However, the team’s main focus is to preserve maximum decentralization by disbanning centralized provers and sequencers in the initial stages of development.

Emerging players in the zkEVM landscape

Integrating EVM within ZK Rollups seems to be reigning the blockchain development space since 2022. Considering that, let’s extend our list of zkEVMs with projects in their early stages of development.

Immutable zkEVM

Immutable is expanding its Rollup with a native zkEVM based on Polygon’s technology for bringing the next-level Web3 gaming. The project has just recently entered a testnet phase and is preparing to go live and onboard on-chain gaming apps into Ethereum via zkEVM to boost their security and ability to accommodate more users.

Kakarot

A zkEVM residing on the Starknet chain plans to support Solidity codes rendered to Starknet’s native programming language Cairo. The intermediary language will enforce efficient contract execution verifiable by Zero-Knowledge Proofs without manually altering the code. Currently, the community is anticipating a public testnet expected to launch in 2023.

With all these projects exploring various scenarios, developers are free to choose which approach appeals to them and will best suit each specific use case.

How to migrate smart contracts to zkEVM

Now, to translate the theory into practice, we’ll explore the most accessible way to reap the benefits of ZK-provided scalability in line with EVM programming standards.

Below is the shortest manual taking you through the process of shipping Solidity contracts to Polygon’s testnet implementation of zkEVM using Remix IDE for you to get a rough idea of how it works.

  1. Import the testnet version of Polygon zkEVM manually into your MetaMask account via an “Add Network” button by inputting the specifications as given:
Connecting_to_zkEVM

Source: Polygon Wiki

  1. Grab some test ETH from any available faucet and move tokens to the zkEVM via an official bridge;
  2. Open Remix from your browser and initiate a new file with .sol extension in the “Workspaces” tab;
  3. Copy a preferred Solidity code, insert it into the newly created file, save, and push “Compile”;
  4. Check that the network within your MetaMask is switched to the zkEVM testnet;
  5. Inside Remix, find the “Deploy & Run Transactions” tab and choose the “Injected Provider - MetaMask” from the drop-down list;
  6. Proceed with deploying your code by navigating to the respective tab.

And just like that, thanks to EVM compatibility, you can either build new contracts on zkEVM-powered Layer-2s or simply reuse the existing code.

Final thoughts

As we move forward, zkEVM's journey promises to be both exciting and transformative. Nevertheless, it must be recognized that zkEVM projects still have to battle-test their cutting-edge technology. Meanwhile, the Web3 community eagerly awaits the future it will bring to this ever-evolving space.

If you're looking to supercharge your blockchain development journey, GetBlock is to aid with infrastructure challenges. Set up a free account and join our community of developers who have already discovered the ease and efficiency of GetBlock's RPC nodes

Context Banner

ZkEVM: FAQ

On a final note, we've gathered the most common questions and provided concise answers to help demystify zkEVM and its potential.

What are the benefits and challenges of using zkEVM?

zkEVMs introduced the optionality to land dApps in low-fee environments and scale them unconditionally. However, the technology should be used with utmost caution since it’s very new and complex hence some parts of it might not work as intended.

What cryptographic techniques are used in zkEVM and how do they improve scalability?

Using recursive schemas of ZK technology, rollups generate a small proof and attach it to bundles of transactions to help Ethereum verify computation correctness. Adding EVM compatibility to this model brings flexibility to Web3 application developers, giving them the optionality of what to build and where.

What are some real-world use cases of zkEVM?

zkEVM makes crypto operations faster, which has already been adopted by many decentralized finance applications in the space. Some prominent examples include Mute.io, PancakeSwap, and Aave.

What are some future developments for zkEVM and what impact could they have?

zkEVM projects will undoubtedly build towards achieving better optimization and introducing more advanced solutions. As the full bloom of ZK Rollups is yet ahead, it is expected to foster the growth of DeFi and Web3 technology in general.

Vance Wood

Vance Wood

September 21, 2023

12 min read

twittertwittertelegramtelegramLinkedinLinkedin