Skip to content

Commit 4c3a00d

Browse files
committed
documentation of the blinded signature use in SwapTx and possible attack
1 parent 6642ca0 commit 4c3a00d

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

concept/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
- [update.md](update.md)
1111
- [ProtocolUpdate2.md](ProtocolUpdate2.md)
12+
- [use of blinded signature in SwapTx](blindedsig/blindedsig-swaptx.md)
1213

1314
## Different aspects in detail
1415

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# blinded signature and taproot signing
2+
3+
## motivation
4+
5+
The `SwapTx` will in most trades not be broadcasted to the blockchain. Therefore
6+
Alice (the Seller, which creates the `SwapTx`) may not want the buyer to learn
7+
the address used in the `SwapTx`. Since Bob (the buyer) needs to sign
8+
the `SwapTx` this can only be done by letting him
9+
blindly sign the transaction.
10+
11+
## basics of signing with key spends
12+
13+
When signing with the internal key in taproot transaction where there are
14+
taproot script,
15+
but we want to spend with the single internal key. For that we need to compute
16+
the signing key $q$
17+
which actually does the signature taking into account the merkle
18+
root of the scripts.
19+
20+
$$q = p + H_{TapTweak}( P ~||~ m)$$
21+
22+
$$\begin{aligned}
23+
\text{where}~~~~~~~~~~& \\
24+
p &~~~~\text{is the internal key} \hspace{1000pt}\\
25+
P = p \cdot G &~~~\text{ is the internal public key} \\
26+
q &~~~~\text{is the tweaked private key, the key for the signature.}\\
27+
m &~~~~\text{is the merkle root of all scripts (if there are any)}\\
28+
\end{aligned}
29+
$$
30+
31+
This effectively means that the signing key is dependent on the internal key and
32+
the output scripts.
33+
34+
The $sighash$ is actually calculated from the transaction data (and other stuff) and is used
35+
as input for the schnorr signature.
36+
37+
## blinded signature
38+
39+
Bob needs to make the signature for the `SwapTx`. Alice could send the
40+
receiver address for the `SwapTx` and Bob could construct the `SwapTx`, then the
41+
$sighash$ and then sign with the signing key $q$. But Alice doesn't want him to
42+
learn the address, so she will only send the $sighash$ to Bob.
43+
44+
## possible attack
45+
46+
Since Bob is not knowing what he signs, Alice could let him sign any transaction.
47+
The transaction is signed with the signing key $q$ by Bob and therefore
48+
is limited only by 2 conditions:
49+
50+
- the internal Key (which $q'$)
51+
- the outputs scripts
52+
53+
The `DepositTx` and The `WarningTx` both have an output with $Q'$ as internal pubkey.
54+
So Alice could use the blinded signature for the `WarningTx` instead of the ``DepositTx``.
55+
The only thing preventing her to do so is if the scripts of `DepositTx Output 1`
56+
and `WarningTx Output 0` and actually different.
57+

0 commit comments

Comments
 (0)