Overview

Exploring the prover in ZKsync, a ZK rollup technology, which ensures secure and efficient transaction verification through cryptographic proofs.

ZKsync utilizes Zero-Knowledge (ZK) proofs to ensure secure and efficient transaction processing on the Ethereum blockchain. This technology compresses transactions, significantly reducing fees for users while maintaining the robust security standards of Ethereum.

How ZKsync Utilizes ZK Proofs

Zero-Knowledge proofs enable a verifier to confirm that a prover has correctly executed a computation without revealing the specifics of the transaction. This approach ensures both privacy and data security. In ZKsync, the prover is responsible for demonstrating the correct execution of ZKsync’s Ethereum Virtual Machine (EVM), and this proof is then verified by a smart contract on Ethereum.

The Proving Process

The proving process in ZKsync involves several crucial steps:

  1. Witness Generation: This is the initial phase where, upon transaction initiation by a user, a witness is generated. This witness acts as proof of the transaction's validity according to the network's consensus rules, without disclosing any transaction details. Witnesses for new transactions are collected in batches and processed together.
  2. Circuits: To generate accurate proofs, standard code logic must be converted into a format interpretable by the proof system. This conversion involves organizing code into various circuits within a virtual machine, ensuring that every aspect of the code execution can be proven.
  3. Proof System: The ZK circuit requires a robust proof system for processing. In ZKsync, this system is called Boojum. It comprises several components:
    • Boojum: This repository acts as a toolkit containing essential tools for proving and verifying circuit functionality, along with backend components necessary for circuit construction.
    • zkevm_circuits: This repository is where the actual EVM-replicating circuits are built using tools from Boojum.
    • zkevm_test_harness: Serving as the testing ground, this repository contains various tests to ensure the circuits function correctly and includes code essential for running these circuits.

Understanding Circuits in ZKsync

A ZK circuit functions similarly to an arithmetic circuit, where inputs at the bottom pass through various computational steps, resulting in a final output at the top. The prover's job is to demonstrate that each step of the circuit is computed correctly, satisfying the circuit with the correct outputs.

It's crucial that each circuit step is fully constrained to prevent any incorrect computations by a malicious prover. In Zero-Knowledge terminology, an underconstrained circuit may result in a soundness error, allowing invalid proofs to pass verification.

Arithmetic Circuit Diagram

What ZKsync’s Circuits Prove

The primary purpose of ZKsync's circuits is to ensure the correct execution of the VM, covering every opcode, storage interaction, and the integration of precompiled contracts. These elements are crucial for the holistic functioning and security of the system.

Additional Resources

For those interested in a deeper dive into the technology behind ZKsync's proof system, resources like Vitalik Buterin's blog on Plonk and the Plonky2 paper provide extensive information on the arithmetization process. More comprehensive details can also be found in the Redshift Paper.

Through these sophisticated cryptographic processes, ZKsync's prover efficiently secures and verifies transactions, leveraging the power of ZK proofs to enhance blockchain scalability and security.


Made with ❤️ by the ZKsync Community