This article is a community contribution. The author Kenny Li is the co-founder of Manta Network. Manta Network is a Layer 1 programmable privacy protocol powered by zero-knowledge proof technology.
The views expressed in this article are those of the contributor/author and do not necessarily reflect the views of Binance Academy.
Abstract
The Zero-Knowledge Ethereum Virtual Machine (zkEVM) is an Ethereum state machine that can execute smart contracts in a manner compatible with Zero-Knowledge Proof (ZKP) technology.
zkEVM extends the zero-knowledge rollups (zk-rollups) functionality in Ethereum to support decentralized applications (DApps).
zkEVM enhances the Ethereum ecosystem by easily deploying existing and new Ethereum projects using zero-knowledge proofs.
Early Ether Fang developers did not have zero-knowledge proof technology in mind when they first proposed the network in 2014. However, in recent years, zero-knowledge proofs have attracted much attention and are expected to play a more prominent role in the blockchain field. Therefore, the integration of zero-knowledge proof technology and the Ethereum Virtual Machine has been strengthened.
To understand what zkEVM is, we need to briefly review the two basic concepts related to it: zero-knowledge summary and Ethereum virtual machine.
Aggregation is a scaling solution that compiles large transaction executions outside the main chain and sends the data as a single transaction Return to the main network. This process increases throughput while reducing the cost of executing these transactions.
In Ethereum, the transactions in the summary are compressed and submitted to the Ethereum main network to pay for the cost of verifying a single transaction. The Ethereum mainnet provides settlement and verifies transaction data included in the rollup.
Zero-knowledge summary is a summary using zero-knowledge proof technology, and zero-knowledge proof technology is a cryptography technology that can be used in Verify the validity of a piece of information without revealing the information itself. Zero-knowledge aggregation does not require all transaction data to be published to the Ethereum mainnet, only status differences (i.e. user account status changes, etc.) and validity proofs are published, thereby reducing gas fees in the process.
Zero-knowledge proof cryptography ensures the security of zero-knowledge summary, that is, using cryptographic means to verify the proof and achieve trustlessness. This is different from other aggregations such as optimistic aggregations. The security of optimistic aggregation is based on economic game theory. According to this theory, criminals are demotivated by potential losses and challengers are motivated by incentives.
The Ethereum Virtual Machine is a state machine that runs the Ethereum account system and smart contracts. Each execution of a smart contract triggers the Ethereum Virtual Machine to transition from an old state to a new state. The Ethereum Virtual Machine defines rules for calculating new and valid states from one block to another.
"State" is an important concept in Ethereum. The state is a Merkle Patricia Trie data structure, which represents the current state of Ethereum. Everyone can trace the transaction information from the current block back to the genesis block.
All nodes involved in maintaining Ethereum help ensure continuity and consensus, so each node is aware of the current exact status. The Ethereum Virtual Machine plays a crucial role in maintaining this consistency.
The Ethereum Virtual Machine does not support zero-knowledge proofs by default. zkEVM is designed to ensure the continuity of Ethereum's state while providing proof that all information is correct. In this way, the various factors involved in these computational processes are verified while maintaining security and privacy.
zkEVM achieves this by replicating the Ethereum environment as a zero-knowledge rollup. zkEVM reads the initial state, calculates all transactions, and then outputs the new updated state and its attached zero-knowledge proof. This proof is submitted to the verifier smart contract, which verifies the correctness of the initial state and new state outputs without having to verify all transactions individually.
Since zkEVM is built on the Ethereum Virtual Machine, developers can easily integrate Ethereum DApps and smart devices without developing zero-knowledge proofs. The contract is ported to zkEVM. In other words, zkEVM allows zero-knowledge summary execution of smart contracts, including token exchange and payments not previously supported by zkEVM.
Due to the compatibility features of the Ethereum Virtual Machine, developers can leverage existing Ethereum Virtual Machine tools and programming language Solidity to build new products while enjoying the enhanced security brought by zkEVM. Users can also benefit from it. They can continue to use the same DApps and familiar tools with twice the security and privacy.
For example If a certain blockchain is said to be compatible with the Ethereum Virtual Machine, then the blockchain provides a deployable DApp environment written in the Solidity programming language. Solidity is designed for developing smart contracts that run on the Ethereum network.
In fact, Ethereum developers can copy and paste the code of existing DApps from Ethereum and make only minor changes. Deploy to various other chains compatible with the Ethereum Virtual Machine. To users, any address that is compatible with the Ethereum Virtual Machine is the same as their Ethereum address.
This means that these addresses are compatible with mainstream wallets such as Metamask and Trust Wallet. Currently, the mainstream chains compatible with the Ethereum Virtual Machine include BNB Chain, Avalanche Contract Chain (C Chain) and Polygon.
Ethereum Virtual Machine compatibility and equivalence cannot be confused. That is, from the perspective of DApp developers, Layer 2 rollup is almost the same as Layer 1 Ethereum.
Following the operating system analogy, assuming that the user's new and old computers are running on the Apple operating system, the Ethereum virtual machine equivalence is similar to restoring through Apple Cloud Files and Settings.
In contrast, the Ethereum Virtual Machine is equivalent to switching from a new computer to a Windows system, which needs to be downloaded and converted through cloud storage Initial files to restore preferred settings and old files.
Since Ethereum was originally designed not to support zero Knowledge proof technology, directly using the Ethereum Virtual Machine to generate and verify zero-knowledge proofs is extremely slow. In some cases, it may take up to several hours. However, the top priority is to strike a balance between Ethereum Virtual Machine compatibility and zero-knowledge proof efficiency.
Ethereum founder Vitalik Buterin divides zkEVM into the following four types. Similar to the blockchain ternary paradox, all four types require a trade-off between zero-knowledge proof performance efficiency and Ethereum Virtual Machine compatibility.
From a consensus level, Type 1 zkEVM (also known as "enshrined rollup") is equivalent to Ethereum, zkEVM chain state and transactions Same as Ethereum. Such zkEVMs can mutually verify blocks and work directly with Ethereum execution clients.
Type 1 zkEVM makes Ethereum itself more scalable and can be directly introduced to the Ethereum mainnet. The disadvantage is that zero-knowledge proof is extremely inefficient and requires a lot of calculations for verification, and the solution is to use zk-SNARK's massively parallel verifier or application-specific integrated circuit in the future.
Type 1 zkEVM with high zero-knowledge efficiency will be the most ideal form of zkEVM. There are many projects currently building or exploring such zkEVMs.
Type 2 is completely equivalent to the Ethereum Virtual Machine rather than Ethereum. The difference from Ethereum lies in the data structure (i.e. block structure and state tree), and the removal of certain stack operations that are not convenient for zero-knowledge.
Type 2 is fully compatible with Ethereum’s existing DApps, debugging tools and developer infrastructure. Although not immediately obvious, bytecode-level equivalence saves the prover time. The obvious disadvantages of Category 2 are that it is expensive, has no synergy with zero knowledge, is inefficient and costly.
Category 2.5 has the advantages and disadvantages of Category 2, but has slightly lower fuel costs.
On the basis of Category 2, Category 3 further abandons compatibility to improve zero-knowledge efficiency. This type of zkEVM removes features that are difficult to implement, such as precompilation. Therefore, some DApps that require this feature must rewrite their code.
Type 4 Ethereum Virtual Machine has the highest zero-knowledge performance, but its compatibility is relatively poor.
The main purpose of implementing zkEVM is to extend zero-knowledge proof computing support into smart contract execution, and in the process extend DApps to all Ethereum Virtual Machine-compatible protocols middle. However, the applications of zero-knowledge proofs don’t stop there.
Zero-knowledge proof technology is expected to be compatible with Web2 use cases. Various Web2 use cases combined with zero-knowledge proofs can make Web3 applications smoother and user-friendly. In this way, users who are accustomed to using traditional Internet browsers will also access Web3, thereby promoting the popularity of Web3.
Zero-knowledge proof concept and its impact on blockchain
Optimistic summary and zero-knowledge proof The difference in knowledge aggregation
Improving cryptocurrency transparency through zero-knowledge proofs
Disclaimer and Risk Warning: The content of this article is factual and is for general information and educational purposes only and does not constitute any representations or warranties. This article should not be construed as financial, legal, or other professional advice and is not a recommendation that you purchase any specific product or service. You should seek your own advice from appropriate professional advisers. If this article was provided by a third-party contributor, please note that the views expressed in this article belong to the third-party contributor and do not necessarily reflect the views of Binance Academy. For more information, please clickhereto read our full disclaimer. Digital asset prices may fluctuate. The value of your investment may fall as well as rise and you may not get back the principal invested. You are solely responsible for your own investment decisions and Binance Academy is not responsible for any losses you may suffer. This article does not constitute financial, legal or other professional advice. For more information, please see ourTerms of UseandRisk Warning.