| Crates.io | rust-rapidsnark |
| lib.rs | rust-rapidsnark |
| version | 0.1.3 |
| created_at | 2025-02-05 12:37:22.004533+00 |
| updated_at | 2025-08-18 02:08:21.479392+00 |
| description | Rust wrapper for the Rapidsnark proof system |
| homepage | https://zkmopro.org/ |
| repository | https://github.com/zkmopro/rust-rapidsnark |
| max_upload_size | |
| id | 1543905 |
| size | 17,252 |
This project provides a Rust adapter for compiling and linking Rapidsnark into a native library for target platforms (e.g., mobile devices). It includes macros and functions to facilitate the integration of proof generation into Rust codebases.
cargo 1.89.0 (c24e10642 2025-06-23)
Include the crate in your Cargo.toml:
[dependencies]
rust-rapidsnark = "0.1"
[build-dependencies]
rust-rapidsnark = "0.1"
It doesn't include the witness generation functions, you need to use one of the following crates to generate the witness:
For example, building witness with witnesscalc-adapter:
witnesscalc_adapter::witness!(multiplier2);
let json_input_string = "{\"a\": [\"2\"], \"b\": [\"3\"]}";;
let wtns_buffer = multiplier2_witness(json_input_string).unwrap();
Calculate the proof by using the groth16_prover_zkey_file_wrapper function.
It will take a wtns bytes array like the output of witnesscalc or snarkjs.
let zkey_path = "./test-vectors/multiplier2_final.zkey";
let proof = rust_rapidsnark::groth16_prover_zkey_file_wrapper(zkey_path, wtns_buffer).unwrap();
Verify the proof by using the groth16_verifier_zkey_file_wrapper function.
let vkey = std::fs::read_to_string("./test-vectors/keccak256_256_test.vkey.json")?;
let valid = rust_rapidsnark::groth16_verify_wrapper(
&proof.proof,
&proof.public_signals,
&vkey,
)?;