# How to properly calculate fee for RBF transaction?

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.

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.