0

I am working on Bitcoin and trying to understand how transaction fee is calculated. Bitcoin support site states that the reason for selection of small and large transaction by miner:

Again due to the fact that a block on the bitcoin blockchain can contain no more than 1 MB of information, transaction size is an important consideration for miners. Smaller transactions are easier to validate; larger transactions take more work, and take up more space in the block. For this reason, miners prefer to include smaller transactions. A larger transaction will require a larger fee to be included in the next block.

https://support.blockchain.com/hc/en-us/articles/360000939883-Explaining-bitcoin-transaction-fees

I have below questions on it:

  1. Does the size difference matter only in case of validation or even while mining or PoW.
  2. What is the mathematical reasoning for difference.
1

Smaller transactions are easier to validate; larger transactions take more work, and take up more space in the block. For this reason, miners prefer to include smaller transactions.

This is not necessarily true. Miners do not validate transactions, nodes do. Miners generally are only aware of the current block template they are trying to mine. That's why it's important for a miner to connect to a node they trust, in order to get the block template. Miners will get block templates that prioritize transactions with the highest fee/kB. This maximizes the tx fees for the miner for mining the the block.

While it is true that larger transactions are harder to validate, a larger transaction is not harder for the miner to validate because it does not do validation. See Node Operation under Bitcoin Mining. It is also not harder for the miner to hash because it is only hashing the merkle root of all the transactions (along with the other header data) selected for the block. See Block Hashing Algorithm. The merkle root is the same size regardless of how many transactions it represents.

Users must compete for the higher fee/kB if they want a better chance that their tx will be included in the next block.

Edit: As an aside, extremely large transactions with lots of inputs can cost the network almost as much to process as they cost the sender in fees, because computing signature hashes is O(ninputs*txsize). For this reason, nodes limit transactions to MAX_STANDARD_TX_WEIGHT to mitigate CPU exhaustion attacks.

  • Thanks for the help. What you are telling is correct. Right now I am looking into difference between small and large size transaction which is important for miner. "Smaller transactions are easier to validate; larger transactions take more work, and take up more space in the block. For this reason, miners prefer to include smaller transactions. A larger transaction will require a larger fee to be included in the next block." Can you comment on this part. – Pushpendra Aug 4 '18 at 4:39
  • Just added another paragraph addressing that specifically – JBaczuk Aug 4 '18 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.