Circom Prover
Circom prover is a Rust library for generating and verifying proofs for Circom circuits. It is designed to be used in cross-platform applications, and is compatible with the Mopro library.
It supports multiple adapters, allowing you to choose the one that best optimizes performance.
Features
- ✅ Cross-platform proving — Works seamlessly on Linux, macOS, iOS, and Android.
- 🔄 Flexible architecture — Easily switch between different witness generators and proof systems.
- ⚡ High performance — The fastest known Rust-based Circom prover (see performance).
- 🔐 Curve support — Supports both
BN254andBLS12-381elliptic curves.
Adapters
Witness Generation
Proof Generation
Performance
It speeds up circom proof by ~100x comparing to arkworks-rs/circom-compat in keccak256 circuits. We will provide more benchmarks with different adapters in the future. And you can also check the Mopro documentation for more benchmarks. We’ve also published a blog post that outlines the pros and cons of each adapter: Comparison of Circom Provers.
Usage
Install circom-prover
Depends on the witness generation method, build the rust witness function first. Here is how to use the rust-witness generator.
Include the crate in your Cargo.toml:
[]
= "0.1"
[]
= "0.1"
In build.rs, add the following code to compile the witness generator wasm sources (.wasm) into a native library and link to it:
transpile_wasm;
// e.g. rust_witness::transpile::transpile_wasm("./test-vectors".to_string());
// The directory should contain the following files:
// - <circuit name>.wasm
Proof Generation
use HashMap;
use ;
// Prepare witness generator
witness!;
// Prepare inputs
let inputs = from;
let input_str = to_string.unwrap;
// Prepare zkey path
let zkey_path = "./test-vectors/multiplier2_final.zkey".to_string;
// Generate proof
let result = prove.unwrap;
Proof Verification
// Verify proof
let valid = verify.unwrap;
Advanced usage
circom-prover also supports witnesscalc, circom-witnesscalc and rapidsnark for advanced users. These tools offer better performance but may not be entirely stable.
Below is a tutorial on how to enable witnesscalc, circom-witnesscalc and rapidsnark.
witnesscalc
Setup features flags
[]
= { = "0.1", = false, = ["witnesscalc"] }
= "0.1"
[]
= "0.1"
Install dependencies:
- Linux:
- MacOS
Rust toolchain: cargo 1.89.0 (2948388 2025-08-07)
In build.rs, add the following code to compile the witness generator cpp and dat sources (.cpp, .dat) into a native library and link to it:
build_and_link;
// e.g. witnesscalc_adapter::build_and_link("../testdata");
// The directory should contain the following files:
// - <circuit name>.cpp
// - <circuit name>.dat
Usage
let result = prove.unwrap;
circom-witnesscalc
Prepare the graph.
Clone the repo: https://github.com/iden3/circom-witnesscalc, go to the directory circom-witnesscalc, and run:
Setup features flags
[]
= { = "0.1", = false, = ["circom-witnesscalc"] }
Install dependencies:
- Linux:
Usage
// import graph path
const GRAPH_PATH: &str = "./test-vectors/circom/multiplier2.bin";
graph!;
let result = prove.unwrap;
rapidsnark
[]
= { = "0.1", = false, = ["rapidsnark"] }
[]
= { = "0.1", = false, = ["rapidsnark"] }
use ;
use HashMap;
use Result;
// Prepare witness generator
witness!;
// Prepare inputs
let inputs = from;
let input_str = to_string.unwrap;
// Prepare zkey path
let zkey_path = "./test-vectors/multiplier2_final.zkey".to_string;
// Generate proof
let result = prove
.unwrap;
Proof Verification
// Verify proof
let valid = verify.unwrap;
BLS12-381 Curve
To use the BLS12-381 curve, simply generate a .wasm with circom and generate a .zkey file with snarkjs using the bls12-381 curve option. Then, provide this .zkey and your input to the prover to produce a BLS12-381 proof. Usage is identical to proof generation, with only the witness function and zkey path differing.
[!NOTE]
This feature is currently only supported when using the default configuration, which includesrust-witnessandarkworks.
Community
- X account:
- Telegram group:
- Mopro Documentation: https://zkmopro.org
Acknowledgements
This work is sponsored by PSE.