A pure-Rust implementation of Bulletproofs using Ristretto.
This crate contains both an implementation and a set of notes on how and why Bulletproofs work. The external documentation describes how to use this crate’s API, while the internal documentation contains the notes.
This code is still research-quality. It is not (yet) suitable for deployment.
- Public API documentation
- Internal documentation
- Notes on how Bulletproofs work (located in the internal
notes
module) - Range proof protocol description
- Inner product protocol description
- Notes on how Bulletproofs work (located in the internal
Unfortunately, cargo doc
does not yet have support for custom HTML injection
and for documenting private members, so the documentation is built using:
make doc # Builds external documentation
make doc-internal # Builds internal documentation
Note: cargo doc --open
rebuilds the docs without the custom
invocation, so it may be necessary to rerun make
.
Run tests with cargo test
.
This crate uses criterion.rs for benchmarks. Run benchmarks with
cargo bench
.
The yolocrypto
feature enables the yolocrypto
feature in
curve25519-dalek
, which enables the experimental AVX2 backend. To use it for
Bulletproofs, the target_cpu
must support AVX2:
RUSTFLAGS="-C target_cpu=skylake" cargo bench --features "yolocrypto"
Skylake-X CPUs have double the AVX2 registers. To use them, try
RUSTFLAGS="-C target_cpu=skylake-avx512" cargo bench --features "yolocrypto"
This prevents spills in the AVX2 parallel field multiplication code, but causes worse code generation elsewhere ¯\_(ツ)_/¯
This is a research project being built for Chain, Inc, by Henry de Valence, Cathie Yun, and Oleg Andreev.