Why is there a need to construct ZKEVM?

This article is written by a curious non-technical investor @Jeremy from Rootz Labs

Rootz Labs
Rootz Official Pub Hub
6 min readJun 11, 2023

--

In the first part of ZKEVM, we could speak about the core technical points and challenges of building ZKEVM.

First, we would help you understand the circuit logic and the compilation process. Most team are working on constructing a circuit to be applicable to as many scenarios as possible appropriate combinations and algebraic structure. During the process of circuit compilation, ensuring correctness in four dimensions is vital and necessary. Next, we would show you how smart contracts are compiled into circuit and executed. You would also have a glimpse at what challenges we are facing during this process.

To grasp the significance of focusing on the development of ZK-EVM (Zero-Knowledge Ethereum Virtual Machine), it is essential to have a fundamental understanding of the reasons behind it and the key problems it aims to tackle within the field of cryptography.

Security Inherited from EVM: ZKEVM aims to ensure the confidentiality of all computation steps and state transitions during contract execution. This prevents malicious nodes from accessing specific computation steps and contract execution data, thus preventing information leakage and privacy violations. It addresses security concerns such as front-running attacks.

Realizing the goal of ZK-SNARK everything: ZKEVM utilizes efficient universal circuits to achieve a broader scope of application across different scenarios, including Dapps, wallets, tools, and interfaces. By employing ZK-SNARK technology, it aims to provide greater versatility and applicability.

The core technical points and challenges of building ZKEVM

The circuit logic and the compilation process

The process of circuit writing involves expressing high-level smart contract languages through decomposed low-level algebraic languages. It is highly complex to represent the process and results of data transmission through a set of circuits.

To construct a circuit to be applicable to as many scenarios as possible through appropriate combinations and algebraic structure

The Current challenge lies in the requirement of developing and compiling a new circuit for each new scenario and smart contract system encountered. Moreover, the absence of standardization results in compatibility issues, demanding substantial time and effort.

Our ultimate goal is to create a more unified and standardized ecosystem where circuits can be developed, shared, and reused across various smart contract platforms and applications. This would lead to greater efficiency, compatibility, and scalability in the deployment of circuits, making it easier for developers to leverage the power of zero-knowledge proofs and enhance the security and privacy of decentralized systems.

During the process of circuit compilation, it is necessary to ensure correctness in four dimensions

  • The signature is correct: ECDSA (Elliptic Curve Digital Signature Algorithm): This involves verifying the correctness of the cryptographic signature scheme used.
  • The Byte-code is correct: It requires rigorous testing and verification of the compilation process to ensure that the bytecode accurately represents the intended functionality of the smart contract.
  • The trace opcode is correct: Trace opcode, need to be properly established and validated. This involves verifying that the connections and dependencies within the circuit are accurately represented to ensure the correct flow of data and operations.
  • The storage is correct: The storage operations and memory accesses within the circuit accurately reflect the intended behavior. This includes validating that the storage operations comply with the contract’s logic and that the memory accesses are correctly implemented.

How smart contracts are compiled into circuit and executed?

By referring to the provided diagram, we can gain a comprehensive overview of the entire process of smart contract compilation and execution. This diagram is instrumental in understanding the essential aspects involved in the compilation process. It is important to note that these key points play a vital role in evaluating the understanding and competence of a ZK-focused startup in handling the associated technology and grasping the correct product logic.

The challenges of architecting circuits

  • When encountering ZK-unfriendly opcodes, the use of bit-level logical proofs becomes necessary.
  • Verification of stack, memory, and storage operations is consistently required.
  • Loading from additional ROM is essential for contract, transaction, and block contexts.
  • Each table necessitates additional circuitry to constrain the contents within the tables. Sub-tables are employed to validate and restrict the logic of the main table, thereby enhancing accuracy even further.

Within the diagram, we can observe various table representations that function as the foundational unit frameworks comprising the circuit. An important concept introduced here is the Custom gate, which offers a more profound understanding of the fundamental principles of ZK technology and the construction of ZK EVM.

How to assess the feasibility of a ZK project?

Some evaluation dimensions from an investor’s perspective

  • The team’s understanding of cryptography and mathematics should be assessed based on their backgrounds and previous experience. As mentioned earlier, ZK technology heavily relies on a solid grasp and application of cryptography and mathematics, where smart contracts are just one application within this field. It is important to acknowledge that expertise in data re-encoding logic, for instance, may not be expected from a contract engineer.
  • The entrepreneurial project should aim to address a specific problem within the ZK ecosystem. Defining and clearly articulating this problem is crucial for the project’s success and relevance.
  • The team’s learning ability and logical reasoning skills are important factors to consider. Their capacity to acquire new knowledge and apply logical thinking in complex scenarios will greatly contribute to the project’s advancement.
  • The team’s capability for continued research and development, as well as the quality of their work, should be evaluated. This reflects their potential for innovation, improvement, and the ability to deliver reliable and effective solutions.
  • The support and dedication received from the developer community can provide valuable insights into the project’s viability and potential for collaboration and growth. A strong developer community can contribute to the project’s success by sharing knowledge, providing feedback, and fostering a vibrant ecosystem.
  • The following are several key projects related to ZK, focused on developing solutions for ZKEVM at the language-level, bytecode-level, and consensus level. In my future research, I will share more insights. However, as I do not possess a technical background, my understanding is limited. I eagerly anticipate engaging in discussions and collaborating with more developers to further explore and study this field.

The following are several key projects related to ZK, focused on developing solutions for ZKEVM at the language-level, bytecode-level, and consensus level. In my future research, I will share more insights. However, as I do not possess a technical background, my understanding is limited. I eagerly anticipate engaging in discussions and collaborating with more developers to further explore and study this field.

We welcome all interesting discussion in this field! If you would like to discuss ZKEVM with us and have any insights to share, please message us on medium or contact us in Twitter: @rootzlabs. Stay tunes with Rootz for our ZK sharing!

______________________________

Special thanks to Ye Zhang from Scroll (https://scroll.io/) for sharing insights that enabled a non-technical person to grasp the logic behind ZKEVM. Also, gratitude to Vitalik for publishing articles on his personal website (https://vitalik.ca/). His logical thinking about technology and even the development of things exemplifies the importance of first principles.

--

--