Understanding zkEVMs: Bringing Smart Contracts to Layer 2

Understanding zkEVMs: Bringing Smart Contracts to Layer 2

The Ethereum blockchain has revolutionized decentralized applications through smart contracts, but congestion on its mainnet poses challenges to broader adoption. Layer 2 scaling solutions address this by shifting transaction processing off-chain, but until recently, they lacked support for smart contracts.Enter zkEVMs: Zero-Knowledge Ethereum Virtual Machines that enable smart contracts on layer 2 while maintaining security. Let’s take a deeper look at zkEVMs, how they work, the challenges faced in building them, examples of currently available systems, and why they represent such an exciting breakthrough.To understand zkEVMs, we must first understand how they fit into Ethereum’s layer 2 scaling ecosystem. Ethereum’s layer 1 blockchain is inefficient for high transaction throughput due to constraints like block space and transaction processing speed. Layer 2 solutions address this by batching transactions and processing them off-chain through techniques like optimistic and zero-knowledge rollups.zkRollups, in particular, utilize zero-knowledge proofs to cryptographically verify transactions without publicly revealing their details. This preserves users’ privacy while allowing trustless validation. However, early zkRollups needed more support for smart contracts since the Ethereum Virtual Machine’s design did not consider proofs. zkEVMs change this by combining the EVM and zero-knowledge proofs.At a high level, here’s how zkEVMs work:zkEVMs marry the versatile computation of Ethereum’s EVM with zkRollups’ trustless execution environment and privacy benefits, unlocking smart contracts for scaling. Users enjoy near-instant transactions, while dApps can access the entire Ethereum toolset and ecosystem.zkEVMs can validate and execute blockchain operations without needing to expose all the details. It’s like saying, “I can prove this transaction or contract is valid and follows the rules, but I won’t show you all the inner workings of it.” Image source: ChainlinkWhile zkEVMs opened promising doors, they realized their potential posed major technical challenges. The EVM was never designed with proof, so several aspects conflict with this new paradigm.For one, the EVM’s stack-based architecture proved difficult to convert to a format compatible with proving. Its special opcodes for error handling also confounded efforts to build verifiable circuits.Storage was another hurdle, as the EVM’s Merkle Patricia tree clashed with proving needs. Replacing the KECCAK256 hashing function helped but risked breaking infrastructure compatibility.Most significantly, zero-knowledge proofs demand computationally-intensive operations that drive up costs, especially on-chain. Generating and verifying proofs for each smart contract execution transaction consumed prohibitive resources.Addressing these issues required rethinking core EVM components and sparking innovations in proofs like optimized circuits and hybrid STARK-SNARK schemes. Much progress has been made, though optimizations continue as the field matures. Perfecting zkEVMs necessitated reconciling two dissimilar yet essential technologies.While research continues, several zkEVM systems have already launched, each approaching the technical challenges somewhat differently:Beyond technical distinctions, these zkEVMs also vary in features, user experience optimizations, and partnership ecosystems. All represent significant milestones in proving EVM compatibility while maintaining practical usability and performance.Popular zkEVM Projects and Focus AreasBy reconciling Ethereum’s versatile smart contracts with privacy-preserving scaling, zkEVMs promise a wealth of benefits for both users and developers:Widespread adoption of zkEVMs could realize the vision of Ethereum serving as a universal decentralized backplane, with layer 2 networks unleashing its full potential through scalability and privacy. However, challenges remain in proliferating these benefits.While zkEVMs have advanced by leaps and bounds conceptually, major hurdles persist between research and widespread usability at scale. Chief among these are high deployment costs that presently constrain zkEVM usage to niche scenarios and limit overall throughput.Additionally, integrating complex zkEVM proofs fully into applications introduces UI/UX challenges and risks reducing developer productivity versus more straightforward solutions. However, projects like Manta are working intensively to abstract away this complexity.Looking ahead, continued optimizations to zkSNARKS/STARKS construction, circuit design, and refining the EVM abstraction layer give hope that costs and usability gaps will steadily recede. Promising developments like zkPorter rollup aggregators may further boost throughputs.As zkEVM adoption grows, other research avenues like reducing proof sizes, providing advanced cryptography as a cloud service, and using specialized hardware also warrant exploration. Interoperability between networks also remains nascent.While challenges persist, progress in zkEVMs reveals a future where even massively scaled decentralized applications remain private, low-cost, and fully trusted through smart contracts – goals that seemed inconceivable just years ago. For now, early examples prove the concept works; tomorrow awaits their widespread, user-friendly reality.If you want to learn more about unique computational use cases that are enabled by blockchain technology, check out our article on Decentralized Physical Infrastructure Networks (DePINs).