2

As far as I know Bitcoin Core knows two types of RBF. These are Full RBF and Opt-in Full RBF. In both cases, the transaction will be replaced if a new one arrives that consumes at least one of the same inputs, is valid and has a higher fee. The only difference is that with Full RBF this applies to every transaction, while with Opt-in Full RBF transactions must signal it (some nSequence smaller than 0xffffffff-1).

  1. What other types of replacement exist, either "replace by fee" or some other? (I just need the list, I'll research what they are myself)

Here they mention Child-Pays-For-Parent (CPFP), Replace-By-Fee (RBF; I assume this means both Full RBF/Opt-in RBF; correct me if I'm wrong) and First-Seen-Safe Replace-By-Fee (FSS RBF). It doesn't mention Opt-in Full RBF but I assume that's what's considered under RBF since it's actually Full RBF where the transaction has to signal replacement, correct me if I'm wrong. By the way, the answer is from 2015, so I'm interested in whether there are more types of replacement in Bitcoin.

  1. Does Bitcoin Core support CPFP and FSS RBF, as well as all the types you listed in the answer to question 1?

  2. What type of replacement does Bitcoin Core use by default? I know that it was an Opt-in Full RBF and that there were some indications to switch on Full RBF.

Thanks to all!

2 Answers 2

4

The original software release included a mechanism that allowed transactions with a higher sequence on inputs to supersede transactions with a lower sequence. This mechanism was not incentive-compatible and got removed.

First-Seen-Safe RBF was a proposal that would only permit a replacement when the replacement transaction replicated all outputs from the original transaction. This would have meant that almost every new replacement transactions would add another change output (whereas only one of the original inputs had to remain, so one or more of the others could have just been swapped out for UTXOs with larger amounts). The protection FSS RBF offered to unconfirmed transactions was also generally considered unreliable. For these reasons and others, the proposal was not popular and the network instead adopted Opt-in Full RBF.

The "opt-in" requires the original transaction to signal replaceability, by having at least one input with a sequence field lower than MAX-1. "Full RBF" in this context meant that a replacement was permitted to completely supersede the original transaction without preserving any of the payments that the original transaction had announced. The replacement transaction would still need to pay a higher absolute fee as well as a higher feerate.

Full nodes operating under these mempool policies would not permit replacement of transactions that had signaled finality, much like for every transaction before Opt-in Full RBF got adopted.

More recently, Bitcoin Core got a configuration option that allows node operators to permit "Full RBF" replacements per the same rules, without requiring the original transaction to have signaled replaceability.

CPFP is another mechanism to reprioritize a pending payment, but CPFP is not a replacement mechanism. CPFP works by adding a higher feerate transaction as a dependent to an existing transaction. Miners are incentivized to include both the parent and the child in order to collect the attractive fee on the child transaction.

8
  • Thanks for this comprehensive answer. I have one question related to what you wrote for FSS-RBF. By writing this: "This would have meant that replacement transactions would have often ended up with two change outputs." you meant that since we can't change outputs (we can't just decrease change output value - output that return sats back to us - in order to increase fee) we need to add one additional input and change output, and by that way to increase fee. The result is that we have at least 2 change outputs (and maybe more if we do FSS-RBF again) Did I understand you correctly?
    – LeaBit
    Dec 4, 2023 at 20:19
  • Yes, you would generally need to add another change output with each replacement, unless your input set for the replacement happens to not need change, but you could keep just one input stable across all replacements and swap out other ones with larger UTXO amounts.
    – Murch
    Dec 4, 2023 at 20:30
  • 1
    Hmm. So you meant the following. Original transaction: inputs(10 bc, 5bc) - outputs(13bc, 1bc). Second output is change and fee is 1bc. If 1bc is not enough (2bc is), we can make the replacement transaction as follow (11bc, 5bc) - outputs(13bc, 1bc). In this case, we just changed one input and outputs stayed as they were (no additional change outputs). However, it is much more realistic for the replacement transaction to look like this: inputs(14bc, 5bc) - outputs(13bc, 1bc, 3bc) or inputs(12bc, 3, 5bc) - outputs(13bc, 1bc, 4bc).
    – LeaBit
    Dec 4, 2023 at 20:49
  • 1
    No, only a single input is necessary to create a conflict with the preceding transactions, therefore the number of inputs can vary freely, but generally would be greater than one after the original, although their total amount must go up with each replacement. So, you might have an input that is present on the original and all subsequent versions of the transaction, but the remainder could for example be two inputs summing to 1 BTC (and two change outputs), then five inputs summing to 2 BTC (and three change outputs), finally a single input worth 3 BTC (and four change outputs).
    – Murch
    Dec 4, 2023 at 22:05
  • 1
    No, since you have to replicate all outputs of the previous version of the transaction, the sum of the amounts of the inputs has to strictly go up in order for you to be able to pay more fees.
    – Murch
    Dec 4, 2023 at 23:14
0
  1. Here you can find a list of all transaction replacement types (no mention of CPFP).

  2. Bitcoin Core today only supports Full RBF and Opt-in RBF. Bitcoin Core also supports CPFP (but that is not a transaction replacement policy).

enter image description here

  1. By default, Bitcoin Core uses Opt-in RBF.
7
  • 1
    CPFP is not a transaction replacement policy (no replacement is involved). It's a quality the mining algorithm has to prioritize parent transactions when the child pays a higher fee. It can be used as an alternative to replacement in dealing with transactions whose fee is too low, but through a completely different mechanism. Dec 4, 2023 at 12:39
  • In your table, what is "Satoshi RBF"? Dec 4, 2023 at 12:40
  • @PieterWuille I took the image/table from here.
    – LeaBit
    Dec 4, 2023 at 12:48
  • 1
    None that I know of, no. Dec 4, 2023 at 12:52
  • 1
    Miners need to get their block template from somewhere, and typically that comes from Bitcoin Core directly or indirectly. The block building feature in Bitcoin Core supports CPFP since version 0.13.0. Dec 4, 2023 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.