Bitcoin doesn’t use a traditional account balance model. Instead, it uses UTXOs (Unspent Transaction Outputs).
When a transaction spends multiple UTXOs, each input can increase the transaction’s virtual size and therefore affect the fee.
My question is:
How does UTXO consolidation affect both transaction fees and on-chain privacy, and when can consolidating UTXOs actually make privacy worse?
I’m interested in hearing technical explanations and real-world examples.
pull down to refresh
related posts
UTXO consolidation exposes all the addresses in that transaction as originating from the same entity. If you coinjoin with other users, you can spend UTXOs together without creating links between them: #1521114
If you want to pay 0.05btc and you only have a bunch of 0.01btc utxos, it will cost more in fees than if you had one big 0.1 utxo.
Every new utxo you need to add to a transaction in order to spend the amount you want to spend increases the amount of block space it takes up and therefore the amount you need to pay in fees.
However, everyone assumes that a single person owns all the inputs in a normal transaction, so when you spend utxos in the same transaction, you tie the history of each of those utxos together into one history.
Say you bought some btc on an exchange and got some in trade for work you did. If you spend both those utxos together it is likely that governments and anyone with access to the exchanges database now knows you own both utxos.
So, I think the beat course of action is to practice very careful labelling of your utxos (where they came from, are they kyc'd) and to think a little whenever you need to spend.
Then when it comes time for spending make sure you use a wallet that allows you to select utxos (sometimes called coin control).
For example, if you need to spend btc and you can choose between combining two smaller utxos that come from different sources, and using one larger utxo that comes from a single source, you may choose to use the single utxo to avoid losing some privacy.
Ultimately, it is a lot of trade offs and in my experience privacy preserving spending often comes with a little extra cost.
As far as numbers go, if you are creating utxos that are smaller than .01, you probably want to be using lightning -- it is better privacy anyway.
Also, I'm far from the most knowledgeable about this, so do lots of research.
The two answers above cover the idea, so here are the rough numbers behind it.
A normal bc1q input adds about 68 vbytes to a transaction, and a taproot input about 58. Say you have ten small bc1q coins. Spend all ten in one payment when fees are 20 sat/vB, and the inputs alone cost around 13,600 sats. Consolidate them into one coin on a quiet day at 2 sat/vB and that costs about 1,450 sats, after which the payment needs only one input, about 1,360 sats. You save roughly 10,800 sats, but only if you consolidate while the mempool is quiet. Do it at 20 sat/vB and you've just paid the fee early.
The same arithmetic explains dust. A 1,000-sat coin costs about 1,020 sats to spend at 15 sat/vB, so it's worth less than nothing until fees drop.
On privacy, merging coins does more damage than people expect. It tells the next person you pay how much you hold, because they can see your change. The many-inputs, one-output pattern also screams "same owner", which is exactly what chain analysis looks for. And if you ever merge a KYC exchange withdrawal with coins that had no name attached, those coins carry your name from then on. No later transaction undoes that.
So consolidate only coins from the same source, do it when fees are low, and use a wallet with coin control so you decide what goes together.
deleted by author