It's usually recommended for users to frequently switch their addresses to minimize privacy risks. But what if those risks are still there even if we do that? This thought popped into my head earlier today, and I ended up sketching some diagrams to help me understand and to pose a few questions below.
So, we all know that UTXOs are like chunks of Bitcoin that we can receive or spend through transactions. When a UTXO is spent, it gets destroyed and a new one is created in its place. I tried my best to illustrate this in the image I made, which details how UTXOs work when dealing with one wallet address.
The first image shows several UTXOs tied to a single wallet. This wallet has three incoming transactions: 0.5 BTC, 1 BTC, and 3 BTC. Now let's say we want to send 0.7 BTC to someone. Here's how the UTXO model plays into this:
1. We pick UTXO 2 (the 1 BTC) to complete this transaction.
2. The whole 1 BTC acts as an input, and we end up with two outputs: 0.7 BTC for the person we're sending to and 0.2 BTC as change sent back to the same wallet (you can see this in the second image).
3. After calculating the outputs, we see they don't quite match the initial input of 1 BTC. That is, 0.7 + 0.2 doesn't equal 1. This is because the leftover 0.1 BTC is considered transaction fees, so 0.7 + 0.2 + 0.1 equals 1.
Privacy risks from combining UTXOs across multiple addresses
9 replies 34 views
It doesn't have to. The wallet creating the transaction can choose whatever inputs it wants to use. Oldest first is an okay coin selection algorithm, but there's are many others which perform better, depending on the metric. Coin selection algorithms are an active area of research with many different ones being devised to optimize for some metrics, such as current fees, future fees, privacy, network health, etc.
Ideally none of the above. The wallet should create a new change address and send the change there. Otherwise, it's very obvious which output is change.
Yes, it's called the Common Input Heuristic. Strategies such as CoinJoin are designed to break this heuristic by having multiple people provide inputs to the transaction. If you don't want people to know that two UTXOs were owned by the same person, don't spend them in the same tx.
No. There is nothing that actually distinguishes consolidation transactions from other transactions nor some separate fee for them to pay. It's all just transaction fees. All transactions are validated in the same way, there's no special consideration for "consolidations", "regular", or anything else.
Might depend on wallet sometimes,if it's Electrum you can place your wallet under coin control which will allow you to choose the input to spend in a particular transaction
I.e
If you want to spend 0.5BTC and you have 1BTC as your first input and 0.6BTC as your second input, if your wallet is under coin control then you can select the 0.6BTC to be spent as your output
gwei_minerSenior Member
Posts: 197 · Reputation: 966
#4Apr 17, 2019, 07:39 PM
From what I have been learning in this site learn-me-a-bitcoin, You can not just open an output and spend some without spending the entire output, So basically you need to create an extra change output to send the remaining bitcoins back to yourself. So the first in and first out are not to be used.
There is no special consolidation fee, only tx fee and it covers for both combining the UTXOs and creating new outputs and also the change output.
All this are in this learn-me-a-bitcoin you visit if you mind.
You can spend from any of the output in your address as a new input. If they are all in one address, you can use coin control by freezing the outputs which you don't want to spend from and use the only the output that you want to spend from as your new input.
There is nothing like consolidation fee, the fee that you pay to make all your small output as one during consolidation is still transaction fee. This is why the best time to consolidate your transactions is when the network is not congested, and when TX fee is low, because the transaction fee is determined by how big in bytes your transaction is in the blockchain.
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#6Apr 18, 2019, 01:26 AM
My only correction, rather a "note", is when learning about UTXO model and blockchain, do not include addresses in its logic since the address is only in the wallet-side.
So the article where you read "first in first out" (which isn't used in any of the wallet I know) must be applied to the UTXO where the first that's created should be the first to be spent,
not applicable to the change nor the related addresses (derived from those inputs).
There's no rule in UTXO selection so any client can freely choose which to use first as long as those have larger total value than the output(s)' value.
As for the change, you should've already experienced this first-hand if you're using a "good" wallets like Bitcoin Core, Sparrow or Electrum... most self-custodial wallets do.
The change will be sent to a "change address" by default and not back to any of the address related to the inputs, unless specified not to.
And this isn't a rule either, the wallet can freely choose where to send the change.
Yes, using multiple inputs in a single transaction is a total giveaway that the address are sent by the same person.
The simple reason is: being able to sign those inputs in a single transaction tells that the private keys used are contained in the same wallet or owned by a single entity.
Except in cases of "coinjoin" or similar approach which uses inputs from multiple persons to one transaction.
No, fee is just the difference of the inputs' and output's amount.
No.. just as everyone replied
[Using Transaction fee (sats/vB) as "fee")]
It just from the word "consolidation " => combine into sing)le unit
Relating it to input it's just the combination of existing inputs into single unit,with this you won't need to worry about paying too much fee when the need arises and the fee is a little bit higher .
Generally, consolidation are done when the fee is very low, it's just a fee you can do it when it's high but that will defeat the purpose of doing it in the first place , fine you will have a new single input...
You can check topic on consolidation of inputs https://bitcointalk.org/index.php?topic=2848987.0 started by @LoyceV
All corrections and opinions have been NOTED. Regarding coin control, I can't find the feature on the Mycelium wallet
Don't know about mycelium wallet, but in Electrum you should probably find the option when you right click on an input in the coin section like this
After you select it there should be an active green stretch background at the bottom showing that it's under coin control.. you can reset it if you don't want it again
[Edit]
I've been trying to help you s3arch if they have the coin control feature all I could found was this https://github.com/mycelium-com/wallet-android/issues/306... (they don't have the feature)although that was around 2016, I believe newer versions would have been released can't still affirm if they added the feature but if you want to try it you can do it on Electrum..
RogueDegenFull Member
Posts: 74 · Reputation: 309
#10Apr 19, 2019, 07:05 PM
You've already got several very good answers here, but I'd like to add a few points of additional detail.
No. Not "often". EVERY TIME you receive bitcoins, it should be to a brand new address.
They are. The advice does not ELIMINATE the risk, but it does REDUCE the risk. There are additional steps you can take to reduce the risk even more.
Several people have already pointed out to you that this is not true. UTXO can be used in any order that works well for the goal of your transaction.
If transaction fees are low, and your goal is consolidation of UTXO, then yes, it might be ideal for all the UTXO to combine into a single transaction (not a single input, each UTXO is it's own separate input).
However, if your goal is privacy, then perhaps it might be better to ONLY use the 0.9 BTC UTXO as a single input all by itself. Then you could have 0.8 BTC UTXO to recipient, 0.03 BTC transaction fee, and 0.07 BTC change UTXO.
That's not an input. That's the sum of the values of the 4 inputs in the single transaction.
Preferably? None of them. EVERY TIME you receive bitcoins, it should be to a brand new address. If you are not going to follow that rule, then I suppose it doesn't matter, re-use whichever address you want to.
Yes. If privacy is important and you don't want to link these UTXO together, then be more careful about how you use them.
As already explained, there is no such thing as a "consolidation fee". However, when you combine multiple UTXO inputs in a single transaction, it does require more bytes. That means that the total transaction fee will be more than if you had not included those extra UTXO inputs, since the fee is paid per vByte. Combining UTXO that you don't have privacy concerns about can be a good idea if the current fee rate is low, resulting in just a single UTXO to be used later when fee rate is higher. You just have to decide if the reduction in privacy is worth the savings in future fees.
?Reply
Sign in to reply to this topic
Related topics
- Bitcoin Core Security Advisory and 10 Older Vulnerabilities Revealed 5
- $77M Exploit of eBTC on Monad: $870K Stolen 10
- Taiko reopens bridge after $1.7M exploit, assures users are compensated 0
- IRS crypto tax audit notice 10
- Proof-of-Reserves (PoR) isn’t a real audit 9
- Heads up: IRS might check your Coinbase 2