Author

Topic: How Replace-By-Fee (RBF) an Child-Pays-For-Parent (CPFP) can speed up confirmati (Read 442 times)

legendary
Activity: 2268
Merit: 18711
If you turned it off in the past, forgot about it, you might have trouble in future.
Full RBF is now widespread. You can fairly easily replace a transaction with a higher fee transaction, even if the original is opted out of opt-in RBF. You can see all recent full RBF replacements here: https://mempool.space/rbf#fullrbf
hero member
Activity: 1442
Merit: 775
Good writeup. I would also include that replace by fee can only be done with the inputs (sending address) and child pays for parent can only be done by one of the outputs (receiving addresses).
[TUTORIAL] getting a low-fee transaction unstuck by creating a CPFP with electrum

Quote
Both are really powerful functions and I use them all the time. Sparrow Wallet supports both of them which is one of the many reasons why it is the only desktop wallet that I ever recommend to anyone.
To avoid inconvenience from Child Pay For Parents, because you won't always have access to private keys or receiving address, you must always tick on Replace-by-Fee in your non custodial wallet. Default, wallet software turns it on but make sure you check it is on or off. If you turned it off in the past, forgot about it, you might have trouble in future.
member
Activity: 237
Merit: 93
Humble Bitcoin Stacktivist
Good writeup. I would also include that replace by fee can only be done with the inputs (sending address) and child pays for parent can only be done by one of the outputs (receiving addresses).

Both are really powerful functions and I use them all the time. Sparrow Wallet supports both of them which is one of the many reasons why it is the only desktop wallet that I ever recommend to anyone.
legendary
Activity: 2268
Merit: 18711
I am not have any pending transaction at the moment and I don't remember exact descriptions for two options. Preserved payment and another option.
The current options are "Preserve payment" or "Decrease payment".

However, these options were simplified from the older three options in version 4.4.6. Since in bitmover's screenshots he is still using 4.3.4, he will see the old options as follows:
- "decrease change, or add new inputs, or decrease any outputs"
- "decrease change, or decrease any outputs"
- "decrease payment"
hero member
Activity: 1442
Merit: 775
This was the first time I made this kind of transaction. Just googled about it and found this topic.

Very easy and straightforward in Electrum, just as odolvlobo mentioned.



Just right click on the unconfirmed transaction and choose increase fee. The old transaction simple disappeared.
I am very surprised that you did not use this RBF (Increase fee/ Bump fee) after many years. You had to understand about Bitcoin mempools very well that I know you did. But you also have to very lucky that mempools never sudden increase after you broadcast your transaction and you also have good patience to wait for confirmation in such situations of mempool sudden increase.

I did not see you mention in your post and screenshot and I assume you did not know about it.

In Electrum wallet, when you click on Increase fee, you will have to choose to deduct the bump fee from a transaction value or don't deduct it. If in your initial transaction broadcast, you use all coin in your wallet, you will see an error. I am not have any pending transaction at the moment and I don't remember exact descriptions for two options. Preserved payment and another option.



My Bitcoin transaction is not confirming, what can I do?
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Replace-By-Fee (RBF)

RBF is straightforward. A stuck transaction is replaced by reusing the same coins in a similar transaction that pays a higher fee. A miner can only confirm one of the two transactions, so they will confirm the one that pays the higher fee. If the fee is high enough, they will confirm it immediately. The lower-fee transaction becomes invalid, so it is just discarded. Generally, your wallet must support RBF, because it normally won't allow you to reuse the same coins in another transaction.

This was the first time I made this kind of transaction. Just googled about it and found this topic.

Very easy and straightforward in Electrum, just as odolvlobo mentioned.



Just right click on the unconfirmed transaction and choose increase fee. The old transaction simple disappeared.
hero member
Activity: 1358
Merit: 851
Nicely presented. Just sharing my one written on Child-Pays-For-Parent long ago- https://bitcointalksearch.org/topic/child-pays-for-parent-5198274

