|
|
@ -4,52 +4,53 @@ actor Bob
|
|
|
|
Actor Alice
|
|
|
|
Actor Alice
|
|
|
|
database Monero
|
|
|
|
database Monero
|
|
|
|
|
|
|
|
|
|
|
|
Bob --> Alice: Establish connection
|
|
|
|
group Negotiation
|
|
|
|
|
|
|
|
|
|
|
|
group Request Response Channel
|
|
|
|
Bob --> Alice: Establish connection
|
|
|
|
Bob -> Alice: Request Amounts
|
|
|
|
|
|
|
|
note left: Btc Amount
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Alice --> Bob: Send Amounts
|
|
|
|
group Request Response Channel
|
|
|
|
note right: Btc & Xmr Amounts
|
|
|
|
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
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
group Request Response Channel
|
|
|
|
group Execution Setup
|
|
|
|
Bob -> Alice: bob::Message0
|
|
|
|
group Phase A [Messages can be exchanged in any order]
|
|
|
|
note left: Pubkeys\ndleq proof s_b\nxmr viewkey v_b\nbtc refund addr
|
|
|
|
Bob -> Alice: Message0
|
|
|
|
|
|
|
|
note left: Pubkeys\ndleq proof s_b\nxmr viewkey v_b\nbtc refund addr
|
|
|
|
|
|
|
|
|
|
|
|
Alice --> Bob: alice::Message0
|
|
|
|
Alice -> Bob: Message1
|
|
|
|
note right: Pubkeys\ndleq proof s_a\nxmr view key v_a\nbtc redeem addr\nbtc punish addr
|
|
|
|
note right: Pubkeys\ndleq proof s_a\nxmr view key v_a\nbtc redeem addr\nbtc punish addr
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
group Request Response Channel
|
|
|
|
group Phase B [Messages must be exchanged in the given order]
|
|
|
|
Bob -> Alice: bob::Message1
|
|
|
|
|
|
|
|
note left: btc lock tx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Alice --> Bob: alice::Message1
|
|
|
|
Bob -> Alice: Message2
|
|
|
|
note right: cancel tx sig\nrefund tx enc sig S_b
|
|
|
|
note left: unsigned btc lock tx
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
Alice -> Bob: Message3
|
|
|
|
|
|
|
|
note right: btc cancel tx sig\nbtc refund tx enc sig S_b
|
|
|
|
|
|
|
|
|
|
|
|
group Request Response Channel
|
|
|
|
Bob -> Alice: Message4
|
|
|
|
Bob -> Alice: bob::Message2
|
|
|
|
note left: btc punish tx sig\nbtc cancel tx sig
|
|
|
|
note left: punish tx sig\ncancel tx sig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
== Negotiated ==
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group Execution
|
|
|
|
Bob ->> Bitcoin: Lock
|
|
|
|
Bob ->> Bitcoin: Lock
|
|
|
|
|
|
|
|
|
|
|
|
Alice ->> Monero: Lock
|
|
|
|
Alice ->> Monero: Lock
|
|
|
|
|
|
|
|
|
|
|
|
Alice --> Bob: alice::Message2
|
|
|
|
Alice -> Bob: Message5
|
|
|
|
note right: xmr lock tx transfer proof
|
|
|
|
note right: xmr lock tx transfer proof\nThis can be removed if Bob watches the blockchain.
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
group Request Response Channel
|
|
|
|
Bob -> Alice: Message6
|
|
|
|
Bob -> Alice: bob::Message3
|
|
|
|
|
|
|
|
note left: redeem tx enc sig S_a
|
|
|
|
note left: redeem tx enc sig S_a
|
|
|
|
Alice --> Bob: alice::Message3
|
|
|
|
|
|
|
|
note right: Empty
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Alice ->> Bitcoin: Redeem
|
|
|
|
Alice ->> Bitcoin: Redeem
|
|
|
|
|
|
|
|
|
|
|
@ -58,5 +59,6 @@ end
|
|
|
|
Bob -> Bob: Extract s_a
|
|
|
|
Bob -> Bob: Extract s_a
|
|
|
|
|
|
|
|
|
|
|
|
Bob ->> Monero: Redeem
|
|
|
|
Bob ->> Monero: Redeem
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@enduml
|
|
|
|
@enduml
|
|
|
|