Skip to content

Commit 47e8c60

Browse files
committed
Merge branch 'main' of github.com:dalek-cryptography/bulletproofs into update-deps
2 parents 111b642 + 015af16 commit 47e8c60

File tree

16 files changed

+610
-258
lines changed

16 files changed

+610
-258
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ serde = "1"
2222
serde_derive = "1"
2323
failure = "0.1"
2424
merlin = "1.0.0-pre.0"
25+
clear_on_drop = "0.2"
2526

2627
[dev-dependencies]
2728
hex = "0.3"

README.md

Lines changed: 97 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,128 @@
1-
# Ristretto Bulletproofs
2-
3-
A pure-Rust implementation of [Bulletproofs][bp_website] using [Ristretto][ristretto].
4-
5-
This crate contains both an implementation and a set of notes on how and why
6-
Bulletproofs work. The [external documentation][doc_external] describes how to use this
7-
crate’s API, while the [internal documentation][doc_internal] contains the notes.
8-
9-
## WARNING
10-
11-
This code is still research-quality. It is not (yet) suitable for deployment.
1+
# Bulletproofs
2+
3+
<img
4+
width="100%"
5+
src="https://user-images.githubusercontent.com/698/46373713-9cc40280-c643-11e8-9bfe-2b0586e40369.png"
6+
/>
7+
8+
The fastest [Bulletproofs][bp_website] implementation ever, featuring
9+
single and aggregated range proofs, strongly-typed multiparty
10+
computation, and a programmable constraint system API for proving
11+
arbitrary statements (under development).
12+
13+
This library implements Bulletproofs using [Ristretto][ristretto],
14+
using the `ristretto255` implementation in
15+
[`curve25519-dalek`][curve25519_dalek]. When using the [parallel
16+
formulas][parallel_edwards] in the `curve25519-dalek` AVX2 backend, it
17+
can verify 64-bit rangeproofs **approximately twice as fast** as the
18+
original `libsecp256k1`-based Bulletproofs implementation.
19+
20+
This library provides implementations of:
21+
22+
* Single-party proofs of single or multiple ranges, using the
23+
aggregated rangeproof construction;
24+
25+
* Online multi-party computation for rangeproof aggregation between
26+
multiple parties, using [session types][session_type_blog] to
27+
statically enforce correct protocol flow;
28+
29+
* A programmable constraint system API for expressing rank-1
30+
constraint systems, and proving and verifying proofs of arbitrary
31+
statements (under development in the `circuit` branch);
32+
33+
* Online multi-party computation for aggregated circuit proofs
34+
(planned future work).
35+
36+
These proofs are implemented using [Merlin transcripts][doc_merlin],
37+
allowing them to be arbitrarily composed with other proofs without
38+
implementation changes.
1239

1340
## Documentation
41+
42+
The user-facing documentation for this functionality can be [found
43+
here][doc_external]. In addition, the library *also* contains
44+
extensive notes on how Bulletproofs work. These notes can be found in
45+
the library's [internal documentation][doc_internal]:
46+
47+
* how [Bulletproofs work][bp_notes];
48+
* how [the range proof protocol works][rp_notes];
49+
* how [the inner product proof protocol works][ipp_notes];
50+
* how [the aggregation protocol works][agg_notes];
51+
* how the Bulletproof circuit proofs work (under development);
52+
* how the constraint system reduction works (under development);
53+
* how the aggregated circuit proofs work (future work).
54+
55+
## Comparative Performance
56+
57+
The following table gives comparative timings for proving and
58+
verification of a 64-bit rangeproof on an i7-7800X with Turbo Boost
59+
disabled. Times are in microseconds (lower is better), with the
60+
relative speed compared to the fastest implementation.
61+
62+
| Implementation | Group | Proving (μs) | rel | Verification (μs) | rel |
63+
|----------------|------------------|-------------:|----------:|------------------:|----------:|
64+
| ours (avx2) | ristretto255 | 7300 | **1.00x** | 1040 | **1.00x** |
65+
| ours (u64) | ristretto255 | 11300 | **1.54x** | 1490 | **1.43x** |
66+
| libsecp+endo | secp256k1 | 14300 | **1.96x** | 1900 | **1.83x** |
67+
| libsecp-endo | secp256k1 | 16800 | **2.30x** | 2080 | **2.00x** |
68+
| Monero | ed25519 (unsafe) | 53300 | **7.30x** | 4810 | **4.63x** |
69+
70+
This crate also contains other benchmarks; see the *Benchmarks*
71+
section below for details.
1472

