Crate zcash_proofs

Source
Expand description

Zcash circuits and proofs.

zcash_proofs contains the zk-SNARK circuits used by Zcash, and the APIs for creating and verifying proofs.

§Feature flags

  • bundled-prover — Bundles the Sapling proving parameters inside the binary, which will increase its size by around 50 MiB.
  • directories — Enables APIs for determining the default location on the local filesystem for storing the Sprout and Sapling proving parameters.
  • download-params — Enables APIs for downloading the Sprout and Sapling proving parameters to the default location on the local filesystem.
  • local-prover (enabled by default) — Enables APIs for loading the Sapling proving parameters from the default location on the local filesystem.
  • multicore (enabled by default) — Enables multithreading support for creating proofs.
  • expensive-tests — A feature used to isolate tests that are expensive to run. Test-only.

Modules§

circuit
Implementations of the Zcash circuits and Zcash-specific gadgets.
proverlocal-prover or bundled-prover
Abstractions over the proving system and parameters for ease of use.
sprout
APIs for creating and verifying Sprout proofs.

Structs§

SaplingParameterPathsdownload-params
The paths to the Sapling parameter files.
ZcashParameters
Zcash Sprout and Sapling groth16 circuit parameters.

Constants§

SAPLING_OUTPUT_NAME
The sapling output parameters file name.
SAPLING_SPEND_NAME
The sapling spend parameters file name.
SPROUT_NAME
The sprout parameters file name.

Functions§

default_params_folderdirectories
Returns the default folder that the Zcash proving parameters are located in.
download_parametersDeprecateddownload-params
Download the Zcash Sapling parameters if needed, and store them in the default location. Always checks the sizes and hashes of the files, even if they didn’t need to be downloaded.
download_sapling_parametersdownload-params
Download the Zcash Sapling parameters if needed, and store them in the default location. Always checks the sizes and hashes of the files, even if they didn’t need to be downloaded.
download_sprout_parametersdownload-params
Download the Zcash Sprout parameters if needed, and store them in the default location. Always checks the size and hash of the file, even if it didn’t need to be downloaded.
load_parameters
Load the specified parameters, checking the sizes and hashes of the files.
parse_parameters
Parse Bls12 keys from bytes as serialized by groth16::Parameters::write.