wallet, coin selection: config option to prioritize ’no change’ when possible #23372

issue brunoerg openend this issue on October 27, 2021
  1. brunoerg commented at 10:47 am on October 27, 2021: contributor
    Bitcoin Core has 3 algorithms for coin selection. All of them are executed and then, the result with the ‘best’ waste metric is chosen. Thinking about privacy, the user could prefer a solution that doesn’t generate change (of course, users that want privacy usually prefer choose the coins manually). Anyway, what if the user could choose to prioritize the solution given by BnB? So, in the case of BnB finds a solution, the other algorithms would not need to be executed.
  2. brunoerg added the label Feature on Oct 27, 2021
  3. brunoerg renamed this:
    wallet: config option to prioritize BnB when possible
    wallet: config option to prioritize 'no change' when possible
    on Oct 27, 2021
  4. bitcoin deleted a comment on Oct 28, 2021
  5. ghost commented at 8:33 am on October 31, 2021: none

    Anyway, what if the user could choose to prioritize the solution given by BnB?

    How about having a config option to decide coin selection algorithm or priority?

    Example: coinselection=abc or coinselection=privacy

    Where abc is an algorithm and privacy is a priority. Other priorities can be fees, utxo etc.

  6. brunoerg commented at 11:49 am on October 31, 2021: contributor

    How about having a config option to decide coin selection algorithm or priority?

    Priority. I used BnB as example because its solution doesn’t generate change. But I think we can use the priority since the algorithms can change and most user don’t know their name.

    What do you think, @prayank23 ?

  7. ghost commented at 12:12 pm on October 31, 2021: none

    I agree with any kind of configuration options related to coin selection

    Last time we discussed this in a different issue and below are different arguments FOR and AGAINST it:

    Maybe: coinselection=1 for privacy, coinselection=2 for fees, coinselection=3 for dust and by default it will work as its working right now

    #20598 (comment)

    Providing so much additional information to users generally makes a bad user experience, especially for users who don’t know how transactions and transaction fees work. I don’t think it would be good to do be suggesting alternatives and telling users to study all this other stuff. The point of having a software manage UTXOs and make transactions is to abstract all of that away from the user. You end with with decision paralysis or users choosing some “obvious” thing without understanding the nuance. I’m certain that if you presented the option for users to have a “prefer lower fees” coin selection, the vast majority of users would pick that and not realize that doing so will create a degenerate wallet in the long run.

    #20598 (comment)

    I think in the future it might make sense to offer different coin selection algorithms, because the one-size-fits-all doesn’t really fit everyone. An algorithm that selects the least amount of input coins to reach the target (for a high feerate tx) could make sense in a wallet that regularly consolidates the change-spam with lower feerates.

    Obviously, there is always the possibility to implement coin selection externally, but not all users of Bitcoin Core might have the expertise to do so.

    #20598 (comment)


    But I think we can use the priority since the algorithms can change and most user don’t know their name. @brunoerg I have reviewed few coin selection related PRs, read few posts, tried reproducing lot of issues, experimenting and still don’t know what all algorithms are used for coin selection by Bitcoin Core and how do they work. Since my priority is mostly privacy for personal transactions I prefer to use coin control and none of the coin selection algorithms however such algorithms can be useful for others especially exchanges. Sometimes even power users make mistakes so algorithms and saved configuration can help them.

  8. brunoerg commented at 7:57 pm on October 31, 2021: contributor

    @prayank23 We have 3 algorithms in Bitcoin Core, the waste metric decides what solution should be used. So, BnB can find a solution with 10 inputs and SRD finds one with 3 inputs but generating change, if the solution provided by SRD is more economic than the BnB one, it will be choose. However, I may not want the most economic, what if I want the solution that doesn’t generate change (for privacy reason)? I don’t think the users should know how the algorithms work, but it would be great if he could choose a strategy. Of course, those who wanna 100% privacy will choose the coins manually, but in some cases not everyone has this possibility.

    Thanks for posting here that other issue, I am reading it..

  9. brunoerg renamed this:
    wallet: config option to prioritize 'no change' when possible
    wallet, coin selection: config option to prioritize 'no change' when possible
    on Nov 2, 2021
  10. brunoerg commented at 10:29 pm on November 10, 2021: contributor
  11. EmmanuelTheCoder commented at 3:42 pm on November 11, 2021: none
    I agree that the user may not have to know how the algorithm works. Users should also be given coin selection liberty.
  12. Aladin-dev commented at 5:27 am on November 24, 2021: none
    Having a configuration option for coin selection by adding the specific algorithm to the wallet
  13. bitcoin deleted a comment on Dec 9, 2021
  14. brunoerg closed this on May 3, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me