Bitcoin Forum
December 24, 2025, 09:39:13 PM *
News: Latest Bitcoin Core release: 30.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: The Conflict Between CPFP and Transaction Cancellation  (Read 144 times)
coinlary (OP)
Full Member
***
Offline Offline

Activity: 241
Merit: 106


View Profile
December 22, 2025, 10:17:17 AM
 #1

Let's assume a transaction was agreed upon by two individuals [Sender & Receiver]. Now, the sender initiates the transaction, but due to network congestion, the transaction gets stuck for a very long time. For a reason, the Receiver couldn't hold their patience, so the Receiver used CPFP with a fee that can get both transactions confirmed.However, unknowingly, the sender already double-spent it back to cancel the transaction entirely.
 
Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?
Mia Chloe
Legendary
*
Offline Offline

Activity: 938
Merit: 1817


Contact me for your designs...


View Profile
December 22, 2025, 10:21:17 AM
 #2

Let's assume a transaction was agreed upon by two individuals [Sender & Receiver]. Now, the sender initiates the transaction, but due to network congestion, the transaction gets stuck for a very long time. For a reason, the Receiver couldn't hold their patience, so the Receiver used CPFP with a fee that can get both transactions confirmed.However, unknowingly, the sender already double-spent it back to cancel the transaction entirely.
Nahhh.. once you cancel a transaction most wallets automatically use a high fee to ensure it gets confirmed almost immediately. And that already means the coin will be marked as spent on the network. That same coin cannot be respent. However assuming the cancellation was not not confirmed before the CPFP, then the CPFP will be validated leaving the cancellation hash invalid.

Every transaction must have an origin and that's why miners have to validate a transaction before they can confirm it else we'll have countless counterfeit coins or people will just double spend to multiply their coins. The idea is one must get confirmed first which is the one with the bigger fees. And that's what determines which will be invalid.

LoyceV
Legendary
*
Offline Offline

Activity: 3906
Merit: 20747


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 22, 2025, 10:23:01 AM
Merited by ABCbits (1), Charles-Tim (1)
 #3

Is it possible for both to actually get confirmed?
No.

When it comes to CPFP vs RBF, miners will most likely select the combination that pays the highest fee per vbyte. If it's the same, they'll just pick one.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
Cookdata
Legendary
*
Offline Offline

Activity: 1540
Merit: 1175


Not Your Keys, Not Your Bitcoin


View Profile
December 22, 2025, 10:37:01 AM
 #4

Let's assume a transaction was agreed upon by two individuals [Sender & Receiver]. Now, the sender initiates the transaction, but due to network congestion, the transaction gets stuck for a very long time. For a reason, the Receiver couldn't hold their patience, so the Receiver used CPFP with a fee that can get both transactions confirmed.However, unknowingly, the sender already double-spent it back to cancel the transaction entirely.
 

Logically, each transaction comes with a fee and miners are going to give priority to transaction with a high fee.

Supposely the median fee is 1 sats/vbyte, the sender decided to double spend with a new transaction fee of 1.5 sats to reverse the transaction while the receiver used 10 sats/vbyte to CPFP, the receiver will likely get mine before the sender cancel the transaction. If the fees are the other way round, the miners prioritize transaction with high fee.

Quote
Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?


The two transactions can't be confirmed at once, one will be confirmed and the other will be dropped from mempools.

Zaguru12
Legendary
*
Offline Offline

Activity: 1288
Merit: 1148



View Profile WWW
December 22, 2025, 10:45:31 AM
 #5


Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?


If you look at it you’re simply just saying that one UTXO or input is spent twice which is never possible, both cases you’re referring to are just replacing the main transaction and the race is for one to get confirmed first, the first to get confirmed invalidates the other transactions, you can only spend an input once.

So the first to get confirmed is the right transaction which is usually based on fee rate since miners now prioritize transactions base on it. If your CPFP get confirmed first, nodes with the RBF transaction will just drop it and vice versa

