Bitcoin fees are the payment method decided to pay miners for processing the transactions that are made on the bitcoin blockchain. However, to understand how the fees are calculated, we need to consider what happens when we send bitcoins to another address
When we send any amount of bitcoin, the first step is the verification of the transaction, when the transaction is checked by all the computers that have a copy of the distributed ledger. These computers called nodes check the history of our bitcoins, checking that they are really on our address. After that, once the transaction has been completed, it is inserted into the mempool or memory pool.
To better understand, the mempool is like a waiting room of a virtual airport, with all the transactions waiting to take the plane to enter in a block, or a miner that picks up them and locks them in one of the blocks of the blockchain.
Now the transaction is considered unconfirmed despite being valid and included in the list of transactions that took place.
The transaction is confirmed when a miner takes the transaction and places it in a block and the funds are transferred when the block is closed.
Always remember that blocks have a specific size. if we were in a period in which many transactions take place, obviously the miners will give priority to transactions with higher fees.
So Fees are a way to tell the miner how urgent your transaction is. Faster speed need higher fees to be paid, which are always paid by the sender and there is no way to avoid pay them.
In case we want to calculate the fees, we must remember that the transactions have a size, as if they were files stored on your computer so the miners who want to maximize their earnings, will prefer transactions with a high fee but low weight.
The size of a transaction depends on several factors:
The first factor is the number of inputs.
The bitcoins we have in our wallet are a sum of the bitcoins we have received over time combined with those we already owned on this wallet. This sum is called inputs. When we send bitcoins to someone, we select some of these inputs sent by others and transform them into outputs.
Now, the more inputs a transaction has, the greater the size.
A second factor is the number of outputs, the number of addresses we are sending to.
If we are paying to a single address, we are creating two outputs, one for the address it sends and one to receive the rest of the initial payment.
In fact, if our bitcoin account is a sum of inputs from different sources, these inputs cannot be spent in part but must be sent in their entirety to the receiving address and we will receive the rest on our wallet without realizing it.
Let’s assume we have a wallet with 3 bitcoins, formed by two inputs of 1 and 2 bitcoins. In case we have to spend 1.5 bitcoins, our sending will be 2 bitcoins with the remainder of 0.5 going back to our wallet.
Another important factor to consider is the complexity of the script. Some transactions use special options such as multi sig, which increase the size of the transaction for the average user, calculating the size of the transaction is quite difficult but don’t worry, our wallet will take care of it and will also suggest the most correct fees at the time of sending.
It should be remembered that the blockchain does not mark the cost of the transaction explicitly. If you want to mark the costs you will have to check it specifically
There are ways to reduce bitcoin sending fees:
avoid sending bitcoins when it is rush hour on the trading markets. If we are in the middle of a bitcoin pumpĀ or a dump, with great volatility there will be a lot of movements between trader wallets and exchange wallets. Those in hurry will put higher fees so the price at that time will be higher.
In addition, you can use a segwit wallet that lowers fees and transaction sizes.
In the event that the fees are absolutely crazy, you could use other coins that have much lower costs such as Ripple for example.
Obviously there would be other costs related to the use of exchanges. In this case, the atomic swap comes to help. Do your math before testing this solution.
As already mentioned, most wallets give suggestions and indicate which are the most suitable fees for the moment in which we are operating. Pay attention because there are also wallets that charge too much, so also on this aspect a specific search must be made for the best product. Generally it must also be said that the most advanced wallets give the possibility to choose different options, more or less fast and expensive.
However, if you are stingy, and you don’t pay enough fees, it sometimes happens that transactions are blocked just because the fees are too low and no miner is interested in your transaction.
in this case what to do?
the available options are to wait at least 72 hours or use an RBF replace by fee system, which allows the wallet to replace low fees with higher ones but beware, not all wallets support this option.
Hypothetically, a transaction cannot be blocked forever but it really depends. In fact when we talked about mempool at the beginning of the video, we didn’t specify where the mempool is. It is not only one but each node of the network has a section dedicated to it, different nodes have different versions of the mempool.
If a transaction is not confirmed, it is deleted from the mempool, the ordinary cancellation time is 72 hours.
However, it may happen that the node where the mempool resides with your transaction does not delete it.
Fees are a big problem for Bitcoin and they can be for you too if you move large amounts without thinking about it.
Learn more about safety here.