You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
This is extremely important. If it can be done well, it will serve as a model for future decentralized, trustless exchange between all type of financial assets running on top of Bitcoin.
A full financial system can be built in which intermediaries are optional.
To issue other assets as colored coin will be a bigger effort. Other colored coin projects like Colu, Omni or Counterparty have different more complex transaction concepts (encoded in data, not utxo based) so that will be hard to integrate.
At the end I think the offchain trade protocol delivers a much more flexible and simple way and does not require an onchain tx per trade which will become more important once tx fee become expensive again.
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
The text was updated successfully, but these errors were encountered: