Bitcoin Forum
November 10, 2024, 09:57:48 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can unconfirmed transactions be automatically cancelled by RBF  (Read 260 times)
Oshosondy (OP)
Legendary
*
Offline Offline

Activity: 1624
Merit: 1201


Gamble responsibly


View Profile
May 31, 2021, 07:12:39 PM
Merited by o_e_l_e_o (2), GeorgeJohn (2)
 #1

I was thinking about unconfirmed transaction and RBF today, this came to my mind after reading a post about it on this forum, I just want to be sure of what will happen.

Assuming I sent bitcoin to a friend that is using electrum wallet, the bitcoin transaction was not yet confirmed and it is taken too long, he decided to create CPFP and use it to send the bitcoin to another address on his electrum wallet. But my friend also mistakenly use low fee too, which makes the child transaction also to be stuck.

If I use RBF during this time for the original transaction, that means the unconfirmed CPFP will be invalidated?
Or I will not be able to create RBF because the transaction already has child transaction?

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
hosseinimr93
Legendary
*
Offline Offline

Activity: 2576
Merit: 5676



View Profile
May 31, 2021, 07:22:18 PM
Merited by o_e_l_e_o (2)
 #2

If I use RBF during this time for the original transaction, that means the unconfirmed CPFP will be invalidated?
When you bump the fee, you actually replace the transaction with a new one. Since the new transaction has a new hash, all children of the original transaction become invalid.


Or I will not be able to create RBF because the transaction already has child transaction?
Any RBF-enabled transaction can be replaced by a new one if the second transaction pays a higher fee and it spends at least one of inputs of the original transaction.
This can be done even if the original transaction has several children.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18746


View Profile
May 31, 2021, 08:11:01 PM
Merited by DaveF (2), nc50lc (1)
 #3

hosseinimr93 is right, but one additional clarification:

This can be done even if the original transaction has several children.
Any RBF transaction you broadcast must pay both a higher fee rate and a higher absolute fee than not just the transaction it is replacing, but of all the transactions which would be evicted from the mempool if it were to be accepted. So if an unconfirmed transaction has several unconfirmed children, then you would need to add together the total fee paid by all of them and set your RBF transaction to have a higher fee than that, and not just a higher fee than the parent transaction you are replacing.
DaveF
Legendary
*
Offline Offline

Activity: 3654
Merit: 6664


Crypto Swap Exchange


View Profile WWW
May 31, 2021, 08:34:44 PM
 #4

Any RBF transaction you broadcast must pay both a higher fee rate and a higher absolute fee than not just the transaction it is replacing, but of all the transactions which would be evicted from the mempool if it were to be accepted. So if an unconfirmed transaction has several unconfirmed children, then you would need to add together the total fee paid by all of them and set your RBF transaction to have a higher fee than that, and not just a higher fee than the parent transaction you are replacing.

I thought it was just the fee for the inputs that came from the parent transaction. You are saying that it is the fee for the entire child transaction.
Learn something new everyday.
Kind of handy if someone sends you a RBF transaction with a low fee, you can 'lock' it by adding a bunch of dust inputs if you have them and also sending with a low fee so they can't just RBF it without paying to move your dust.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18746


View Profile
May 31, 2021, 09:05:59 PM
Merited by DaveF (1)
 #5

You are saying that it is the fee for the entire child transaction.
Correct. It is the combined fee for everything you are ejecting from the mempool, which includes both the parent transaction you are directly replacing and any and all child transactions which stem from that parent transaction.

You can see this in the text of BIP125 (emphasis added):

One or more transactions currently in the mempool (original transactions) will be replaced by a new transaction (replacement transaction) that spends one or more of the same inputs if,
...
3. The replacement transaction pays an absolute fee of at least the sum paid by the original transactions.

Kind of handy if someone sends you a RBF transaction with a low fee, you can 'lock' it by adding a bunch of dust inputs if you have them and also sending with a low fee so they can't just RBF it without paying to move your dust.
Also correct. This is known as transaction pinning. See the first bullet point here for the exact scenario you have described: https://bitcoinops.org/en/topics/transaction-pinning/
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6366


Self-proclaimed Genius


View Profile
June 01, 2021, 03:28:31 AM
Merited by o_e_l_e_o (2), ABCbits (1)
 #6

-snip-
If I use RBF during this time for the original transaction, that means the unconfirmed CPFP will be invalidated?
Or I will not be able to create RBF because the transaction already has child transaction?
The previous posts are true based from the RBF rules,
but take note that there are clients that will not let your perform RBF if the transaction has a child.

