Understanding Transaction Fees, Outputs, and Change (Simplified)
A Bitcoin transaction must obey a simple rule: Total Input ≥ Total Output.
1.
Outputs:
The amounts you send to recipients plus any change sent back to yourself.
2.
Fee:
The miner fee is the difference left over:
Fee = Total Inputs - Total Outputs
3.
Example:
Input: 0.10000000 BTC
Send to recipient: -0.01000000 BTC
Return as change: -0.08950000 BTC
──────────────────────────────
Miner Fee: = 0.00050000 BTC
In short:
In short: You cannot create bitcoins. The total inputs must fund all outputs (to recipients and yourself) plus the miner fee.
⚠️ Crucial Warning:
If you do not explicitly specify a change output back to your own address, the entire leftover amount will be given to the miner as an unexpectedly large fee. Always ensure your transaction includes a change output to yourself, unless you intentionally want to overpay.
About Replace-by-Fee (RBF):
This optional flag allows you to replace an unconfirmed transaction with a new version that has a higher fee, speeding up confirmation.
Transaction replacement Bitcoin Wiki