Arithmatic circuits convertible to R1CS based on Bulletproofs
Creating zero knowledge proofs using the Bulletproofs implementation from dalek-cryptography. This repo contains several examples that show how various statements can be represented as arithmetic circuits which can be converted to R1CS. A blog post was written that explains the Bulletproofs API with several examples, though the API has changed slightly.
This project uses a slightly modified implementation of Bulletproofs's develop
branch. The difference is addition of the methods num_constraints
and num_multipliers
to Prover
to return the number of constraints and multipliers respectively and addition of some new methods in constraint system and linear combinations
evaluate_lc
: to evaluate a linear constraintallocate_single
: to return output variable when allocating right multiplier.simplify
: to simplify a linear combination, eg. simplify a linear combination like 2*x + 3*y + 4*x
to 6*x + 3*y
.Use the nightly compiler to run tests like
cargo +nightly test --all-features
OR in release mode to run faster
cargo +nightly test --release --all-features