Bitcoin fees and mining difficulty
Network data: mempool.space
Bitcoin Transaction Fees and Mining Difficulty Explained
Every Bitcoin transaction includes a small fee, which varies with demand for space in the blockchain. Most transactions on the Bitcoin network require a fee, and fees are based on the total byte size of the signed transaction. The network automatically limits its block size. Fees can, however, change depending on the network's current usage.
How transaction fees work
Processing power for Bitcoin transactions comes from miners. Anybody and everybody can compete, and mining hardware like ASICs is powerful enough to mine blocks. Mining is a distributed consensus system that is used to confirm pending transactions by including them in the blockchain: as more people start to mine, the network automatically increases difficulty to ensure that the average time to find a block remains equal to 10 minutes.
As more miners compete, difficulty of finding valid blocks is automatically increased by the network, and it is ultimately up to each miner to choose the minimum transaction fee they will accept. Miners include transactions in blocks, which earns them a reward of new Bitcoins and transaction fees: the priority each transaction gets is determined by the fee, which guarantees control over how quickly a transaction will confirm in the most general and effective way. Fees incentivise miners to validate and confirm transactions.
The node sends the 80-byte block header (containing the hash of the previous block, a timestamp, and the difficulty target) along with a target threshold (difficulty setting) to its mining hardware (an ASIC) before starting work to add a block to the blockchain. Each piece of mining hardware is thus provided with a target threshold to work on, configured by the node or mining pool software, depending on the mining hardware setup.
If the node or mining software deems the transaction as valid, it will relay unconfirmed transactions and accept them into the mempool. The transaction will then be broadcast to the Bitcoin network, from which miners include transactions in a block to be validated and confirmed — ensuring transactions are eventually written permanently into the blockchain.
Transaction fees vary
Evidence shows that users who are willing to wait just a few hours for their transactions to confirm can often save 80% or more in transaction fees over users who need rapid confirmation during periods of high demand. In Bitcoin Core release updates, fee estimation improvements showed that fee estimates now adjust faster to changing network conditions of higher or lower demand for block space. In order to expose this new increased range in the graphical user interface, the previous fee slider was replaced by a fee dropdown.
The transaction fees vary based on network demand, especially when transaction volume rises significantly. Fees can fluctuate rapidly, and transactions pay fees based on the total byte size of the signed transaction. There is also a concept of so-called high-priority transactions, which spend satoshis that have not moved for a long time.
In the Bitcoin network, thousands of miners compete to update the blockchain by confirming transactions, calculating valid block hashes, and adding valid blocks to the ledger. The miners who find a valid block are the first to confirm pending transactions, and the rest of the network subsequently validates and accepts it.
Fees depend on transaction size
Transactions have different byte sizes, and so do the fees. The simplest type of transaction will contain standard inputs and outputs.
The larger the transaction, such as when the sender needs to send funds from lots of smaller individual inputs to a mix of recipients, the larger the total byte size. These transactions require more block space and require a higher fee.
More bytes are used in transactions as the number of signatures and inputs increases, which makes them larger and costlier to be included in a block. Miners can choose to include or exclude transactions, according to the fees.
Are transactions safe without confirmation?
In order to solve the double-spending problem, as explained in the blockchain section, transactions need to be confirmed. Zero confirmation transactions (unconfirmed transactions) should generally not be trusted without risk analysis.
When a transaction is submitted, it has no confirmation (zero-conf). It must be included in a block confirmed on the blockchain, and miners choose which transactions to include in each block they discover.
According to the Bitcoin Developer Guide, zero-confirmation transactions carry double-spend risks before being included in the blockchain. It is thus up to miners to choose which fees to accept and up to recipients to evaluate risk before accepting unconfirmed payments.