Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Coinselection Autopilot (Bitkit) #1749

Open
catch-21 opened this issue Apr 26, 2024 · 5 comments
Open

[Bug]: Coinselection Autopilot (Bitkit) #1749

catch-21 opened this issue Apr 26, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@catch-21
Copy link
Contributor

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

  1. Have two of more UTxOs in the wallet
  2. Make a transaction with an output amount plus fee significantly lower than at least one of your UTxOs
  3. 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.
  4. 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.
  5. 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).

Simulator.Screen.Recording.-.iPhone.15.-.2024-04-25.at.17.14.49.mp4

Operating system

Android 13 TKQ1.220829.002

Bitkit version

c55c045

Log output

No response

@catch-21 catch-21 added bug Something isn't working triage This issue needs to be looked over by the team labels Apr 26, 2024
@coreyphillips
Copy link
Collaborator

coreyphillips commented Apr 26, 2024

Autopilot/Automatic Coin Selection is a feature we have to temporarily remove from the UI until a later date (after we come out of beta) where we can enable it and thoroughly test it. We were meant to remove/comment out this setting earlier to avoid confusion, but never got around to it.

@catch-21
Copy link
Contributor Author

catch-21 commented May 9, 2024

This problem is partly hidden by #1761 because now the user doesn't know what type of autopilot is being used. However, in manual mode there is still an Auto option that is 'use smallest utxo' and that doesn't work correctly.

@catch-21
Copy link
Contributor Author

The simplest fix here is to remove the text "Small: uses smallest UTxO's first"

@catch-21 catch-21 added the high priority This should be worked on urgently label May 10, 2024
coreyphillips added a commit that referenced this issue May 14, 2024
@JeanlChristophe JeanlChristophe removed the high priority This should be worked on urgently label Nov 27, 2024
@pwltr pwltr added estimate:40 and removed triage This issue needs to be looked over by the team labels Nov 27, 2024
@pwltr
Copy link
Collaborator

pwltr commented Nov 27, 2024

Should start with implementation in beignet and add tests there. Then integrate into Bitkit.

@JeanlChristophe
Copy link

JeanlChristophe commented Nov 27, 2024

User can select coin selection method:

  • Manual
  • Autopilot

Autopilot mode options:

  • Consolidate
  • Maximum Privacy
  • Minimum UTXOs

Image

@pwltr pwltr removed the estimate:40 label Nov 27, 2024
@pwltr pwltr changed the title [Bug]: Autopilot "Lowest Fee" and manual coin selection "Use smallest UTXO's first" both use more UTxOs than needed [Bug]: Coinselection Autopilot (Bitkit) Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants