pub struct BulletproofGens {
pub gens_capacity: usize,
pub party_capacity: usize,
// some fields omitted
}
The BulletproofGens
struct contains all the generators needed
for aggregating up to m
range proofs of up to n
bits each.
Instead of constructing a single vector of size m*n
, as
described in the Bulletproofs paper, we construct each party's
generators separately.
To construct an arbitrarylength chain of generators, we apply
SHAKE256 to a domain separator label, and feed each 64 bytes of
XOF output into the ristretto255
hashtogroup function.
Each of the m
parties' generators are constructed using a
different domain separation label, and proving and verification
uses the first n
elements of the arbitrarylength chain.
This means that the aggregation size (number of
parties) is orthogonal to the rangeproof size (number of bits),
and allows using the same BulletproofGens
object for different
proving parameters.
This construction is also forwardcompatible with constraint
system proofs, which use a much larger slice of the generator
chain, and even forwardcompatible to multiparty aggregation of
constraint system proofs, since the generators are namespaced by
their party index.
The maximum number of usable generators for each party.
Number of values or parties
Create a new BulletproofGens
object.

gens_capacity
is the number of generators to precompute
for each party. For rangeproofs, it is sufficient to pass
64
, the maximum bitsize of the rangeproofs. For circuit
proofs, the capacity must be greater than the number of
multipliers, rounded up to the next power of two.

party_capacity
is the maximum number of parties that can
produce an aggregated proof.
Returns jth share of generators, with an appropriate
slice of vectors G and H for the jth range proof.
Performs copyassignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightlyonly experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightlyonly experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightlyonly experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightlyonly experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightlyonly experimental API. (try_from
)
🔬 This is a nightlyonly experimental API. (get_type_id
)
this method will likely be replaced by an associated static