Bisq2 MuSig protocol #2439
Replies: 4 comments 7 replies
-
It isn't entirely clear to me how the proposed single tx protocol solves the problem of the seller going AWOL, at least after the buyer starts payment but before the atomic swap at the end. If my understanding is correct, the main purpose of the swap txs is to deal with the impossibility of an atomic information swap (in this case, of the private keys at the trade close), and thus one has to have an on-chain fallback. (Though, I think only one swap tx is required, not two, as I commented on bisq-network/proposals#456.) I believe that if the aim is to punish the counterparty (without third party involvement) for going AWOL, and not just simply claim your own payout, you have to have some kind of warning txs, like those in the Bisq 1 v5 trade protocol. This is because there is no way to tell the difference between the buyer or the seller having gone AWOL just from the information on the blockchain, and it is the sending rather than the receipt of information (that is, the buyer confirming payment start) which shifts the culpability to the counterparty. But you cannot ever benefit from the sending of information, unless it takes the form of a transaction broadcast, which would probably end up being some kind of warning tx. |
Beta Was this translation helpful? Give feedback.
-
@HenrikJannsen regarding nexts Steps. refinement of the protocol:I am looking detailing / exploring the protocol more. next steps here include
re wallet integrationProbably dependent in the refinement of the protocol, then we know exactly what we need and how to integrate. re Fee PaymentFor the maker we could also introduce a listing fee, he has to pay a fee to get the offer listed, that prevents spam and needs to be validated by other Nodes. UX for Offer Book and Trade Protocolcan / should be developed asap. But detailed protocol and fee payment need to be finalised. |
Beta Was this translation helpful? Give feedback.
-
Here is an additional idea regarding Trade Fee Payment which also would add additional security properties: We could reuse the reputation model of Bisq Easy where burned BSQ is the main revenue source. Both buyers and seller could have a free tier where they can trade say, up to 100 USD. There might be some warnings that reputation is absent and therefore lower amount limits are applied. For higher amounts, both traders require a certain reputation score. The reputation score should be usable for both protocols (and maybe more in future). The benefits of that model are:
The drawbacks are:
[1] There might be a BSQ "shop" to mitigate that requirement. E.g. user send BTC to a shop to get reputation added to their profile. |
Beta Was this translation helpful? Give feedback.
-
Discussion about the fee model is delegated to #2922 Lets stick here to the higher level discussions. One missing part not mentioned yet is the support for:
Both have dependency on the account and the relevant fields used there. When we design the payment account model for Bisq 2 we need to take that into account. To avoid the scaling issues we should consider a different storage model, e.g. to add a TTL to data which do not have dependencies, but it has to be seen if that is feasible (its a multi-tree-like structure and for verification the root nodes are needed even if those are from inactive users). Maybe some cut-through approach can be applied to reduce the depth of the structure. Furthermore the Signed account age witness implementation need to be re-implemented in Bisq 2. This is a large and complex code base and should not be underestimated. I guess the code base is largely in a good quality and most can be copy-pasted with minor effort to resolve dependencies. A more radical approach would be to drop the Signed account age witness model and use reputation as replacement for security against charge-back. This would remove a complex system and the load of data for supporting it (even if we restart the data model it will hit scaling issues at some point again). |
Beta Was this translation helpful? Give feedback.
-
The proposal for the Multisig-based trade protocol for Bisq2 looks very promising. Assuming no major showstoppers arise, we can anticipate this will be the path for the protocol implementation in Bisq2.
This document aims to discuss open conceptual questions and outline the next steps.
Open Conceptual Questions
Trade Fee Payment
We would like to avoid direct trade fee payments from traders to the DAO (via distributed Burningmen) to mitigate friction in the protocol and prevent privacy degradation (since BM receivers are known addresses that can be traced back to the trade transactions). Possible alternative options include:
Avoiding the Requirement for Makers to Be Online
We aim to eliminate the need for makers to be online. Once the protocol is more refined, we can better analyze alternatives to the interactive process that requires both parties to be online at the offer-taking time. One possibility is for a maker to prepare all non-security relevant data and delegate the interactive process to a relay node, though the feasibility of this is uncertain.
Managing/Reserving UTXOs for Deposit Transactions of Makers
In Bisq1, the trade fee transaction prepares the required amount for the trade as a UTXO, which is reserved in the wallet. This approach has liquidity issues as makers with many offers need to have those funds blocked. Since we aim to reduce the number of transactions and avoid the trade fee payment, this option is unlikely for Bisq2.
Managing the wallet to always fulfill any open trade could be challenging, considering the uncertainties of miner fees and input UTXO fragmentation. We could adopt a "negotiation" phase where required funds are checked and temporarily reserved for a potential trade, which might also offer flexibility with payment methods and price.
Alternative Options to Sending Funds in Arbitration Cases to the DAO
In Bisq1, most arbitration cases result from non-responsive sellers. This issue will be resolved by the atomic swap in the new protocol and the new staged payout protocol update in Bisq1. Assuming real arbitration cases are rare, we could consider donating traders' funds to organizations beneficial to Bisq, such as Tor, I2P, and Bitcoin donation funds.
While there is a risk of abuse by those interested in increasing donations to these receivers, the security deposit loss and potential measures (e.g., letting the seller select the receiver or splitting donations among many) should mitigate this risk. An open question is whether these donation receivers are okay with receiving funds from a trade platform, but this should generally not be an issue due to the improved privacy.
Alternatively, we could flag if funds should go to the DAO via the distributed BM or to donation receivers. In case of unexpectedly high arbitration loads and costs to the DAO, we might need to fall back to avoid excessive financial loss. A more radical option would be to not reimburse users at all, clearly stating that if a trade fails in arbitration, the funds are donated. Lower trade amounts could make this more acceptable, and repeated trades can address the need for higher transaction volumes.
Next Steps
Refine, Analyze, Develop Protocol
We invite anyone with experience in protocol development and cryptography to review, analyze, and help implement the proposed protocol. This protocol is more complex than Bisq1's and uses cutting-edge cryptography. Alongside conceptual and cryptographic challenges, we must ensure a robust and secure engineering pattern for implementing the protocol. While our FSM-based framework has worked well for Bisq Easy, its limitations make it uncertain if this approach suits a more complex protocol, especially with alternative path handling.
Define Requirements for Wallet Library and Integration
We have support for bitcoind and Electrum, though Electrum may not meet our requirements. The MuSig protocol will require extra libraries, available with JVM bindings. Managing secret keys in a non-typical wallet manner (non-HD wallet keys) for security reasons necessitates checking for wallet library support for custom key management.
For flexibility and higher security, we should run the wallet in an independent process, a model we already use for Tor, I2P, bitcoind, Electrum, Elements, and the new Webcam app. This approach allows us to use any non-JVM wallet and reduces security risks if the main Bisq app is compromised. We need to ensure the wallet is clearly separated into key-management/storage and blockchain interaction layers. BDK seems a promising candidate for this. Initially, we could use public Electrum servers supported by BDK for blockchain interaction and later improve with using Compact Block Filters and custom solutions for retrieving mempool transactions of interest.
Decide on Payment Accounts Model
This depends on some previous open questions. In Bisq1, the requirement to reserve funds in the wallet limits liquidity for power traders wishing to create many offers in different currencies without locking up too much funds. We added support for reusing UTXOs and maker fees for multiple offers in Bisq1. Another approach might be making payment account handling more flexible, though it increases code and UX complexity.
If we do not have a maker trade fee and do not require UTXO reservation for an offer, this problem might be resolved, eliminating the need for a complex account model. We want to make Bisq MuSig as "easy" as possible.
Develop Basic UX for Offer Book and Trade Protocol
We should start integrating the new protocol into Bisq2 from a UX perspective, addressing UI elements in parallel to protocol work to identify and resolve potential issues early. We can build on elements from Bisq Easy, like the trader process, and adopt an offer book style similar to Bisq1. Completing the wallet UI independently of the wallet library implementation, based on existing bitcoind or Electrum wallets, should also be a priority.
Beta Was this translation helpful? Give feedback.
All reactions