Author

Topic: I want to know more about child pay for parent (Read 216 times)

legendary
Activity: 2730
Merit: 7065
January 26, 2021, 05:43:31 AM
#11
Although the users above have explained it quite well, but since you are interested in the topic, I would suggest you take a look at the tutorial that
mocacinno posted on CPFP transactions > https://bitcointalksearch.org/topic/--5285192

It's main focus is on how to perform a CPFP transaction on Electrum, but it's an excellent resource nevertheless.
legendary
Activity: 1624
Merit: 2481
[...] it can not work with wallets that can not spend unconfirmed, which can make it useless in such wallet [...]

Then switching to a wallet which gives you the option would be a solution.
Even if you insist on using a wallet which doesn't provide that option such as horrible web wallets (honestly, who still uses web wallets? It is 2021 already) for example, exporting the private key and importing it into a proper wallet would be sufficient to create a CPFP transaction.
member
Activity: 518
Merit: 45
One important thing you seem to be missing is that "Child Pays For Parent" can only be executed by a wallet that has received one of the outputs from the unconfirmed transaction.
Thanks for this, I also know about receiver's address to be able to use child pay for parent, it can not work with wallets that can not spend unconfirmed, which can make it useless in such wallet, but unlike wallets that can spend unconfirmed transactions, it will work perfectly. Unlike the sender's address that even if the wallet can not spend unconfirmed transaction, it will still be able to use child pay for parent but if and only if one of the child address containing the parents unspent transaction that is sent to the wallet back during the parent transaction.
HCP
legendary
Activity: 2086
Merit: 4363
One important thing you seem to be missing is that "Child Pays For Parent" can only be executed by a wallet that has received one of the outputs from the unconfirmed transaction.

So for:

Case 1:
Code:
InputFromWalletA -----> ReceiveAddressWalletB

Only WalletB can execute the CPFP... as it is the only wallet with a "child"


Case 2:
Code:
InputFromWalletA -----> ReceiveAddressWalletB
                   |--> ChangeAddressWalletA

Either WalletA or WalletB (or Both) can attempt to execute CPFP... as they both have "children" from the transaction.
member
Activity: 518
Merit: 45
Thanks for your meritable answers, you explained what is very difficult for me to understand online in just few minutes. I believe I now know all about child pay for parent and when to use it.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
1. Supposing I have 0.0002btc, I sent the whole 0.0002btc to wallet B with low fee, if wallet A receive 0.001btc later. Wallet A can not do child pay for parent because no bitcoin to change address because all the bitcoin (0.0002btc) were sent.
Correct.
2. But if wallet A has 0.00002btc, sent 0.000019btc with low fee, wallet A change address will receive 0.00001btc. Later wallet a receive 0.01btc from another wallet, because of the 0.00001btc received by wallet A change address, wallet A can do child pay for parent?
Correct. As long as you control at least one of the outputs in that unconfirmed transaction. The amount is a bit wrong as the change should be 0.000001BTC and that's a dust but it's not a problem since most wallets will not include a dust output.
member
Activity: 518
Merit: 45
Thanks for the answer, I now know that if the change address is not having sufficient bitcoin amount, I can not do child pay for parent.
You can. Just make sure that your wallet includes at least one of the outputs from that specific transaction, and you'll be able to do CPFP even if you spend the other confirmed output as well.
Thank younfir this good answers. Please let us take this as an examples:

1. Supposing I have 0.0002btc, I sent the whole 0.0002btc to wallet B with low fee, if wallet A receive 0.001btc later. Wallet A can not do child pay for parent because no bitcoin to change address because all the bitcoin (0.0002btc) were sent.

2. But if wallet A has 0.00002btc, sent 0.000019btc with low fee, wallet A change address will receive 0.00001btc. Later wallet a receive 0.01btc from another wallet, because of the 0.00001btc received by wallet A change address, wallet A can do child pay for parent?
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Thanks for the answer, I now know that if the change address is not having sufficient bitcoin amount, I can not do child pay for parent.
You can. Just make sure that your wallet includes at least one of the outputs from that specific transaction, and you'll be able to do CPFP even if you spend the other confirmed output as well.
member
Activity: 518
Merit: 45
Which means it is not that child pay for parent has lower fee, it is just like increasing the fee for the child transaction above normal rate in a way to make it normal rate for the two transactions so that miners can process the transaction at one time. Thanks for the answer, I now know that if the change address is not having sufficient bitcoin amount, I can not do child pay for parent. That is why I make a transaction with low fee but it is not yet confirmed, I later receive bitcoin from someone, thinking I can use child pay for parent, but the second transaction is now confirmed while the first transaction is not yet confirmed.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Child pay for parent involves two transactions.

The parent transaction is unconfirmed.

A -> B
   -> C   Fees: 1 sat/vbyte 142 bytes

B is the address that you're sending to and C is the address that you control which is the change address. Unfortunately, your fee rate is too low and it remains unconfirmed.

Since you have the ability to spend output C, you can create a transaction which spends it with a larger than proportionate fee (say 20sat/vbyte).
Child transaction:

C -> D Fees: 20 sat/vbyte 299 bytes

Total fees: 142sat+ 5980sat
Fee rate: 13.8sat/vbyte

If you combine both of the size and fees together to get the fee rates, it should be fairly high.  If the combined fee/size is sufficiently high, miners are incentivized to mine both of your transaction so as to obtain the transaction fees for both.

To answer your question: Depends. As illustrated, miners are incentivized with CPFP only if you're spending an output from the unconfirmed transaction so they would confirm both to collect all the fees. CPFP requires you to include at least one output from the unconfirmed transaction. If possible, enable opt-in RBF.
 

CPFP is not the most ideal method to bump fee. Spending C entails the fact that you also have to pay for the cost to spend that output and thus incurs an additional fee ontop of your current fees. In comparison, Replace-By-Fee is better as you can just replace the original transaction with a higher fee rate for it to be confirmed. There are cases where CPFP is useful, if you're not the sender and/or if you didn't enable RBF.
member
Activity: 518
Merit: 45
I have been reading recently about child pay for parent but it is not easy to understand, I have known little about it and bring the ones I do not know to this forum for explanations. I know if I have confirmed transactions, I can be able to send a transaction and if the transaction is not  confirmed on time I can use child pay for parent. But what about if I have no bitcoin again after making the parent transaction but not confirmed, later bitcoin was transfer to my wallet and got confirmed, can I use it for the child transaction?
Jump to: