20

I'm running a private Ethereum blockchain. When I set one of the nodes to mine, that node continuously creates blocks, even if there are no transactions inside of it. What is the purpose of this?

marked as duplicate by galahad, Paul S, Community Nov 2 '16 at 10:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

17

A benefit of a blockchain is that it is append-only with, in practice, immutable past blocks.

These past blocks are immutable because it is very difficult (via proof-of-work) to create a competing block that "rewrites history". Plus, you have to take into account the fact that subsequent blocks add their own difficulty. So to change a block in the past, and be accepted by other nodes, you need to change that past block and all those that came thereafter.

So to come back to your question, those empty blocks are constantly adding new layers of difficulty to ensure the practical immutability of past blocks.

The awarding of new Ethers is there to incentivise miners to protect past blocks.

  • This answer is as good as it could be, but you might explain the reason why it's happening more often now than it has in the past because of the recent Dos attacks. I'm not sure why that is. Perhaps you can add an explanation of why it's happening now more often then before. – Thomas Jay Rush Oct 14 '16 at 22:39
9

On a public chain, it makes perfect sense to keep creating blocks, because a miner will still get the 5 ETH block reward, with or without transactions inside. Thus, geth will continuously mine as long as it is told to do so. It doesn't know that the chain isn't public. It is possible to write a script to control geth's mining. See this question.

If you are looking for a private blockchain to test dapps, a simulator such such as testrpc will likely be more suitable than a genuine full node. testrpc only "mines" when there is a transaction, and this mining is simulated--no actual hashing occurs.

5

In the ethereum blockchain we creates blocks every N time (15 s) check https://etherscan.io/charts/blocktime

we do that for 2 purpose :

1-include transactions.

2-generate new Ethers.

If there is no transaction to include or the miner refuses to include them then he crates a new block without transactions, but containing the rewarded Ethers.

so a block could contains no transaction inside it, but keep in mind that a validated block need some confirmations (additional blocks after it) to be more reliable [12 confirmations for making "irreversible" changes to data].

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