Skip to content

Commit 73eae1f

Browse files
committed
Introduce adaptorless signatures and redefine adaptor signature
1 parent 94a4e2f commit 73eae1f

File tree

3 files changed

+55
-50
lines changed

3 files changed

+55
-50
lines changed

md/atomic-swap.md

+23-21
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ to B on one chain, while B is sending coins to A on the other.
1212

1313
1. Both parties A and B put their coins into multisignature outputs on each chain
1414
which require both parties' signatures to be spent.
15-
2. A gives B auxiallary data "adaptor signatures" which allow A to extract a
16-
discrete logarithm from a signature on one chain, and conversely to extract a
17-
signature from the same discrete logarithm on the other chain.
15+
2. A gives B auxiliary data, "adaptorless signatures", for each output. This will allow B to extract a
16+
discrete logarithm from a signature on one chain, and then to adapt A's
17+
signature with the same discrete logarithm on the other chain.
1818
3. B then signs to give A her coins on one chain.
1919
4. When A signs to take her coins, B is able to extract a discrete logarithm
2020
from her signature.
@@ -38,21 +38,23 @@ with public key `P` is a pair `(s, R)` satisfying the equation
3838
```
3939
sG = R + H(P || R || m)P
4040
```
41-
Closely related, an _adaptor signature_ is a triplet `(s', R, T)` satisfying
41+
Closely related, an _adaptorless signature_ is a triplet `(s', R, T)` satisfying
4242
```
43-
s'G = T + R + H(P || R || m)P
43+
s'G = R + H(P || R + T || m)P
4444
```
45-
It is easy to see that given a Schnorr signature `(s, R)` and adaptor signature
46-
`(s', R, T)` (notice both `R`s are the same) that the discrete logarithm of `T`
47-
can be computed as `s' - s`, since subtracting the above equations reveals
48-
`(s' - s)G = T`.
4945

50-
Similarly, given an adaptor signature `(s', R, T)` and `t` such that `T = tG`,
51-
it is easy to compute a Schnorr signature `(s, R)` by the equation `s = s' - t`.
46+
It is easy to see that given a Schnorr signature `(s, R + T)` and adaptor signature
47+
`(s', R, T)` that the discrete logarithm of the _adaptor_ `T`,
48+
can be computed as `s - s'`, since subtracting the above equations reveals
49+
`(s - s')G = R + T - R = T`.
5250

53-
We conclude that given an adaptor signature `(s', R, T)` with public key `P`,
54-
knowledge of a Schnorr signature with same `P` and same `R` is equivalent to
55-
knowledge of the discrete logarithm of `T`.
51+
Similarly, given an adaptorless signature `(s', R, T)` and `t` such that `T = tG`,
52+
it is easy to compute a Schnorr signature `(s, R + T)` by the equation `s = s' + t`.
53+
54+
We conclude that given an adaptorless signature `(s', R, T)` with public key `P`,
55+
knowledge of a Schnorr signature `(s, R + T)` with same `P` is equivalent to
56+
knowledge of the discrete logarithm of `T`. Schnorr signature `(s, R + T)` is an
57+
_adaptor signature_ for `(s', R, T)` because it provides the adaptor.
5658

5759
#### Schnorr Multisignatures
5860

@@ -68,17 +70,17 @@ On a lower level, the above scheme works as follows. We assume first that both
6870
blockchains use the same group generated by the same fixed generator `G`, and
6971
that both blockchains support Schnorr signatures.
7072

71-
1. Each party puts their coins into a multisignature output. They agree on an
73+
1. Each party puts their coins into a multisignature output. They agree on a public Schnorr signature nonce
7274
`R` for each signature that they'll eventually use to move the coins to their
7375
final destinations.
74-
2. A chooses a random `t`, sets `T = tG`, and produces adaptor signatures in place
76+
2. A chooses a random `t`, sets `T = tG`, and produces adaptorless signatures in place
7577
of her contributions to `s`. Each signature uses the same `T`. She sends these
76-
to B.
78+
and `T` to B.
7779
3. B reveals his contribution to `s` for the signature that sends his coins to A.
78-
4. A reveals her contribution to `s` for that signature, completing it, and
80+
4. A reveals her contribution to `s` for that signature, completing it by adapting previous adaptorless signature, and
7981
publishes it to take her coins.
80-
5. Using the adaptor signature, B learns `t` from the output of step (4), and uses
81-
it to compute A's contribution to `s` for the signature that sends her coins to
82+
5. Using the adaptorless signature, B learns `t` from the output of step (4), and uses
83+
it to adapt A's contribution to `s` for the signature that sends her coins to
8284
him.
8385
6. B adds his contribution to `s`, completing the signature, and publishes it to
8486
take his coins.
@@ -90,4 +92,4 @@ aggregation techniques such as [Schnorr
9092
"half-aggregation"](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-May/014272.html).
9193
This is because with aggregation the `s`-part in a signature can be
9294
re-randomized while staying valid, such that knowledge of a corresponding
93-
adaptor signature does not allow to compute the adaptor secret `t` as `s' - s`.
95+
adaptor signature does not allow to compute the adaptor secret `t` as `s - s'`.

