Bitcoin transaction fees have definitely gathered the attention of a lot of developers around the world. When bitcoins change their owner, the transaction is always a subject of a fee that’s paid by the sender. Unlike the banks, where they charge you a flat rate or a percentage based on the value, the bitcoin transaction fees depend on the amount of data needed for encoding.
The fees may sometimes be very expensive for the one who pays. Usually they represent a small amount of the whole transaction. But there are cases where the fees exceed the amount being transferred or are really high in general. You need to be aware that this may happen in the following hypothetical situations: published address to collect donations; old bitcoin wallet; you take part in a mining pool and etc.
The creator (or creators, as it’s still disputed) of Bitcoin Satoshi Nakamoto, described it as an “electronic cash system”. You probably can’t find important the difference between a online banking system and a cash system. But if you want to understand the bitcoin transaction fees, you need to disregard all your previous knowledge on the standard payment methods that you’ve had.
Try to imagine that you are organizing a fundraising event and you are the one collecting all the donations, each one carefully placed in a paper envelope. At the end of course, you would merge all the funds and redistribute them into new envelopes. Now, back to our cryptocurrency, the bitcoin address represents such digital “cash envelope”. Zero or more units of electronic cash in different denominations are held on that address. All incoming payments increase the value on the address by adding cash units, while the outgoing payments remove value and cash units.
As a reference to the units of electronic cash, bitcoin uses the term “unspent output”. Imagine it as a paper bill with a fixed denomination. Address’ unspent transaction output gives any application the required information to construct new transaction inputs for spending.
Not all bitcoin transactions are equal. As a start, through bitcoin transactions one or more unspent outputs change their owners. So, whether you makes sense of it or not, fees are not based on the total value of the reassigned unspent outputs, but on their total number.
Transactions are represented as droplets of digital data, similar to the files on your computer. Files have certain content and take up disk space, so the bigger they are, the higher network bandwidth they would require for transfer. Similarly to that, greater number of reassigned unspent outputs require more data and resources for validation and archiving. That’s why, if you pay a certain amount of bitcoins consisted of big number of unspent outputs, then the fee would be higher. This is because the data requirements for this transaction would be heavier load for the network’s bandwidth and storage.
There are a couple of ways to minimize the transaction fees. You have probably already guessed the first one and it’s minimizing the number of small inputs in a bitcoin wallet. Try to avoid receiving them. If you have a clients that pays you regular but small amounts, try instead negotiating rarer, but larger payments. But if the number of payments that you receive is not under your control, because they are from donations, your software wallet might select the right inputs for you. If that doesn’t work and the fees continue to be high, consider getting a wallet supporting coin control such as Bitcoin Core.
The way to reduce bitcoin transaction fees is by reducing the data requirements for each input. This happens with compressed public keys that help reducing the per-input byte requirement from 180 to 148. If you are not sure whether your bitcoin wallet uses public key compression, take a look at the Wallet Import Format of your private keys. The ones that begin with the number ‘5’ indicate uncompressed public keys, while those beginning with the letters ‘K’ or ‘L’ respectively indicate the compressed public keys.
I would like to briefly mention that some transactions can avoid fees, if they answer to certain conditions. According to Wikipedia, if transaction is smaller than 1,000 bytes, has outputs greater than 10 mBTC in value AND all of the inputs are of adequate age and value, they are fee free. But be prepared that you would need to wait 5 to 10 days before you could spend these bitcoins. The aim of these restrictions is to keep the spam transactions value as small as possible.
All the bitcoin transaction fees may seem a bit random to you, but in reality they follow clear rules:
Bitcoin is a Peer-to-Peer Electronic Cash system. The ‘unspent output’ plays the role of an electronic paper bill. The unspent outputs from one transaction turn into inputs for the next transaction.
The taxes issued by the network are based on the transaction’s size in bytes, and not its value in money.
Generally the number of inputs determines the size of the transaction and its cost.
If one bitcoin’s equivalent is held just for one day, it can be spent without transaction fee.
If you spend bitcoins from addressed that have received a big number of small payments, this can issue high fees.
Coin control is very helpful when you are combining a large number of unspent outputs from smaller transaction to you.