Host-customized fork of https://github.com/tecnovert/basicswap/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
8.1 KiB
86 lines
8.1 KiB
1 year ago
|
# Reverse Adaptor Signature Swap protocol
|
||
|
|
||
3 years ago
|
|
||
|
|
||
|
## WIP
|
||
|
|
||
1 year ago
|
Offerer - Sends the offer
|
||
|
Bidder - Sends the bid
|
||
|
Leader - Sends the first lock tx (ITX)
|
||
|
Follower - Sends the second lock tx (PTX)
|
||
3 years ago
|
|
||
|
|
||
1 year ago
|
The ITX must be sent from the script chain (coin A).
|
||
|
The side sending the ITX can be switched and the system can abstract to
|
||
|
users that the protocol is running in the opposite direction.
|
||
3 years ago
|
|
||
|
|
||
|
NOSCRIPT_COIN lock tx:
|
||
1 year ago
|
- Sent second.
|
||
|
- Is sent to a combined key using a private key from each participant.
|
||
3 years ago
|
|
||
|
|
||
|
SCRIPT_COIN lock tx:
|
||
1 year ago
|
- Sent first.
|
||
3 years ago
|
- Requires two signatures to spend from.
|
||
|
- Refund to sender txn is presigned for and can only be mined in the future.
|
||
1 year ago
|
- Spending the refund tx reveals the leader's NOSCRIPT_COIN split private key.
|
||
3 years ago
|
- Sender withholds signature until NOSCRIPT_COIN lock tx is confirmed.
|
||
1 year ago
|
- spending the spend txn reveals the follower's NOSCRIPT_COIN split private key.
|
||
3 years ago
|
|
||
|
|
||
|
```
|
||
1 year ago
|
Offerer (Follower) | Bidder (Leader) |
|
||
3 years ago
|
------------------------------------------------------------------------|-------------------------------------------------------------------------------|
|
||
|
o1. Sends offer | |
|
||
1 year ago
|
- x NOSCRIPT_COIN for y SCRIPT_COIN | |
|
||
|
- Sends smsg OfferMessage | |
|
||
3 years ago
|
| b1. Receives offer |
|
||
1 year ago
|
| - Validates offer |
|
||
|
| b2. Sends bid intent message |
|
||
|
| - Sends smsg ADSBidIntentMessage |
|
||
|
| |
|
||
|
o2. Receives bid intent message | |
|
||
|
- Validates bid intent | |
|
||
|
o3. Accepts bid intent message | |
|
||
|
- Sends smsgs ADSBidIntentAcceptMessage + 2x XmrSplitMessage | |
|
||
3 years ago
|
| |
|
||
1 year ago
|
| b3. Receives bid intent message |
|
||
|
| - Sends smsgs XmrBidAcceptMessage + 2x XmrSplitMessage |
|
||
3 years ago
|
| |
|
||
1 year ago
|
o4. Receives bid accept | |
|
||
|
- Validates | |
|
||
|
- Signs for lock tx refund | |
|
||
|
- Sends smsg XmrBidLockTxSigsMessage | |
|
||
3 years ago
|
| |
|
||
1 year ago
|
| b4. Receives bidder lock refund tx signatures |
|
||
|
| - Sends smsg XmrBidLockSpendTxMessage |
|
||
|
| - Full SCRIPT_COIN lock tx |
|
||
|
| - Signature to prove leader can sign for split key |
|
||
|
| - Submits SCRIPT_COIN lock tx to network |
|
||
3 years ago
|
| |
|
||
1 year ago
|
o5. Receives XmrBidLockSpendTxMessage | |
|
||
|
- Validates SCRIPT_COIN lock tx and signature | |
|
||
|
- Waits for SCRIPT_COIN lock tx to confirm in chain | |
|
||
|
o6. Sends NOSCRIPT_COIN lock tx | |
|
||
3 years ago
|
| |
|
||
1 year ago
|
| b5. Waits for NOSCRIPT_COIN lock tx to confirm in chain |
|
||
|
| b6. Sends SCRIPT_COIN lock release. |
|
||
|
| - Sends smsg XmrBidLockReleaseMessage |
|
||
|
| - Includes OtVES ciphertext signature for the SCRIPT_COIN lock |
|
||
|
| spend tx. |
|
||
3 years ago
|
| |
|
||
1 year ago
|
o7. Receives leader OtVES for SCRIPT_COIN lock spend tx. | |
|
||
|
- Submits SCRIPT_COIN lock spend tx to network. | |
|
||
3 years ago
|
| |
|
||
1 year ago
|
| b7. Waits for SCRIPT_COIN lock spend tx. |
|
||
|
| - Extracts the NOSCRIPT_COIN follower's key using the signature |
|
||
|
| b8. Combines the keys to spend from the NOSCRIPT_COIN lock tx |
|
||
|
| - Submits NOSCRIPT_COIN lock spend tx to network |
|
||
3 years ago
|
```
|
||
|
|
||
1 year ago
|
Per swap (including the offer smsg):
|
||
|
Offerer sent 5 smsgs (2 extra from split messages)
|
||
|
Bidder sent 6 smsgs (2 extra from split messages)
|
||
3 years ago
|
|