Skip to main content

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]
CommandPurpose
generateGenerate a proof from a witness
verifyVerify a proof against its public inputs
infoShow 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>]
FlagShortDefaultDescription
--circuit-cCircuit name (required)
--witnesses-wPath to the witness JSON file (required)
--output-oproof.binOutput path for the proof
--k-kcircuit defaultOverride the circuit size parameter k
--cache-dir.zerostyl_cacheCache 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>]
FlagShortDefaultDescription
--circuit-cCircuit name (required)
--proof-pPath to the proof file (required)
--inputs-ipublic_inputs.jsonPublic inputs JSON (written by generate)
--k-kcircuit defaultOverride the circuit size parameter k
--cache-dir.zerostyl_cacheCache 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" }