Skip to content

Commit cd6663f

Browse files
authored
Merge pull request #8 from t-bast/master
Perdersen Swap: clarify why `x` can be brute-forced.
2 parents 11ab798 + 347a5e7 commit cd6663f

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

md/pedersen-swap.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Multiplication Proof for Pedersen Commitments
2626
---
2727
This is a non-interactive zero knowledge proof that for given Pedersen
2828
commitments `Q = r*G + x*H`, `T1 = t1*G` and `T2 = t2*G` it holds that `r =
29-
t1*t2`. The given construction is special case (commitment to 0) of the proof
29+
t1*t2`. The given construction is a special case (commitment to 0) of the proof
3030
from the paper [Zero-knowledge proofs of knowledge for group
3131
homomorphisms](https://sci-hub.la/10.1007/s10623-015-0103-5) by Ueli Maurer
3232
section 6.7 with the addition of the Fiat-Shamir heuristic.
@@ -64,9 +64,10 @@ Protocol rationale
6464
Assume someone wants to buy the opening `(r, x)` of a Pedersen commitment `Q =
6565
r*G + x*H` from a seller. The seller can't just use `r*G` as the auxiliary
6666
point in an adaptor signature and send it to the buyer. Upon receiving `r*G`
67-
the buyer would compute `Q - r*G = x*H` and simply brute-force `x` without
68-
paying. This is where the multiplication proof for Pedersen commitments comes
69-
into play: the seller chooses t1 and t2 s.t. `t1*t2 = r`, sends `T1 = t1*G` and
67+
the buyer would compute `Q - r*G = x*H` and since `x` can belong to a small
68+
set, the buyer could simply brute-force `x` without paying.
69+
This is where the multiplication proof for Pedersen commitments comes into
70+
play: the seller chooses t1 and t2 s.t. `t1*t2 = r`, sends `T1 = t1*G` and
7071
`T2 = t2*G` as auxiliary points to the buyer along with the multiplication
7172
proof. Obtaining `r` from `T1` and `T2` is the computational Diffie-Hellman
7273
problem, but learning `t1` and `t2` during the swap allows the buyer to compute
@@ -83,13 +84,13 @@ transactions](https://people.xiph.org/~greg/confidential_values.txt). So we
8384
can abuse that scheme not to prove ranges, but to prove that each `Qi` commits
8485
to a bit of `x`.
8586

86-
As a result, the seller must send an adaptor signatures for the factors `ti1`
87-
and `ti2` of each `ri`. Simply sending multiple adaptor sigs is problematic.
88-
Say the seller sends one adaptor sig with auxiliary point `Ti1=ti1*G` and one
89-
with aux point `Ti2=ti2*G`. Then even without seeing the actual signature, by
90-
just subtracting the signatures the buyer learns `ti1 - ti2`. Instead, the
91-
seller uses auxiliary points `H(Ti1)*ti1*G and H(Ti2)*ti2*G` revealing
92-
`H(Ti1)ti1 - H(Ti2)ti2` which is meaningless for the buyer.
87+
As a result, the seller must send adaptor signatures for the factors `ti1` and
88+
`ti2` of each `ri`. Simply sending multiple adaptor signatures is problematic.
89+
Say the seller sends one adaptor signature with auxiliary point `Ti1=ti1*G` and
90+
one with auxiliary point `Ti2=ti2*G`. Then even without seeing the actual
91+
signature, by just subtracting the signatures the buyer learns `ti1 - ti2`.
92+
Instead, the seller uses auxiliary points `H(Ti1)*ti1*G and H(Ti2)*ti2*G`
93+
revealing `H(Ti1)ti1 - H(Ti2)ti2` which is meaningless for the buyer.
9394

9495

9596
Protocol description
@@ -100,7 +101,7 @@ r*G + x*H` from a seller.
100101
1. Setup
101102

102103
* The seller publishes a range proof to allow potential buyers to later
103-
reconstruct `x` from just `Q` and `r`.A ssuming a prime order group with
104+
reconstruct `x` from just `Q` and `r`. Assuming a prime order group with
104105
an order close to `2^256` the seller publishes `(Q0, ..., Q255, e, s0,
105106
..., s255)` where `sum(Qi) = Q` and `e = hash(si*G + hash(si*G +
106107
e*Qi)*(Qi-2^i*H))`.
@@ -110,7 +111,7 @@ r*G + x*H` from a seller.
110111
2. Adaptor signatures
111112

112113
* Just as in regular atomic swaps using adaptor signatures, the parties
113-
agree on an `R` for the the signature. The seller creates a transaction
114+
agree on an `R` for the signature. The seller creates a transaction
114115
spending the coins from the multisig output and computes a Bellare-Neven
115116
challenge `c` for the transaction.
116117
* For each bit commitment `Qi`, seller generates a uniformly random scalar

0 commit comments

Comments
 (0)