Get started
Get started
To make a transaction on Bitcoin, users have to pay fees. This is an aspect that is sometimes overlooked, but it is essential in our use of this payment system. In this article, we take a detailed look at all the mechanisms you need to know about Bitcoin transaction fees.
Transaction fees represent an amount that a Bitcoin user must pay in order to be able to execute a transaction.
When a transaction is broadcast on the Bitcoin network, it is not immediately confirmed. It must first be included in a block within the blockchain. This work is done by miners who will build blocks with pending transactions and search for a valid fingerprint for them (this is what we call Proof of work). When a miner finds a valid block, they can add it to the Bitcoin blockchain and collect all the fees associated with the transactions they have just confirmed.
⚠️ Bitcoin transaction fees should not be confused with exchange fees. Cryptocurrency exchanges charge their customers a service fee for each purchase or sale transaction. These fees have absolutely nothing to do with the transaction fees internal to the Bitcoin system.
Bitcoin blocks have limited capacity. They are not stretchy. In addition, the difficulty adjustment mechanism associated with the proof of work ensures that, on average, only one block is added every 10 minutes on the Bitcoin blockchain. The space in each block is therefore a scarce resource and each transaction takes up a portion of this space. When demand for this resource increases, the adjustment variable remains price. As a result, the fees for each transaction increase.
You can imagine this mechanism as the operation of a hotel. If a property has 24 rooms, it can rent exactly that number every night, but not one more. If 10 rooms are booked, there are only 14 rooms available for the night in question. The following day, the hotelier will again have 24 rooms to offer. However, if he sees a high demand for a specific date, since he cannot push the walls of his hotel, the hotelier will increase his rate per room.
The Bitcoin fee market works the same way. A block is published on average every 10 minutes and each is strictly limited in size. The space in a block is a cyclically scarce resource, in the same way as the rooms in a hotel are. So, if there are a lot of Bitcoin transactions waiting to be confirmed, the demand for this space increases, causing the price to rise. This price corresponds precisely to transaction fees.
Just like the hotelier, the Bitcoin miner wants to make a profit. If he can only include 4,000 transactions in a block, but there are 100,000 pending confirmation, he will go to the highest bidder. The Bitcoin fee market is therefore an English auction system, where users who pay the most fees win block spaces for their transactions.
The consequence of this mechanism is very easy to understand: The more fees you pay compared to other users, the faster your Bitcoin transaction will be confirmed.
Not all Bitcoin transactions take up the same space in a block. Some are bigger than others because they have more inputs or more outputs. There can also be significant differences depending on the type of script used: Taproot scripts are lighter than SegWit scripts, which are themselves lighter than Legacy scripts.
When a minor has to choose among the pending transactions, he will naturally take into account the weight of each one. Between two transactions offering the same amount of fees in absolute value, he will always prefer the lighter one, because the blocks are not constrained by the number of transactions, but by their total size (or their weight to be more precise).
As a user, when you want to make a Bitcoin transaction, it is not wise to calculate the fees in absolute value. It is preferable to relate these fees to the weight of our transaction in order to determine its competitiveness on the auction market, in comparison with other pending transactions. To do this, we will determine the fee rate per unit weight of the transaction. This indicator is called “sats/vB” (satoshis per virtual byte).
For example, if you stream a small SegWit transaction that measures 141 vB and you decide to allocate 1,994 sats in fees to it, then its fee rate will be 14 sats/vB (1,994/141 = 14).
📌 The fees for a Bitcoin transaction are not an output. In absolute terms, they represent the difference between total inputs and total outputs. For example, if I have one input of 1,000 sats and two outputs of 400 sats, then the fee allocated to this transaction is 200 sats (1,000 - 400 × 2 = 200).
Obviously, the Bitcoin fee market is constantly fluctuating. During periods of high demand for block space, prices can quickly rise. On the contrary, during a slower period, the fees required to confirm a transaction will decrease. It is therefore essential to check the current fee rates when you broadcast a new transaction.
In general, Bitcoin wallet software automatically suggests rates that are adapted to the market situation. You can also check directly by yourself. To do this, the most common practice is to go to the website of mempool.space. It provides a precise order of priorities based on the fee rate. It can also analyze previous blocks and probable future blocks, in order to estimate the optimal rate to be included in a reasonable amount of time. To protect your privacy, you can also run your own mempool.space instance on your Bitcoin node.
➤ Discover 6 reasons to set up your own Bitcoin node.
Note that it is better to make a downward error than an upward error. Indeed, if you allocate a fee rate well above the current market, your transaction will be quickly included in the next mined block. However, once the transaction is confirmed, you will not be able to change it. This is what happened recently to a user who allocated by mistake more than 19 bitcoin fees to its transaction.
On the contrary, if you underestimated the rate of fees allocated to your transaction, then it may simply not pass. In this case, there are two possibilities. If its fees are below the node purge limit, your transaction will be forgotten from the Bitcoin network. It's like it was cancelled. So you can do it again. On the other hand, if your transaction remains stuck in the node mempools, you can use mechanisms like CPFP (Child Pays For Parent) or RBF (Replace By Fee) in order to increase its fee rate, and thus unblock it. These two mechanisms will be the subject of a future article.
Finally, it is obviously necessary to adjust the fee rate in view of the urgency of the transaction concerned.
Transaction fees have two main uses in the operation of the Bitcoin protocol. First of all, they allow minors to be paid for the service they provide to us. Producing proof of work incurs electricity costs, requires investments in equipment, and also incurs expenses for machine maintenance. To meet all these burdens and generate profits, minors must be able to earn an income. Transaction fees represent part of the gains they can receive through their activity. In other words, transaction fees are necessary to fund the securing of economic history on Bitcoin.
The second use of fees is to create a cost for multiplying transactions in order to avoid spam. If sending transactions to Bitcoin nodes were free, it would be easy to generate a multitude of them with paltry amounts. This would have the effect of completely saturating the Bitcoin network and increasing the operational load on the nodes. For this reason, Bitcoin nodes can set a minimum fee rate below which they will not agree to relay a transaction. That's what we call the” MinRelaytxFee ”. By default, this setting is 1 sat/vB in Bitcoin Core.
In theory, it is therefore possible to create a valid Bitcoin transaction with zero fees. But in practice, the vast majority of network nodes will refuse to broadcast such a transaction in order to avoid spam. As a result, it will never be able to reach a minor and will never be included in a block.
As with the block grant, the fees are recovered by the winning miner in a specific transaction called” Coinbase transaction ”. The sum of fees that can be regenerated is the difference between all inputs and outputs of each transaction included in the block.
In addition, these bitcoins recovered in a Coinbase transaction are not expendable during a period of 100 blocks. This is called the maturation period of the blocks.
➤ Learn everything about building a Bitcoin block.
To complete a transaction, Bitcoin users must assign fees to it, which will be collected by the miner who will include it in a valid block.
Since the size of Bitcoin blocks is strictly limited, the miner first chooses the transactions that pay the most fees based on their weight (that is, according to the space they take up in the block). Thus, the fees allocated to a transaction are expressed in sats/vB, a ratio between the absolute value of the fees and the weight of the transaction. To find the right rate, you need to know the current state of the fee market. During periods of high demand for block space, fees will be more expensive, and vice versa.