[][src]Module zkp::toolbox

Contains lower-level tools that allow programmable specification of proof statements.

The higher-level define_proof macro allows declarative specification of static proof statements, and expands into code that uses this lower-level API. This lower-level API can also be used directly to perform imperative specification of proof statements, allowing proof statements with runtime parameters (e.g., an anonymous credential with a variable number of attributes).

The SchnorrCS trait defines the common constraint system API used for specifying proof statements; it is implemented by the Prover, Verifier, and BatchVerifier structs.

Roughly speaking, the tools fit together in the following way:

Note that the expansion of the define_proof macro contains a public internal module with the generated proof statement function, making it possible to combine generated and hand-crafted proof statements into the same constraint system.



Implements batch verification of batchable proofs.


Implements proof creation.


Implements proof verification of compact and batchable proofs.



An interface for specifying proof statements, common between provers and verifiers.


This trait defines the wire format for how the constraint system interacts with the proof transcript.