▄███████████████████▄
████████████████████████
██████████▀▀▀▀██████████
███████████████▀▀███████
████████▄▄████▄▄███████
███████████████████████
██████████▀██▀██████████
█████████▄████▄▄▄▄██████
██████▀████▄▄████▀██████
████████▀████████▀██████
██████▄████▀▀▀▀█████████
█████████▄▄████▄▄████████
▀███████████████████▀
.
 BC.GAME 
███████████████
███████████████
███████████████
███████████████
██████▀░▀██████
████▀░░░░░▀████
███░░░░░░░░░███
███▄░░▄░▄░░▄███
█████▀░░░▀█████

███████████████

███████████████

███████████████

███████████████
███████████████
███████████████
███████████████
███████████████
███░░▀░░░▀░░███
███░░▄▄▄░░▄████
███▄▄█▀░░▄█████
█████▀░░▐██████
█████░░░░██████

███████████████

███████████████

███████████████

███████████████
███████████████
███████████████
███████████████
███████████████
██████▀▀░▀▄░███
████▀░░▄░▄░▀███
███▀░░▀▄▀▄░▄███
███▄░░▀░▀░▄████
███░▀▄░▄▄██████

███████████████

███████████████

███████████████

███████████████

DEPOSIT BONUS
..470%..
GET FREE
...5 BTC...

REFER & EARN
..$1000 + 15%..
COMMISSION


 Play Now 
internetional
Legendary
*
Offline Offline

Activity: 2030
Merit: 2808



View Profile
December 22, 2025, 11:07:43 AM
Merited by nc50lc (1), Cookdata (1)
 #6

I would like to add one important nuance here.

Even if one of the conflicting transactions has a higher fee, miners do not magically see all transactions at the same time. A miner can only choose between transactions that have already reached their mempool. It is entirely possible that one transaction propagated through the network and reached a miner, while the competing transaction was broadcast just moments before the block was found and simply did not reach that miner in time. Since nobody knows when the next block will be mined, this propagation risk always exists.

So in practice, a miner will include either the transaction (or transaction package via CPFP) with the higher effective fee or the one that happened to reach them first. Fee rate improves your odds, but it does not eliminate the risk of losing a race between conflicting transactions.

█████████████████████████
█████████████████████████
███████▀█████████▀███████
█████████████████████████
█████████████████████████
████████████▀████████████
███████▀███████▄███████
███████████▄▄▄███████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████

 2UP.io 
NO KYC
CASINO
██████████████████████████
████████████████████████
███████████████████████
███████████████████
██████████████████████
███████████████████████
███████████████████████
██████████████████
███████████████████████
██████████████████
███████████████████████
████████████████████████
██████████████████████████
███████████████████████████████████████████████████████████████████████████████████████
 
FASTEST-GROWING CRYPTO
CASINO & SPORTSBOOK

 

███████████████████████████████████████████████████████████████████████████████████████
███████████████████████████
█████████████████████████
███████████████████████
███████████████████████
████████████████████████
███████████████████████
███████████████████████
██████████████████████
████████████████████████
███████████████████████
███████████████████████
█████████████████████████
███████████████████████████
 

...PLAY NOW...
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1890
Merit: 9194


Bitcoin is ontological repair


View Profile
December 22, 2025, 02:34:29 PM
 #7

Even if one of the conflicting transactions has a higher fee, miners do not magically see all transactions at the same time.
In addition to that, even if miners have all transactions, it's still not granted they'll pick the optimal combination that maximizes their profit. The algorithm used to select the optimal set of transactions is NP-hard. Miners pick a set of transactions that is profitable enough, but not always the most profitable. That's because picking something good enough is very often a process that finishes a lot faster than finding the best one.

So, the right answer is that they'll just choose one, nearly randomly, if CPFP pays around the same as RBF:
When it comes to CPFP vs RBF, miners will most likely select the combination that pays the highest fee per vbyte. If it's the same, they'll just pick one.



