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
Let's define a UTXO as having "negative effective value" if it costs more to include in a transaction than its value at the requested feerate. A related concept is dust; which I think is a strict subset where the requested feerate is the min relayfee.
How hard should the wallet logic try not to spend these?
Problem 1.
User is constructing a new transaction and clicks "Max" (as value to send). Should the negative effective value UTXOs be included? Several points to consider.
Micro-economically for the user it makes more sense to exclude the small UTXOs as then a larger value output can be created. Is "Max" supposed to maximise the output value?
When the user clicks "Max" they might be abandoning that wallet forever, so the leftover UTXOs might remain in full nodes' UTXO set forever.
If these UTXOs are left behind that probably increases the number of support requests :P Note that after sending "Max" in this case, the user would still be shown a positive balance for the wallet...
If "Max" tries to include all UTXOs, then it might not be possible to create a transaction at all at a given high feerate, potentially confusing the user. (consider wallet with many small value UTXOs but also some larger ones)
Problem 2.
The CoinChooser atm has a policy to spend all UTXOs associated with an address if it spends any. What if negative and positive effective value UTXOs are both associated with an address?
First, if any coin is spent from a user address, all coins are.
Compared to spending from other addresses to make up an amount, this reduces
information leakage about sender holdings. It also helps to
reduce blockchain UTXO bloat, and reduce future privacy loss that
would come from reusing that address' remaining UTXOs.
At the moment, the codebase ignores this issue.
"Send max" selects all UTXOs as inputs.
Also, the CoinChooser in some cases assumes that negative effective value UTXOs don't exists. If you specify a high feerate (say 5000+ sat/byte), it will often bail out and incorrectly tell the user they have insufficient funds to create a transaction.
The text was updated successfully, but these errors were encountered:
I think privacy should be the main principle here.
I think if it's associated with an address that has more utxos it should be included as to not risk dust for future analysis. In that case the privacy win is worth a slight cost.
If it's just a small utxo not associated with anything then the wallet can leave it IMO. There may be a time when it becomes economical to spend the output.
It may also be useful to suggest the user to use a lower fee to be able to spend that coin. It might be that they aren't in a hurry.
I would also add that ideally the wallet should try hard to prevent such utxos from forming in the first place. That's probably a separate ticket, but there are ways of offering customers to round up fees or receiving amounts to avoid small change being left. Samourai does some stuff in that regard.
In my opinion "send max" is a "wallet sweep" operation which is a special case for wallets. I think the conservative assumption that developers should make is that the wallet may very well be abandoned after this transaction. As such, I'd hope that we'd be good stewards of the UTXO set and not leave any outputs behind.
During normal operation (not sweeping the wallet) the coin selector should avoid spending uneconomic UTXOs; the user can always consolidate them later.
Calculate the effective value of buckets, and filter <0 out.
Note that the filtering is done on the buckets, not per-coin.
This should better preserve the user's privacy in certain cases.
When the user "sends Max", as before, all UTXOs are selected,
even if they are not economical to spend.
see #5433
Let's define a UTXO as having "negative effective value" if it costs more to include in a transaction than its value at the requested feerate. A related concept is dust; which I think is a strict subset where the requested feerate is the min relayfee.
How hard should the wallet logic try not to spend these?
Problem 1.
User is constructing a new transaction and clicks "Max" (as value to send). Should the negative effective value UTXOs be included? Several points to consider.
Problem 2.
The CoinChooser atm has a policy to spend all UTXOs associated with an address if it spends any. What if negative and positive effective value UTXOs are both associated with an address?
electrum/electrum/coinchooser.py
Lines 370 to 374 in e3c26d7
At the moment, the codebase ignores this issue.
"Send max" selects all UTXOs as inputs.
Also, the CoinChooser in some cases assumes that negative effective value UTXOs don't exists. If you specify a high feerate (say 5000+ sat/byte), it will often bail out and incorrectly tell the user they have insufficient funds to create a transaction.
The text was updated successfully, but these errors were encountered: