LLFourn / bdk_core_staging

Staging area for bdk_core initial development
15 stars 12 forks source link

Add Coin Grouping to CoinSelection #168

Open vladimirfomene opened 1 year ago

vladimirfomene commented 1 year ago

This PR adds an implementation of Coin Grouping to Coin Selection.

I have also added an example to demonstrate how to use the coin-grouping features.

To try it, you will have to manually test it using one of the blockchain clients. Added a command to the CLI that allows you to coingroup following a particular strategy. The only strategy supported right now is Address Reuse. If you run the CLI command with Address Reuse as your grouping strategy. The program will execute coinselection with grouping and without grouping and will show you the waste in each case. Here is command to run for coingrouping

cargo run -- --network regtest coingroup <amount> <address> --coin-group address-reuse -c bnb