▄▄▄▄▄▄▄▄▄▄▄░▄▄▄▄▄███▄▄▄▄▄▄▄▄▄███▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄░▄▄▄▄▄▄░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄░▄▄▄▄▄░▄▄▄▄▄▄▄░███████████████████░░████████▄▄░███████████████████████████████
▄█████████████████████████████████████████████████████████████░░██████████▄█████████████████▀▀███████████▀
████████████████████████████████████████████████████████████░░█████████████████████████▀████▄███████▀░░
████▄▄███████████████████████████████▄▄██████████████████████░▄██████████████████████████▄███▄███████░░░░
▀█████████████████████████████████████████████████████▀██████████████████▀▀████████████████▄▄▄█████████▄░░
██████████░▀███▀█████████████▀░▀████▀███████▀█████████████▀████████████████░░▀▀████████░▀█████████████████▄
█████████████▀███████▀▀▀████▀████▀████▀░░▀██████████████████
█████████████████████████████████████████████████████████████████████████████████▀▀▀▀▀▀
███████████████████████████████████████████████▀███▀
.
..100% WELCOME BONUS  NO KYC  UP TO 15% CASHBACK....PLAY NOW...
hosemary
Legendary
*
Offline Offline

Activity: 2982
Merit: 6754



View Profile
December 22, 2025, 03:37:30 PM
Merited by Charles-Tim (1)
 #8

If the sender use CPFP to cancel the transaction and the CPFP transaction has been successful, the receiver will not be able to use CPFP.
You probably meant RBF, not CPFP. Because you can't cancel a transaction with CPFP.
Using CPFP, you can only make the transaction get confirmed faster. It's RBF that allows you to replace a transaction with a one sending the funds to yourself.

nc50lc
Legendary
*
Offline Offline

Activity: 2996
Merit: 8171


Self-proclaimed Genius


View Profile
December 23, 2025, 09:30:08 AM
Merited by coinlary (1)
 #9

Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?
There seem to be a misunderstanding on how RBF/CPFP work and how the fee is paid due this question.
Let me use your example scenario to explain;

From the sender side:
  • Let's label the sender's original transaction as "Txn A1".
  • Then "Txn A2" is his replacement transaction that aims to be included to a block instead of A1.
Since both are spending the same input, only one of them can be accepted by each individual node.
Nodes select based on a few factors like RBF policy of the particular node, which one it seen first, was the other txn already dropped (since you mentioned "very long time"), etc.
Pools and Solo miners have their own mempool as well so they're also subjected to that, unless their method of acquiring transactions is unique.

Then, from the receiver side:
  • Aside from Txn A1, there's "Txn B" that spends Txn A1's output to bump its effective fee rate.
Since he managed to create a CPFP despite the sender already replaced A1 at his end, let's assume that his node isn't aware of A2.
And since it's trying to spend A1's output, it will only get relayed by nodes that has Txn A1.

Now it's a "race" on which can get to a miner that will mine the next block first.

With those in mind, there're two scenarios:
  • If Txn A1 got confirmed, his CPFP Txn B can also get confirmed.
  • But if Txn A2 got confirmed, Txn B will be dropped by nodes that has the latest block because they'll see that its parent Txn A1 is now invalid at that point.

As for the fee, it's not paid up front to the miner,
It's just the difference between the inputs' and outputs' total amount, they can get it when they included the transaction to their block.

MusaMohamed
Sr. Member
****
Offline Offline

Activity: 1358
Merit: 377



View Profile
Today at 03:59:28 AM
 #10

