Skip to content

Commit 8dc3f3d

Browse files
committed
Updated README
1 parent fb8bbde commit 8dc3f3d

File tree

4 files changed

+35
-38
lines changed

4 files changed

+35
-38
lines changed

README.md

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Taprootized Atomic Swaps
22

3-
Taprootized Atomic Swaps (TAS) is an extension for Atomic Swaps that presumes the untraceability of
4-
transactions related to a particular swap. Build top on Schnorr signatures, Taproot technology, and
5-
zero-knowledge proofs TAS hide swap transactions under regular payments.
3+
Taprootized Atomic Swaps (TAS) is an extension for Atomic Swaps that presumes the untraceability of
4+
transactions related to a particular swap. Based on Schnorr signatures, Taproot technology, and
5+
zero-knowledge proofs, the taprootized atomic swaps hide swap transactions under regular payments.
66

77
## Intro
88
Atomic swap is an incredible approach to cross-chain exchanges without mediators. However, one of
9-
the disadvantages of its implementation in the classical form is the “digital trail” - any party
10-
can make a matching between transactions in the blockchains in which the exchange took place and
9+
the disadvantages of its implementation in the classical form is the “digital trail” any party
10+
can make a matching between transactions in the blockchains in which the exchange took place and
1111
find out both the participants in the exchange and the proportion in which assets were exchanged.
1212

1313
<div align="center">
@@ -20,10 +20,11 @@ parties and a “mathematical contract” between them directly. That is, an ide
2020
1) Only counterparties participate in the exchange (works by default)
2121
2) Only counterparties know about the fact of the exchange (it would be nice to ensure)
2222

23-
To an external auditor, transactions to initiate and execute atomic swaps will be indistinguishable
24-
from regular Bitcoin payments. In the other accounting system involved in the transfer, more
25-
information is disclosed (the fact of exchange can be traced). Still, it is impossible to link this
26-
to the corresponding Bitcoin transactions (without additional context from the involved parties).
23+
This paper will provide a concept of taprootized atomic swaps that allow hiding the swap's very fact. To an
24+
external auditor, transactions to initiate and execute atomic swaps will be indistinguishable from regular Bitcoin
25+
payments. In the other accounting system involved in the transfer, more information is disclosed (the fact of
26+
exchange can be traced). Still, it is impossible to link this to the corresponding Bitcoin transactions (without
27+
additional context from the involved parties).
2728

