[bisq-network/proposals] Off-chain trading using a lightning network of BTC & tainted BSQ (#312)

Steven Barclay notifications at github.com
Fri Feb 12 17:10:54 CET 2021


> Maybe a merkle root like structure could work here?

I guess all the TAG and DBH data would ideally be included directly in the tx somewhere, rather than just a hash or set of hashes (and then subsequently storing them off chain, like the ballot data), as that would make tx parsing simpler and more reliable.

Thinking about the loan idea, it may be possible to relax the condition that the taint (TAG+DBH pair) is unique to each trade & escrow agent (including when Alice & Bob both double up as escrow agents, so they're just swapping differently tainted TBSQ), and instead allow it to be reused for different trades but always the same escrow agent. (There's definitely a security hole if it's reused for different escrow agents.) This would allow the BSQ lender to loan out TBSQ instead of BSQ, against a much smaller amount of the borrower's BTC collateral (just slightly larger than the escrow amount), which could then be passed to the trade peer(s) as normal. Thus the lender becomes a kind of backup escrow agent and the borrower (typically one of the traders) becomes a kind of delegate escrow agent who holds the actual escrow. If clean BSQ was borrowed instead, a much larger amount of collateral would presumably be needed to make a loan safe, since otherwise the borrower could just sell it instead of giving it back (and the BSQ could go up in price).

In the case where Alice & Bob both have equal amounts (say 5k) of borrowed/reused TBSQ, then instead of creating TBSQ-ATBSQ pairs from a 10k BSQ bond each, they could open a trade (not necessarily involving BTC) by exchanging it in a tx which would typically have 3 inputs and 3 outputs, like:

Input 1: 5k TBSQ from Alice
Input 2: 5k TBSQ from Bob
Input 3: BTC mining fee fund from taker
Output 1: 5k TBSQ to lockup address
Output 2: 5k TBSQ to lockup address
Output 3: BTC mining fee change to taker

If the trade closes normally, Bob could give Alice a private key or nonce that would unlock the first input for her, in order to return her TBSQ, and vice versa for the second input. Otherwise a (possibly timelocked) prepared tx could be published by either party to burn the TBSQ of both parties. Moving one of the outputs would automatically unlock the other output, much like the single tx trade protocol idea: #279. Thus it would be possible to trade arbitrary currency pairs with a single on-chain tx per trade to lock up the bonds. As I mentioned in #279, it may be possible to use cryptographic techniques to make the outputs P2WPKH instead of needing a custom script, in which case I guess it would work out around 150(?) vBytes per trade. (The TBSQ coins could be used whole even if they're too big for the given trade, instead of splitting/joining them, in order to save tx fees.)


-- 
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/312#issuecomment-778287077
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210212/f1e89464/attachment.htm>


More information about the bisq-github mailing list