15-
* [Public API documentation][doc_external]
16-
* [Internal documentation][doc_internal]
17-
* [Notes on how Bulletproofs work][bp_notes] (located in the internal `notes` module)
18-
* [Range proof protocol description][rp_notes]
19-
* [Inner product protocol description][ipp_notes]
20-
21-
22-
Unfortunately, `cargo doc` does not yet have support for custom HTML injection
23-
and for documenting private members, so the documentation is built using:
24-
25-
```text
26-
make doc # Builds external documentation
27-
make doc-internal # Builds internal documentation
28-
```
73+
## WARNING
2974

30-
Note: `cargo doc --open` rebuilds the docs without the custom
31-
invocation, so it may be necessary to rerun `make`.
75+
This code is still research-quality. It is not (yet) suitable for
76+
deployment. The development roadmap can be found in the
77+
[Milestones][gh_milestones] section of the [Github repo][gh_repo].
3278

3379
## Tests
3480

3581
Run tests with `cargo test`.
3682

3783
## Benchmarks
3884

39-
This crate uses [criterion.rs][criterion] for benchmarks. Run benchmarks with
40-
`cargo bench`.
85+
This crate uses [criterion.rs][criterion] for benchmarks. Run
86+
benchmarks with `cargo bench`.
4187

4288
## Features
4389

44-
The `yolocrypto` feature enables the `yolocrypto` feature in
45-
`curve25519-dalek`, which enables the experimental AVX2 backend. To use it for
46-
Bulletproofs, the `target_cpu` must support AVX2:
90+
The `avx2_backend` feature enables `curve25519-dalek`'s AVX2 backend,
91+
which implements curve arithmetic using [parallel
92+
formulas][parallel_edwards]. To use it for Bulletproofs, the
93+
`target_cpu` must support AVX2:
4794

4895
```text
49-
RUSTFLAGS="-C target_cpu=skylake" cargo bench --features "yolocrypto"
96+
RUSTFLAGS="-C target_cpu=skylake" cargo bench --features "avx2_backend"
5097
```
5198

5299
Skylake-X CPUs have double the AVX2 registers. To use them, try
53100

54101
```text
55-
RUSTFLAGS="-C target_cpu=skylake-avx512" cargo bench --features "yolocrypto"
102+
RUSTFLAGS="-C target_cpu=skylake-avx512" cargo bench --features "avx2_backend"
56103
```
57104

58105
This prevents spills in the AVX2 parallel field multiplication code, but causes
59106
worse code generation elsewhere ¯\\\_(ツ)\_
60107

61108
## About
62109

63-
This is a research project being built for Chain, Inc, by Henry de Valence,
64-
Cathie Yun, and Oleg Andreev.
110+
This is a research project sponsored by [Interstellar][interstellar],
111+
developed by Henry de Valence, Cathie Yun, and Oleg Andreev.
65112

