<p>Neither.  The client chooses the best fit of coins for your spending.  This is known as the knapsack problem.</p>

<p>The coins chosen will be the ones that yield the lowest amount of change, with exceptions for very recent (unconfirmed or newly confirmed) coins.  Even when there are multiple solutions that yield the same amount of change, it will not necessarily choose an older coin versus a newer coin.</p>

<p>Here's an answer to another question that gives more details on this:</p>

<ul>
<li><a href="https://bitcoin.stackexchange.com/a/1078/153">https://bitcoin.stackexchange.com/a/1078/153</a></li>
</ul>

CC BY-SA 3.0
2012-08-21T15:49:16.400Z
2012-08-21T15:49:16.400Z
2017-04-13T12:47:33.283Z
Stephen Gornick
<p>Imagine I've got 100 BTC in my wallet, which I accumulated at different points of time. When spending a fraction of my BTC, e.g. 10 BTC, which one of my 100 BTC do I actually spent? The last one I accumulated (Lifo)? The first one I accumulated (Fifo)?</p>

<economic-theory><accounting><bitcoin-days-destroyed>
BTC Days Destroyed, Lifo or Fifo?
lifofifo
# BTC Days Destroyed, Lifo or Fifo?

(Asked by: username_0 on 2012-08-21)

Imagine I've got 100 BTC in my wallet, which I accumulated at different points of time. When spending a fraction of my BTC, e.g. 10 BTC, which one of my 100 BTC do I actually spent? The last one I accumulated (Lifo)? The first one I accumulated (Fifo)?

**Tags:** economic-theory, accounting, bitcoin-days-destroyed


---

## 1 answers

### Answer by username_1 on 2012-08-21. Score: 8 | Accepted answer

Neither. The client chooses the best fit of coins for your spending. This is known as the knapsack problem.

The coins chosen will be the ones that yield the lowest amount of change, with exceptions for very recent (unconfirmed or newly confirmed) coins. Even when there are multiple solutions that yield the same amount of change, it will not necessarily choose an older coin versus a newer coin.

Here's an answer to another question that gives more details on this:

* <https://bitcoin.stackexchange.com/a/1078/153>


---

