so i know x = (sat/vB_effective * (vB_parent + vB_child) - current_parent_fee) / vB_child where x is the child fee (in sats/vbyte) that would need to get bumped. so this is figured off the child fee. What i would like to know is how to calculate how much to bump the change output to get the desired parent fee in sats/vbyte.
I would recommend thinking about the feerate you are trying to calculate rather as a specific amount of fees plus a feerate:
The parent transaction is short a specific count of satoshis to have the desired feerate. It’s exactly that
bump_fee in satoshis that the child has to pay more, in order to prioritize the parent to the desired feerate. Then the child itself has to pay the feerate that you are trying to bump the parent to, too.
c_fee = (p_vsize × target_feerate) - p_fee + c_vsize × target_feerate
c_fee = bump_fee + c_vsize × target_feerate
Perhaps you can leverage your wallet software by constructing a raw transaction that uses the parent’s output as a preset input and sends the whole amountg to yourself at
target_feerate. If you had that, you would only need to decrement the output to yourself by the
If you are trying to do this with Bitcoin Core, you could try my branch from pull request #26152, which aims to resolve exactly this issue.