2021-01-13 11:12:57 +11:00
|
|
|
@startuml
|
|
|
|
database Bitcoin
|
2021-01-14 11:48:49 +11:00
|
|
|
actor Bob as "Bob (User)"
|
|
|
|
Actor Alice as "Alice (Service Provider)"
|
2021-01-13 11:12:57 +11:00
|
|
|
database Monero
|
|
|
|
|
2021-01-13 11:47:02 +11:00
|
|
|
group Negotiation
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-01-13 11:47:02 +11:00
|
|
|
Bob --> Alice: Establish connection
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-01-13 11:47:02 +11:00
|
|
|
group Request Response Channel
|
2021-02-12 17:05:06 +11:00
|
|
|
Bob -> Alice: Quote request
|
2021-01-13 11:47:02 +11:00
|
|
|
note left: Btc Amount\naddress hints
|
|
|
|
note right: Alice stores peer id & address hints\nto contact Bob
|
|
|
|
|
2021-02-12 17:05:06 +11:00
|
|
|
Alice --> Bob: Quote response
|
2021-01-14 10:46:50 +11:00
|
|
|
note right: Exact XMR amount
|
2021-01-13 11:47:02 +11:00
|
|
|
end
|
2021-01-13 11:12:57 +11:00
|
|
|
end
|
|
|
|
|
2021-01-13 11:47:02 +11:00
|
|
|
group Execution Setup
|
2021-01-14 10:27:33 +11:00
|
|
|
group Phase A [Messages can be exchanged in any order]
|
2021-02-03 16:45:43 +11:00
|
|
|
Bob -> Alice: Message0
|
2021-01-13 11:47:02 +11:00
|
|
|
note left: Pubkeys\ndleq proof s_b\nxmr viewkey v_b\nbtc refund addr
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-02-03 16:45:43 +11:00
|
|
|
Alice -> Bob: Message1
|
2021-01-13 11:47:02 +11:00
|
|
|
note right: Pubkeys\ndleq proof s_a\nxmr view key v_a\nbtc redeem addr\nbtc punish addr
|
|
|
|
end
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-01-14 10:27:33 +11:00
|
|
|
group Phase B [Messages must be exchanged in the given order]
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-02-03 16:45:43 +11:00
|
|
|
Bob -> Alice: Message2
|
2021-01-13 11:47:02 +11:00
|
|
|
note left: unsigned btc lock tx
|
|
|
|
|
2021-02-03 16:45:43 +11:00
|
|
|
Alice -> Bob: Message3
|
2021-01-13 11:47:02 +11:00
|
|
|
note right: btc cancel tx sig\nbtc refund tx enc sig S_b
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-02-03 16:45:43 +11:00
|
|
|
Bob -> Alice: Message4
|
2021-01-13 11:47:02 +11:00
|
|
|
note left: btc punish tx sig\nbtc cancel tx sig
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-01-13 11:47:02 +11:00
|
|
|
end
|
|
|
|
end
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-01-13 11:47:02 +11:00
|
|
|
group Execution
|
2021-01-13 11:12:57 +11:00
|
|
|
Bob ->> Bitcoin: Lock
|
|
|
|
|
|
|
|
Alice ->> Monero: Lock
|
|
|
|
|
2021-01-27 14:14:20 +11:00
|
|
|
Alice -> Bob: TransferProof
|
2021-01-14 10:45:29 +11:00
|
|
|
note right: xmr lock tx transfer proof\nThis can be removed if Bob watches the blockchain.
|
2021-01-13 11:12:57 +11:00
|
|
|
|
2021-01-27 14:14:20 +11:00
|
|
|
Bob -> Alice: EncryptedSignature
|
2021-01-13 11:36:02 +11:00
|
|
|
note left: redeem tx enc sig S_a
|
2021-01-13 11:12:57 +11:00
|
|
|
|
|
|
|
Alice ->> Bitcoin: Redeem
|
|
|
|
|
|
|
|
Bitcoin ->> Bob: Signature
|
|
|
|
|
2021-01-13 11:36:02 +11:00
|
|
|
Bob -> Bob: Extract s_a
|
2021-01-13 11:12:57 +11:00
|
|
|
|
|
|
|
Bob ->> Monero: Redeem
|
2021-01-13 11:47:02 +11:00
|
|
|
end
|
2021-01-13 11:12:57 +11:00
|
|
|
|
|
|
|
@enduml
|