Ziren verifies the correct execution of programs through zero-knowledge proofs. The process involves code compilation, virtual machine execution, generation of the execution trace, and the use of technologies such as STARK, PLONK, and Groth16 to produce efficient and verifiable proofs, enabling on-chain verification and privacy protection.
Ziren verifies the correctness of MIPS program execution by generating zero-knowledge proofs (ZKPs) that reflect the CPU state during runtime. Essentially, the “computation problem” in Ziren is the given program, and the “solution” is the execution trace produced while running the program. This trace records every step of the program’s execution: each row corresponds to a step (or a cycle), and each column represents a fixed CPU variable or register state. The core task of the verifier is to check whether each step in the execution trace aligns with the expected logic of the instructions and the MIPS program.
As shown in the diagram, the Ziren workflow consists of the following stages:
Developers write application logic using a high-level language such as Go or Rust.
The program written in a high-level language is compiled into a MIPS ELF binary using a dedicated compiler. This step converts the source code into MIPS32-compliant instructions, generating an executable ELF file.
The ELF loader reads and parses the ELF file and prepares it for execution in the MIPS VM. This includes loading code segments, initializing memory, and setting the program entry point.
The MIPS VM simulates a MIPS CPU to run the loaded ELF file and records every step of the program’s execution, including register states, memory accesses, and instruction addresses. This results in a complete execution trace (i.e., a detailed record of the computation process).
The execution trace is the core data structure for verifying the program. Each row represents one execution step, and each column corresponds to a specific CPU register or state variable. By ensuring each step in the trace conforms to the expected behavior of MIPS instructions, Ziren proves that the program executed correctly.
The Prover component receives the execution trace generated by the MIPS VM and produces a zero-knowledge proof based on it. This proof demonstrates that the program followed the correct state transitions without revealing any sensitive internal data. The proof is then verified by a verifier contract or another verification component, typically deployed on-chain, to confirm the correct execution of the MIPS program.
Inside the Prover, Ziren processes and proves the execution trace efficiently through multiple stages, ultimately producing a proof format suitable for on-chain verification:
The full execution trace is divided into multiple segments to reduce data size per step and enable parallel and modular proof generation.
Each segment is further divided into multiple modules, typically categorized into four tables: Arithmetic, Logic, Memory, and Control. By organizing instructions into specialized modules, the Prover can process computations more efficiently.
Each module undergoes a separate STARK proof using FRI (Fast Reed-Solomon Interactive Oracle Proofs of Proximity) technology. These FRI proofs ensure that arithmetic, logic, memory, and control operations follow the correct rules.
Once all modules within a segment are proven, the LogUp protocol (implemented using Starky) merges multiple STARK proofs into a single segment-level proof.
The segment proofs are then recursively aggregated using PLONK (e.g., Plonky) into a continuous proof covering the entire program execution trace, ensuring proper connection between all segments.
Finally, to enable efficient on-chain verification (e.g., on the Ethereum Virtual Machine), the proof is converted into a Groth16 proof. Groth16 is a widely used SNARK system known for its low on-chain verification cost.
The entire Ziren process transforms a high-level program into MIPS instructions, runs those instructions to generate an execution trace, and then uses technologies like STARK, LogUp, PLONK, and Groth16 to generate a concise zero-knowledge proof. This proof can be verified on-chain to ensure the correctness and privacy of the computation.
Ziren: Build with confidence. Deploy without compromise.
Subscribe to the Ziren Blog to stay updated with the latest research by ZKM. If you have any questions about the article, you can contact the ZKM team on discord: discord.com/zkm
Ziren verifies the correct execution of programs through zero-knowledge proofs. The process involves code compilation, virtual machine execution, generation of the execution trace, and the use of technologies such as STARK, PLONK, and Groth16 to produce efficient and verifiable proofs, enabling on-chain verification and privacy protection.
Ziren verifies the correctness of MIPS program execution by generating zero-knowledge proofs (ZKPs) that reflect the CPU state during runtime. Essentially, the “computation problem” in Ziren is the given program, and the “solution” is the execution trace produced while running the program. This trace records every step of the program’s execution: each row corresponds to a step (or a cycle), and each column represents a fixed CPU variable or register state. The core task of the verifier is to check whether each step in the execution trace aligns with the expected logic of the instructions and the MIPS program.
As shown in the diagram, the Ziren workflow consists of the following stages:
Developers write application logic using a high-level language such as Go or Rust.
The program written in a high-level language is compiled into a MIPS ELF binary using a dedicated compiler. This step converts the source code into MIPS32-compliant instructions, generating an executable ELF file.
The ELF loader reads and parses the ELF file and prepares it for execution in the MIPS VM. This includes loading code segments, initializing memory, and setting the program entry point.
The MIPS VM simulates a MIPS CPU to run the loaded ELF file and records every step of the program’s execution, including register states, memory accesses, and instruction addresses. This results in a complete execution trace (i.e., a detailed record of the computation process).
The execution trace is the core data structure for verifying the program. Each row represents one execution step, and each column corresponds to a specific CPU register or state variable. By ensuring each step in the trace conforms to the expected behavior of MIPS instructions, Ziren proves that the program executed correctly.
The Prover component receives the execution trace generated by the MIPS VM and produces a zero-knowledge proof based on it. This proof demonstrates that the program followed the correct state transitions without revealing any sensitive internal data. The proof is then verified by a verifier contract or another verification component, typically deployed on-chain, to confirm the correct execution of the MIPS program.
Inside the Prover, Ziren processes and proves the execution trace efficiently through multiple stages, ultimately producing a proof format suitable for on-chain verification:
The full execution trace is divided into multiple segments to reduce data size per step and enable parallel and modular proof generation.
Each segment is further divided into multiple modules, typically categorized into four tables: Arithmetic, Logic, Memory, and Control. By organizing instructions into specialized modules, the Prover can process computations more efficiently.
Each module undergoes a separate STARK proof using FRI (Fast Reed-Solomon Interactive Oracle Proofs of Proximity) technology. These FRI proofs ensure that arithmetic, logic, memory, and control operations follow the correct rules.
Once all modules within a segment are proven, the LogUp protocol (implemented using Starky) merges multiple STARK proofs into a single segment-level proof.
The segment proofs are then recursively aggregated using PLONK (e.g., Plonky) into a continuous proof covering the entire program execution trace, ensuring proper connection between all segments.
Finally, to enable efficient on-chain verification (e.g., on the Ethereum Virtual Machine), the proof is converted into a Groth16 proof. Groth16 is a widely used SNARK system known for its low on-chain verification cost.
The entire Ziren process transforms a high-level program into MIPS instructions, runs those instructions to generate an execution trace, and then uses technologies like STARK, LogUp, PLONK, and Groth16 to generate a concise zero-knowledge proof. This proof can be verified on-chain to ensure the correctness and privacy of the computation.
Ziren: Build with confidence. Deploy without compromise.
Subscribe to the Ziren Blog to stay updated with the latest research by ZKM. If you have any questions about the article, you can contact the ZKM team on discord: discord.com/zkm