Transaction fees may be included with any transfer of bitcoins from one address to another.
The market for block space
The transaction toverfee is received by the bitcoin miner. When a fresh bitcoin block is generated with a successful hash, the information for all of the transactions is included with the block and all transaction fees are collected by that miner creating the block, who is free to assign those fees to himself. Traditionally, the sender pays the total Bitcoin network toverfee, deducting the toverfee from the amount received by the recipient will often be considered an incomplete payment, albeit some wallets have a “sender-pays-fee” feature where the miner toverfee is deduced from send amount.
Transaction fees are voluntary on the part of the person making the bitcoin transaction, spil the person attempting to make a transaction can include any toverfee or none at all te the transaction. On the other forearm, nobody mining fresh bitcoins necessarily needs to accept the transactions and include them te the fresh block being created. The transaction toverfee is therefore an incentive on the part of the bitcoin transactor to make sure that a particular transaction will get included into a block.
It is envisioned that overheen time the cumulative effect of collecting transaction fees will permit somebody creating fresh blocks to “earn” more bitcoins than will be mined from fresh bitcoins created by the fresh block itself. This is also an incentive to keep attempting to create fresh blocks spil the creation of fresh bitcoins from the mining activity goes towards zero ter the future.
Because of deep technical reasons, bitcoin block space is a scarce commodity, getting a transaction mined can be seen spil purchasing a portion of it. The price of block space is set by supply and request, albeit te the real world the supply of space for transactions is enormously noisy, because more becomes available (and has to be instantly consumed or it’s lost forever) every time a block is mined, and block mined is an intentionally random process, that randomness being essential for bitcoin’s operation. Request is random and cyclical. Random because each transaction is generated individually so the total amount is noisy (albeit that averages out to be somewhat slick at scale) and has both daily and weekly cycles, with more transactions done during the day than at night. Request can also be affected by speculative movements te the exchange rate. 
Therefore the market for block space asks users to make a tradeoff inbetween confirmation time and cost. Users with high time requirements may pay a higher than average miner toverfee to be confirmed quickly, while more users under less time pressure can save money by being ready to wait longer.
The following sections describe the behavior of the reference implementation spil of version 0.12.0. Earlier versions treated fees differently, spil do other popular implementations (including possible straks versions).
Users can determine to pay a predefined toverfee rate by setting `-paytxfee=<,n>,` (or `settxfee <,n>,` rpc during runtime). A value of `n=0` signals Bitcoin Core to use floating fees. By default, Bitcoin Core will use floating fees.
Based on past transaction gegevens, floating fees approximate the fees required to get into the `m`th block from now. This is configurable with `-txconfirmtarget=<,m>,` (default: `2`).
Sometimes, it is not possible to give good estimates, or an estimate at all. Therefore, a fallback value can be set with `-fallbackfee=<,f>,` (default: `0.0002` BTC/kB).
At all times, Bitcoin Core will cap fees at `-maxtxfee=<,x>,` (default: 0.Ten) BTC. Furthermore, Bitcoin Core will never create transactions smaller than the current ondergrens relay toverfee. Eventually, a user can set the ondergrens toverfee rate for all transactions with `-mintxfee=<,i>,`, which defaults to 1000 satoshis vanaf kB.
Note that a typical transaction is 500 bytes.
Including ter Blocks
This section describes how the reference implementation selects which transactions to waterput into fresh blocks, with default settings. All of the settings may be switched if a miner wants to create larger or smaller blocks containing more or fewer free transactions.
Then transactions that pay a toverfee of at least 0.00001 BTC/kb are added to the block, highest-fee-per-kilobyte transactions very first, until the block is not more than 750,000 bytes big.
The remaining transactions remain te the miner’s “memory pool”, and may be included te zometeen blocks if their priority or toverfee is large enough.
For Bitcoin Core 0.12.0 zero bytes [Two] ter the block are set aside for the highest-priority transactions. Transactions are added highest-priority-first to this section of the block.
The reference implementation’s rules for relaying transactions across the peer-to-peer network are very similar to the rules for sending transactions, spil a value of 0.00001 BTC is used to determine whether or not a transaction is considered “Free”. However, the rule that all outputs vereiste be 0.01 BTC or larger does not apply. To prevent “penny-flooding” denial-of-service attacks on the network, the reference implementation caps the number of free transactions it will relay to other knots to (by default) 15 thousand bytes vanaf minute.
Toverfee Plotting Sites
Spil of May 2016, the following sites seem to plot the required toverfee, ter satoshi vanaf (kilo)byte, required to get a transaction mined te a certain number of blocks. Note that all thesis algorithms work te terms of probabilities.
Other Useful Sites
- https://anduck.netwerken/bitcoin/fees/ – Shows what kleintje of fees packed up latest blocks
- https://btc.com/stats/unconfirmed-tx – the state of the webstek’s mempool cracked down by toverfee rate
- https://jochen-hoenicke.den/queue/#1w – another mempool violated down by toverfee rate webpagina
- https://esotericnonsense.com/ – yet another mempool webpagina, also very good
- http://mempool.us.to/tx.html – Tells you where a unconfirmed txid is ter the queue based on its toverfee rate (Note that not all miners use the same algorithm)
- https://estimatefee.com/ – You can click any of the transactions ter that graph to get more informatie (like its “effective toverfee rate” which uses recursive ancestors/descendants for CPFP) and an estimated amount of blocks it’ll take to confirm. It works with any transaction ter the top 100MB of the bitcoin mempool. And you can inject te any transaction txid for informatie when you’er wondering why it doesn’t confirm.
Historically it wasgoed not required to include a toverfee for every transaction. A large portion of miners would mine transactions with no toverfee given that they had enough “priority”. Today, low priority is mostly used spil an indicator for spam transactions and almost all miners expect every transaction to include a toverfee. Today miners choose which transactions to mine only based on fee-rate.
Transaction priority wasgoed calculated spil a value-weighted sum of input age, divided by transaction size ter bytes:
Transactions needed to have a priority above 57,600,000 to avoid the enforced limit (spil of client version 0.Three.21). This threshold wasgoed written te the code spil COIN * 144 / 250, suggesting that the threshold represents a one day old, 1 btc coin (144 is the expected number of blocks vanaf day) and a transaction size of 250 bytes.
So, for example, a transaction that has Two inputs, one of Five btc with Ten confirmations, and one of Two btc with Trio confirmations, and has a size of 500bytes, will have a priority of
Historic rules for free transactions
A transaction wasgoed safe to send without fees if thesis conditions were met:
- It is smaller than 1,000 bytes.
- All outputs are 0.01 BTC or larger.
- Its priority is large enough (see above)