Replaced by fees – What happens if two or more transactions are processed (“hit”) by RBF?
Bitcoin Stack Exchange is a question and answer site for Bitcoin users, developers, and enthusiasts. It only takes 1 minute to sign up.
Sign up to join this community
Anyone can ask questions
Anyone can answer
The best answers are voted on and promoted to the top.
Asked
copy
Episode 22
RBF (Full RBF, Opt-in Full RBF, FSS-RBF) is applied to a transaction when one of its inputs “matches” one of the inputs of the superseding transaction.
But what happens if an input from a replacement transaction “hits” input from two (or more) different transactions?
Does the replacement transaction then replace all “hit” transactions (transactions being replaced)?
For substitution to occur, must the alternative transaction fee be greater than the largest of all “applied” transactions, or may the alternative transaction fee be greater than the sum of all “applied” transaction fees? (or something else)?
What if the node operates in Opt-in Full RBF mode and some transactions “included” in the replacement do not allow for the possibility of replacement (the nSequence of all inputs is
0xffffffff
)? This assumes that the replacement will not occur and the replacement transaction will be declined.
For swaps to be allowed in the mempool, the mempool needs to be improved for miners. So you have to pay more fees than every transaction evicted, you have to pay additional relay fees of your own, and ultimately you can’t evict too many transactions at once. Specifically:
- If a node operates in opt-in full RBF mode, any directly conflicting transaction must check for signal replaceability, otherwise the replacement attempt will fail.
- The superseding transaction must pay at least as many fees as all superseded transactions (including any descendants of the directly conflicting transaction!) plus Its vsize is multiplied by the product of the node. Incremental relay fee.
- The replacement transaction will not use any new, unchecked input that has not already been used by one of the directly conflicting transactions.
- The replacement transaction will have to pay a larger fee than each directly conflicting transaction.
- The sum of the number of children of conflicting transactions does not exceed 100.
You can read more about this topic, for example in the policy paper on Mempool replacement for Bitcoin Core and in glozow’s gist which collects thoughts on improving RBF.
FSS RBF is omitted in this answer. Because we don’t know which nodes in the network implement that policy.