66113
[bp_website]: https://crypto.stanford.edu/bulletproofs/
67-
[ristretto]: https://doc.dalek.rs/curve25519_dalek/ristretto/index.html
68-
[doc_external]: https://doc.dalek.rs/ristretto_bulletproofs/index.html
69-
[doc_internal]: https://doc-internal.dalek.rs/ristretto_bulletproofs/index.html
70-
[bp_notes]: https://doc-internal.dalek.rs/ristretto_bulletproofs/notes/index.html
71-
[rp_notes]: https://doc-internal.dalek.rs/ristretto_bulletproofs/range_proof/index.html
72-
[ipp_notes]: https://doc-internal.dalek.rs/ristretto_bulletproofs/inner_product_proof/index.html
114+
[ristretto]: https://ristretto.group
115+
[doc_merlin]: https://doc.dalek.rs/merlin/index.html
116+
[doc_external]: https://doc.dalek.rs/bulletproofs/index.html
117+
[doc_internal]: https://doc-internal.dalek.rs/bulletproofs/index.html
118+
[bp_notes]: https://doc-internal.dalek.rs/bulletproofs/notes/index.html
119+
[rp_notes]: https://doc-internal.dalek.rs/bulletproofs/range_proof/index.html
120+
[ipp_notes]: https://doc-internal.dalek.rs/bulletproofs/inner_product_proof/index.html
121+
[agg_notes]: https://doc-internal.dalek.rs/bulletproofs/notes/index.html#aggregated-range-proof
73122
[criterion]: https://github.com/japaric/criterion.rs
123+
[session_type_blog]: https://blog.chain.com/bulletproof-multi-party-computation-in-rust-with-session-types-b3da6e928d5d
124+
[curve25519_dalek]: https://doc.dalek.rs/curve25519_dalek/index.html
125+
[parallel_edwards]: https://medium.com/@hdevalence/accelerating-edwards-curve-arithmetic-with-parallel-formulas-ac12cf5015be
126+
[gh_repo]: https://github.com/dalek-cryptography/bulletproofs/
127+
[gh_milestones]: https://github.com/dalek-cryptography/bulletproofs/milestones
128+
[interstellar]: https://interstellar.com/

benches/bulletproofs.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ use rand::Rng;
99
extern crate curve25519_dalek;
1010
use curve25519_dalek::scalar::Scalar;
1111

12+
extern crate merlin;
13+
use merlin::Transcript;
14+
1215
extern crate bulletproofs;
1316
use bulletproofs::RangeProof;
14-
use bulletproofs::Transcript;
1517
use bulletproofs::{BulletproofGens, PedersenGens};
1618

