June 29, 2023
zkEVM Illustration
zkEVM, or Zero-Knowledge Ethereum Virtual Machine, is a type of Ethereum Virtual Machine (EVM) that uses zero-knowledge proofs to verify the correctness of each program.
To understand zkEVM, let's break down its components:
Now, let's combine these two concepts. A zkEVM is an EVM that uses zero-knowledge proofs. This means it can execute smart contracts while verifying the validity of inputs and outputs in the operations of the virtual machine without revealing any additional information. This adds an extra layer of security and privacy to the transactions.
Initially, zk-rollups (a type of Layer 2 scaling solution) did not have the capability for smart contract execution, focusing specifically on general token payments and exchanges. However, zkEVMs have enabled zk-rollups to offer support for decentralized application (dApp) development on Ethereum.
Zero-knowledge (Zk) rollups are a layer 2 scaling solution that increases throughput on Ethereum by moving computation and state storage off-chain. It can process thousands of transactions in a batch and then post minimal summary data to Mainnet.
Let's further clarify it:
zkEVM is a type of zk rollup that is compatible with the Ethereum Virtual Machine, which means that it can execute smart contracts written in Solidity or other high-level languages. It is one of the possible implementations of zk rollups, but not the only one. There are other zk rollup (Layer 2) projects that use different languages or frameworks for smart contracts, such as zkSync, StarkWare, or Loopring.
Layer 2 solutions are secondary protocols built on top of a blockchain (Layer 1) to increase its scalability and efficiency. They process transactions off-chain and then post the final state to the underlying blockchain.
Zk-rollups, specifically, bundle multiple operations into a single transaction, then use zero-knowledge proofs to verify the validity of these operations. This reduces the amount of data that needs to be stored on-chain, thereby increasing scalability.
In simpler terms, imagine you're playing a game on your computer. The game is too heavy for your computer to run smoothly, so you use a more powerful server to run the game and then stream the video to your computer. Your computer only needs to handle the video stream, not the entire game, which makes the game run smoothly. This is similar to how zkEVM works: it handles the heavy computations off-chain and only posts the final results to the Ethereum blockchain, making the whole system more efficient.
Please note that zkEVM is still a relatively new technology and is under active development. As such, it may evolve and change over time.
In simple terms, zkEVM is like a more private and secure version of the Ethereum Virtual Machine, which allows for the execution of smart contracts with added privacy and security features.
Ethereum Nodes. Photo by Taylor Vick on Unsplash
In regular Ethereum transactions, the details of smart contract execution, including inputs, outputs, and computations, are visible to everyone on the network. However, zkEVM introduces a layer of privacy by allowing smart contracts to be executed in a way that conceals sensitive information while still proving the correctness of the execution.
With zkEVM, a user can interact with a smart contract and execute its functions without revealing the specifics of the inputs and computations to the outside world. Instead, they can generate a proof, a cryptographic evidence, that attests to the fact that the smart contract was executed correctly without revealing any sensitive information.
This proof is then verified on the Ethereum network by a special smart contract called a verifier contract. The verifier contract checks the validity of the proof without needing to execute the entire smart contract again. If the proof is valid, the verifier contract accepts the transaction and updates the state of the Ethereum network accordingly, maintaining the privacy of the transaction.
zkSync logo, Image by Matter Labs.
zkEVM works by using zero-knowledge proofs to verify the correctness of smart contract execution without revealing any information about the inputs, outputs, or intermediate steps. Zero-knowledge proofs are a type of cryptographic proof that anyone can verify but only generated by someone who knows a secret.
To generate a zero-knowledge proof for a smart contract execution, the zkEVM needs to do two things:
The proof is then submitted to the Ethereum main chain along with the circuit's public inputs and public outputs. Anyone can verify the proof using the verify algorithm and check that the smart contract execution was valid.
One of the advantages of zkEVM is that it is EVM-compatible, which means that most of the existing smart contracts, developer tools, and wallets that work on Ethereum can also work on zkEVM seamlessly. This makes it easier for developers and users to migrate to ZK Rollups without changing much of their code or experience.
Polygon zkEVM
An example of a project that is building a zkEVM-based ZK Rollup is Polygon zkEVM. Polygon zkEVM aims to bring Ethereum scalability to everyone by leveraging the power of ZK proofs. Polygon zkEVM claims to have lower cost, higher performance, and better finality than other L2 solutions like Optimistic Rollups. Polygon zkEVM is currently in beta and has launched its testnet and mainnet.
ZkEVM is not just a technical innovation, but a social and ethical one as well. How will it affect the future of decentralized applications and the rights of users? The choice is ours to make.
Subscribe to the newsletter to learn more about the decentralized web, AI and technology.
Please be respectful!