1

As I understand it, if I'm a miner, and I have 5 transactions in my queue, I then would use the previous blocks hash and my list of transactions to attempt to create a new block. To do this, I must verify that the 5 transactions are valid, this costs computational power.

If all a miner is trying to do is create the next block, then why bother including transactions at all? It costs my computational power and time to verify those transactions. Why can't I simply look for the next block and have no transactions in my list?

It seems like a miner wouldn't even bother including transactions.

2 Answers 2

6

Transactions include a fee, which miners are allowed to claim if they include that transaction in their block. While it is legal to not include any transactions, miners who do this will miss out on the fees.

Furthermore, the computational cost needed to verify a transaction is absolutely negligible compared to the work of producing PoW. What is more important is the fact that verifying transactions and building a block on top takes time, time which the miner isn't mining. For this reason, some miners will briefly work on a temporary empty block just after the predecessor block is found, and will then switch to a full one once the full processing pipelining is through with it.

Lastly, if a miner were to skip transactions for computational reasons, those transactions might (and likely will) still be included by other miners. And when this happens, the miner still has to verify them, in order to build on top of it.

4
  • While working on the empty block, what if they find the solution? Will the empty block go into circulation? or do the nodes reject the block as there're no txns in it?
    – anotherDev
    Commented Jul 20, 2021 at 20:43
  • 2
    Blocks without transactions are perfectly legal, so those are accepted by the network. It wouldn't make sense to outlaw them as it's trivially bypassed (miners can just stuff them with their own transactions). Commented Jul 20, 2021 at 20:52
  • Got it. What generally prevents miners from stuffing the blocks with their own txns though? Or do they already do that? Sorry for noobish questions.
    – anotherDev
    Commented Jul 20, 2021 at 21:01
  • 1
    The fact that it doesn't gain them any money. Commented Jul 20, 2021 at 21:01
3

Transactions pay transaction fees to the miner which includes that transaction in a block. So miners are incentivized to include transactions because it means they get paid more. This becomes more important as the block subsidy goes down as then a miner's revenue will primarily come from transaction fees rather than the generation of new Bitcoin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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