<p>Early versions of Bitcoin used a simple knapsack solver to optimize for the least number of inputs possible given the available UTXOs in the wallet. </p>

<p>Modern versions have much more complicated selection logic, additionally attempting to not combine change from many unrelated transactions for the sake of privacy. </p>

<p>Other wallets have different selection criteria with differing payoffs. Historically many simple wallets attempted to just add the largest possible outputs until they satisfied the amount, however this optimized for low fees and transaction sizes at the expense of maximizing the amount of small dust UTXOs produced. These all have different trade offs, but the simple ones tend to be horrifically inefficient or lacking in even basic privacy. </p>

CC BY-SA 4.0
2020-05-05T02:40:42.117Z
Thank you. Your answer is very helpful to me
Yaoyao
CC BY-SA 4.0
2020-04-19T07:36:57.353Z
2020-05-05T05:16:32.857Z
2020-05-05T05:16:32.857Z
Claris
<p>How does the wallet choose the UTXOs it will use?Retrieve one by one until the number meets the number to be paid?</p>

<wallet>
How does a bitcoin wallet incorporate UTXOs for payment?
Yaoyao
# How does a bitcoin wallet incorporate UTXOs for payment?

(Asked by: username_0 on 2020-04-19)

How does the wallet choose the UTXOs it will use?Retrieve one by one until the number meets the number to be paid?

**Tags:** wallet


---

## 1 answers

### Answer by username_1 on 2020-04-19. Score: 3

Early versions of Bitcoin used a simple knapsack solver to optimize for the least number of inputs possible given the available UTXOs in the wallet.

Modern versions have much more complicated selection logic, additionally attempting to not combine change from many unrelated transactions for the sake of privacy.

Other wallets have different selection criteria with differing payoffs. Historically many simple wallets attempted to just add the largest possible outputs until they satisfied the amount, however this optimized for low fees and transaction sizes at the expense of maximizing the amount of small dust UTXOs produced. These all have different trade offs, but the simple ones tend to be horrifically inefficient or lacking in even basic privacy.

> **Comments:**
> **username_0**: Thank you. Your answer is very helpful to me  

---

