Introduction to ZKVMs and Types of ZKVMs
In the ever-evolving landscape of blockchain technology, Zero-Knowledge Virtual Machines (ZKVMs) have emerged as a promising solution to address scalability issues. This article introduces ZKVMs, exploring the various types currently available and focusing on the advantages and disadvantages of Type 1 ZKVMs.
Scalability Challenges on the Ethereum Blockchain
The Ethereum blockchain, while revolutionary, faces a significant challenge in terms of scalability, particularly concerning transaction throughput. As of now, Ethereum can confirm 29.33 transactions per second. As the network grows and user activity increases, scalability becomes a bottleneck to using Ethereum as any other web 2.0 transaction system. In the following sections, we'll explore how a well-implemented ZKVM could be the key to enhancing the performance and scalability of the Ethereum network.
Foundations of ZKVMs and Basic Concepts
Before diving into the specifics of ZKVMs, let's establish some foundational concepts. A Virtual Machine (VM) is a simulated computer running as software on a physical computer. Ethereum's native VM is the Ethereum Virtual Machine (EVM), a crucial component in the Ethereum ecosystem. It is the software run on all validator nodes maintaining the local state of Ethereum and establishing consensus between other nodes. Each validator’s EVM would manually execute every transaction in every block to verify it and accept state changes to the chain. This is a time-consuming and resource-intensive process. ZKVMs can improve this exponentially.
To grasp the potential of ZKVMs, it's imperative to understand Zero-Knowledge Proofs (ZKPs) and ZK Rollups. ZKPs enable transactions to be verified without having to manually execute them again. ZK Rollups, based on ZKPs, offer a layer 2 ZKVM scaling solution by aggregating transactions off-chain and submitting proofs to the main chain. Validator nodes only need to verify the proof of execution of a bunch of transactions without having to manually execute them all. While ZK rollups are prevalent today, ZKVM on Ethereum is a long way away.
Ethereum's Scaling Roadmap and Challenges Ahead
Ethereum has set an ambitious scaling roadmap, with the recent accomplishment of the Merge phase marking a transition to a Proof-of-Stake (POS) chain. However, this is just the beginning of a multi-phased journey. The upcoming phases include Surge to empower rollups, Scourge to protect against MEV attacks, Verge to bring Layer 1 ZK verification, Purge to lower the cost of participation on Ethereum, and finally, Splurge for miscellaneous improvements. Each phase plays a crucial role in enhancing the network's capabilities. To visualize this roadmap, you can refer to the diagram below, which outlines the milestones on Ethereum's path to scalability and sustainability.
The Verge phase is the target to bring ZKVM natively to Ethereum’s Layer 1. A ZKVM that can verify all of Ethereum’s L1 transactions is termed Type 1 EVM. It is a collaborative community effort to create a zkVM capable of verifying Ethereum’s current execution layer. The goal is to be “fully and uncompromisingly Ethereum-equivalent.” Till then an EVM-compatible ZK rollup will be achieved first as a byproduct of the more difficult and long-term challenge of creating a proof of validity for every L1 block. If proof of validity is achieved, it would be possible to embed the solution inside of an L1 smart contract and use the smart contract to validate the L1 itself. We call ZKVM that are Ethereum-equivalent or Ethereum-compatible ZKEVMs.
Types of ZKEVMs
Vitalik in his article on ZKEVMs classified them into 4 types. Type 1 (e.g., Taiko) is perfectly Ethereum-equivalent, and Type 4 (e.g., zkSync) generates proofs most efficiently. All other types (Type 2, Type 2.5, Type 3) are somewhere in between these two edge cases. Most ZKEVMs started as Type 3 or Type 2.5, broadcasting some intentions of moving towards Type 1 or at least Type 2 without providing any specific timing or commitments. It is described in the diagram below.
Here Type 1 is fully compatible with Ethereum while Type 4 compiles solidity/vyper to other DSLs that can then be used to create ZKPs. Type 1 can support all existing applications on Ethereum while Type 4 may not be able to support all.
Pros and Cons of Type 1 ZKEVM
Type 1 ZKEVM enables validation of all Layer 1 transactions within the Zero-Knowledge Execution Environment. It is able to generate ZKPs based on state changes in Layer 1, which can then be verified by all validators on the same layer. This compatibility with existing Ethereum decentralized applications (dapps) is a significant advantage. All Ethereum opcodes can seamlessly translate to ZKSnark circuits, simplifying the proof generation process.
Validators in Type 1 ZKEVM are relieved from executing all transactions individually, as they only need to verify the proof generated with each Ethereum block. This significantly reduces the time and resources required for validation. Additionally, the infrastructure for proof generation and validation nodes can be shared across various protocols, fostering a more decentralized participation model.
Furthermore, Type 1 ZKEVM ensures a level of security comparable to re-executing all transactions for verification but achieves this with lower time and resource consumption. The simplified verification process opens the door to wider participation, as it can be executed on handheld devices like mobile phones, enhancing both accessibility and security.
However, the journey towards implementing Type 1 ZKEVM faces challenges. The time-consuming nature of ZKP generation and the need for specialized off-chain hardware for proof generation are significant hurdles. To address the prolonged ZKP generation time, lower types of ZKEVM (type 2 - type 4) that introduce new codes for faster-proving processes could be explored. While Type 1 ZKEVM represents the ultimate scaling solution, advancements in technology and methodologies are required to overcome the current challenges which the community is already on the path to solving.
Taiko as a Type 1 ZKEVM
One such effort is Taiko Labs. Taiko is a decentralized, almost Ethereum-equivalent ZK-Rollup (Type 1 ZK-EVM). Taiko scales Ethereum in a manner that emulates Ethereum as closely as possible. It supports all EVM opcodes in a layer-2 architecture that is decentralized, permissionless, and secure.
Taiko ZKEVM can run the Ethereum smart contract code as is without any change. Developers can migrate their existing Ethereum smart contracts and full dapps to Taiko easily and can continue maintaining code in Solidity. Taiko's ZK-EVM supports every EVM opcode, producing a validity proof of the ZK-EVM circuit. Besides perfect compatibility with Ethereum L1 smart contracts and dapps, this also means that all Ethereum and solidity tooling works seamlessly with Taiko enhancing dev experience and retaining battle-tested dapps from L1.