1719
static AGGREGATION_SIZES: [usize; 6] = [1, 2, 4, 8, 16, 32];
@@ -79,7 +81,7 @@ fn verify_aggregated_rangeproof_helper(n: usize, c: &mut Criterion) {
7981
let blindings: Vec<Scalar> = (0..m).map(|_| Scalar::random(&mut rng)).collect();
8082

8183
let mut transcript = Transcript::new(b"AggregateRangeProofBenchmark");
82-
let proof = RangeProof::prove_multiple(
84+
let (proof, value_commitments) = RangeProof::prove_multiple(
8385
&bp_gens,
8486
&pc_gens,
8587
&mut transcript,
@@ -88,17 +90,11 @@ fn verify_aggregated_rangeproof_helper(n: usize, c: &mut Criterion) {
8890
n,
8991
).unwrap();
9092

91-
let value_commitments: Vec<_> = values
92-
.iter()
93-
.zip(blindings.iter())
94-
.map(|(&v, &v_blinding)| pc_gens.commit(v.into(), v_blinding))
95-
.collect();
96-
9793
b.iter(|| {
9894
// Each proof creation requires a clean transcript.
9995
let mut transcript = Transcript::new(b"AggregateRangeProofBenchmark");
10096

101-
proof.verify(&bp_gens, &pc_gens, &mut transcript, &value_commitments, n)
97+
proof.verify_multiple(&bp_gens, &pc_gens, &mut transcript, &value_commitments, n)
10298
});
10399
},
104100
&AGGREGATION_SIZES,

docs/aggregation-api.md

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.
-155 KB
Binary file not shown.
700 KB
Loading

docs/notes.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ Instead, the prover chooses vectors of blinding factors
287287
and uses them to construct vector polynomials
288288
\\[
289289
\begin{aligned}
290-
{\mathbf{l}}(x) &= {\mathbf{l}}\_{0} + {\mathbf{l}}\_{1} x = ({\mathbf{a}}\_{L} + {\mathbf{s}}\_{L} x) - z {\mathbf{1}} & \in {\mathbb Z\_p}[x]^{n} \\\\
291-
{\mathbf{r}}(x) &= {\mathbf{r}}\_{0} + {\mathbf{r}}\_{1} x = {\mathbf{y}}^{n} \circ \left( ({\mathbf{a}}\_{R} + {\mathbf{s}}\_{R} x\right) + z {\mathbf{1}}) + z^{2} {\mathbf{2}}^{n} &\in {\mathbb Z\_p}[x]^{n}
290+
{\mathbf{l}}(x) &= {\mathbf{l}}\_{0} + {\mathbf{l}}\_{1} x = ({\mathbf{a}}\_{L} + {\mathbf{s}}\_{L} x) - z {\mathbf{1}} & \in {\mathbb Z\_p}\[x\]^{n} \\\\
291+
{\mathbf{r}}(x) &= {\mathbf{r}}\_{0} + {\mathbf{r}}\_{1} x = {\mathbf{y}}^{n} \circ \left( ({\mathbf{a}}\_{R} + {\mathbf{s}}\_{R} x\right) + z {\mathbf{1}}) + z^{2} {\mathbf{2}}^{n} &\in {\mathbb Z\_p}\[x\]^{n}
292292
\end{aligned}
293293
\\]
294294
These are the left and right sides of the combined inner product with \\({\mathbf{a}}\_{L}\\), \\({\mathbf{a}}\_{R}\\)
@@ -529,10 +529,10 @@ and compress the vectors by adding the left and the right halves
529529
separated by the variable \\(u\_k\\):
530530
\\[
531531
\begin{aligned}
532-
{\mathbf{a}}^{(k-1)} &= {\mathbf{a}}\_L \cdot u\_k + u^{-1}\_k \cdot {\mathbf{a}}\_R \\\\
533-
{\mathbf{b}}^{(k-1)} &= {\mathbf{b}}\_L \cdot u^{-1}\_k + u\_k \cdot {\mathbf{b}}\_R \\\\
534-
{\mathbf{G}}^{(k-1)} &= {\mathbf{G}}\_L \cdot u^{-1}\_k + u\_k \cdot {\mathbf{G}}\_R \\\\
535-
{\mathbf{H}}^{(k-1)} &= {\mathbf{H}}\_L \cdot u\_k + u^{-1}\_k \cdot {\mathbf{H}}\_R
532+
{\mathbf{a}}^{(k-1)} &= {\mathbf{a}}\_{\operatorname{lo}} \cdot u\_k + u^{-1}\_k \cdot {\mathbf{a}}\_{\operatorname{hi}} \\\\
533+
{\mathbf{b}}^{(k-1)} &= {\mathbf{b}}\_{\operatorname{lo}} \cdot u^{-1}\_k + u\_k \cdot {\mathbf{b}}\_{\operatorname{hi}} \\\\
534+
{\mathbf{G}}^{(k-1)} &= {\mathbf{G}}\_{\operatorname{lo}} \cdot u^{-1}\_k + u\_k \cdot {\mathbf{G}}\_{\operatorname{hi}} \\\\
535+
{\mathbf{H}}^{(k-1)} &= {\mathbf{H}}\_{\operatorname{lo}} \cdot u\_k + u^{-1}\_k \cdot {\mathbf{H}}\_{\operatorname{hi}}
536536
\end{aligned}
537537
\\]
538538
The powers of \\(u\_k\\) are chosen so they cancel out in the
@@ -546,17 +546,17 @@ Expanding it in terms of the original \\({\mathbf{a}}\\), \\({\mathbf{b}}\\),
546546
\\({\mathbf{G}}\\) and \\({\mathbf{H}}\\) gives:
547547
\\[
548548
\begin{aligned}
549-
P\_{k-1} &{}={}& &{\langle {\mathbf{a}}\_L \cdot u\_k + u\_k^{-1} \cdot {\mathbf{a}}\_R, {\mathbf{G}}\_L \cdot u^{-1}\_k + u\_k \cdot {\mathbf{G}}\_R \rangle} + \\\\
550-
&& &{\langle {\mathbf{b}}\_L \cdot u^{-1}\_k + u\_k \cdot {\mathbf{b}}\_R, {\mathbf{H}}\_L \cdot u\_k + u^{-1}\_k \cdot {\mathbf{H}}\_R \rangle} + \\\\
551-
&& &{\langle {\mathbf{a}}\_L \cdot u\_k + u^{-1}\_k \cdot {\mathbf{a}}\_R, {\mathbf{b}}\_L \cdot u^{-1}\_k + u\_k \cdot {\mathbf{b}}\_R \rangle} \cdot Q
549+
P\_{k-1} &{}={}& &{\langle {\mathbf{a}}\_{\operatorname{lo}} \cdot u\_k + u\_k^{-1} \cdot {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{G}}\_{\operatorname{lo}} \cdot u^{-1}\_k + u\_k \cdot {\mathbf{G}}\_{\operatorname{hi}} \rangle} + \\\\
550+
&& &{\langle {\mathbf{b}}\_{\operatorname{lo}} \cdot u^{-1}\_k + u\_k \cdot {\mathbf{b}}\_{\operatorname{hi}}, {\mathbf{H}}\_{\operatorname{lo}} \cdot u\_k + u^{-1}\_k \cdot {\mathbf{H}}\_{\operatorname{hi}} \rangle} + \\\\
551+
&& &{\langle {\mathbf{a}}\_{\operatorname{lo}} \cdot u\_k + u^{-1}\_k \cdot {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{b}}\_{\operatorname{lo}} \cdot u^{-1}\_k + u\_k \cdot {\mathbf{b}}\_{\operatorname{hi}} \rangle} \cdot Q
552552
\end{aligned}
553553
\\]
554554
Breaking down in simpler products:
555555
\\[
556556
\begin{aligned}
557-
P\_{k-1} &{}={}& &{\langle {\mathbf{a}}\_L, {\mathbf{G}}\_L \rangle} + {\langle {\mathbf{a}}\_R, {\mathbf{G}}\_R \rangle} &{}+{}& u\_k^2 {\langle {\mathbf{a}}\_L, {\mathbf{G}}\_R \rangle} + u^{-2}\_k {\langle {\mathbf{a}}\_R, {\mathbf{G}}\_L \rangle} + \\\\
558-
&& &{\langle {\mathbf{b}}\_L, {\mathbf{H}}\_L \rangle} + {\langle {\mathbf{b}}\_R, {\mathbf{H}}\_R \rangle} &{}+{}& u^2\_k {\langle {\mathbf{b}}\_R, {\mathbf{H}}\_L \rangle} + u^{-2}\_k {\langle {\mathbf{b}}\_L, {\mathbf{H}}\_R \rangle} + \\\\
559-
&& &({\langle {\mathbf{a}}\_L, {\mathbf{b}}\_L \rangle} + {\langle {\mathbf{a}}\_R, {\mathbf{b}}\_R \rangle})\cdot Q &{}+{}& (u^2\_k {\langle {\mathbf{a}}\_L, {\mathbf{b}}\_R \rangle} + u^{-2}\_k {\langle {\mathbf{a}}\_R, {\mathbf{b}}\_L \rangle}) \cdot Q
557+
P\_{k-1} &{}={}& &{\langle {\mathbf{a}}\_{\operatorname{lo}}, {\mathbf{G}}\_{\operatorname{lo}} \rangle} + {\langle {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{G}}\_{\operatorname{hi}} \rangle} &{}+{}& u\_k^2 {\langle {\mathbf{a}}\_{\operatorname{lo}}, {\mathbf{G}}\_{\operatorname{hi}} \rangle} + u^{-2}\_k {\langle {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{G}}\_{\operatorname{lo}} \rangle} + \\\\
558+
&& &{\langle {\mathbf{b}}\_{\operatorname{lo}}, {\mathbf{H}}\_{\operatorname{lo}} \rangle} + {\langle {\mathbf{b}}\_{\operatorname{hi}}, {\mathbf{H}}\_{\operatorname{hi}} \rangle} &{}+{}& u^2\_k {\langle {\mathbf{b}}\_{\operatorname{hi}}, {\mathbf{H}}\_{\operatorname{lo}} \rangle} + u^{-2}\_k {\langle {\mathbf{b}}\_{\operatorname{lo}}, {\mathbf{H}}\_{\operatorname{hi}} \rangle} + \\\\
559+
&& &({\langle {\mathbf{a}}\_{\operatorname{lo}}, {\mathbf{b}}\_{\operatorname{lo}} \rangle} + {\langle {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{b}}\_{\operatorname{hi}} \rangle})\cdot Q &{}+{}& (u^2\_k {\langle {\mathbf{a}}\_{\operatorname{lo}}, {\mathbf{b}}\_{\operatorname{hi}} \rangle} + u^{-2}\_k {\langle {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{b}}\_{\operatorname{lo}} \rangle}) \cdot Q
560560
\end{aligned}
561561
\\]
562562
We now see that the left two columns in the above equation is the
@@ -566,8 +566,8 @@ terms with \\(u^2\_k\\) as \\(L\_k\\) and all terms with \\(u^{-2}\_k\\) as \\(R
566566
\\[
567567
\begin{aligned}
568568
P\_{k-1} &= P\_k + u^2\_k \cdot L\_k + u^{-2}\_k \cdot R\_k\\\\
569-
L\_k &= {\langle {\mathbf{a}}\_L, {\mathbf{G}}\_R \rangle} + {\langle {\mathbf{b}}\_R, {\mathbf{H}}\_L \rangle} + {\langle {\mathbf{a}}\_L, {\mathbf{b}}\_R \rangle} \cdot Q\\\\
570-
R\_k &= {\langle {\mathbf{a}}\_R, {\mathbf{G}}\_L \rangle} + {\langle {\mathbf{b}}\_L, {\mathbf{H}}\_R \rangle} + {\langle {\mathbf{a}}\_R, {\mathbf{b}}\_L \rangle} \cdot Q
569+
L\_k &= {\langle {\mathbf{a}}\_{\operatorname{lo}}, {\mathbf{G}}\_{\operatorname{hi}} \rangle} + {\langle {\mathbf{b}}\_{\operatorname{hi}}, {\mathbf{H}}\_{\operatorname{lo}} \rangle} + {\langle {\mathbf{a}}\_{\operatorname{lo}}, {\mathbf{b}}\_{\operatorname{hi}} \rangle} \cdot Q\\\\
570+
R\_k &= {\langle {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{G}}\_{\operatorname{lo}} \rangle} + {\langle {\mathbf{b}}\_{\operatorname{lo}}, {\mathbf{H}}\_{\operatorname{hi}} \rangle} + {\langle {\mathbf{a}}\_{\operatorname{hi}}, {\mathbf{b}}\_{\operatorname{lo}} \rangle} \cdot Q
571571
\end{aligned}
572572
\\]
573573
If the prover commits to \\(L\_k\\) and \\(R\_k\\) before \\(u\_k\\) is randomly
@@ -623,7 +623,7 @@ New notation for aggregated proofs
623623

624624
The subscript \\({(j)}\\) denotes the \\(j\\)th party's share. For instance, \\(v_{(j)}\\) is the \\(v\\) value of the \\(j\\)th party; \\( \mathbf{a}\_{L, (j)}\\) is the \\( \mathbf{a}\_L \\) vector of the \\(j\\)th party; \\(\mathbf{l}\_{(0)}(x)\\) is the \\(\mathbf{l}(x)\\) polynomial of party \\(0\\).
625625

626-
We use pythonic notation to denote slices of vectors, such that \\(\mathbf{G}\_{[a:b]} = [\mathbf{G}\_{a}, \mathbf{G}\_{a+1}, \dots, \mathbf{G}\_{b-1} ]\\).
626+
We use pythonic notation to denote slices of vectors, such that \\(\mathbf{G}\_{\[a:b\]} = [\mathbf{G}\_{a}, \mathbf{G}\_{a+1}, \dots, \mathbf{G}\_{b-1} ]\\).
627627

628628
\\({\mathbf{G}\_{(j)}}\\) is party \\(j\\)'s share of the generators \\({\mathbf{G}}\\), or \\({\mathbf{G}\_{[j\cdot n : (j+1)n]}}\\), and \\({\mathbf{H}'\_{(j)}}\\) is party \\(j\\)'s share of the generators \\({\mathbf{H}'}\\), or \\({\mathbf{H}'\_{[j\cdot n : (j+1)n]}}\\).
629629

@@ -692,8 +692,8 @@ The prover chooses vectors of blinding factors \\( \mathbf{s}\_{L, (j)}, {\mathb
692692

693693
\\[
694694
\begin{aligned}
695-
{\mathbf{l}}\_{(j)}(x) &= ({\mathbf{a}}\_{L, (j)} + {\mathbf{s}}\_{L, (j)} x) - z {\mathbf{1}} & \in {\mathbb Z\_p}[x]^{n} \\\\
696-
{\mathbf{r}}\_{(j)}(x) &= {\mathbf{y}}^{n}\_{(j)} \circ \left( ({\mathbf{a}}\_{R, (j)} + {\mathbf{s}}\_{R, (j)} x\right) + z {\mathbf{1}}) + z^{2} z_{(j)} {\mathbf{2}}^{n} &\in {\mathbb Z\_p}[x]^{n}
695+
{\mathbf{l}}\_{(j)}(x) &= ({\mathbf{a}}\_{L, (j)} + {\mathbf{s}}\_{L, (j)} x) - z {\mathbf{1}} & \in {\mathbb Z\_p}\[x\]^{n} \\\\
696+
{\mathbf{r}}\_{(j)}(x) &= {\mathbf{y}}^{n}\_{(j)} \circ \left( ({\mathbf{a}}\_{R, (j)} + {\mathbf{s}}\_{R, (j)} x\right) + z {\mathbf{1}}) + z^{2} z_{(j)} {\mathbf{2}}^{n} &\in {\mathbb Z\_p}\[x\]^{n}
697697
\end{aligned}
698698
\\]
699699

docs/range-proof-protocol.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ S_{(j)} &\gets \operatorname{Com}({\mathbf{s}}\_{L, (j)}, {\mathbf{s}}\_{R, (j)}
3131
\\] where \\(\widetilde{v}\_{(j)}, \widetilde{a}\_{(j)}, \widetilde{s}\_{(j)}\\) are sampled randomly
3232
from \\({\mathbb Z\_p}\\) and \\(\mathbf{s}\_{L, (j)}, \mathbf{s}\_{R, (j)}\\) are sampled randomly from \\({\mathbb Z\_p}^{n}\\).
3333

34-
The parties all send their \\(V_{(j)}\\), \\(A_{(j)}\\), and \\(S_{(j)}\\) values to the dealer as `ValueCommitment`. The dealer adds each \\(V_{(j)}\\) value to the protocol transcript, in order. The dealer then computes \\(A\\) and \\(S\\) as follows:
34+
The parties all send their \\(V_{(j)}\\), \\(A_{(j)}\\), and \\(S_{(j)}\\) values to the dealer as `BitCommitment`. The dealer adds each \\(V_{(j)}\\) value to the protocol transcript, in order. The dealer then computes \\(A\\) and \\(S\\) as follows:
3535

3636
\\[
3737
\begin{aligned}
@@ -40,9 +40,9 @@ The parties all send their \\(V_{(j)}\\), \\(A_{(j)}\\), and \\(S_{(j)}\\) value
4040
\end{aligned}
4141
\\]
4242

43-
The dealer adds \\(A\\) and \\(S\\) to the protocol transcript and obtains challenge scalars \\(y,z \in {\mathbb Z\_p}\\) from the transcript. The dealer sends \\(y, z\\) as `ValueChallenge` to all of the parties.
43+
The dealer adds \\(A\\) and \\(S\\) to the protocol transcript and obtains challenge scalars \\(y,z \in {\mathbb Z\_p}\\) from the transcript. The dealer sends \\(y, z\\) as `BitChallenge` to all of the parties.
4444

45-
Using their secret vectors and the challenges \\(y, z\\) from `ValueChallenge`, each party constructs vector polynomials:
45+
Using their secret vectors and the challenges \\(y, z\\) from `BitChallenge`, each party constructs vector polynomials:
4646
\\[
4747
\begin{aligned}
4848
{\mathbf{l}}\_{(j)}(x) &= {\mathbf{l}}\_{0, (j)} + {\mathbf{l}}\_{1, (j)} x \\\\

0 commit comments

Comments
 (0)