Skip to content

Repository files navigation

Circuits Traspiler Library for =nil; Foundation's zkLLVM circuit compiler

Usage

This library uses Boost CMake build modules (https://github.com/NilFoundation/placeholder/tree/master/crypto3/cmake). To actually include this library in a project it is required to:

  1. Add CMake Modules to target project repository.
  2. Add all the internal dependencies using CMake Modules to target project repository.
  3. Initialize parent project with CMake Modules (Look at crypto3 for the example).

Run examples

This library is used in the proof-producer binary. It produces gate argument for EVM from fill-assignment stage, which generates circuit.crct and assignment.tbl file. It can also create test proof to check gate argument by evm-placeholder-verification.

  1. Build proof-producer binary file Follow build instruction for proof-producer
nix build .#proof-producer -L
  1. Generate circuit and assignemnt table
./result/bin/proof-producer \
    --stage "preset" \
    --circuit-name "zkevm" \
    --circuit="circuit.crct"
./result/bin/proof-producer \
    --stage "fill-assignment" \
    --circuit-name "zkevm" \
    --trace "trace.pb" \
    --assignment-table="assignment.tbl"
  1. Let output_folder is a folder for transpiler output. Run to generate gate argument files:
./result/bin/proof-producer \
    --circuit="circuit.crct" \
    --assignment-table="assignment.tbl" \
    --evm-verifier "output_folder" \
    --proof="proof.bin" -q 10
  1. Copy output_folder to evm-placeholder-verification/contracts/zkllvm.

  2. Run hardhat to verify proof:

npx hardhat deploy
npx hardhat verify-circuit-proof --test output_folder

Dependencies

Internal

Crypto3 suite:

External

About

Circuits Transpiler Library

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages