bitkit
bitkit copied to clipboard
[Bug]: Coinselection Autopilot (Bitkit)
Describe the bug
When using either the default coin selection setting of Autopilot with "Lowest Fee' OR when using manual coin selection that automatically uses "Use smallest UTXO's first" the result is the same for both: more UTxOs are selected for input to a transaction than required to satisfy the output and fee. This results in paying a higher fee than could have been achieved with less inputs.
Reproduce
- Have two of more UTxOs in the wallet
- Make a transaction with an output amount plus fee significantly lower than at least one of your UTxOs
- If using Manual coin selection, the 'Auto' option will show you which UTxOs are being selected (to use smallest UTXO first) but it actually uses more UTxOs than needed, including the largest.
- If using Autopilot coin selection, it isn't possible to immediately see the selected UTxOs. You can either check the proposed fee against your expectations (compare with manual coin selection) or you can submit the transaction and check what inputs were actually used.
- Either way, the wallet uses more inputs than necessary when trying to optimise for low fee or use smallest UTxO first.
Screenshots / Recording
This screengrab shows manual coin selection for a transaction on regtest. Either of the two UTxOs are large enough to satisfy the total requires yet the Auto insists on using both. The same two UTxOs are selected when using Autopilot (default).
https://github.com/synonymdev/bitkit/assets/74595920/83ebc5e1-b5d1-4305-9c52-8b03abc71d60
Operating system
Android 13 TKQ1.220829.002
Bitkit version
c55c045f58b7e76ee82acdc1419bccf9db8490ae
Log output
No response