bitcoindevkit / coin-select

Tool to help you select inputs for making bitcoin transactions.
Other
12 stars 6 forks source link

CPFP: Allow telling coin selector that a candidate has unconfirmed parents #24

Open LLFourn opened 5 months ago

LLFourn commented 5 months ago

I guess this is just a new field on Candidate which lets you say the combined weight and fee of all parents. I think the approach to use in practice in bdk is to roll all inputs that are in an unconfirmed tree into a single candidate. This will give you the correct answer but has the disadvantage of forcing you to spend them altogether. Needs some design work before trying to implement it. Looking at the actual CPFP related logic in core might provide some inspiration.

murchandamus commented 5 months ago

Unfortunately, the problem of assessing the effective feerate of a new transaction in the context of its ancestry can become fairly complex to assess. E.g. when parents have a higher feerate than the transaction to be created, they do not encumber the confirmation of the new transaction; or when a lower feerate parent transaction is already reprioritized by another child transaction, it may similarly not require a bump.

We worked on solving this problem for Bitcoin Core in https://github.com/bitcoin/bitcoin/pull/27021.