2829
<div align="center">
2930
<img src="assets/sequence-diagram.png"/>
@@ -32,36 +33,32 @@ to the corresponding Bitcoin transactions (without additional context from the i
3233
### The protocol includes the following steps:
3334
1. Alice (`skA`, `PKA`) and Bob (`skB`, `PKB`) have their keypairs and know each other's public keys.
3435
2. Alice generates a random `k` and calculates the public value `K = k * G`
35-
3. Alice calculates an escrow public key as `PKEsc = K + PKB`
36-
1. The signature can be generated only with the knowledge of `k` and `skB`
37-
4. Alice calculates the `h` as a hash value of `k` (zk-friendly hash function is recommended to use)
38-
5. Alice forms the funding transactions with the following conditions of how it can be spent:
39-
1. Signature of `skEsc`: Bob, with knowledge of `k` and skB can spend the output
40-
2. Signature of `skA` + Locktime: Alice, with knowledge of `skA` can spend the output, but only
41-
after some point in time t1
42-
6. Alice sends the transaction to the Bitcoin network
43-
7. Alice generates the zero-knowledge proof that includes:
44-
1. The proof of knowledge of `k` that satisfes `k * G == K`
45-
2. The proof of knowledge of `k` that satisfes `zkHash(k) == h`
46-
8. Alice provides the set of data to Bob:
36+
3. Alice forms the alternative spending path `Script = sig(skA) + Locktime` in the form of Bitcoin Script
37+
4. Alice calculates an escrow public key as `PKEsc = K + PKB + hash((K + PKB) || Script) * G` (here,
38+
escrow is just a public key, formed using Taproot technology
39+
1. The signature `sig(skEsc)`, verified by thr `PKEsc`, can be generated only with the knowledge of `k`, `skB` and `Script`
40+
5. Alice calculates the `h` as a hash value of `k` (zk-friendly hash function is recommended to use)
41+
6. Alice forms the funding transactions with the following conditions of how it can be spent:
42+
1. Signature of `skEsc`: Bob, with knowledge of `k` and `skB` can spend the output
43+
2. Signature of `skA` + Locktime: Alice, with knowledge of `skA` can spend the output, but only after some point in time `t1` (it's the `Script` itself)
44+
7. Alice sends the transaction to the Bitcoin network
45+
8. Alice generates the zero-knowledge `proof` that includes:
46+
1. The proof of knowledge of `k` that satisfies `k * G == K`
47+
2. The proof of knowledge of `k` that satisfies `zkHash(k) == h`
48+
9. Alice provides the set of data to Bob:
4749
1. `h`
4850
2. `K`
49-
3. `PKEsc`
51+
3. `Script`
5052
4. `proof`
51-
9. Bob performs the following verifications:
52-
1. Verify that `PKEsc == K + PKB`, it means that the valid `PK` of Bob was added to escrow PK
53-
2. Verifes that Alice knows `k` that satisfies `k * G == K` and `zkHash(k) == h`, it means that Bob
54-
can access the output `PKEsc` if he receives `k`
55-
10. If verifications are passed, Bob forms the transaction that locks his funds on the following
56-
conditions:
57-
1. Publishing of `k` and the signature of `skA`: only Alice can spend it if she reveals `k`
58-
2. Signature of `skB` + Locktime: Bob, with knowledge of `skB`, can spend the output, but only after
59-
some point in time t2
60-
11. Bob sends the transaction to the Ethereum network (or other)
61-
12. Alice sees the locking conditions defined by Bob and publishes the `k` together with the signature
62-
generated by her `skA`. As a result - Alice spent funds locked by Bob.
53+
10. Bob calculates `PKEsc` as `K + PKB + hash((K + PKB) || Script) * G` and finds the transaction locked BTC (verifies it exists). Then Bob performs the following verification:
54+
1. Verifies that Alice knows `k` that satisfies `k*G == K` and `zkHash(k) == h`, it means that Bob can access the output `PKEsc` if he receives `k`
55+
2. Verifies that the `Script` is correct and includes only the required alternative path.
56+
11. If verifications are passed, Bob forms the transaction that locks his funds on the following conditions:
57+
1. Publishing of `k` and the signature of `skA`: only Alice can spend it if she reveals `k` (hash preimage)
58+
2. Signature of `skB` + Locktime: Bob, with knowledge of `skB`, can spend the output, but only after some point in time `t2`
59+
12. Bob sends the transaction to the Ethereum network (or any other that supports `zkHash()`)
60+
13. Alice sees the locking conditions defined by Bob and publishes the `k` together with the signature generated by her `skA`. As a result - Alice spent funds locked by Bob.
6361
1. If Alice doesn’t publish the relevant `k`, Bob can return funds after locktime is reached
64-
13. If Alice publishes a transaction with `k`, Bob can recognize it and extract the kvalue
65-
14. Bob calculate the needed `skEsc` as `skEsc = k + skB`
66-
15. Bob sends the transaction with the signature generated by the `skEsc` and spends funds locked by
67-
Alice.
62+
14. If Alice publishes a transaction with `k`, Bob can recognize it and extract the `k` value
63+
15. Bob calculate the needed `skEsc` as `skEsc = k + skB + hash((K + PKB) || Script)`
64+
16. Bob sends the transaction with the signature generated by the `skEsc` and spends funds locked by Alice.

Taprootized Atomic Swaps.pdf

-134 KB
Binary file not shown.

assets/atomic-swap.png

-99.5 KB
Loading

assets/sequence-diagram.png

-134 KB
Loading

0 commit comments

Comments
 (0)