Generate halo2 zk solidity verifiers
  • Rust 98.6%
  • Circom 0.7%
  • Shell 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-05-26 18:59:32 +02:00
g16 groth16 zk generate 2025-05-26 18:57:26 +02:00
proofs base generator 2025-05-21 02:37:43 +02:00
src sync from devnet box 2025-05-26 17:49:32 +02:00
.gitignore Initial commit 2025-05-21 02:22:39 +02:00
Cargo.toml base generator 2025-05-21 02:37:43 +02:00
LICENSE Initial commit 2025-05-21 02:22:39 +02:00
readme.md g16 veri 2025-05-26 18:58:19 +02:00
runo.sh base generator 2025-05-21 02:37:43 +02:00

Rust version used to build:

rustc -V rustc 1.86.0 (05f9846f8 2025-03-31)

Run:

We need to generate 2 contracts, a verification key and a proof verifier, both will be saved in the output directory.

cargo run
warning: `/root/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
   Compiling clean_slate v0.1.0 (/tmp/halohack/clean_slate)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.39s
     Running `target/debug/clean_slate`
start
Solidity Verifier successfully saved to /tmp/halohack/clean_slate/output/Verifier.sol
Solidity VerifierKey successfully saved to /tmp/halohack/clean_slate/output/VerifyingKey.sol
Verified ok

Deploy to an evm:

$ forge create --rpc-url  https://EVM_RPC_HERE  --broadcast  --private-key 0xENTERPRIVATEKEYHERE  generated/Verifier.sol:Halo2Verifier  --legacy

Compile to westend:

Due to limits in the upload size and resolc solidity conversion to risc-v/polkavm, we only currently support the halo2 zk system on Moonbase, but we have added support for groth16 zk on Moonbase and we are actively working to get halo2 zk verifiers deployed on Westend. Due to the time constraint and the fact that we need to enable no-std support for halo2 to work on polkavm contracts, we have shipped the first version on Westend with groth16 and we will switch it to halo2 once the no-std version of it is live.

Link to groth16 verifier repo: go into the g16 folder and generate the verifier