Blockchain technology has undergone significant advancements since the inception of Bitcoin over a decade ago. While the initial blockchain networks were groundbreaking in their decentralized approach, they faced challenges, particularly in terms of scalability. As blockchain applications and use cases continue to expand, finding solutions to scalability issues has become a top priority.
One promising advancement in this realm is the transition from zkEVM (Zero-Knowledge Ethereum Virtual Machine) to zkVM (Zero-Knowledge Virtual Machine), which has the potential to greatly enhance blockchain scalability. In this article, we will explore the world of zkEVM, its limitations, and how the evolution to zkVM is set to bring substantial improvements in blockchain scalability.
The Rise of Zero Knowledge Proofs (ZKPs)
Zero-knowledge proofs play a crucial role in safeguarding user privacy on the internet, especially as we strive for widespread adoption on the blockchain. They also have the potential to resolve computational challenges. Currently, there are two prominent approaches to achieve this: zkEVMs and zkVMs. In this exploration, we will delve into both approaches, weighing their advantages and disadvantages. However, before diving into this analysis, it is important to understand what we are optimizing for and why privacy is significant.
In the field of cryptographic evolution, the development of traits is guided by the aim of optimizing for specific outcomes. For example, Bitcoin prioritized security above all else, recognizing that decentralized digital currency needed to be unequivocally secure before gaining acceptance and widespread adoption. Ethereum followed a similar path, emphasizing security while introducing the programmability afforded by smart contracts.
These iterations in cryptographic evolution build upon one another, each bringing its own unique set of trade-offs. In the case of Ethereum, every node is required to re-execute every transaction, resulting in computational challenges, high gas fees, and sluggish transaction speeds. While this decision enhances security and transparency, it compromises performance and privacy.
Rollups emerged as a solution to enhance scalability by reducing computational burdens associated with Ethereum. However, they do not fully address privacy concerns, which have become a prerequisite for applications aiming to expand their user base. Users increasingly demand more control over their data and are wary of entities seeking unrestricted access to their information.
App developers have recognized the growing trend towards privacy and its necessity. As a result, they have been actively exploring methods to safeguard privacy through the use of zero-knowledge proofs (ZKPs). These cryptographic protocols enable users or applications to verify the truth of a statement without divulging any additional information. For example, ZKPs can confirm that a user is over 18 years old without disclosing their exact age or date of birth.
According to a16z’s 2023 State of Crypto report, the adoption of ZK-proof technology by developers is expected to increase further. This trend is driven by a surge in academic publications and a rising number of daily transactions that involve verifying ZK proofs on the Ethereum network. The momentum behind ZKPs demonstrates their growing importance in balancing privacy, security, and scalability in the blockchain space.
Understanding zkVM
First, let’s define what constitutes a virtual machine (VM). In simple terms, a VM is a software program capable of executing other programs, typically functioning as an iterative loop that carries out a specified set of instructions.
The Ethereum Virtual Machine (EVM) serves as the VM responsible for executing Ethereum smart contracts. The compilation of supported instructions and their behaviors was outlined in the seminal yellow paper authored by Gavin Wood in 2014. The yellow paper undergoes continuous updates to reflect the current array of supported instructions.
On the other hand, a zero-knowledge virtual machine (zkVM) is essentially a VM implemented as a circuit within a zero-knowledge proof (ZKP) system. This distinguishes it from conventional ZKP systems that focus primarily on proving program execution. In zkVMs, the emphasis shifts towards verifying the execution of a virtual machine itself.
Within ZKP systems, programs or circuits are immutable entities, similar to binaries compiled from specific programs. Therefore, a zkVM circuit effectively embodies a predetermined number of iterations for the loop, which can be likened to unrolling the loop. In essence, a zkVM is a circuit designed to execute a virtual machine. The instructions of the actual program can be introduced as public input to this circuit, enabling complete transparency regarding the program being verified.
Several zkVM projects have emerged, including Cairo, Miden, and Risczero. Each project accommodates distinct instruction sets, making them non-interoperable with each other.
Types of zkVM
The field of zkVMs can be categorized into two distinct types:
1. zk-optimized VMs: Examples include Cairo and Miden. These VMs are meticulously designed to prioritize efficiency, making them significantly faster. Their primary aim is to facilitate seamless integration with zero-knowledge proof (ZKP) systems, streamlining the verification process.
2. Real-world VMs: This category encompasses VMs like RiscZero, which supports the RISC-V instruction set, and various zkEVMs tailored to the Ethereum Virtual Machine (EVM). Real-world VMs provide compatibility with established instruction sets and ecosystems beyond the realm of zero-knowledge proofs.
Supporting the EVM offers several compelling advantages. For Ethereum, it enables the creation of proofs encompassing the entire state transition, from the genesis state to the latest Ethereum state. Non-Ethereum projects can also benefit from EVM compatibility by seamlessly incorporating projects and applications from the Ethereum ecosystem, promoting interoperability and attracting developers from the Ethereum community.
Mechanism of zkVM
zkVM, influenced by Bitcoin and Ethereum designs, introduces a novel transaction format. In zkVM, a transaction is represented as a program that directly manipulates asset flow as first-class objects, updating the blockchain state via a transaction log. This separation of transaction log application from validation enables a highly scalable design while providing a robust environment for custom contracts.
To enhance blockchain scalability and enable confidential value transfers, zkVM employs a UTXO (Unspent Transaction Output) model to represent balances. All balances are expressed as sets of unspent outputs (UTXOs), which can be created, destroyed, and manipulated within transactions. These UTXOs are efficiently stored as Merkle roots using the Utreexo scheme, significantly reducing storage requirements and facilitating wider deployment of fully-validating nodes.
In zkVM, each output is a contract stored in the blockchain state, containing multiple items protected by a predicate—a condition that must be met to unlock these items. zkVM utilizes a Taproot-based design, allowing contracts to be unlocked either through cryptographic signatures or by executing an embedded sub-program that verifies custom conditions.
Contracts in zkVM serve as versatile building blocks for higher-level protocols like accounts, order books, and payment channels. This flexibility enables platforms like Stellar to move protocol design choices away from the consensus-critical layer, promoting experimentation with a wide range of decentralized applications.
Regarding confidentiality, zkVM strikes a balance using the Taproot scheme in predicates. Contract logic need not be revealed if all parties cooperate, but security remains intact if they do not. Even when contract logic must be disclosed, data such as balances and contract parameters remain confidential due to a zero-knowledge verified constraint system.
zkVM leverages the Bulletproofs zero-knowledge proving system, encrypting values and data by default as Pedersen commitments. Users can specify arithmetic and logical expressions over secret values, which are automatically transformed into a Bulletproofs constraint system. Transactions are compact and efficient, with small transactions ranging from 1 to 1.5 KB in size and aggregated payments incurring a marginal cost of just 200 bytes per input-output pair. Verification is highly parallelizable, taking only about 1 millisecond per output. This efficiency allows zkVM to prioritize security without compromising data encryption, ensuring that data is revealed solely to authorized parties on a need-to-know basis. Furthermore, the Bulletproofs framework eliminates the need for a trusted setup, enabling the creation of new protocols atop zkVM without necessitating network-wide upgrades for each feature.
The Need for Transitioning from zkEVM to zkVM
While zkEVM introduced significant improvements, it still had limitations that hindered its scalability potential:
1. Limited Compatibility: zkEVM was primarily designed for the Ethereum network. This limited its broader impact on the blockchain ecosystem, as other platforms could not readily adopt the technology.
2. Complexity: Implementing zkEVM required a deep understanding of zero-knowledge proofs and cryptography, making it challenging for developers to incorporate zkEVM into their projects and limiting its adoption.
3. Storage and Data Challenges: zkEVM did not effectively address the issue of data storage on the blockchain. Large data storage requirements remained a bottleneck for scalability.
Recognizing the limitations of zkEVM, the blockchain community set out to develop zkVM as a more versatile and scalable solution. zkVM is designed to be blockchain agnostic, meaning it can be integrated into various blockchain networks, not limited to Ethereum. This broader compatibility opens the door for zkVM to have a more significant impact on the entire blockchain ecosystem.
In addition to compatibility, zkVM aims to simplify the implementation process for developers by offering user-friendly tools and interfaces. This reduces the barrier to entry and makes it easier for developers to harness the power of zero-knowledge proofs.
zkVM also addresses the issue of data storage more effectively by introducing innovative techniques for data compression and storage. This optimization decreases the storage requirements on the blockchain, positively impacting scalability by reducing the size of the blockchain’s data.
Furthermore, zkVM’s off-chain computation capabilities reduce the computational load on the blockchain network, leading to faster transaction processing times, lower fees, and improved overall performance.
What Are We Optimizing For?
When designing a system, it is often more effective to optimize for a specific purpose rather than trying to optimize for multiple objectives simultaneously. This parallels the blockchain realm, where systems like Ethereum were initially conceived as fully public and transparent platforms. Introducing privacy features into such blockchains may compromise performance compared to systems designed with privacy as a core principle from the start.
The alternative approach involves developing a purpose-built application layer designed specifically for privacy. This allows for the optimization of privacy-related functionalities while leveraging the benefits offered by zero-knowledge proofs.
Real-World Applications of zkVM and zkEVM
Both zkEVM and zkVM find applications in various domains, promising to reshape industries and blockchain use cases:
1. DeFi Revolution: Decentralized Finance (DeFi) platforms can leverage zkVM and zkEVM to enhance transaction speed, reduce fees, and protect sensitive financial data.
2. Supply Chain Transformation: Improved transparency and traceability in supply chains are possible with zkVM and zkEVM, reducing fraud and increasing efficiency.
3. Healthcare Data Security: zkEVM and zkVM can ensure the privacy and security of healthcare data, enabling secure sharing of information among authorized parties.
4. Gaming and NFTs: The gaming industry and Non-Fungible Token (NFT) marketplaces can benefit from faster transactions and secure data handling provided by zkVM and zkEVM.
The Future of zkVM and Blockchain Scalability
As zkVM gains traction in the blockchain space, it has the potential to address long-standing scalability issues that have limited blockchain adoption and growth. However, there are challenges to overcome and considerations to keep in mind:
1. Adoption Hurdles: While zkVM’s compatibility with various blockchains is an advantage, widespread adoption will depend on the willingness of blockchain projects to integrate this technology into their networks.
2. Security Concerns: Zero-knowledge proofs introduce complex cryptographic techniques, and any vulnerabilities could pose significant security risks. Continuous auditing and improvement of zkVM implementations are crucial to maintain user trust.
3. Regulatory Landscape: As blockchain technology evolves, it will face regulatory scrutiny. How regulators treat zero-knowledge proofs and their applications could impact zkVM’s future adoption.
In conclusion, the transition from zkEVM to zkVM represents a significant step forward in addressing blockchain scalability challenges. While zkEVM laid the groundwork, zkVM offers a more versatile and scalable solution that has the potential to revolutionize how blockchain technology is used across various industries.
Although there are challenges to overcome, the benefits of cross-platform compatibility, user-friendliness, data management, and transaction processing speed make zkVM a compelling advancement in the blockchain space. As zkVM continues to evolve and find its place in blockchain ecosystems, we can expect to see more scalable and efficient blockchain applications that have the potential to transform industries and improve the lives of people worldwide.