zerostyl-prove
zerostyl-prove generates and verifies halo2 KZG proofs off-chain, and reports what a circuit
expects. Proofs are written as a binary artifact plus a public_inputs.json file.
Synopsis
zerostyl-prove <COMMAND> [OPTIONS]
| Command | Purpose |
|---|---|
generate | Generate a proof from a witness |
verify | Verify a proof against its public inputs |
info | Show circuit metadata and a witness template (info list lists all circuits) |
The --circuit value must be a registered circuit: example, state_mask, tx_privacy, or
private_vote.
generate
zerostyl-prove generate --circuit <CIRCUIT> --witnesses <FILE> \
[--output <FILE>] [--k <K>] [--cache-dir <DIR>]
| Flag | Short | Default | Description |
|---|---|---|---|
--circuit | -c | — | Circuit name (required) |
--witnesses | -w | — | Path to the witness JSON file (required) |
--output | -o | proof.bin | Output path for the proof |
--k | -k | circuit default | Override the circuit size parameter k |
--cache-dir | .zerostyl_cache | Cache directory for the KZG parameters |
zerostyl-prove generate --circuit state_mask \
--witnesses state_mask.json --output proof.bin
ZeroStyl Prover — circuit: state_mask k: 10
Proof: 2720 bytes → proof.bin
Public inputs → public_inputs.json
Done.
The public inputs are written to public_inputs.json as 32-byte little-endian field
representations. The first run generates and caches the KZG parameters under --cache-dir, so
later runs are faster.
verify
zerostyl-prove verify --circuit <CIRCUIT> --proof <FILE> \
[--inputs <FILE>] [--k <K>] [--cache-dir <DIR>]
| Flag | Short | Default | Description |
|---|---|---|---|
--circuit | -c | — | Circuit name (required) |
--proof | -p | — | Path to the proof file (required) |
--inputs | -i | public_inputs.json | Public inputs JSON (written by generate) |
--k | -k | circuit default | Override the circuit size parameter k |
--cache-dir | .zerostyl_cache | Cache directory for the verifying parameters |
zerostyl-prove verify --circuit state_mask \
--proof proof.bin --inputs public_inputs.json
ZeroStyl Verifier — circuit: state_mask k: 10
Proof is VALID
Done.
info
zerostyl-prove info <circuit> # metadata + witness template
zerostyl-prove info list # list all registered circuits
zerostyl-prove info state_mask
Circuit: state_mask v1.0.0
Default k: 10
Public inputs: 2
Private witnesses: 5
Witness fields:
- [private] state_value : u64 ...
- [private] nonce : fp ...
...
Witness template (copy, fill, save as <circuit>.json):
{ "collateral_ratio": "0", "hidden_balance": "0", "nonce": "0", "state_value": "0", "threshold": "0" }
Related
zerostyl-debug— validate the witness before proving.- Prove & verify with the Rust SDK — the same flow from Rust.