@@ -2,49 +2,45 @@ Partially Blind Atomic Swap Using Adaptor Signatures
2
2
===========================
3
3
4
4
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 Alice as a tumbler service provider engages in
6
+ a partially blind atomic swap with the users Bob and Carol, the tumbler would not
7
+ be able to determine if a swapped output belongs to Bob or Carol (assuming the
8
+ transaction amounts are identical or confidential). This property is very
9
+ similar to [ TumbleBit] ( https://eprint.iacr.org/2016/575.pdf ) but in the form of
10
+ a [ scriptlessscript] ( https://github.com/apoelstra/scriptless-scripts/blob/master/md/atomic-swap.md )
12
11
and therefore purely in the elliptic curve discrete logarithm setting.
13
12
14
13
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 ) ).
14
+ adaptor signature is not chosen uniformly at random by the server. Instead, the user
15
+ computes ` T = t*G ` where ` t ` is a [ blind Schnorr signature] ( https://blog.cryptographyengineering.com/a-note-on-blind-signature-schemes/ )
16
+ of the tumbler over a transaction spending the funding transaction without knowing
17
+ ` t ` (similar to [ Discreet Log Contracts] ( https://adiabat.github.io/dlc.pdf ) ).
20
18
21
19
Protocol description
22
20
---
23
- Assume Alice has a permanent public key ` A = a*G ` , ephemeral pubkey `A1 = A +
21
+ Assume the tumbler has a permanent public key ` A = a*G ` , ephemeral pubkey `A1 = A +
24
22
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.
23
+ has a secret key known only to the tumbler and doesn't have to be derived from ` A ` .
24
+ Bob has two pubkeys ` B1 = b1*G ` and ` B2 = b2*G ` and ` H ` is a cryptographic hash
25
+ function. Public key aggregation in "2-of-2" scripts is achieved with [ MuSig] ( https://eprint.iacr.org/2018/068.pdf )
26
+ and the signature scheme is adapted from [ Bellare-Neven] ( https://cseweb.ucsd.edu/~mihir/papers/multisignatures-ccs.pdf ) .
27
+ The partially blind atomic swap protocol with Alice as tumbler and Bob as a user
28
+ works as follows.
33
29
34
30
1 . Setup
35
31
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 ` .
32
+ * Bob anonymously asks the tumbler to put coins into a key aggregated output
33
+ O1 with public key ` P1 = H(A1,B1,A1)*A1 + H(A1,B1,B1)*B1 ` .
38
34
* 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
35
+ H(A2,B2,B2)* B2`. As usual, before sending coins tumbler and Bob agree on
40
36
timelocked refund transactions in case one party disappears.
41
37
2 . Blind signing
42
38
43
39
Bob creates a transaction ` tx_B ` spending O1. Then Bob creates an auxiliary
44
40
point ` T = t*G ` where ` t ` is a Schnorr signature over ` tx_B ` in the
45
41
following way:
46
42
47
- * Bob asks Alice for nonce ` Ra = ka*G `
43
+ * Bob asks the tumbler for nonce ` Ra = ka*G `
48
44
* Bob creates nonce ` Rb = kb*G `
49
45
* Bob computes
50
46
* the combined nonce ` R = Ra+Rb `
@@ -55,21 +51,21 @@ follows.
55
51
* the challenge ` c' ` for ` A1 ` as part of ` P1 ` : ` c' = c1*H(A1,B1,A1) `
56
52
* the blinded challenge ` c = c'+beta `
57
53
* 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
54
+ * Bob sends ` c ` to the tumbler
55
+ * The tumbler replies with an adaptor signature over ` tx_A ` spending ` O2 `
56
+ with auxiliary point ` T = t*G, t = ka + c*a ` where ` a ` is the discrete
61
57
logarithm of permanent key ` A ` .
62
58
3 . Swap
63
59
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
60
+ * Bob gives the tumbler his contribution to the signature over ` tx_A ` .
61
+ * The tumbler adds Bob's contribution to her own signature and uses it to take
66
62
her coins out of O2.
67
63
* Due to previously receiving an adaptor signature Bob learns ` t ` from step (2).
68
64
4 . Unblinding
69
65
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 ` .
66
+ * Bob unblinds the tumbler 's blind signature ` t ` as ` t' = t + alpha + c'*h ` where
67
+ ` c' ` is the unblinded challenge ` h ` is the tweak for ` A1 ` . This results in a
68
+ regular signature ` (R', t') ` of the tumbler (` A1 ` ) over ` tx_B ` .
73
69
* Bob adds his contribution to ` t' ` completing `(R', s), s = t' + kb +
74
70
c1* H(A1,B1,B1)* b1` which is a valid signature over ` tx_B` spending O1:
75
71
```
@@ -84,17 +80,17 @@ follows.
84
80
+------------+ (R', s) +------------+
85
81
| O1 +----------->| ...|
86
82
+------------+ +------------+
87
- Alice 's setup tx tx_B
83
+ the tumbler 's setup tx tx_B
88
84
89
85
+------------+ +------------+
90
86
| O2 +----------->| ...|
91
87
+------------+ +------------+
92
88
Bob's setup tx tx_A
93
89
```
94
90
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.
91
+ As a result, the tumbler can not link Bob's original coins and his new coins.
92
+ From the tumbler 's perspective `tx_B` could have been just as well the result
93
+ of a swap with someone else.
98
94
99
95
Blind Schnorr signatures suffer from a vulnerability known as "parallel attack"
100
96
([Security of Blind Discrete Log Signatures Against Interactive Attacks, C. P.
@@ -109,20 +105,20 @@ challenge.
109
105
A simpler scheme that would be broken by Aggregated Signatures
110
106
---
111
107
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)`.
108
+ messages. Therefore, the tumbler must only use fresh ephemeral keys `A1` when
109
+ creating outputs. This complicates the protocol because at the same time the
110
+ tumbler must not be able to determine for which exact input she signs. As a
111
+ result, It's Bob's job to apply tweak `h` to convert a signature of `A` to `A1`.
112
+
113
+ A simpler protocol where the tumbler uses `A` instead of `A1` is broken by
114
+ aggregated signatures because it allows spending multiple inputs with a single
115
+ signature. If Bob creates many funding txs with the tumbler , he can create a
116
+ tx spending all of them, and prepares a message for the tumbler to sign which is
117
+ her part of the aggregate signature of all the inputs. The tumbler just dumbly
118
+ signs any blinded message, so can't decide if it's an aggregated sig or not. For
119
+ example Bob may send the tumbler a challenge for an aggregate signature covering
120
+ output 1 with pubkeys `L1 = {A, B1}` and output 2 with pubkeys `L2 = {A, B2}` as
121
+ `c'=H(P1, 0, R', tx_B)*H(L1,A) + H(P2, 1, R', tx_B)*H(L2,A)`.
126
122
127
123
Similarly, the [SIGHASH_SINGLE
128
124
bug](https://underhandedcrypto.com/2016/08/17/the-2016-backdoored-cryptocurrency-contest-winner/)
0 commit comments