A proof of knowledge demonstrates that a prover possesses a private witness satisfying a public statement, without revealing the witness. Noninteractive zero-knowledge proofs use public data, a common reference string (CRS), and a public proof; verification checks consistency and aims to be short while keeping the proof small. section 1.3.4 section 19.7
A SNARK-style construction organizes the proof around a quadratic arithmetic program (QAP):
- Represent computation as addition and multiplication gates whose inputs and outputs are QAP wires. section 19.7
- Separate public statement values from private witness values and permute the statement wires into the order required by the CRS. section 19.5.4
- Compute line values, cross-term coefficients, and the h(x) coefficients used to encode the QAP relation. section 19.5.4 section 19.7
- Combine CRS points with these coefficients to construct proof points A, B, and C, then save public values and proof points as a record. section 19.5.4
A medical-record proof record
A contrived record uses the medicine number and dose as public statement values while keeping the patient number in the witness. With inputs 2036, 1700000, and 49, the implementation computes QAP wires, derives cross terms, constructs A, B, and C through elliptic-curve operations, and writes the statement and points to a SNARK record file. section 19.5.4
Figure 19.10 Assignment of values for each record in QAP example
Use the wire-assignment diagram to trace how each record value becomes a public statement, private witness, or derived QAP value. section 19.5.4
