Blockchain transaction fees
This week, we’ve invited Ofir Beigel to guest blog for us. We’ll let him take it from here.
Recently, scaling bitcoin has been a hot topic for the bitcoin community. Why is this? Well, as bitcoin grows and more users hop onboard, a big priority is to ensure the network can efficiently handle the increasing transaction volume. And lately, many users have been expressing their worries over transaction delays caused by network congestion. In this post I’m going to talk a bit about how transaction confirmations work, and the role that fees play in the process.
Miners, bounties, and newly-generated bitcoins
In order to understand transaction confirmations, we’ll need to cover some key concepts of bitcoin mining. I won’t attempt to explain the whole process of bitcoin mining in this post, but I’ll try to simplify the process with this short explanation. Every day hundreds of thousands of transactions are sent and received on the bitcoin network. These transactions need to be ordered and documented on what is called the blockchain, or the global ledger that references every bitcoin transaction ever made.
Bitcoin miners are powerful computers that connect to and make up the network. They decide which transactions to include, and in what order. And how is that? Well, it’s based on several factors, but one of the most important (and the one we’ll dive into here) is how big of a mining fee was included with a transaction.
You see, miners don’t spend all of this electricity and computing power for free; they get paid. Each time a new block of transactions is added to the blockchain, the miner(s) responsible receive a bounty in the form of new bitcoins; that’s how bitcoins are “born”. They also get to keep all the fees attached to the transactions they included in the block, so miners have an incentive to include transactions with higher fees into their blocks.
Today, the lion’s share of the payment is based on the new coins generated with each block, but since the coin reward halves approximately every four years, transaction fees will become more and more prominent in the decision of prioritizing transactions.
Transactions fees and transaction size
In order to further understand fees, it will help to know how to spot the fees for transactions in the first place. Using a block explorer, you can identify the fee paid for a transaction by viewing transaction details. You can also identify it by calculating the difference between the inputs (sending funds) and the outputs (receiving funds). In the example below you can see that the input equals 0.12605724 and the output equals 0.12583356. The fee, 0.00022368, is actually the difference between these two numbers.
So the question remains – how do I know how much of a fee to pay in order for my transaction to confirm as quickly as possible? Well, it depends mainly on the size of your transaction.
Each bitcoin transaction is just a piece of code that has a certain size, just like a file on your computer. The size of the transaction isn’t related to how much money you’re sending but to other factors we won’t get into in this post. And the larger the size of the transaction, the more space it takes up inside each block of transactions. If it takes up more space, it means other transactions will be left out as the block size is limited. Hence, the bigger the transaction, the bigger the fee you’ll need to pay in order to compensate for taking up space inside the block.
Once you know your transaction size you can decide how many satoshis (0.00000001 bitcoins) you want to pay per byte of your transaction. This chart shows the probability of your transaction being included and in which block depending on your fee per byte ratio.
For example, if your transaction is 600 bytes and you pay a fee of 10, 000 Satoshis you will be in the 16.66 Satoshi per byte section (10, 000/600=16.66). At the time of writing this post, this will probably get your transaction included somewhere within the next 15 blocks of transactions (or roughly 150 minutes, since a new block is found every 10 minutes on average).
So, now you know about the important role transaction fees play on the bitcoin network. But you don’t have to give another thought if you’re using a Blockchain Wallet, which uses dynamic fees to calculate an appropriate fee based on the transaction size, and the degree of traffic on the network.