Skip to content

Latest commit

 

History

History
73 lines (50 loc) · 2.51 KB

README.md

File metadata and controls

73 lines (50 loc) · 2.51 KB

Ristretto Bulletproofs

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.

WARNING

This code is still research-quality. It is not (yet) suitable for deployment.

Documentation

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.

Tests

Run tests with cargo test.

Benchmarks

This crate uses criterion.rs for benchmarks. Run benchmarks with cargo bench.

Features

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 ¯\_(ツ)_/¯

About

This is a research project being built for Chain, Inc, by Henry de Valence, Cathie Yun, and Oleg Andreev.