zerostyl-debug
zerostyl-debug inspects circuits and validates witnesses. Its core command runs the halo2
MockProver against a witness and reports exactly which constraint fails, in which region — far more
readably than bare halo2 — so you can catch mistakes before generating a real proof.
Synopsis
zerostyl-debug <COMMAND> [OPTIONS]
| Command | Purpose |
|---|---|
inspect | Circuit structure: columns, gates, degree, k |
schema | Expected witness schema and a copy-pastable template |
debug | Run the MockProver against a witness and surface failing constraints |
witness | Pretty-print a witness file alongside the circuit's schema |
The --circuit value must be a registered circuit: example, state_mask, tx_privacy, or
private_vote.
debug
zerostyl-debug debug --circuit <CIRCUIT> --witnesses <FILE> [--k <K>] [--format <FORMAT>]
| Flag | Short | Default | Description |
|---|---|---|---|
--circuit | -c | — | Circuit name (required) |
--witnesses | -w | — | Path to the witness JSON file (required) |
--k | -k | circuit default | Override the circuit size parameter k |
--format | -f | text | Output format: text or json |
zerostyl-debug debug --circuit state_mask --witnesses state_mask.json
=== Debug Report: state_mask ===
Circuit: state_mask k=10
Result: ALL CONSTRAINTS SATISFIED
When a constraint fails, the report lists each failure with its region and column:
Result: 2 FAILURE(S)
--- Failure 1 [permutation] ---
Region: in Region 17 ('range check 16 bits') at offset 16
Column: Column('Advice', 4)
Details: Equality constraint not satisfied ...
The region name (here range check 16 bits) points straight at the constraint that rejected the
witness.
inspect
zerostyl-debug inspect --circuit <CIRCUIT>
Circuit: state_mask
k: 10 (2^k = 1024 rows)
Columns: 20 total
advice: 11
instance: 1
fixed: 8
Selectors: 16
Max degree: 6
schema
Prints the witness schema and a template you can copy, fill, and save as <circuit>.json:
zerostyl-debug schema --circuit state_mask
witness
Pretty-prints a witness file next to the circuit's schema, so you can confirm each field is present and well-typed before proving:
zerostyl-debug witness --circuit state_mask --witnesses state_mask.json
Related
- Debug a failing witness — a worked failure end to end.
zerostyl-prove— generate and verify a proof once the witness is valid.