Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Nergon on August 12, 2020, 03:52:26 PM



Title: Bitcoin Core bumpfee with descendants in mempool
Post by: Nergon on August 12, 2020, 03:52:26 PM
Hello,
Is it possible to use the bumpfee command if there are descendants in the mempool? Currently Bitcoin Core 0.20.0 always prints following error:

Code:
error code: -8
error message:
Transaction has descendants in the mempool

Is there a way to still do a replace by fee? How does it work?


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: achow101 on August 12, 2020, 04:20:17 PM
No, it is not.

If a transaction has descendants, that means that there are transactions that spend its outputs. Bumping the fee on that transaction will change the txid of that transaction and invalidate those descendant transactions. Thus bumpfee is disallowed on transactions with descendants.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: Nergon on August 12, 2020, 04:35:35 PM
No, it is not.

If a transaction has descendants, that means that there are transactions that spend its outputs. Bumping the fee on that transaction will change the txid of that transaction and invalidate those descendant transactions. Thus bumpfee is disallowed on transactions with descendants.

Oh interesting. Why can you do it on Wallets like Electrum if its not allowed?


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: achow101 on August 12, 2020, 07:03:36 PM
Oh interesting. Why can you do it on Wallets like Electrum if its not allowed?
It's not disallowed by the network. It's just disallowed by Bitcoin Core's bumpfee functionality.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: Nergon on August 13, 2020, 12:04:27 PM
Oh interesting. Why can you do it on Wallets like Electrum if its not allowed?
It's not disallowed by the network. It's just disallowed by Bitcoin Core's bumpfee functionality.

Can you bump the fee manually with sendrawtransaction?


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: nc50lc on August 13, 2020, 12:26:33 PM
Can you bump the fee manually with sendrawtransaction?
After manually creating a replacement signed raw transaction?
You will probably get "txn-mempool-conflict" due to the same reason achow101 explained above (I've only tested in on regtest).

But sending that RAW transaction through other clients might work as long as the to-be-replaced transaction is RBF.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: Nergon on August 13, 2020, 06:18:25 PM
Can you bump the fee manually with sendrawtransaction?
After manually creating a replacement signed raw transaction?
You will probably get "txn-mempool-conflict" due to the same reason achow101 explained above (I've only tested in on regtest).

But sending that RAW transaction through other clients might work as long as the to-be-replaced transaction is RBF.

I tried it today. It works fine with sendrawtransaction. You only get a txn-mempool-conflict if Replace by fee is disabled.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: nc50lc on August 14, 2020, 03:50:08 AM
I tried it today. It works fine with sendrawtransaction. You only get a txn-mempool-conflict if Replace by fee is disabled.
Sorry, sendrawtransaction indeed works.
Seems like I have used the wrong UTXO on my previous test.
The previous transaction and its descendants were automatically booted out of the node's mempool.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: CardCoins on August 18, 2020, 07:48:05 PM
As mentioned, bumpfee won't let you do this, but if you do attempt it with a raw transaction, note that you will have to bump the fee relative to the entire package of transactions. So if you are bumping the fee of a transaction with a lot of descendants, you will need to calculate the total package size in bytes, then bump the fee accordingly.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: HCP on August 18, 2020, 10:05:49 PM
As mentioned, bumpfee won't let you do this, but if you do attempt it with a raw transaction, note that you will have to bump the fee relative to the entire package of transactions. So if you are bumping the fee of a transaction with a lot of descendants, you will need to calculate the total package size in bytes, then bump the fee accordingly.
Are you thinking of CPFP (Child-Pays-For-Parent)? ??? If so, that works the other way... when you're trying to get one of the descendants confirmed quickly, you have to take into account all of the ascendants.

ie. if you have the following chain of transactions: TransA -> TransB -> TransC -> TransD -> TransE

And you bumpfee on TransA... then B, C, D and E will become invalid as the hash of TransA will change, making B invalid.

If you're wanting to get TransE confirmed quickly, then you would need to take A, B, C & D into account as well, to make sure that the fees are big enough for miners to want to get all 5 transactions included in a block.


Title: Re: Bitcoin Core bumpfee with descendants in mempool
Post by: CardCoins on August 18, 2020, 11:35:03 PM
As mentioned, bumpfee won't let you do this, but if you do attempt it with a raw transaction, note that you will have to bump the fee relative to the entire package of transactions. So if you are bumping the fee of a transaction with a lot of descendants, you will need to calculate the total package size in bytes, then bump the fee accordingly.
Are you thinking of CPFP (Child-Pays-For-Parent)? ??? If so, that works the other way... when you're trying to get one of the descendants confirmed quickly, you have to take into account all of the ascendants.

ie. if you have the following chain of transactions: TransA -> TransB -> TransC -> TransD -> TransE

And you bumpfee on TransA... then B, C, D and E will become invalid as the hash of TransA will change, making B invalid.

If you're wanting to get TransE confirmed quickly, then you would need to take A, B, C & D into account as well, to make sure that the fees are big enough for miners to want to get all 5 transactions included in a block.

Are you familiar with RBF pinning? This is a good explanation of the issue I have described. CPFP is subject to the same principle. If I could just kick out transactions w/ descendants from the mempool without paying for the full package that would be a DoS attack of sorts. Unfortunately it can also be turned on its head to "stick" transactions.

https://bitcoinops.org/en/topics/transaction-pinning/