Also, people can choose transaction not to support RBF even on electrum, this can be a mistake from a newbie
There are a number of reasons you may want to disable RBF. There are quite a few merchants which will accept zero confirmation transaction as long as RBF is disabled
Bitrefill accepts zero-confirmation tx only if RBF isn't enabled. The last time I used Bitrefill was a bad experience for this as I used to use RBF and didn't have enough fund to bump the fee.
legendary
Activity: 2268
Merit: 18711
I mean if wallet A is noncustodial, it will be able to spend UTXO. Although I am not sure, correct me if wrong.
If the person in question is using a non-custodial wallet, in which they have access to their private keys, then they will be able to spend an unconfirmed input one way or another. If their particular wallet software does not support doing this, then they can always import their seed phrase or private keys in to a wallet which does support it, such as Electrum, and do it from there.

I obviously can't say that every non-custodial wallet will allow the user to spend unconfirmed inputs since I have not tested every non-custodial wallet.

Also, people can choose transaction not to support RBF even on electrum, this can be a mistake from a newbie
There are a number of reasons you may want to disable RBF. There are quite a few merchants which will accept zero confirmation transaction as long as RBF is disabled, but will not if RBF is enabled (for obvious reasons). Further, most payment processors which generate an address for you to pay for an order will automatically detect the first transaction to that address and monitor it for confirmations. If you use RBF, your first transaction will be cancelled, your order will be cancelled, and your replacement transaction will go unnoticed by the processor, and you will need to email their support to sort it out.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
What if A's wallet doesn't allow spending unconfirmed outputs?  Smiley
Noncustodial wallet nature will allow A wallet to spend UTXO. I mean if wallet A is noncustodial, it will be able to spend UTXO. Although I am not sure, correct me if wrong.

I always flag my transactions as RBF whenever possible since replacing by fee is cheaper than paying for parents. The only inconvenience with rbf is that it cancels the original transaction and creates a new one with a totall
o_e_l_e_o also well explained this above how CPFP can have higher transaction if compared to RBF, but not all wallets support RBF, in this case you can use CPFP. Or, this is another instance, assuming I want to send bitcoin to someone, and I told him I do not have enough funds for the fee but still insist me to send it with lower fee, the person can later see it frustrating if the transaction not confirmed and later pump the fee himself. Also, people can choose transaction not to support RBF even on electrum, this can be a mistake from a newbie, in this case also, CPFP can be the alternative to get the transaction confirmed fast.

But, I too will suggest wallet like electrum that support RBF, just like you meant. Just very easy to use RBF to pump fee on electrum wallet.
legendary
Activity: 2702
Merit: 3045
Top Crypto Casino
What if A's wallet doesn't allow spending unconfirmed outputs?  Smiley
@op, imo, you should remove the (X,Y,Z)->A part as it only complicates things for newbies.
I always flag my transactions as RBF whenever possible since replacing by fee is cheaper than paying for parents. The only inconvenience with rbf is that it cancels the original transaction and creates a new one with a totally different txid.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
To speed up the transaction's confirmation, the owner of B can use B in a new transaction paying a very high fee, or if your transaction has change, C, you can do the same with C.
It depends, there are some cases the B will find it impossible to use CPFP, if the wallet of B can not be able to spend unconfirmed transaction, this will not be possible, I will like if you can include this to the OP board to make it more clear. In order for b to be able to use CPFP, the wallet should be able to spend unconfirmed transaction, just like on electrum wallet. But, in all cases, A will be able to use CPFP in any circumstances so far their is enough funds from the previous UTXO in his balance to perform another transaction into his another wallet address or to another address with high fee.
legendary
Activity: 2268
Merit: 18711
A couple of additions/things I would clarify.

RBF is straightforward. You replace a stuck transaction by reusing the same coins in a similar transaction that pays a higher fee.
You only need to reuse a single one of the inputs in the previous transaction, not all of them. Some or even the majority of the coins can be left untouched by the replacement transaction. As long as one of the inputs is used, the entire first transaction becomes invalid.

