cyphernode icon indicating copy to clipboard operation
cyphernode copied to clipboard

RBF+CPFP monster

Open BullishNode opened this issue 2 years ago • 1 comments

  • We want to RBF a transaction. It is 200 bytes and has a fee of 2000 sats, a priori feerate of 10 sats/vbyte.

  • But the transaction has many unconfirmed ancestors.

  • So when doing the RBF we need to take into account the effective feerate of the transaction.

  • We sum the weight of all ancestors + the weight of the transaction we want to RBF.

example: 4 ancestors of 200 vbytes each, for total of 1,000 vbytes

  • We sum all the fees of the ancestors + the fee of the transaction we want to RBF.

example: 4 ancestors at 5 sats/vbyte each is 4000 sats, plus the transaction we want to RBF at 10 sats/vbyte which is 2000 sats, for a total of 6000 sats.

  • We obtain effective rate of the transaction we want to RBF in sat/vbyte.

example: 6 sats/vbyte

  • We set a target for an effective sat/vbyte we want for that transaction, given an estimated confirmation time in blocks.

example: 20 sats/vbyte

  • We calculate how many sats in total we need to obtain our effective rate.

1000 vbytes * 20 sats/vbyte = 20,000 sats

  • Since Bitcoin Core only accepts feerate as argument for RBF, and not fee, we need to calculate the feerate based on the transaction size so that the total fee will be 20,000 sats.

20,000 sats / 200 bytes = 100 sats/vbyte

  • We use the Bitcoin Core bumpfee command with feerate 100 sats/vbyte to obtain an effective feerate of 20 sats/vbyte

BullishNode avatar May 16 '23 18:05 BullishNode

nice, love this. is this done or still open @BullishNode ?

thibistaken avatar May 20 '25 04:05 thibistaken