One big example is Bitcoin Core GUI (bitcoin-qt), once your transaction has an unconfirmed child in your mempool, it wont let you select "increase fee" option.
bumpfee wont also work, but it's still possible to manually create a replacement transaction using commands.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
June 01, 2021, 04:45:02 PM
Merited by o_e_l_e_o (2), DaveF (1), BitMaxz (1), ABCbits (1)
 #7

The previous posts are true based from the RBF rules,
but take note that there are clients that will not let you perform RBF . . .

Also important to bee aware that these are the rules that are implemented in those nodes and miners that happen to be honoring them.  However, there is nothing in the consensus rules that prevents a miner from creating a block with the original transaction and confirming it even if you've broadcast a replacement.  Miners are generally interested in increasing their revenue, and so will typically be more interested in confirming the replacement transaction to increase their revenue, but the possibility still exists that the original transaction could confirm regardless of how big you make the fee on the replacement transaction.

RBF does NOT provide a tool to guarantee cancelation of a previously broadcast transaction, it just provides a method to encourage the mining pools to consider your replacement transaction as an opportunity to increase their profits.
khaled0111
Legendary
*
Online Online

Activity: 2702
Merit: 3045


Top Crypto Casino


View Profile WWW
June 03, 2021, 10:44:06 PM
 #8

It's also important to note that if the original transaction has more than 99 child transactions, it can't be replaced no matter how much fee the replacement transaction pays.

Correct. It is the combined fee for everything you are ejecting from the mempool, which includes both the parent transaction you are directly replacing and any and all child transactions which stem from that parent transaction.

You can see this in the text of BIP125 (emphasis added):

One or more transactions currently in the mempool (original transactions) will be replaced by a new transaction (replacement transaction) that spends one or more of the same inputs if,
...
3. The replacement transaction pays an absolute fee of at least the sum paid by the original transactions.
Are you sure the fees paid by child transactions have to be included too? Because, the way I interpreted it, by "original transactions" I believe they mean only the transactions which ,at least, one of their inputs is going to be consumed by the replacement transaction! (=> a replacement transaction can cancel/replace multiple transactions by consuming inputs from each one of them).

ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
June 03, 2021, 11:26:01 PM
 #9

It's also important to note that if the original transaction has more than 99 child transactions, it can't be replaced no matter how much fee the replacement transaction pays.
Actually, since Bitcoin Core limit the number of ancestor transactions in an unconfirmed chain to 25, the 99 child transaction is quite redundant. You wouldn't be able to do RBF with anything longer than that as the transactions simply wouldn't have even been relayed.

I think the BIP is a bit outdated and the limit was changed after the BIP was drafted.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
khaled0111
Legendary
*
Online Online

Activity: 2702
Merit: 3045


Top Crypto Casino


View Profile WWW
June 04, 2021, 08:22:47 PM
 #10

Thank you @ranochigo for the information. So, this rule overrides the RBF third rule mentioned in bip125
This means you can't make CPFP if the parent transaction has more than 25 ancestor, right!

Regarding my question to @o_e_l_e_o, I did a quick research about "transaction pinning" and find out he was right:
BIP125 RBF rule #3 requires a replacement transaction pay a higher absolute fee (not just feerate) than the transaction being replaced and any of its children.

o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18746


View Profile
June 05, 2021, 07:03:59 AM
 #11

Actually, since Bitcoin Core limit the number of ancestor transactions in an unconfirmed chain to 25, the 99 child transaction is quite redundant.
Not necessarily.

The rule states the total number of transactions evicted from the mempool must not exceed 100 transactions. That does not mean all 100 have to be a single parent to child chain, such as A -> B -> C -> D -> etc. I could create a parent transaction with 2 outputs, create two new unconfirmed transactions - one from each of those outputs - with a further 2 outputs each, create four new unconfirmed transactions from each of those outputs, and so on. I could even just create a single parent transaction with 100 outputs, and then spend each of those outputs. The ancestor count will be well under 25 for all the children, while an RBF on the parent would still have to evict >100 transactions.
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
June 05, 2021, 10:40:51 AM
 #12

Not necessarily.

The rule states the total number of transactions evicted from the mempool must not exceed 100 transactions. That does not mean all 100 have to be a single parent to child chain, such as A -> B -> C -> D -> etc. I could create a parent transaction with 2 outputs, create two new unconfirmed transactions - one from each of those outputs - with a further 2 outputs each, create four new unconfirmed transactions from each of those outputs, and so on. I could even just create a single parent transaction with 100 outputs, and then spend each of those outputs. The ancestor count will be well under 25 for all the children, while an RBF on the parent would still have to evict >100 transactions.
Thanks.. I misinterpreted the BIP and thought it was referring to a single transaction chain.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!