coinselect icon indicating copy to clipboard operation
coinselect copied to clipboard

BIP 125 selection for replacement

Open monokh opened this issue 5 years ago • 2 comments

Replace by fee BIP125 states that at least one input in the transaction needs to be reused in the replacing transaction. Is this something this library should cater for? Such that you also provide the inputs from the previous transaction and the coin selection will ensure that at least one of them is used.

Alternatively are there any workarounds for using this library for RBF transactions?

monokh avatar Apr 23 '20 17:04 monokh

I found that I could use coinselect/accumulative pretty reliably to achieve this if I prioritised the utxos spent in the previous transaction before sending to 'coinselect'. However there probably should be something to 100% guarantee that those prioritised inputs aren't skipped.

monokh avatar Apr 24 '20 15:04 monokh

Agree that this should be prioritized. I wrote something to accomplish this in Coinbase Wallet's codebase. If you only use accumulative for the original and for the replacement it should work 100% of the time already, as long as you guarantee the inputs are the same when both transactions are generated.

spencerstock avatar Nov 29 '23 19:11 spencerstock