Remove Req-Res and update for single market maker use case

- Bob initiate swap with BTC Amount
- Alice acks with approx. xmr amount
- Rework terminology, make a difference between negotiations and
execution setup
- Remove request response channels in favor of one shots
- Give exact amount to Bob once assets are locked
This commit is contained in:
Franck Royer 2021-01-13 11:47:02 +11:00
parent 1e08a17bd9
commit c55f3e3403
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4

View File

@ -4,52 +4,53 @@ actor Bob
Actor Alice
database Monero
group Negotiation
Bob --> Alice: Establish connection
group Request Response Channel
Bob -> Alice: Request Amounts
note left: Btc Amount
Bob -> Alice: Swap request
note left: Btc Amount\naddress hints
note right: Alice stores peer id & address hints\nto contact Bob
Alice --> Bob: Send Amounts
note right: Btc & Xmr Amounts
Alice --> Bob: Swap response
note right: ACK or NACK\n Approx. XMR amount
end
end
group Request Response Channel
group Execution Setup
group Phase 0 [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
Alice -> Bob: alice::Message0
note right: Pubkeys\ndleq proof s_a\nxmr view key v_a\nbtc redeem addr\nbtc punish addr
end
group Request Response Channel
Bob -> Alice: bob::Message1
note left: btc lock tx
group Phase 1 [Messages must be exchanged in the given order]
Alice --> Bob: alice::Message1
note right: cancel tx sig\nrefund tx enc sig S_b
Bob -> Alice: bob::Message1
note left: unsigned btc lock tx
Alice -> Bob: alice::Message1
note right: btc cancel tx sig\nbtc refund tx enc sig S_b
Bob -> Alice: bob::Message2
note left: btc punish tx sig\nbtc cancel tx sig
end
end
group Request Response Channel
Bob -> Alice: bob::Message2
note left: punish tx sig\ncancel tx sig
== Negotiated ==
group Execution
Bob ->> Bitcoin: Lock
Alice ->> Monero: Lock
Alice --> Bob: alice::Message2
note right: xmr lock tx transfer proof
end
Alice -> Bob: alice::Message2
note right: Exact xmr amount\nzxmr lock tx transfer proof\nThis can be removed if Bob watches the blockchain.
group Request Response Channel
Bob -> Alice: bob::Message3
note left: redeem tx enc sig S_a
Alice --> Bob: alice::Message3
note right: Empty
end
Alice ->> Bitcoin: Redeem
@ -58,5 +59,6 @@ end
Bob -> Bob: Extract s_a
Bob ->> Monero: Redeem
end
@enduml