@@ -168,7 +168,7 @@ Alice creates a valid signature commitment (`s`) for the transaction paying Bob
168
168
(` P = pG ` ). She also uses a private random nonce (` r ` ), a hidden value
169
169
(` t ` ), and the elliptic curve points for them (` R = rG, T = tG ` ):
170
170
171
- s = r + t + H(P || R + T || m) * p
171
+ s = r + t + H(R + T || P || m) * p
172
172
173
173
She subtracts ` t ` from the signature commitment to produce a signature adaptor:
174
174
@@ -181,20 +181,20 @@ data:
181
181
182
182
Bob can verify the adaptor:
183
183
184
- s' * G ?= R + H(P || R+T || m) * P
184
+ s' * G ?= R + H(R + T || P || m) * P
185
185
186
186
But the adaptor is not a valid BIP340 signature. For a valid signature, BIP340 expects
187
187
` x ` and ` Y ` , using them with the expression:
188
188
189
- x * G ?= Y + H(P || Y || m) * P
189
+ x * G ?= Y + H(Y || P || m) * P
190
190
191
191
However,
192
192
193
193
- If Bob sets ` Y = R ` so that it matches the ` s' ` he received in the
194
- adaptor, then BIP340 is going to fail on ` H(P || R || m) `
195
- since Alice computed her hash with ` H(P || R + T || m) ` .
194
+ adaptor, then BIP340 is going to fail on ` H(R || P || m) `
195
+ since Alice computed her hash with ` H(R + T || P || m) ` .
196
196
197
- - If Bob sets ` Y = R + T ` so that it matches ` H(P || R + T || m) ` , BIP340
197
+ - If Bob sets ` Y = R + T ` so that it matches ` H(R + T || P || m) ` , BIP340
198
198
is going to fail on the initial ` Y ` since Bob is providing ` R + T `
199
199
rather than the needed ` R ` .
200
200
@@ -204,7 +204,7 @@ signature Alice created but Bob doesn't commit to `t` here, since Bob
204
204
doesn't know that value. All variables here except ` T ` are different
205
205
for Bob than they were for Alice:
206
206
207
- s = r + H(P || R + T || m) * p
207
+ s = r + H(R + T || P || m) * p
208
208
209
209
Unlike Alice, Bob doesn't need to tweak his signature. Bob's signature commitment ` s ` is
210
210
not a part of a valid signature because it commits to ` r ` and ` R + T ` , which
@@ -221,7 +221,7 @@ adaptor so we use its full form. Alice can produce a
221
221
signature from that adaptor using the hidden ` t ` value that
222
222
only she knows so far:
223
223
224
- (s + t) * G ?= R + T + H(P || R + T || m) * P
224
+ (s + t) * G ?= R + T + H(R + T || P || m) * P
225
225
226
226
Alice uses the signature to broadcast Bob's transaction that
227
227
pays her. When Bob sees ` (s + t) ` onchain, he can learn the value of ` t ` :
@@ -231,7 +231,7 @@ pays her. When Bob sees `(s + t)` onchain, he can learn the value of `t`:
231
231
He can then use ` t ` to solve the adaptor Alice gave him
232
232
earlier:
233
233
234
- (s' + t) * G ?= R + T + H(P || R + T || m) * P
234
+ (s' + t) * G ?= R + T + H(R + T || P || m) * P
235
235
236
236
Bob uses that signature to broadcast the transaction Alice
237
237
originally gave him.
0 commit comments