Bitshala-Incubator / silent-pay

a TS library for silent payments
MIT License
8 stars 10 forks source link

Implement multi-algorithm coin selection #25

Open theanmolsharma opened 5 months ago

theanmolsharma commented 5 months ago

The current CoinSelector class only implements the Lowest Larger coin selection algorithm. The goal is to implement Branch and Bound coin selection and Single Random Draw selection, then use a waste metric to pick the best selection.

Things to implement in CoinSelector class :

  1. selectBranchAndBound()
  2. selectSingleRandomDraw()
  3. getWaste()
  4. update select() in CoinSelector class to call all 3 algorithms, calculate waste for all selections and choose the one with least waste.

References: Our implementation is very very similar to bcoin's implementation so I suggest reading attemptSelection() and the functions it calls.

Ayush170-Future commented 4 months ago

Since no one is assigned. I'll start working on this.

theanmolsharma commented 4 months ago

Since no one is assigned. I'll start working on this.

This issue is not a high priority. #24 is a higher priority. I'd appreciate if you work on that instead of this.

24 is a bit more involved issue, so before you start implementing code, I'd like to see a short description of what changes you'd need to make and how you'd do it. In summary, make a plan first.

Ayush170-Future commented 4 months ago

Since no one is assigned. I'll start working on this.

This issue is not a high priority. #24 is a higher priority. I'd appreciate if you work on that instead of this. #24 is a bit more involved issue, so before you start implementing code, I'd like to see a short description of what changes you'd need to make and how you'd do it. In summary, make a plan first.

Okay, I'll start working on it.