[bisq-network/proposals] Atomic swap protocol for BSQ-BTC trades (#50)

Manfred Karrer notifications at github.com
Mon Oct 22 19:20:04 UTC 2018


We will use the normal trade protocol for trading BSQ with BTC (BSQ is treated like any other altcoin). That way we don't have extra effort for supporting BSQ trading.

Because BSQ is technically BTC (a colored coin) we could use a single atomic transaction to swap BSQ with BTC (not to be confused with atomic cross chain tx - we don't have the cross chain aspect and therefor all is much easier).

Let's assume Alice wants to buy 100 BSQ for 0.1 BTC.

The tx would look like that (ignoring miner fee, trade fee and change outputs):
Input 1 (Alice): 0.01 BTC
Input 2 (Bob): 100 BSQ
Output 1 (Alice): 100 BSQ
Output 2 (Bob): 0.01 BTC

Such a transaction is completely trustless and has zero risk, as it either gets confirmed and both users get their funds or nothing happens (atomic property).

Beside having a better, faster, cheaper and more secure trade option for BSQ we could enable automatic swaps and make first time BSQ purchase easier.

The user who has no BSQ need to buy first BSQ on the market to be able to get the discounted trade fee. With the atomic swap we could offer a "Get BSQ at best market rate" button where the app takes the best market price offered for a BSQ/BTC swap. Any market maker could add offers to that dedicated offerbook and the user experience would only be interrupted by the requirement to wait for 1 blockchain confirmation until he can use his received BSQ. But even for that there might be a solution if the BSQ seller is paying the trade fee for the users via a protocol extension (to be defined how to do in detail, but I think that should work and then the user do not need to wait for the block confirmation).

Technically it can be built based on the part of the take-offer protocol where the desposit tx gets created. So there will be a handshake protocol where both users exchange the required data to co-sign the tx.

The trade fee could be deducted from the BSQ output and some BSQ get burned so that would solve the first user who has no BSQ cannot pay the trade fee issue. The BSQ seller also need to add a bit more BSQ to his input as it would be the case of the pure exchange rate and therefor also pays his part of the fee. E.g. the burnt BSQ is the sum of maker and taker trade fee. 

Let's assume a BSQ fee of 0.05 BSQ for both traders. The tx would look like that (excluding miner fee and change outputs):
Input 1 (Alice): 0.01 BTC
Input 2 (Bob): 100.05 BSQ
Output 1 (Alice): 99.95 BSQ
Output 2 (Bob): 0.01 BTC
Burnt BSQ: 0.1 BSQ


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/proposals/issues/50
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181022/8edaadbe/attachment.html>


More information about the bisq-github mailing list