I’m creating this issue to chase some concept ACKs. If this looks like a good idea to some people (other than myself), I’ll actually go ahead and implement it myself.
Coin selection has a mode where it actively tries to consolidate small utxos into a bigger one. This is generally a good thing, but in L2 scenarios you don’t want to consolidate too aggressively, because having a pool of small utxos is useful for fee-bumping.
This mode activates based on a start-up flag (consolidatefeerate
, by default 10 sat/vbyte): if the current feerate is below this value, bitcoind
will perform utxo consolidation when the user funds transactions. We’ve seen long periods of time where the feerate stayed below this value, effectively making utxo consolidation the default behavior. From an L2 application’s perspective, I’d like to keep a pool of small utxos, and only consolidate when it becomes too big. Using a start-up flag makes this quite hard.
My proposal is to introduce a new RPC argument to all the funding RPCs: consolidate_wallet
(or consolidate_utxos
, whatever name you feel makes more sense). This would give more freedom to applications to choose when wallet consolidation should happen. The downside is that it’s yet another RPC argument. Do you think this is acceptable?
@achow101 @Xekyo