JSON Files

This section covers the four primary JSON files you interact with during zk-SNARK circuit development and proof generation.

Input JSON

Must be declared/created manually

  • Purpose: Holds the actual inputs to your circuit.

  • Name: input.json

  • Used when generating the witness.

  • Keys must match the input signals defined in your .circom circuit.

  • Example:

{
    "inputs": [123456789, 987654321]
}

Proof JSON

  • Purpose: Contains the actual zk-SNARK proof generated from the circuit and witness.

  • Used during verification (off-chain or on-chain). Proves correctness without revealing private inputs.

  • Based on the proof / constraint logic used

  • For example, the circuit1.circom generates proof of this format

{
 "pi_a": [
  "1638329484090018111484545145134123326282976225451659760854477883805645013830",
  "2752848822609064803808122574190917007462921804832306929245310246470507673159",
  "1"
 ],
 "pi_b": [
  [
   "12928121437374283859766510658948626502569276294417251057345670634037972300681",
   "3072475294923701060398512508048631849550392927891055663937107847188429980474"
  ],
  [
   "11508245998816662493251752397385822782800620266877355492680399191829984602572",
   "3604629777497933934614151017709501267123628857660300935447784683726337949100"
  ],
  [
   "1",
   "0"
  ]
 ],
 "pi_c": [
  "15894848609843251674759956385838065880216240325475388560338119973858218893471",
  "15792043424541481373933396337759762189531409286468660893990919779800448181866",
  "1"
 ],
 "protocol": "groth16",
 "curve": "bn128"
}

Public JSON

  • Purpose: Contains only the public inputs and outputs of the circuit (used for verification). Must match what's embedded in the verifier smart contract.

  • For example:

Verification JSON

  • Purpose: Stores the public verification key generated during the trusted setup phase.

  • Required by snarkjs groth16 verify to verify a proof.

  • Created during snarkjs groth16 setup.

  • For example:

Last updated