[bisq-network/bisq] Prevent dust outputs from being created during the trade process (#4094)

sqrrm notifications at github.com
Mon Mar 30 10:16:24 UTC 2020

@sqrrm requested changes on this pull request.

> @@ -257,6 +260,7 @@ public Transaction completeBsqTradingFeeTx(Transaction preparedBsqTx,
         checkNotNull(wallet, "Wallet must not be null");
         Transaction resultTx = sendRequest.tx;
+        removeDust(resultTx);

I think this will cause BSQ change that lower than dust to be used as extra fee. That could be a non trivial amount (5.46 BSQ > USD3). While that's not a huge amount it's still too big to be an acceptable loss for users. If BSQ prices rise it will become even less so.

I think we'll have to fail transactions that try to pay the fee using BSQ if the change is less than dust. Best would be to show something at the time the fee is selected that it's likely to result in a dust change output and thus not be possible to continue. I think that should be doable, the fees are known at the time of setting up the trade so we can calculate the BSQ dust. One thing we need to do is make sure that if there is enough BSQ but split over 2 or more outputs, it's aggregated to avoid dust outputs. Example, counting satoshis:

Fee: 1000
BSQ wallet outputs:
1. 1200
2. 900

I think the tx might be constructed using only outputs 1. leaving a change output of 200, but it would be possible to construct the tx to take both 1. and 2. to pay the 1000 in fee and get the change 1100.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200330/7e6a9cf1/attachment.html>

More information about the bisq-github mailing list