So here's a scenario: two guys agree to a transaction. The sender goes ahead but the network's super congested, and it's stuck for ages. The receiver can't wait and uses CPFP to boost the fee and get both transactions confirmed. But, guess what? The sender decides to double-spend to cancel it. Can both still go through? And if so, what happens to the CPFP fee if the double-spend goes through?
Can CPFP and Transaction Cancellation Coexist?
12 replies 211 views
Not likely. When you cancel a transaction, most wallets pump the fee up to get it confirmed fast. That means the coin's marked as spent. If the cancellation isn't confirmed before the CPFP, then the CPFP transaction gets validated, leaving the cancellation hash invalid.
Nah, I don't think so.
diamond_minerFull Member
Posts: 138 · Reputation: 623
#4May 26, 2024, 10:59 AM
When we’re talking CPFP and RBF, miners usually go for the one that pays the highest fee per vbyte. If they’re equal, they might just pick randomly.
True, miners prioritize higher fee transactions. Say the sender tries to reverse with a low fee while the receiver’s CPFP is high. The CPFP will likely get mined first. They can’t both be confirmed; one gets tossed from the mempool.
You're saying one input can be spent twice which is impossible. Those transactions are just racing for confirmation. The first one confirmed makes the others invalid. Miners focus on fee rate, so the winning transaction is the one with the highest fee.
I gotta add something important here. Even if one transaction has a higher fee, miners don't see them all at once. One could reach a miner while the other didn’t yet. Timing matters a lot in this game.
chrisomegaFull Member
Posts: 158 · Reputation: 631
#8May 27, 2024, 10:42 AM
Exactly, even if miners see everything, that doesn’t mean they’ll pick the best profiting combo. The selection process is complicated and takes time. Miners will often just choose one that seems good enough instead of the optimal.
Wait, I think you mixed things up. You can’t cancel a transaction with CPFP. CPFP is about speeding up a transaction, while RBF replaces one transaction with another.
There’s some confusion about how RBF and CPFP really work. Let's use your scenario: the sender’s first transaction is Txn A1. Txn A2 would be his replacement that wants to get confirmed instead. Only one can get through since they're using the same input.
CPFP generally costs more than RBF, and it's trickier to use. It might be better to prioritize RBF to boost the fee on your stuck transaction.
gwei_blockNewbie
Posts: 185 · Reputation: 37
#12May 31, 2024, 06:18 AM
This isn’t really addressing what OP asked. Read the scenario carefully. It’s not just about bumping transactions, but about the most likely outcome of that conflict.
ben.matrixNewbie
Posts: 3523 · Reputation: 35
#13May 31, 2024, 09:57 AM
I think OP is making a good point about CPFP. It can only work if the receiver's wallet isn't aware of the sender's replacement transaction. Once the sender's transaction is in the mempool, the original one gets evicted.