In recent years, the blockchain and cryptocurrency spaces have achieved tremendous growth and innovation with the emergence of various use cases and applications. However, with the development of blockchain technology, scalability issues have emerged as the number of users has soared. Blockchain technology’s potential has become more apparent, from the CryptoKitties craze in 2017 to DeFi Summer in 2020 and NFT Boom in 2021, but this growth has led to high gas costs and low throughput, making it a big challenge to popularization.
One of the best ways to solve this scalability problem is to utilize zero knowledge proof(ZKP). ZKP means that you can prove whether the information is true or not without exposing your information to the other person. Based on this concept, ZK-rollup, a layer 2 scaling solution, has emerged. Recently, a zero knowledge Ethereum Virtual Machine (zkEVM) using ZK-rollup has been developed.
zkEVM is a solution that leverages ZKP to improve the scalability of the blockchain. To understand this, it is important to understand the concept of ZK-rollup first.
Zero Knowledge Rollup (ZK-rollup)
zk-rollup is a layer 2 scaling solution that aims to increase the throughput of Ethereum transactions by processing them off-chain while ensuring on-chain security. It achieves this by bundling multiple transactions together and generating a single proof for the entire batch. There are two main components of a zk-rollup:
- Operator: The operator is responsible for collecting and aggregating user transactions into a single batch. They also facilitate the processing of these transactions in the off-chain VM and submit the generated validity proofs and new state root to the on-chain smart contract.
- Off-chain Virtual Machine (VM): The off-chain VM is responsible for executing the bundled transactions in a manner similar to the Ethereum Virtual Machine (EVM). It processes smart contracts and performs necessary state transitions off-chain to reduce on-chain computation requirements. Additionally, the off-chain VM generates the validity proofs for the batched transactions.
- On-chain Smart Contract: This component serves as a bridge between the off-chain VM and the main Ethereum network. It receives the aggregated transactions, along with their validity proofs, and verifies them before updating the on-chain state. This ensures that only valid transactions are recorded on the blockchain.
EVM Compatibility of ZK-rollup
zk-rollup provides significant advantages in terms of scalability and security; however, it faces some limitations in achieving full EVM compatibility. The primary reason for this limited compatibility is the complexity of generating zero-knowledge proofs for aggregated transactions. Certain EVM operations, especially those involving dynamic data structures, loops, or intricate arithmetic, may not be easily incorporated into efficient zero-knowledge proof circuits.
As a result, zk-rollup may encounter difficulties in supporting all the features and functionalities of the EVM seamlessly. This constraint could limit the range of smart contracts and dApps that can be effectively deployed and executed using zk-rollup.
To overcome these limitations and enhance EVM compatibility, zkEVM was proposed as an extension of zk-rollup.
zkEVM is an extension of zk-rollup that seeks to enhance the EVM compatibility of zk-rollup by creating an off-chain execution environment for EVM-compatible smart contracts. In zkEVM, the off-chain virtual machine (VM) is designed to execute EVM bytecode directly, allowing for seamless integration with existing Ethereum smart contracts and dApps.
Like ZK-rollup, zkEVM aggregates multiple transactions into a single batch and processes them off-chain. The off-chain VM is responsible for executing the batched transactions, generating validity proofs, and updating the off-chain state. The validity proofs are then submitted to an on-chain smart contract for verification, and if validated, the on-chain state is updated accordingly.
To achieve EVM compatibility and scalability, zkEVM utilizes an off-chain execution environment for processing transactions. This off-chain environment is composed of three main components: the execution environment, the proving circuit, and the verifier contract.
The execution environment
The execution environment in zkEVM is designed to execute EVM bytecode directly, allowing for seamless integration with existing Ethereum smart contracts and dApps. This environment consists of a set of pre-compiled circuits that can execute a wide range of EVM bytecode operations efficiently. When a new transaction is submitted, the execution environment processes it and updates the off-chain state accordingly.
The proving circuit
After processing the transaction in the execution environment, the proving circuit generates a validity proof for the entire batch of transactions. The proof attests to the validity and consistency of the off-chain state resulting from the execution of the transactions. The proving circuit uses zero-knowledge proofs, which allows for efficient and secure validation without the need to reveal transaction details.
The verifier contract
The validity proof generated by the proving circuit is submitted to the on-chain verifier contract for verification. The verifier contract checks the proof’s validity and consistency with the current on-chain state before updating the on-chain state with the new state root. The verifier contract ensures that only valid transactions are recorded on the Ethereum network.
Advantages of zkEVM
zkEVM offers several advantages over other scaling solutions on the Ethereum network, such as:
zkEVM provides secure scalability by allowing off-chain transaction processing without sacrificing on-chain security. The use of zero-knowledge proofs ensures that only valid transactions are recorded on the Ethereum network, maintaining the network’s security and integrity.
zkEVM significantly reduces transaction costs by processing transactions off-chain. The off-chain processing significantly reduces gas fees, making it more affordable for users to participate in the Ethereum network. Additionally, the use of zero-knowledge proofs reduces the computational overhead and gas costs associated with verifying transactions.
Fast Finality and Capital Efficiency
zkEVM offers fast finality for transactions, with the off-chain processing enabling faster confirmation times. This increased speed makes zkEVM ideal for high-frequency trading and other applications where fast confirmation times are critical. Additionally, zkEVM allows for capital efficiency by reducing the need for users to hold large amounts of ETH or other tokens to pay for gas fees.
By providing EVM compatibility, zkEVM offers significant network effects by enabling seamless integration with existing Ethereum smart contracts and dApps. This integration makes it easier for developers to create and deploy new applications and services on the Ethereum network, further expanding its ecosystem.
Drawbacks of zkEVM
While zkEVM offers several advantages over other scaling solutions on the Ethereum network, it also has some drawbacks that should be considered. Some of the main drawbacks of zkEVM include:
Due to the unique architecture of zkEVM, not all EVM opcodes can be supported. Some of the less commonly used opcodes may not be compatible with zkEVM, limiting the functionality of some smart contracts and dApps.
The EVM is designed as a stack-based machine, which can be challenging to implement efficiently in zero-knowledge proof circuits. This limitation can lead to higher proving costs and slower transaction processing times.
As with any off-chain solution, zkEVM requires additional storage space to store off-chain state. This storage overhead can be significant and may require additional resources to maintain and scale effectively.
While the use of zero-knowledge proofs offers several benefits, it also comes with some costs. Generating and verifying zero-knowledge proofs can be computationally intensive and can significantly increase the transaction processing times and gas costs associated with zkEVM.
These limitations can affect the functionality and efficiency of zkEVM. Recently, many projects are trying to solve these shortcomings.
Polygon has focused on optimizing opcode codes by designing custom opcodes specific to their zkEVM implementation. These custom opcodes are tailored to reduce the complexity of circuits, resulting in more efficient proving and verification processes. Additionally, Polygon is working on improving the stack-based architecture by introducing intermediate state representations to reduce the stack’s depth, which can lead to more efficient circuit designs and lower proving costs.
zkSync has developed a unique approach to address the storage overhead issue by utilizing a technique called “sparse Merkle trees.” This allows for more efficient storage of account and contract data, as well as quicker updates to the state. To tackle the proving cost challenge, zkSync is also investing in research and development of more efficient proof generation algorithms, which can potentially reduce the time and resources required for generating proofs.
Scroll is primarily focused on privacy and addresses the storage overhead issue by implementing a privacy-preserving storage mechanism that leverages zero-knowledge proofs. This allows for the efficient storage of data while maintaining privacy. To tackle the opcode codes and stack-based architecture challenges, Scroll is working on optimizing its zkEVM implementation by designing specialized circuits and adopting innovative techniques to reduce the complexity of the overall system.
Applied ZKP is a project dedicated to researching and implementing practical applications of knowledge proof technologies, including zkEVM. Applied ZKP uses two validations: state proof and EVM proof to separate compute and storage and to link them using bus mapping. In addition, Applied ZKP is developing new algorithms, tools, and libraries to improve the efficiency of opcode code, simplify stack-based architecture, reduce storage overhead and lower attestation costs.
As previously discussed, zkEVM is one of the promising solutions that can address the scalability issues faced by the Ethereum network. Although zkEVM is still in the development stage, it has great potential to not only transform the Ethereum ecosystem but also bring about the mass adoption of blockchain technology. In particular, the synergy is expected to be tremendous when combined with Layer 1 solution, sharding.
If you are planning a business using blockchain technology, consult with an expert!
To receive industry trends and product/event updates in real-time, subscribe to our newsletter!