md/partially-blind-swap.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ confidential). This property is very similar to
1111
script](https://github.com/apoelstra/scriptless-scripts/blob/master/md/atomic-swap.md)
1212
and therefore purely in the elliptic curve discrete logarithm setting.
1313

14-
The basic idea is that the discrete logarithm of the auxiliary point `T` in the
15-
adaptor signature is not chosen uniformly at random by Alice. Instead, Bob
14+
The basic idea is that the discrete logarithm of the adaptor point `T` in the
15+
is not chosen uniformly at random by Alice. Instead, Bob
1616
computes `T = t*G` where `t` is a [blind Schnorr
1717
signature](https://blog.cryptographyengineering.com/a-note-on-blind-signature-schemes/)
1818
of Alice over a transaction spending the funding transaction without knowing `t`
@@ -38,7 +38,7 @@ follows.
3838
timelocked refund transactions in case one party disappears.
3939
2. Blind signing
4040

41-
Bob creates a transaction `tx_B` spending O1. Then Bob creates an auxiliary
41+
Bob creates a transaction `tx_B` spending O1. Then Bob creates adaptor
4242
point `T = t*G` where `t` is a Schnorr signature over `tx_B` in the
4343
following way:
4444

@@ -54,15 +54,15 @@ follows.
5454
* the blinded challenge `c = c'+beta`
5555
* and the blinded signature of A times `G`: `T = R + c*A`
5656
* Bob sends `c` to Alice
57-
* Alice replies with an adaptor signature over `tx_A` spending `O2` with
58-
auxiliary point `T = t*G, t = ka + c*a` where `a` is the discrete
57+
* Alice replies with an adaptorless signature over `tx_A` spending `O2` with
58+
adaptor point `T = t*G, t = ka + c*a` where `a` is the discrete
5959
logarithm of permanent key `A`.
6060
3. Swap
6161

6262
* Bob gives Alice his contribution to the signature over `tx_A`.
6363
* Alice adds Bob's contribution to her own signature and uses it to take
6464
her coins out of O2.
65-
* Due to previously receiving an adaptor signature Bob learns `t` from step (2).
65+
* Due to previously receiving an adaptorless signature Bob learns `t` from step (2).
6666
4. Unblinding
6767

6868
* Bob unblinds Alice's blind signature `t` as `t' = t + alpha + c'*h` where

md/pedersen-swap.md

+26-23
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ s1*T2 + s2*H = k1*T2 + H(R1,R2)*t1*T2 + k2*H + H(R1,R2)*x*H
6262
Protocol rationale
6363
---
6464
Assume someone wants to buy the opening `(r, x)` of a Pedersen commitment `Q =
65-
r*G + x*H` from a seller. The seller can't just use `r*G` as the auxiliary
66-
point in an adaptor signature and send it to the buyer. Upon receiving `r*G`
65+
r*G + x*H` from a seller. The seller can't just use `r*G` as the adaptor
66+
point in an adaptorless signature and send it to the buyer. Upon receiving `r*G`
6767
the buyer would compute `Q - r*G = x*H` and simply brute-force `x` without
6868
paying. This is where the multiplication proof for Pedersen commitments comes
6969
into play: the seller chooses t1 and t2 s.t. `t1*t2 = r`, sends `T1 = t1*G` and
70-
`T2 = t2*G` as auxiliary points to the buyer along with the multiplication
70+
`T2 = t2*G` as adaptor points to the buyer along with the multiplication
7171
proof. Obtaining `r` from `T1` and `T2` is the computational Diffie-Hellman
7272
problem, but learning `t1` and `t2` during the swap allows the buyer to compute
7373
`r`.
7474

7575
Because `x` is multiplied by `H` and not `G` there is no straightforward way to
76-
similarly put `x*H` in an adaptor signature. Let `xi` be the `i`-th bit of `x`.
76+
similarly put `x*H` in an adaptorless signature. Let `xi` be the `i`-th bit of `x`.
7777
The seller creates one Pedersen commitment `Qi = ri*G + xi*G` for every bit of
7878
`x`. After learning all `ri` during the swap, the buyer can reconstruct `x`
7979
bitwise by checking whether `Qi` is a commitment to `0` or `1`. Committing to
@@ -83,13 +83,19 @@ transactions](https://people.xiph.org/~greg/confidential_values.txt). So we
8383
can abuse that scheme not to prove ranges, but to prove that each `Qi` commits
8484
to a bit of `x`.
8585

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.
86+
As a result, the seller must send adaptorless signatures for the factors `ti1`
87+
and `ti2` of each `ri`. In general, in order to reveal multiple secret adaptors
88+
`u1, ..., un` with a single signature the seller must create adaptorless
89+
signatures `(si, R + sum(uj over j)*G - ui*G, ui*G)`. This ensures that all
90+
adaptorless signatures commit to the same Schnorr signature nonce `R + sum(uj
91+
over j)*G`.
92+
93+
However, simply sending multiple adaptorless sigs in that way is problematic.
94+
Say the seller sends one adaptorless sig with adaptor `Ti1=ti1*G` and one with
95+
adaptor `Ti2=ti2*G`. Then even without seeing the actual signature, by just
96+
subtracting the signatures the buyer learns `-ti1 + ti2`. Instead, the seller
97+
uses adaptor `H(Ti1)*ti1*G and H(Ti2)*ti2*G` revealing `H(Ti1)ti1 - H(Ti2)ti2`
98+
which is meaningless for the buyer.
9399

94100

95101
Protocol description
@@ -115,24 +121,21 @@ r*G + x*H` from a seller.
115121
challenge `c` for the transaction.
116122
* For each bit commitment `Qi`, seller generates a uniformly random scalar
117123
`ti1` and sets `ti2`, such that `ti1*ti2*G = ri*G = Qi-xi*H`. Then the
118-
seller computes `Ti1 = ti1*G` and `Ti2 = ti2*G` and sends the following
119-
adaptor signatures `si1` and `si2` with auxiliary points `H(Ti1)*Ti1` and
120-
`H(Ti2)*Ti2` to Bob:
121-
```
122-
si1 = k + H(Ti1)ti1 + c*a
123-
si2 = k + H(Ti2)ti2 + c*a
124-
```
125-
along with a multiplication proof for Pedersen commitments proving the
126-
multiplicative relationship of the blinding factors of Ti1, Ti2 and Qi.
124+
seller computes adaptors `Ti1 = ti1*G` and `Ti2 = ti2*G` and sends
125+
adaptorless signatures `(si1, R + sum(Ai) - H(Ti1)*Ti1, H(Ti1)*Ti1)` and
126+
`(si2, R + sum(Ai) - H(Ti2)*Ti2, H(Ti2)ti2)` where `Ai` is the sum of
127+
both adaptors. The seller also sends a multiplication proof for Pedersen
128+
commitments proving the multiplicative relationship of the blinding
129+
factors of Ti1, Ti2 and Qi.
127130
3. Swap
128131

129-
* The buyer verifies the adaptor signatures and multiplication proofs and
132+
* The buyer verifies the adaptorless signatures and multiplication proofs and
130133
sends his contribution to the signature.
131134
* The seller completes the signature `(R, s)` and publishes it along with
132135
the transaction to take her coins.
133136
* Just as in regular atomic swaps using adaptor signatures, the buyer can
134-
recover the discrete logarithm of the auxiliary points by subtracting s
135-
from the corresponding adaptor signature. So for each bit commitment, the
137+
recover the discrete logarithm of the adaptor by subtracting
138+
the adaptorless signature from the corresponding s. So for each bit commitment, the
136139
buyer is able to recover `ti1` and `ti2`.
137140
* Because it holds that `ti1*ti2 = ri`, the buyer can reconstruct `x` by
138141
setting the `i`-th bit of `x` to `0` if `Qi == ti1*ti2*G + 0*H` and to

0 commit comments

Comments
 (0)