Let's assume a transaction was agreed upon by two individuals [Sender & Receiver]. Now, the sender initiates the transaction, but due to network congestion, the transaction gets stuck for a very long time. For a reason, the Receiver couldn't hold their patience, so the Receiver used CPFP with a fee that can get both transactions confirmed.However, unknowingly, the sender already double-spent it back to cancel the transaction entirely.
 
Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?
Child Pay For Parent (CPFP) costs more than Replace By Fee (RBF) and needs more conditions to use, so if it is possible, let's make your priority of using Replace By Fee in order to pump fee rate of your stuck transaction in the mempool.

Bitcoin open source wallets that support replace-by-fee (RBF).
Turn non-RBF transaction to RBF enabled?
[TUTORIAL] Getting a low-fee transaction unstuck by creating a CPFP with Electrum.
My Bitcoin transaction is not confirming, what can I do?

▄▄█▀███████▀█▄▄
▄█▀▄███░█████▄▀█▄
███████████████████
█████▀▀▀███████
▀█▄███▀███░███▀███▄█▀
███▀▀▀▀▀▀▀▀▀▀▀▀▀███
███▄▄████▀▀▀████▄▄███
█████▀▄▀▄█▀██████████
▐████▄█▄█▀███▀████████▌
███████▄▀▀▄███████
███████▀▀▀▀▀▀▀████████
▀█████▀▀██▄█████▄██▀▀█████▀
▀▀███▀▀

TOSHI.BET  
 
████████████████████████
███████████
████
█████████████
███
██████████████████
████████
███████████████
███████
█████████████████
██████
███████████████████
██████
███████████████████
██
████████████████████
██
███████████████████████
██
█████████████████████
███
██████████████████
█████████
████████
███████████
█████████
████████████████
█████████████████████
███████████████████████
█████████████████████████
████████
████████████████
██████
███████████████████
████
█████████████████████
███
██████████████████████
██████████████████████
███████████████████
████████████████
███████████
████████████████████████

  GOD'S CHOSEN CASINO & SPORTSBOOK


████████████████████████
 [
PLAY NOW
]
nc50lc
Legendary
*
Offline Offline

Activity: 2996
Merit: 8171


Self-proclaimed Genius


View Profile
Today at 05:33:05 AM
 #11

Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?
Child Pay For Parent (CPFP) costs more than Replace By Fee (RBF) and needs more conditions to use, so if it is possible, let's make your priority of using Replace By Fee in order to pump fee rate of your stuck transaction in the mempool.
This isn't what OP is asking, nor even relevant to the question.

Please thoroughly read that "sender and recipient" scenario that he described,
It isn't actually about bumping transactions but about the most probable result when that situation happened and why/how.

Jaksonhard
Member
**
Offline Offline

Activity: 192
Merit: 13


View Profile WWW
Today at 02:07:52 PM
 #12

Let's assume a transaction was agreed upon by two individuals [Sender & Receiver]. Now, the sender initiates the transaction, but due to network congestion, the transaction gets stuck for a very long time. For a reason, the Receiver couldn't hold their patience, so the Receiver used CPFP with a fee that can get both transactions confirmed.However, unknowingly, the sender already double-spent it back to cancel the transaction entirely.

This situation is an example of where the CPFP of the receiver will only work if the original transaction still exists in the mempool and has not been replaced. The moment the sender successfully double spends and miners mine the replacement transaction, the original transaction is considered invalid and therefore the resulting CPFP transaction will also not be confirmed, resulting in wasted effort and time. The receiver cannot recover any fee because the CPFP was never successfully added to the blockchain. This serves as an example of the need for trust when using CPFP on unconfirmed transactions.

 
Is it possible for both to actually get confirmed? If the answer is yes, then what happens to the fee of CPFP if the double-spend scaled through and CPFP got droppedlater?

Under normal conditions, both types of transactions cannot be confirmed at the same time. Therefore, one type of spend would take precedence and get added to the blockchain, while the other would be dropped. If the double spend replaces the initial transaction, the CPFP transaction will then be rendered invalid and not confirmed in a block, which means that there will be no fee paid for this transaction.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!