TL;DR: Due to the two asymmetric sets of rules for replacement, a total of five transactions is sufficient to make a cycle of replacements that beat each other in turn. This allows an attacker to rebroadcast the same transactions over and over while at most paying for one small transaction per block.
In all of the graphics an arrow points from child to parent, while a dotted line with a socket and ball points from original to replacement with socket and ball at the side of the replacement. A socket without ball (see Step 4) indicates an indirect conflict with the socket on the side of the replacement.
You have three confirmed UTXOs c1
, c2
and c3
. Let’s say 20 s/vB is the bottom of the first block.
- You create
tx_LL
, a large low-feerate transaction with 100,000 vB at 1 s/vB (fee: 100,000 s). It spends the confirmed output c1
and has an output tx_LL:0
.
- You attach a small low-feerate transaction
tx_LS
as a child with 100 vB at 1 s/vB (fee: 100 s) by spending tx_LL:0
.
- You replace
tx_LS
with tx_HS
a high-feerate transaction that spends c2
and tx_LL:0
. tx_HS
has 5000 vB and pays 21 s/vB, but since it spends an output of a low-feerate parent, its mining score is only 1.95 s/vB.
- You replace
tx_LL
with tx_LM
that has 100,000 vB and pays 3.05 s/vB (fee: 305,000 s) by spending the outputs c1
and c3
. tx_LM
also indirectly replaces tx_HS
even while tx_HS
has a higher individual feerate. This is permitted, since tx_LM
pays a higher total fee than the replaced transactions and because it only conflicts directly with tx_LL
it only has to beat the feerate of tx_LL
but not the feerate of tx_HS
.
- You use the new RBFr rules to replace
tx_LM
with a small high feerate transaction tx_RBFr
with 200 vB paying 20 s/vB (fee: 4000 s) that spends c3
and makes it into the top block of the mempool. tx_LM
was not going to be in the next block, and tx_RBFr
pays more than 1.25× the feerate of tx_LM
. So this is permitted under the new rules.
- As no transaction in the mempool spends
c1
, you then rebroadcast tx_LL
and tx_LS
.
- You immediately replace both
tx_LS
and tx_RBFr
with tx_HS
. tx_HS
has a feerate of 21 s/vB which is higher than tx_RBFr
(20 s/vB) and tx_LS
(1 s/vB), and pays more absolute fees than both (105,000 s vs 2000 s + 100 s). But since it’s a child of tx_LL
it only has a mining score of 1.95 s/vB.
Repeat 4.–7. to make every node on the network cycle the same five transactions ad nauseam. Roll the locktimes or sequences to make the transaction have a new TXIDs in each iteration, while spending the same UTXOs. The only transaction that is ever in any danger of getting mined is tx_RBFr
which costs you 4000 sats. If it it does get included in a block, just start over with two new confirmed UTXOs as your c2'
and c3'
.