2

What is the algorithm in Bitcoin Wallet for Android to select the inputs to create a new transaction?

2

It appears that Bitcoin Wallet for Android uses the DefaultCoinSelector from bitcoinj.

The DefaultCoinSelector sorts the available UTXO by diminishing age and value:

value [satoshi] * age [confirmations]

Should two UTXO compare as equal, larger value is preferred.

The CoinSelection then picks from the front until the target is reached.


Still trying to figure out whether I understood this correctly:
If the resulting change is large enough to pay for the fee and remain above dust level, the transaction goes ahead.
Else, change will be increased by 0.01 BTC. If it satisfies neither option, the change will be added to the fee.

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.