<p>Transactions explicitly refer to which UTXOs they are spending.</p>

<p>You can construct a transaction which only spends one of the two 5-BTC UTXOs, and sends 2 BTC to the destination and 3 BTC to a (possibly new) address of yourself.</p>

<p>You can also construct a transaction which spends both, and sends 8 BTC back to yourself. Or it could have multiple outputs that send funds back to yourself, summing up to 8 BTC.</p>

<p>In short: there is nothing special about the two UTXOs that share an address, apart from the fact that the same key can sign for both - but it doesn't have to.</p>

CC BY-SA 4.0
2019-03-06T23:55:35.477Z
Thank you for this clear explanation of the wonderful flexibility of the UTXO model.
Simon O'Hanlon
CC BY-SA 4.0
2019-03-07T17:48:06.440Z
Remember to also leave some room for the mining fee as it is, by definition the diff between the utxo set minus the spend tx. `5 utxo = 2btc tx + 2.9 btc tx( change) +(0.1 btc miner fee is not expicited) `. Please, Correct me if I'm wrong, Peter
FKrauss
CC BY-SA 4.0
2019-03-06T23:43:23.010Z
2019-03-06T23:43:23.010Z
Pieter Wuille
<p>Imagine I have 2 UTXOs locked by my address, each of which allows me to spend 5 bitcoins.</p>

<p>If I subsequently want to send just 2 bitcoins to someone else, will <em>both</em> UTXOs be used as inputs in the transaction, where I now receive 8 BTC change as a single UTXO locked to my address, <em>or</em> as the value I want to spend can be covered by a single UTXO, is only one of the 5 BTC UTXOs <em>spent</em> by the transaction and I receive change in a new UTXO worth 3 BTC locked by my address. So now my address locks two UTXOs, one for 5 BTC which was not needed in this transaction, plus the change I just received for 3 BTC. Or something else?</p>

CC BY-SA 4.0
2019-03-07T01:01:27.607Z
As an aside, this question helps exemplify why address reuse is very bad for privacy: the person you pay 2 BTC to will be able to see that you control an address that holds many UTXOs, rather than just seeing the single UTXO that you spent to pay them. So with address reuse, you grant anyone you transact with the ability to see a **much** larger portion of your financial history.
chytrik
<utxo><transaction-input><address-reuse><coin-selection>
Are all UTXOs locked by an address spent in a transaction?
Simon O'Hanlon
# Are all UTXOs locked by an address spent in a transaction?

(Asked by: username_0 on 2019-03-06)

Imagine I have 2 UTXOs locked by my address, each of which allows me to spend 5 bitcoins.

If I subsequently want to send just 2 bitcoins to someone else, will *both* UTXOs be used as inputs in the transaction, where I now receive 8 BTC change as a single UTXO locked to my address, *or* as the value I want to spend can be covered by a single UTXO, is only one of the 5 BTC UTXOs *spent* by the transaction and I receive change in a new UTXO worth 3 BTC locked by my address. So now my address locks two UTXOs, one for 5 BTC which was not needed in this transaction, plus the change I just received for 3 BTC. Or something else?

**Tags:** utxo, transaction-input, address-reuse, coin-selection

> **Comments:**
> **username_1**: As an aside, this question helps exemplify why address reuse is very bad for privacy: the person you pay 2 BTC to will be able to see that you control an address that holds many UTXOs, rather than just seeing the single UTXO that you spent to pay them. So with address reuse, you grant anyone you transact with the ability to see a **much** larger portion of your financial history.  

---

## 1 answers

### Answer by username_2 on 2019-03-06. Score: 5 | Accepted answer

Transactions explicitly refer to which UTXOs they are spending.

You can construct a transaction which only spends one of the two 5-BTC UTXOs, and sends 2 BTC to the destination and 3 BTC to a (possibly new) address of yourself.

You can also construct a transaction which spends both, and sends 8 BTC back to yourself. Or it could have multiple outputs that send funds back to yourself, summing up to 8 BTC.

In short: there is nothing special about the two UTXOs that share an address, apart from the fact that the same key can sign for both - but it doesn't have to.

> **Comments:**
> **username_0**: Thank you for this clear explanation of the wonderful flexibility of the UTXO model.  
> **username_3**: Remember to also leave some room for the mining fee as it is, by definition the diff between the utxo set minus the spend tx. `5 utxo = 2btc tx + 2.9 btc tx( change) +(0.1 btc miner fee is not expicited) `. Please, Correct me if I'm wrong, Peter  

---

