[][src]Crate zkp

zkp: a toolkit for Schnorr proofs

This crate has a toolkit for Schnorr-style zero-knowledge proofs, instantiated using the ristretto255 group.

It provides two levels of API:

Examples

Examples of how to use the API can be found in the library's tests directory.

Currently, the examples include:

Use and features

To enable the define_proof macro, import the crate like so:

#[macro_use]
extern crate zkp;

Nightly features

The nightly feature enables nightly-specific features. It is required to build the documentation.

Backend selection

zkp provides the following pass-through features to select a curve25519-dalek backend:

Transcript debugging

The debug-transcript feature is for development and testing, and prints a log of the data fed into the proof transcript.

Autogenerated benchmarks

The define_proof macro builds benchmarks for the generated proof statements, but because these are generated in the client crate (where the macro expansion happens), they need an extra step to be enabled.

To enable generated benchmarks in your crate, do the following:

WARNING

THIS IMPLEMENTATION IS NOT YET READY FOR PRODUCTION USE

While I expect the 1.0 version to be largely unchanged from the current code, for now there are no stability guarantees on the proofs, so they should not yet be deployed.

Note

Docs will only build on nightly Rust until RFC 1990 stabilizes.

Modules

toolbox

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

Macros

define_proof

Creates a module with code required to produce a non-interactive zero-knowledge proof statement, to serialize it to wire format, to parse from wire format, and to verify the proof or batch-verify multiple proofs.

Structs

BatchableProof

A Schnorr proof in batchable format.

CompactProof

A Schnorr proof in compact format.

Transcript

A transcript of a public-coin argument.

Enums

ProofError

An error during proving or verification, such as a verification failure.