liveBook · Manning

Witness

As explained in Elliptic Curve Cryptography for Developers

A witness variable is a secret wire value that supplies private information satisfying a proof statement.

A witness is private data used by a prover to satisfy a proof statement without revealing the underlying secret. In a SNARK, public data is the statement and private data is the witness; the verifier receives only public information and the proof. section 19.2 section 19.7

Implementation-wise, the witness fills secret wires in a quadratic arithmetic program. Wire values feed multiplication gates and must satisfy the QAP equations; an invalid witness causes proof verification to fail. section 19.2 section 19.7

A witness participates in the proof flow as follows:

  • The prover combines statement values, witness values, and a common reference string to create a proof. section 19.7
  • Random values can be added so repeated records produce distinct proofs and do not leak information. section 19.7
  • The verifier checks the proof against the statement without learning the witness. section 19.7 section 1.3.4

Medical-record witness

A QAP can use a medicine number, dose, and patient number as inputs. The patient number belongs to the private witness, while the proof establishes that some patient received the specified medicine at the known dose without identifying that patient. section 19.2

Figure 19.2 Example quadratic arithmetic program
figure

Use the quadratic arithmetic program diagram to trace how private wire values propagate through multiplication gates and contribute to the proof statement. section 19.2

How Elliptic Curve Cryptography for Developers covers it

How deep it goes
Connects witnesses to QAP wires, multiplication gates, proof creation, randomization, and verification, but does not implement a prover.
Examples
Uses a medical record, secret patient number, medicine number, dose, QAP wires, and multiplication gates as concrete examples.
What it assumes
Assumes familiarity with public and private data, while introducing statement-versus-witness terminology and QAP wire relationships.
What you can do after
Understand how private inputs satisfy a QAP and support proof generation while remaining hidden from verification.
How it connects
Connects witnesses with zero-knowledge proofs, SNARKs, QAPs, statement variables, provers, verifiers, and common reference strings.

Also explained in

Compare how 2 books explain witness →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elliptic Curve Cryptography for Developers. The section links point to the parts of the book it draws on.