Transaction commission

From Bitcoin Wiki
Jump to: navigation, search

Commission fee can be included in any transaction in the Bitcoin network.

Principles of operation

Currently a large amount of transactions is processed in a way that commission isn't necessary. At the same time in case if transaction has a lot of entry points (e.g. it carries large amounts of data) a small commission is not uncommon.

Any miner can be the one who processes the transaction and earns the commission fee. When the network finds a new block it includes all information about transactions including their commission. Thus any user of group of users who find that block will gain both the reward for the block and the commission fees for every transaction included in it.

Including commission in a transaction is a voluntary decision but a user who finds a block can attach any transactions he wants to the said block. That way transactions with 0 commission have the lowest priority when transactions with even the minimal possible commission (~0.0001 BTC at the current moment) have standard priority and will more probably be included in the block.

In the future along with lowering of reward for each block the main source of miners' income will become commission for transactions. Even when block reward will disappear altogether there will still be point in mining because users will gain commission for all the transactions when they find a block.

Sending transactions


Transaction with 0 commission can be successfully sent if following conditions are met:

  1. Its size is lower than 1000 bytes
  2. Its exit points have value of 0.01 BTC or higher
  3. Its priority is high enough

In other cases the transaction will be rounded down to 1000 bytes and the commission of 0.0001 BTC will be added. For every following 1000 bytes in that transaction another 0.0001 BTC of commission will be added.

Thus for a transaction of 750 bytes the commission will be 0.0001 BTC and for a transaction of 1001 bytes it will be 0.0002 BTC. Standard Bitcoin wallets always ask their users for approval of commission and if user declines it the transaction can be cancelled. At the current moment an average transaction amounts to roughly 500 bytes which corresponds to a commission of 0.0001 BTC.

Inclusion in blocks

In this part of the article the current principle of inclusion of transactions into blocks will be discussed. This setting is flexible for every miner if they want to have blocks of lower or higher size that include lower or higher amount of transactions accordingly.

30 000 bytes are reserved for highest priority transactions and they don't depend on commission in any way. After that all transactions with lower than highest priority are added to the block. The higher the commission the higher the priority. A block's maximum size is 300 000 bytes. Transactions that weren't included in their blocks will remain in miners' memory storage and can be included in next blocks.

Transaction relaying

Rules of transaction relaying across the network are similar to those of transactions inclusion in blocks. Commission fee of 0.0001 BTC is used for recognition of transaction as "free". To avoid DDoS attacks via relaying of large amounts of minimal transactions through the network there was introduced a limit for "free" transactions - no more than 15 000 bytes per minute.

Transaction settings

Settings Default value (unit)
paytxfee 0.0000 (BTC)
limitfreerelay 15 (thousand bytes per minute)
mintxfee 0.0001 (BTC)
blockmaxsize 300000 (bytes)
blockminsize 0 (bytes)
blockprioritysize 30000 (bytes)

Technical details

Transaction priority is calculated as following:

priority = sum * (input_value_in_base_units * input_age) / size_in_bytes

In order to avoid limitation the transaction's priority has to be no less than 57,600,000. Limit is written in code as COIN * 144 / 250 which implies that transaction has a "coin" with the age of one day (144 is estimated number of blocks mined per day) and the size of transaction is 250 bytes.

Let's provide an example of a transaction that has 2 entry points one of which is 5 BTC with 10 approvals and the other one is 2 BTC with 2 approvals. Transaction's size is 500 bytes and thus its priority is equal to (500000000 * 10 + 200000000 * 3) / 500 = 11,200,000

See also