bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Improving Coinselection in BDK

Open rajarshimaitra opened this issue 3 years ago • 4 comments

Description

Coinselection is the scheme to select a set of utxo, from all the available utxos, to create the most optimum spending transaction. Effective coinselection is beneficial for reducing transaction fees as well as improving operation privacy for a wallet. BDK currently uses two coinselection algorithms, LargestFirst and BranchAndBound.

The aim of the project is to

  • include more coinselection algorithms in the library.
  • Add a comparative mechanism to evaluate coinselection results from different algos.
  • Use the most “effective” algorithm chosen by a “specific metric”.

Expected Outcomes

  • General understanding coinselection in Bitcoin protocol.
  • Comparative study between different coinselection algorithms.
  • Coming up with a metric to compare results of different coinselection algos.

Resources

Skills Required

Mentor(s)
@danielabrozzoni

Difficulty : Medium

Competency Test (optional)

  • Install rust, compile and run all bdk examples and tests.
  • Read through the BDK docs.
  • Make a dummy wallet with BDK with different blockchain backends.
  • Familiarity with basic rust, should be able to write custom trait implementations on foreign structures.

rajarshimaitra avatar Nov 30 '21 06:11 rajarshimaitra

Additional reading on coin selection.

Recent: https://bitcoincore.reviews/22009 #435 #120

Historical: https://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf https://scalingbitcoin.org/milan2016/presentations/D2%20-%204%20-%20Mark%20Erhardt.pdf https://scalingbitcoin.org/transcript/milan2016/coin-selection

notmandatory avatar Nov 30 '21 19:11 notmandatory

Hey, I am Tejasvi and I am looking forward to contributing to this project. I am new to rust so currently I am learning it. I have thoroughly gone through the research paper on coin selection. What should be my next step?

Tejasvigupta avatar Mar 01 '22 18:03 Tejasvigupta

Hi @Tejasvigupta are you part of the summer of bitcoin group? And if so have you already gone through their screening? https://guide.summerofbitcoin.org/about/how-it-works

notmandatory avatar Mar 02 '22 04:03 notmandatory

Hi @notmandatory I am a member of the summer of bitcoin group and I have already gone through their screening round.

Tejasvigupta avatar Mar 02 '22 07:03 Tejasvigupta

Closing this issue until we have officially move coin selection out of bdk_wallet and into a new bdk_coin_select crate.

notmandatory avatar Mar 06 '24 21:03 notmandatory