Skip to content

Commit 9955741

Browse files
authored
Merge pull request #14 from MaxHillebrand/patch-2
Change `Alice` to `server`
2 parents bb59f45 + a61ac72 commit 9955741

File tree

1 file changed

+46
-51
lines changed

1 file changed

+46
-51
lines changed

md/partially-blind-swap.md

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,44 @@ Partially Blind Atomic Swap Using Adaptor Signatures
22
===========================
33

44
In this scheme one of the participants of the swap does not learn which coins
5-
are being swapped. For example if Alice engages in a partially blind atomic
6-
swap with Bob and Carol, she would not be able to determine if a swapped output
7-
belongs to Bob or Carol (assuming the transaction amounts are identical or
8-
confidential). This property is very similar to
9-
[TumbleBit](https://eprint.iacr.org/2016/575.pdf) but in the form of a
10-
[scriptless
11-
script](https://github.com/apoelstra/scriptless-scripts/blob/master/md/atomic-swap.md)
5+
are being swapped. For example if service provider engages in a partially blind
6+
atomic swap with the users Bob and Carol, the server would not be able to
7+
determine if a swapped output belongs to Bob or Carol (assuming the transaction
8+
amounts are identical or confidential). This property is very similar to
9+
[TumbleBit](https://eprint.iacr.org/2016/575.pdf) but in the form of a [scriptlessscript](https://github.com/apoelstra/scriptless-scripts/blob/master/md/atomic-swap.md)
1210
and therefore purely in the elliptic curve discrete logarithm setting.
1311

1412
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
16-
computes `T = t*G` where `t` is a [blind Schnorr
17-
signature](https://blog.cryptographyengineering.com/a-note-on-blind-signature-schemes/)
18-
of Alice over a transaction spending the funding transaction without knowing `t`
19-
(similar to [Discreet Log Contracts](https://adiabat.github.io/dlc.pdf)).
13+
adaptor signature is not chosen uniformly at random by the server. Instead, the user
14+
computes `T = t*G` where `t` is a [blind Schnorr signature](https://blog.cryptographyengineering.com/a-note-on-blind-signature-schemes/)
15+
of the server over a transaction spending the funding transaction without knowing
16+
`t` (similar to [Discreet Log Contracts](https://adiabat.github.io/dlc.pdf)).
2017

2118
Protocol description
2219
---
23-
Assume Alice has a permanent public key `A = a*G`, ephemeral pubkey `A1 = A +
20+
Assume the server has a permanent public key `A = a*G`, ephemeral pubkey `A1 = A +
2421
h*G` where `h` is a tweak that is known to Bob, and ephemeral pubkey `A2` which
25-
has a secret key known only to Alice and doesn't have to be derived from `A`.
26-
Bob has two pubkeys `B1 = b1*G` and `B2 = b2*G`
27-
and `H` is a cryptographic hash function. Public key aggregation in "2-of-2"
28-
scripts is achieved with [MuSig](https://eprint.iacr.org/2018/068.pdf) and the
29-
signature scheme is adapted from
30-
[Bellare-Neven](https://cseweb.ucsd.edu/~mihir/papers/multisignatures-ccs.pdf).
31-
The partially blind atomic swap protocol where Alice acts as a tumbler works as
32-
follows.
22+
has a secret key known only to the server and doesn't have to be derived from `A`.
23+
Bob has two pubkeys `B1 = b1*G` and `B2 = b2*G` and `H` is a cryptographic hash
24+
function. Public key aggregation in "2-of-2" scripts is achieved with [MuSig](https://eprint.iacr.org/2018/068.pdf)
25+
and the signature scheme is adapted from [Bellare-Neven](https://cseweb.ucsd.edu/~mihir/papers/multisignatures-ccs.pdf).
26+
The partially blind atomic swap protocol with the server and Bob as a user
27+
works as follows.
3328

3429
1. Setup
3530

36-
* Bob anonymously asks Alice to put coins into a key aggregated output O1
37-
with public key `P1 = H(A1,B1,A1)*A1 + H(A1,B1,B1)*B1`.
31+
* Bob anonymously asks the server to put coins into a key aggregated output
32+
O1 with public key `P1 = H(A1,B1,A1)*A1 + H(A1,B1,B1)*B1`.
3833
* Bob puts coins into a key aggregated output O2 with `P2 = H(A2,B2,A2)*A2 +
39-
H(A2,B2,B2)*B2`. As usual, before sending coins Alice and Bob agree on
34+
H(A2,B2,B2)*B2`. As usual, before sending coins server and Bob agree on
4035
timelocked refund transactions in case one party disappears.
4136
2. Blind signing
4237

4338
Bob creates a transaction `tx_B` spending O1. Then Bob creates an auxiliary
4439
point `T = t*G` where `t` is a Schnorr signature over `tx_B` in the
4540
following way:
4641

47-
* Bob asks Alice for nonce `Ra = ka*G`
42+
* Bob asks the server for nonce `Ra = ka*G`
4843
* Bob creates nonce `Rb = kb*G`
4944
* Bob computes
5045
* the combined nonce `R = Ra+Rb`
@@ -55,21 +50,21 @@ follows.
5550
* the challenge `c'` for `A1` as part of `P1`: `c' = c1*H(A1,B1,A1)`
5651
* the blinded challenge `c = c'+beta`
5752
* and the blinded signature of A times `G`: `T = R + c*A`
58-
* Bob sends `c` to Alice
59-
* Alice replies with an adaptor signature over `tx_A` spending `O2` with
60-
auxiliary point `T = t*G, t = ka + c*a` where `a` is the discrete
53+
* Bob sends `c` to the server
54+
* The server replies with an adaptor signature over `tx_A` spending `O2`
55+
with auxiliary point `T = t*G, t = ka + c*a` where `a` is the discrete
6156
logarithm of permanent key `A`.
6257
3. Swap
6358

64-
* Bob gives Alice his contribution to the signature over `tx_A`.
65-
* Alice adds Bob's contribution to her own signature and uses it to take
59+
* Bob gives the server his contribution to the signature over `tx_A`.
60+
* The server adds Bob's contribution to her own signature and uses it to take
6661
her coins out of O2.
6762
* Due to previously receiving an adaptor signature Bob learns `t` from step (2).
6863
4. Unblinding
6964

70-
* Bob unblinds Alice's blind signature `t` as `t' = t + alpha + c'*h` where
71-
c' is the unblinded challenge `h` is the tweak for `A1`. This results in a
72-
regular signature `(R', t')` of Alice (`A1`) over `tx_B`.
65+
* Bob unblinds the server's blind signature `t` as `t' = t + alpha + c'*h` where
66+
`c'` is the unblinded challenge `h` is the tweak for `A1`. This results in a
67+
regular signature `(R', t')` of the server (`A1`) over `tx_B`.
7368
* Bob adds his contribution to `t'` completing `(R', s), s = t' + kb +
7469
c1*H(A1,B1,B1)*b1` which is a valid signature over `tx_B` spending O1:
7570
```
@@ -84,17 +79,17 @@ follows.
8479
+------------+ (R', s) +------------+
8580
| O1 +----------->| ...|
8681
+------------+ +------------+
87-
Alice's setup tx tx_B
82+
the server's setup tx tx_B
8883
8984
+------------+ +------------+
9085
| O2 +----------->| ...|
9186
+------------+ +------------+
9287
Bob's setup tx tx_A
9388
```
9489
95-
As a result, Alice can not link Bob's original coins and his new coins. From
96-
Alice's perspective `tx_B` could have been just as well the result of a swap
97-
with someone else.
90+
As a result, the server can not link Bob's original coins and his new coins.
91+
From the server's perspective `tx_B` could have been just as well the result
92+
of a swap with someone else.
9893
9994
Blind Schnorr signatures suffer from a vulnerability known as "parallel attack"
10095
([Security of Blind Discrete Log Signatures Against Interactive Attacks, C. P.
@@ -109,20 +104,20 @@ challenge.
109104
A simpler scheme that would be broken by Aggregated Signatures
110105
---
111106
Note that Bob can get a signature of A over anything including arbitrary
112-
messages. Therefore, Alice must only use fresh ephemeral keys `A1` when
113-
creating outputs. This complicates the protocol because at the same time Alice
114-
must not be able to determine for which exact input she signs. As a result,
115-
It's Bob's job to apply tweak `h` to convert a signature of `A` to `A1`.
116-
117-
A simpler protocol where Alice uses `A` instead of `A1` is broken by aggregated
118-
signatures because it allows spending multiple inputs with a single signature.
119-
If Bob creates many funding txs with Alice, he can create a tx spending all of
120-
them, and prepares a message for Alice to sign which is her part of the
121-
aggregate signature of all the inputs. Alice just dumbly signs any blinded
122-
message, so can't decide if it's an aggregated sig or not. For example Bob may
123-
send Alice a challenge for an aggregate signature covering output 1 with
124-
pubkeys `L1 = {A, B1}` and output 2 with pubkeys `L2 = {A, B2}` as `c'=H(P1, 0,
125-
R', tx_B)*H(L1,A) + H(P2, 1, R', tx_B)*H(L2,A)`.
107+
messages. Therefore, the server must only use fresh ephemeral keys `A1` when
108+
creating outputs. This complicates the protocol because at the same time the
109+
server must not be able to determine for which exact input she signs. As a
110+
result, It's Bob's job to apply tweak `h` to convert a signature of `A` to `A1`.
111+
112+
A simpler protocol where the server uses `A` instead of `A1` is broken by
113+
aggregated signatures because it allows spending multiple inputs with a single
114+
signature. If Bob creates many funding txs with the server, he can create a
115+
tx spending all of them, and prepares a message for the server to sign which is
116+
her part of the aggregate signature of all the inputs. The server just dumbly
117+
signs any blinded message, so can't decide if it's an aggregated sig or not. For
118+
example Bob may send the server a challenge for an aggregate signature covering
119+
output 1 with pubkeys `L1 = {A, B1}` and output 2 with pubkeys `L2 = {A, B2}` as
120+
`c'=H(P1, 0, R', tx_B)*H(L1,A) + H(P2, 1, R', tx_B)*H(L2,A)`.
126121
127122
Similarly, the [SIGHASH_SINGLE
128123
bug](https://underhandedcrypto.com/2016/08/17/the-2016-backdoored-cryptocurrency-contest-winner/)

0 commit comments

Comments
 (0)