How Do You Choose The UXTO Order For A BTC Transaction?
UTXO selection for a BTC transaction is based on the following conditions:
- If any single UTXO matches the Target (spend value) exactly, it will be used.
- If the sum of all UTXOs smaller than the Target happens to match the Target exactly, they will be used. (This prevents bugs while sweeping a wallet.)
However, condition 1 and 2 are less applicable when executing a transaction. In most cases, condition 3 type of the transaction is more commonly seen,
- If the sum of all UTXO smaller than the Target doesn’t exceed the target, the smallest UTXO that is larger than the Target will be used.