If the transaction fees for BD or CE are high enough, a miner will want to confirm them immediately. But in order to confirm them, the miner must also confirm AB +C.
The way to work out the appropriate fee to pay for a CPFP transaction is to add the size of both transactions (the unconfirmed one you are trying to speed up plus the new one you are about to make) in vbytes, multiply by the current "going rate" for a fast confirmation, subtract the absolute fee already paid by the first transaction, and use that number as the absolute fee for your new transaction. This will usually mean your second transaction pays a much higher fee rate than seems necessary, but will put the average fee rate of your two transactions together around the appropriate rate.

For example:

Let's say the current fee rate for a fast confirmation is 50 sats/vbyte.

Let's say AB + C is 300 vbytes in size and pays 5 sats/vbyte in fees, working out to 1,500 sats.
You are going to make transaction BD, which will be 200 vbytes in size.

Both transactions together will be 300 + 200 = 500 vbytes. At a fee rate of 50 sats/vbytes, this means a total fee of 25,000 sats. Your first transaction already pays 1,500 sats, so your second transaction will require a fee of 23,500 sats. This will work out as 23,500/200 = 117.5 sats/vbyte.

If you are trying to confirm a chain of unconfirmed transactions, then you need to take in to account the size of all of them.
hero member
Activity: 1442
Merit: 775
[TUTORIAL]getting a low-fee transaction unstuck by creating a CPFP with electrum

My transaction has been unconfirmed for a long time. What can I do? (electrum.readthedocs.io)

Quote
Create a “Child Pays for Parent” transaction. A CPFP is a new transaction that pays a high fee in order to compensate for the small fee of its parent transaction. It can be done by the recipient of the funds, or by the sender, if the transaction has a change output. To create a CPFP transaction right click on the unconfirmed transaction on the history tab and choose “Child pays for parent”. Set an appropriate fee and click on “OK”. A window will popup with the unsigned transaction. Click on “Sign” and then “Broadcast”.
legendary
Activity: 4466
Merit: 3391
This is a technical explanation of how RBF and CPFP work. Sorry, it is not a tutorial because their usage depend on your wallet. Also, note that even if your wallet doesn't support RBF or CPFP, understanding how they work gives you other options.

Replace-By-Fee (RBF)

RBF is straightforward. A stuck transaction is replaced by reusing the same coins in a similar transaction that pays a higher fee. A miner can only confirm one of the two transactions, so they will confirm the one that pays the higher fee. If the fee is high enough, they will confirm it immediately. The lower-fee transaction becomes invalid, so it is just discarded. Generally, your wallet must support RBF, because it normally won't allow you to reuse the same coins in another transaction.

Child-Pays-For-Parent (CPFP)

First, CPFP is based on an important requirement for confirmation. A transaction is funded by previous transactions, so in order for a transaction to be confirmed, the previous transactions that fund it must be confirmed. For example, suppose address Y is funded by this transaction:

     XY

Then, in order to confirm a transaction sending from Y,

     YZ

the transaction XY must be confirmed first. (Side note: both transactions can be confirmed in the same block).

Now, let's say that you spend the bitcoins at address A, sending them to an address B plus a change address C:

     AB + C

You post your transaction, AB + C, with a low fee.

To speed up the transaction's confirmation, the owner of B can use B in a new transaction paying a very high fee, or if the transaction has change, C, you can do the same with C.

     BD, or
     CE

If the transaction fees for BD or CE are high enough, a miner will want to confirm them immediately. But, the miner must also confirm AB +C in order to confirm either one of them, so the miner will confirm it also.

In essence, the follow-up transaction is also paying for the previous transaction. Note: Some wallets do not allow you to spend unconfirmed outputs, i.e. you can't spend B or C until the stuck transaction is confirmed.


From: https://www.reddit.com/r/BitcoinBeginners/comments/kwo7b9/explaining_of_cpfp/
Jump to: