4

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)?

7

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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.