Expand description
§curvy-prover
Authenticated Curvy witness evaluation and self-verified arkworks Groth16 proving for existing snarkjs artifacts.
CircuitProver combines a deployment’s curvy-graph-v1 artifact and matching
.zkey. Prover can instead consume an existing snarkjs .wtns assignment.
This crate also publishes the curvy-native-prover executable and can be built
as the standalone prover WASM module.
§Install
[dependencies]
curvy-prover = "=0.1.0-rc.3"§Prove from circuit input JSON
use curvy_prover::CircuitProver;
let zkey = std::fs::read("circuit.zkey")?;
let graph = std::fs::read("circuit.graph.bin")?;
let prover = CircuitProver::from_artifacts(
&zkey,
"0000000000000000000000000000000000000000000000000000000000000000",
&graph,
"0000000000000000000000000000000000000000000000000000000000000000",
)?;
let proof = prover.prove_json(r#"{"amount":"42"}"#)?;
println!("{}", proof.proof_json);
println!("{}", proof.public_signals_json);Both artifact hashes are checked before their respective parsers run. Generated proofs are verified internally before being returned.
§Features and execution targets
| Feature | Purpose |
|---|---|
std | Native standard-library support; enabled by default |
parallel | Rayon and arkworks parallel proving; enabled by default |
wasm | Portable wasm-bindgen prover API |
wasm-threads | Shared-memory browser prover with initThreadPool(n) |
The native executable accepts CURVY_PROVER_NUM_THREADS=1..64 and defaults to
one thread. Library consumers can configure Rayon globally. Threaded WASM hosts
choose the worker count by awaiting the generated module’s initThreadPool(n).
See the workspace guide for complete commands, output directories, and threaded-browser requirements.
§Security model
The proving key parser is the committed rs-core implementation vendored
from ark-circom without its Wasmer witness calculator. Bulk query points are
constructed unchecked for fast startup, so every caller must provide a pinned
SHA-256 digest for the zkey before parsing is allowed.
Native builds enable std and Rayon-backed parallel support by default.
Portable WASM uses the wasm feature; threaded browser builds use
wasm-threads and export initThreadPool(n) so the host selects the worker
count explicitly.
Modules§
Structs§
- Circuit
Prover - Authenticated witness graph and proving key for one immutable circuit bundle.
- Proof
Bundle - Prover
- Parsed, reusable proving key and constraint matrices for one circuit.
Enums§
Functions§
- proof_
to_ snarkjs_ json - Serialize a proof with the same coordinate order and shape as snarkjs.
- publics_
to_ json