Can CPFP and Transaction Cancellation Coexist?

12 replies 211 views
wagmiNewbie
Posts: 301 · Reputation: 14
#1May 25, 2024, 03:20 PM
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?
3 Reply Quote Share
ColdGangMember
Posts: 152 · Reputation: 183
#2May 25, 2024, 07:17 PM
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.
6 Reply Quote Share
orbit1337Senior Member
Posts: 434 · Reputation: 941
#3May 26, 2024, 05:28 AM
Nah, I don't think so.
1 Reply Quote Share
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.
4 Reply Quote Share
CalmMinerFull Member
Posts: 554 · Reputation: 784
#5May 26, 2024, 01:58 PM
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.
0 Reply Quote Share
greg1337Member
Posts: 148 · Reputation: 42
#6May 27, 2024, 07:24 AM
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.
2 Reply Quote Share
dave.forkMember
Posts: 375 · Reputation: 185
#7May 27, 2024, 10:05 AM
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.
0 Reply Quote Share
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.
0 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#9May 27, 2024, 04:09 PM
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.
0 Reply Quote Share
0xSigmaHero Member
Posts: 88 · Reputation: 2072
#10May 29, 2024, 10:57 AM
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.
2 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#11May 29, 2024, 02:12 PM
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.
0 Reply Quote Share
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.
2 Reply Quote Share
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.
2 Reply Quote Share

Related topics