-
Notifications
You must be signed in to change notification settings - Fork 57
feat: add consolidation input selection strategy #557
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
base: master
Are you sure you want to change the base?
feat: add consolidation input selection strategy #557
Conversation
Pull Request Test Coverage Report for Build 13778844253Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
05f9f0e
to
d5c2458
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is neat and well thought out. Thank you for the change!
I'd lilke to see a docstring applied to the v2::try_consolidate function as well.
other than that, I believe the most important question left to decide is at what point this is clear enough to include in the API, and whether or not we want to list it as experimental. I will ask BullBitcoin what they think of it. Assuming our other API changes are on track time-wise that we have review capacity to get this into the next release, I welcome the addition.
7b600b5
to
d84676c
Compare
Add a new input selection strategy that optimizes for consolidation when fees are low. This strategy allows receivers to combine multiple UTXOs in a payjoin, subject to configurable constraints: - Maximum fee rate threshold for consolidation - Maximum number of inputs to add - Optional target value to reach - Minimum input value (dust limit) The strategy sorts candidate inputs by value and adds them until reaching either the max inputs limit or target value, but only when the current fee rate is below the specified threshold.
d84676c
to
7e3412e
Compare
Add Consolidation Input Selection Strategy
Overview
This PR introduces a new input selection strategy for receivers that optimizes for UTXO consolidation. This enables receivers to use payjoins as an opportunity to consolidate their UTXOs efficiently, improving their wallet's long-term UTXO management.
Features
SelectionStrategy::Consolidate
option for receiver input selectionmax_consolidation_fee_rate
: Only consolidate when fees are below this thresholdmax_inputs
: Limit the number of inputs to addtarget_value
: Optionally stop adding inputs after reaching a target amountdust_limit
: Minimum value for inputs to be consideredImplementation Details
Considerations
Related Issues
#460