mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
65 lines
1.5 KiB
Plaintext
65 lines
1.5 KiB
Plaintext
@startuml
|
|
database Bitcoin
|
|
actor Bob as "Bob (User)"
|
|
Actor Alice as "Alice (Service Provider)"
|
|
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: Exact XMR amount
|
|
end
|
|
end
|
|
|
|
group Execution Setup
|
|
group Phase A [Messages can be exchanged in any order]
|
|
Bob -> Alice: bob::Message0
|
|
note left: Pubkeys\ndleq proof s_b\nxmr viewkey v_b\nbtc refund addr
|
|
|
|
Alice -> Bob: alice::Message0
|
|
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: Message1
|
|
note left: unsigned btc lock tx
|
|
|
|
Alice -> Bob: Message2
|
|
note right: btc cancel tx sig\nbtc refund tx enc sig S_b
|
|
|
|
Bob -> Alice: Message3
|
|
note left: btc punish tx sig\nbtc cancel tx sig
|
|
|
|
end
|
|
end
|
|
|
|
group Execution
|
|
Bob ->> Bitcoin: Lock
|
|
|
|
Alice ->> Monero: Lock
|
|
|
|
Alice -> Bob: TransferProof
|
|
note right: xmr lock tx transfer proof\nThis can be removed if Bob watches the blockchain.
|
|
|
|
Bob -> Alice: EncryptedSignature
|
|
note left: redeem tx enc sig S_a
|
|
|
|
Alice ->> Bitcoin: Redeem
|
|
|
|
Bitcoin ->> Bob: Signature
|
|
|
|
Bob -> Bob: Extract s_a
|
|
|
|
Bob ->> Monero: Redeem
|
|
end
|
|
|
|
@enduml
|