How are Bitcoin Transaction Fees Calculated?
When you use certain wallets, it seems that the transaction fee is built into the transaction. Many users don’t even notice it; in other cases, users cannot alter it. Other wallets do allow users to set their transaction fees, but always within a certain range. So how is that transaction fee established and why?
Bitcoin Transaction Fees: The Basics
Bitcoin transaction fees are related to two basic principles of how Bitcoin works: 1. The creation of new Bitcoins and 2. The public ledger (blockchain) that registers all Bitcoin transactions that have taken place. This work falls on miners, who provide the computational power needed to create new coins and record all transactions. To create new coins (or introduce them into the money supply), miners solve complex mathematical problems and eventually get rewarded when they find a new block.
But miners must also be rewarded for recording those transactions on a block, which also requires work. If there were no fees, once the mining rewards run out, they would have no incentive to keep on mining. That would prompt them to abandon their mining efforts and Bitcoin would grind to a halt. Therefore, senders include a fee in a transaction to reward the miners for processing, confirming, and recording their transactions. This keeps the incentive for miners to do the work necessary to confirm transactions.
Senders are Not Forced to Include a Fee
Senders, however, are not forced to pay a fee for their transactions. But, since miners can choose which transaction they process first, those with no fees included are likely to be left in the mempool. Transactions are recorded on a block which can hold a maximum of 1 megabyte of memory, meaning there is a maximum amount of transactions that can get recorded on a given block. As such, miners have the incentive to choose the transactions to include in a block that will maximize the income they can collect from fees. Bitcoin is based on scarcity.
How are Bitcoin Fees Calculated?
Trying to establish the right fee then, can become a frustrating exercise of trial and error. Therefore, most wallets will do the calculation for you. Wallets calculate the fee by looking at the amount of “traffic” (how many transactions in the mempool), and how quickly they get picked up depending on the transaction’s fee. This depends on a Satoshi per byte ratio because blocks have limited space to record transactions. Miners are always looking to maximize the amount they earn per block, which means the highest Satoshi per bite.
For example: If your transaction size is 16,000 bytes and at the moment of transaction the average fee rate to be included in the next block is 10 Satoshis/byte, you’ll need to pay 10 X 16,000 i.e. 160,000 Satoshis as a transaction fee, for a good chance to be included in the next block.
Should you Try your Luck at Establishing the Optimal Bitcoin Transaction Fee?
To calculate your fees by hand, you would need to know the size of your transaction (which will depend on its inputs and outputs), and the average fee per byte that is being picked up by the miners. There are websites that keep track of the network activity and can provide a benchmark for the size of the transactions and the speed at which they are processed. Nevertheless, you are more likely to use the default fee mechanism that your wallet offers. Just remember to use lower fees for transactions that are not urgent, higher fees for those that are urgent, and if the mempool is too saturated, consider postponing your transactions to a later date if you can. That way you will be able to save on transaction fees even on the default mechanism of the wallet you use.