Charles-Tim (OP)
Legendary
Offline
Activity: 1638
Merit: 5074
Leading Crypto Sports Betting & Casino Platform
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
May 03, 2021, 11:43:14 AM Last edit: May 04, 2021, 10:24:58 PM by Charles-Tim |
|
Some people might thought child-pay-for-parent is the same as replace-by-fee, thinking child-pay-for-parent was just a way you can pump bitcoin transaction fee just like replace-by-fee, although seem like that, but I think differentiating between this two terms is very important for people to know the differences and when to use one instead of the other. There could be stuck transaction, and the sender unable to pump it using replace-by-feeas the the transaction does not support replace-by-fee, what then comes to the mind of few is to use child-pay-for-parent to unstuck the transaction, but because the sender or the receiver was still using low fee in another (child) transaction, the transaction could still remain stuck, it would be one transaction (parent transaction) before and it became two transactions (parent and child transaction) that will be stuck, the other transaction is the child one. This is one of the challenges many people making use of bitcoin is facing when they do not actually knowing the differences between RBF and CPFP.
What is RBF and how to use it Replace-by-fee is a way to pump a transaction using higher fee. In this way, the bitcoin will be double-spent, which means another transaction hash (txid) will be created, double spending the bitcoin into the same previous receivers address or into another address entirely. That is why transactions that support replace-by-fee can be used to pump the fee or cancel a the transaction. A cancelled transaction is not different at all from RBF because the transaction is not actually cancelled but double-spent into another address on the sender's wallet, the sender's wallet do this automatically if you cancel a transaction.
In a wallet that supports RBF, it is good to check if the wallet RBF is enabled or not, but like on electrum, the RBF is enabled by default, but very good to still confirm this on your wallet to make sure it support RBF. Each time you want to make a transaction, there will be an option to flag a transaction to make it support RBF, but the latest electrum starting from version 4.1.1 and up, the transaction will be automatically support RBF unless you flag it not to support RBF. Depending on the wallet you are using, but checking if the wallet itself support replace-by-fee, many or most bitcoin wallets are not yet supporting it which is one of the bad side of such wallets.
Unstucking transactions using RBF If a transaction support replace-by-fee, you can easily unstuck it by pumping the fee, which means the fee to an unconfirmed transaction can be increased by making use of RBF, so that the transaction can have higher chances to be included in a block mined. This is the way to cancel a transaction too, the fee will be pump but the address will be changed to another address on the wallet so that the unconfirmed bitcoin transaction will be diverted from the former receiver's address to another address which is from the sender's wallet address, which means the transaction is cancelled but require higher fee. In all cases of RBF, there will be change of transaction hash (txid) as the unconfirmed Bitcoin is double-spent.
What is CPFP and how to use it Child-pay-for-parent is a means bitcoin transaction (parent transaction) can have high chance to be confirmed by miners as a result of unspent transaction output (UTXO) in the changed address which is used along in another transaction (child transaction), but this is done when it is the sender that want to make use of CPFP. The receiver can also make use of CPFP, if the receiver is using a wallet that can spend uncomfirmed input, all what the receiver will do is to create another bitcoin transaction spending from the unconfirmed input transaction, and use a high fee.
Unstucking transaction using CPFP Uisng CPFP can be a potential means to unstuck a bitcoin transaction but it will demand for more fee, the more fee that will be demanded for will be required for the child transaction and also an addition fee for the unconfirmed parent transaction, although the fee will be added only in the child transaction but in a way it will compensate for the parent transaction and yet enough to get child transaction confirmed. This will make miner to be able to include the transaction in a block as early as it should, and the parent transaction will be confirmed along with the child transaction as both will be included in the same block mined. So, using CPFP, you will create another transaction, resulting into two (child and parent) transactions which will require more fee to be paid, or resulting to another transaction to be created from an unconfirmed output from the receiver's wallet which will demand for fee.
When to, and when not to use RBF and CPFP When trying unstucking a transaction, RBF must first come in mind, as it has chances of lower fee if compared with CPFP. So, before using CPFP, certain reasons to and not to use it must be known, that is why I will not suggest CPFP not to be used for unstucking certain transactions. If the original transaction hash (txid) is necessary in a transaction in certain payment, and you want to unstuck the transaction, you can not use RBF as the txid will be changed as the coin is double spent, but higher fee will be required for CPFP as explained above to create another transaction with high fee so the parent transaction can have high chance to get confirmed in a block mined. .
Also, if you have an unstuck transaction, and you want to create another transaction to be used to send bitcoin to another person that you know you will include the parent or part of the parent unspent UTXO, you can consider to use CPFP if you know that even if RBF is used, you will still have to send bitcoin to another person. In this case, you can use a stone to kill two birds by making use of CPFP because all you want at the time is two transactions. In this way, it can not be said that CPFP comes with high fee, because if you do not use CPFP, you will still have to create another transaction to send the bitcoin to another person you want to send bitcoin to.
The reason CPFP is said to require higher fee than RBF is because during unstucking such transaction, the sender or receiver are sending bitcoin back into another address on their same wallet which require higher fee.
Check transaction input and output before using CPFP This is more to the receiver than the sender because the sender will still know the transaction he/she created before making child transaction, but the receiver may not know this. The unconfirmed transaction can be tracked on blockchain explorer, if the transaction consist of many inputs and outputs, most especially inputs which are the ones that are more weight to transactions, it will be better not to think if unstucking such transaction, as the more inputs and outputs in the parent transaction, the more fee that will be required for the child transaction. So people will make use of CPFP and yet use a fee that can not get the parent and child transaction confirmed in time but yet stay in mempool for weeks until the mempool become less congested in a way it can get such high inputs and outputs but low fee transaction confirmed.
Using wallet that support RBF and CPFP One thing is that a transaction that support RBF can still support CPFP, it depends on the wallet you are using. As a sender, I can say all noncustododial wallet support CPFP at the senders side, but as for receiver to make use of it, not all wallets support CPFP, also there could be a possibility of the sender wallet not to make use of CPFP, which means it is better to get a wallet that support coin control to be able to be certain that as a sender, you are sending from the parent transaction change address UTXO. Using a wallet that support spending of unconfirmed transactions is necessary if you are the receiver, a good wallet that support all this is electrum. Also not all wallet that support RBF but electrum wallet also support it. So, let me use electrum as the standard wallet and use it as an example. If you enable a transaction to supoort RBF, it is also still supoorting CPFP on electrum so far you have changed address UTXO as a sender and spending from it with higher fee that can get two transactions confirmed, or if you are the receiver, you can spend from the unconfirmed transaction with a high fee that can get two transactions confirmed. That is the reason all transactions should be enabled to support RBF, so it is still your choice to still determine which one that best suit you at the time you want to unstuck the transaction based on what I have explained above, although there are few cases of the receiver telling sender not to enable RBF.
|