Even though it is consensus valid to spend a UTXO of an amount that is lower than the extra fees it would cost to include it in a transaction, most nodes wouldn't relay them because of the minRelayTxFee. Does it make sense to keep those outputs in the UTXO set, increasing its size?
2 Answers
Bitcoin Core removes provably unspendable outputs from the UTXO set, since by definition we know they will never be used to verify new transactions.
One could, in theory, do the same for UTXOs that are highly unlikely to ever be spent, such as those that are highly uneconomical as per your question. However, this introduces a very real risk of splitting yourself off the chain. If just a single one of those UTXOs is spent in a confirmed transaction, your node would reject that block (and any subsequent blocks building on it) since one of its transactions is spending an input that according to your database does not exist.
While it is reasonable to assume that most uneconomical outputs will not be spent (in the current fee environment), it is extremely risky to assume that none of them will be spent. They can be spent accidentally, as part of L2 protocols, or by an attacker that wants to exploit this vulnerability. As such, removing any UTXO that is not provably unspendable would be unwise.

- 550
- 3
- 12
-
1Removing a UTXO from your UTXO set, if it still can be spent, however unlikely that is to actually happen, is a hard forking change. It's not something you should do without extremely widespread understanding that the entire ecosystem will do the same. – Pieter Wuille Jul 15 '22 at 17:15
-
@PieterWuille: Only a hard forking change if you rejected a spend from that UTXO in a mined block right? If you removed it from your UTXO set then it was spent in a block you would request that transaction and the transaction creating that UTXO in the first place from your peers and update your UTXO set accordingly? – Michael Folkson Jul 15 '22 at 17:44
-
3The Bitcoin protocol doesn't work like that. There is no way to synchronize individual transactions or UTXOs. If you delete something from your UTXO set, then by definition you'll reject any block which tries to spend that UTXO. Or you're talking about a wholly different model of what "UTXO set" means. – Pieter Wuille Jul 15 '22 at 17:52
-
I imagine a wallet could move dust UTXOs into a separate dust UTXO set so that most transactions would verify with only reference to a smaller index for the non-dust UTXO set. Very few transactions (perhaps almost none ever) would need the dust UTXO set to be examined. Whether this significantly speeds up processing of incoming blocks might be doubtful. – RedGrittyBrick Jul 15 '22 at 20:04
-
@PieterWuille Thanks for this clarification I was thinking that it was possible to erase an Output from the UTXO set but still accepting blocks containing those outputs but yeah you cant verify them then. – leslie Jul 16 '22 at 10:14
-
@RedGrittyBrick I think moving dust UTXO's to an on-disk storage could be an improvement , but I don't have the skills to predict if it's worthwhile or the risks associated with it – leslie Jul 16 '22 at 10:14
-
2@leslie Bitcoin Core keeps the UTXO database on disk, with an in-memory cache for recently-modified entries. – Pieter Wuille Jul 16 '22 at 11:50
-
2@PieterWuille Disallowing spending a spendable UTXO seems to tighten the rules - therefore it seems to be a soft-fork change, or am I missing something? – Chris Chen Jul 16 '22 at 13:41
-
1@ChrisChen You're right. – Pieter Wuille Jul 16 '22 at 13:56
One example of an uneconomical (meeting the dust threshold) UTXO are haircomb commitments. While they could've been encoded as OP_RETURNs, it's preferable to bloat the bitcoin UTXO set. Without this, haircomb couldn't benefit from a fast Bitcoin sync technology that could be invented in the future.

- 39
- 5