mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
65 lines
1.4 KiB
Plaintext
65 lines
1.4 KiB
Plaintext
@startuml
|
|
database Bitcoin
|
|
actor Bob
|
|
Actor Alice
|
|
database Monero
|
|
|
|
group Negotiation
|
|
|
|
Bob --> Alice: Establish connection
|
|
|
|
group Request Response Channel
|
|
Bob -> Alice: Swap request
|
|
note left: Btc Amount\naddress hints
|
|
note right: Alice stores peer id & address hints\nto contact Bob
|
|
|
|
Alice --> Bob: Swap response
|
|
note right: ACK or NACK\n Exact XMR amount
|
|
end
|
|
end
|
|
|
|
group Execution Setup
|
|
group Phase A [Messages can be exchanged in any order]
|
|
Bob -> Alice: Message0
|
|
note left: Pubkeys\ndleq proof s_b\nxmr viewkey v_b\nbtc refund addr
|
|
|
|
Alice -> Bob: Message1
|
|
note right: Pubkeys\ndleq proof s_a\nxmr view key v_a\nbtc redeem addr\nbtc punish addr
|
|
end
|
|
|
|
group Phase B [Messages must be exchanged in the given order]
|
|
|
|
Bob -> Alice: Message2
|
|
note left: unsigned btc lock tx
|
|
|
|
Alice -> Bob: Message3
|
|
note right: btc cancel tx sig\nbtc refund tx enc sig S_b
|
|
|
|
Bob -> Alice: Message4
|
|
note left: btc punish tx sig\nbtc cancel tx sig
|
|
|
|
end
|
|
end
|
|
|
|
group Execution
|
|
Bob ->> Bitcoin: Lock
|
|
|
|
Alice ->> Monero: Lock
|
|
|
|
Alice -> Bob: Message5
|
|
note right: xmr lock tx transfer proof\nThis can be removed if Bob watches the blockchain.
|
|
|
|
Bob -> Alice: Message6
|
|
note left: redeem tx enc sig S_a
|
|
|
|
Alice ->> Bitcoin: Redeem
|
|
|
|
Bitcoin ->> Bob: Signature
|
|
|
|
Bob -> Bob: Extract s_a
|
|
|
|
Bob ->> Monero: Redeem
|
|
end
|
|
|
|
@enduml
|