-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implement BNB Selection #1
Labels
good first issue
Good for newcomers
Milestone
Comments
I'll give it a try!! |
aruokhai
pushed a commit
to aruokhai/rust-coinselect
that referenced
this issue
Jul 29, 2024
Pulling all Changes to the Forked Main Repo
delcin-raj
closed this as completed
by moving to review
in
coinselection v0.1.0 task list
Aug 18, 2024
delcin-raj
closed this as completed
by moving to review
in
coinselection v0.1.0 task list
Aug 18, 2024
is this still open?? @delcin-raj ? |
delcin-raj
closed this as completed
by moving to review
in
coinselection v0.1.0 task list
Sep 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implement the BNB Coin selection algorithm and add tests via suitable test vectors.
BNB tries to select inputs in such a way that no change outputs are required.
So the total value of the selected outputs should not exceed the target + dust value
You are expected to follow the thesis of Mark Erhard, Algorithm 10 closely.
Here the author tries to explain the concepts by visualizing a tree but in reality we are not going to create the tree
in our program but rather walk through the imaginary tree using recursion.
The user level public function
should follow Algorithm 9.
The private function
should follow Algorithm 10.
NOTE: mutation of variables should not happen rather those state changes should be passed on correctly in the recursive calls.
In order to do BNP we need to find the exact match so the effective value of a target is optimal rather than
recomputing fee at every step.
So implement the private function
fn effective_value(output: &OutputGroup, option: &CoinSelectionOpt) -> u64
first.For practical purposes we are not going to explore all possible subsets and we want the algorithm to finish faster.
So bnp_tries are decremented for every recursion call and if it reaches 0, terminate the search.
Read the code of generating subsets for understanding, how to manipulate selections using Vec.
Read the implementation of SRD on how to calculate fee and waste.
The text was updated successfully, but these errors were encountered: