1

Suppose I just sent Tx1, which has length of 200 bytes and fee rate of 10 satoshi/byte, totaling fee 0.00002 BTC. Now I replace it with Tx2 that has the same count of inputs and outputs, and also has a length of 200 byetes. The relayfee and incrementalfee returned by RPC getnetworkinfo are both 0.00001.

How can I calculate the fee for Tx2? I found that the existing docs are too vague about this.

1 Answer 1

0

The incrementalfee actually indicates a feerate in ₿/kvB. Translated 0.00001 ₿/kvB are 1 ṩ/vB. A replacement transaction must both at least match the sum of absolute fees of the replaced transactions and surpass the feerate of each replaced transaction by the incrementalfee.

Since the incrementalfee is 1 ṩ/vB and the original transaction paid 10 ṩ/vB, your replacement transaction must pay at least a feerate of 11 ṩ/vB. Since the original transaction paid 10 ṩ/vB × 200 vB = 2000 ṩ in absolute fees, the replacement must pay at least 2000 ṩ. As the replacement transaction in your example is the same size as the original, the replacement would need to pay 2200 ṩ to achieve 11 ṩ/vB.

Let’s say your original transaction of 200 vB paying 2000 ṩ (10 ṩ/vB) had a child transaction of 10,000 vB paying 10,000 ṩ (1 ṩ/vB), and your replacement transaction had only 100 vB.
The replacement transaction would need to pay at least 11 ṩ/vB (1100 ṩ), but also pay more fees than the replaced transactions together (10,000 ṩ + 2000 ṩ = 12,000 ṩ). So in this case, the replacement transaction would end up paying 120 ṩ/vB (12,000 ṩ / 100 vB).

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.