<p>Every client has different selection criteria based on fees, age of the outputs, and other factors that impact the ultimate fee and priority. Normally older outputs are preferred as they incur less fees. You would probably want the 0.6 BTC output as you'd need 0.0001 BTC for the fee, sending 0.9999 to a new change address. </p>

<p>There's ultimately no "proper" method as this is wallet functionality and not core protocol. </p>

CC BY-SA 3.0
2014-05-18T13:27:14.250Z
2014-05-18T13:27:14.250Z
user13413
<p>I have a list of unspent outputs. 
Let's say: 0.4 BTC, 0.6 BTC and 1.0 BTC.
Now I want to create a new transaction for a 0.5 BTC. How I understand it, it would be best to take the 0.6 BTC output as input, and add 0.1 output as change.
The simpler way would be to just start at the beginning and add up inputs until I reached the desired amount. But that seems stupid...</p>

<p>How is this being done by the usual bitcoin clients?
What's the best way of finding the most optimal unspent outputs?</p>

<transactions><blockchain><client>
Optimising the inputs for a transaction
D-32
# Optimising the inputs for a transaction

(Asked by: username_0 on 2014-05-18)

I have a list of unspent outputs.
Let's say: 0.4 BTC, 0.6 BTC and 1.0 BTC.
Now I want to create a new transaction for a 0.5 BTC. How I understand it, it would be best to take the 0.6 BTC output as input, and add 0.1 output as change.
The simpler way would be to just start at the beginning and add up inputs until I reached the desired amount. But that seems stupid...

How is this being done by the usual bitcoin clients?
What's the best way of finding the most optimal unspent outputs?

**Tags:** transactions, blockchain, client


---

## 1 answers

### Answer by username_1 on 2014-05-18. Score: 1

Every client has different selection criteria based on fees, age of the outputs, and other factors that impact the ultimate fee and priority. Normally older outputs are preferred as they incur less fees. You would probably want the 0.6 BTC output as you'd need 0.0001 BTC for the fee, sending 0.9999 to a new change address.

There's ultimately no "proper" method as this is wallet functionality and not core protocol.


---

