mirror of
https://github.com/retoaccess1/haveno-reto.git
synced 2024-11-14 07:03:37 +01:00
2.9 KiB
2.9 KiB
Haveno Trade Protocol
Described here is the desired protocol for Haveno. Note that the discussion is still ongoing, so this protocol could be changed/updated in the future.
Roles
- Buyer - person buying XMR
- Seller - person selling XMR
- Maker - person making offer
- Taker - person taking offer
- Arbitrator - entity resolving possible disputes
For each trade, a trader is a buyer or seller and a maker or taker.
Protocol
- Maker deposits funds to Haveno wallet and waits ~20 minutes. (optional)
- Maker initiates offer. If maker does not have available or pending outputs to cover trade funds, prompt to first deposit to Haveno wallet and wait ~20 minutes.
- Maker creates but does not relay "reserve transaction" which pays trade fee and returns multisig deposit amount to maker. Maker freezes input funds and submits offer to arbitrator to sign.
- Arbitrator verifies maker reserve transaction and signs offer. If maker breaks protocol, arbitrator can punish maker by relaying reserve transaction to pay trade fee (unless maker spends reserved inputs which incurs mining fee).
- Offer is posted and available to be taken immediately.
- Taker deposits funds to Haveno wallet and waits ~20 minutes. (optional)
- Taker verifies offer's arbitrator signature and initiates taking offer. If taker does not have available or pending outputs to cover trade funds, prompt to first deposit to Haveno wallet and wait ~20 minutes.
- Taker creates but does not relay "reserve transaction" which pays trade fee and returns multisig deposit amount to taker. Taker freezes input funds and submits request to take offer to arbitrator.
- Arbitrator verifies taker reserve transaction. If taker breaks protocol, arbitrator can punish taker by relaying reserve transaction to pay trade fee (unless taker spends reserved inputs which incurs mining fee).
- Maker, taker, and arbitrator create 2/3 multisig wallet.
- Maker and taker create but do not relay "deposit transactions" to pay trade fees and send deposit amounts to multisig. Buyer deposits trade amount + security deposit whereas seller only deposits security deposit.
- Maker and taker sign contract with trade terms and ids of deposit trasactions.
- Maker and taker submit signed contract and deposit transactions to arbitrator.
- Arbitrator verifies contract and deposit transactions then relays deposit transactions to commit funds to multisig.
- Buyer pays seller (e.g. sends ETH) outside of Haveno after at least a few confirmations.
- When the multisig deposits are available (after ~20 minutes) and payment is acknowledged, maker and taker sign to release funds from multisig to payout addresses, or one trader opens a dispute with the arbitrator.
- Arbitrator resolves dispute if applicable.
Note: all steps involving the arbitrator are automatic except resolving disputes.
Protocol Messaging
See trade-protocol.pdf for documentation of network messages used by the trade protocol.