Does every miner verify blocks that are already in the Blockchain

1

Once a miner adds a block to the chain, does every other miner have to check that block to make sure that its transactions don't violate any rules?

For instance, if a miner added a block with an invalid transaction, is every other miner expected to check that block (and perhaps compare each transaction in it with every other transaction in every other block, to prevent, say, double spending)?

rahs

Posted 2018-03-27T07:01:34.467

Reputation: 137

Question was closed 2018-03-27T12:12:49.033

Answers

1

I'd advise you to use the search function a bit more, as you are asking a lot of questions which have already been answered.

When it is broadcast, other full nodes will ignore it as spam, and typically disconnect from the node that sent it. A bad block is unlikely to propagate very far on the network.

When other miners see it, they will also ignore it. If they mine on top of it, they will be wasting their hashing power. This also means that the miner who did the proof of work on the invalid block has wasted their own hashing power. This is why it's important that miners validate the transactions they include in blocks.

What happens if a miner publishes a block which contains an invalid transaction?

Rutger Versteegden

Posted 2018-03-27T07:01:34.467

Reputation: 966

Thanks for your answer, but in future, please vote to close the question as a duplicate rather than quoting the answer here too :)MeshCollider 2018-03-27T12:12:41.077

True its a duplicate and I should have linked the other question for reference. I cannot comment on that question so I'll ask it here. According to that answer, it does seem that a miner does have to somehow verify previous blocks. If this is true, how many previous blocks does he check?(should I ask this as a separate question?)rahs 2018-03-27T12:27:03.260

@RahulSaha The miner indirectly checks all blocks. An interesting property of the bitcoin blockchain is that blocks which are once valid are never invalid in the future. So, you can only verify each block once and you are done.sanket1729 2018-03-28T08:29:00.663

@sanket1729 So does that mean that, say, if I just start mining, then I first need to check the entire blockchain?rahs 2018-03-28T08:53:22.473

@RahulSaha, yes you need to check the entire blockchain. That is the entire point of bitcoin blockchain where you trustlessly arrive at the same chain without trusting anyone about the validity of the blockssanket1729 2018-03-28T09:11:46.713

@sanket1729 and how is this verification of the blockchain done? Is every transaction compared with every other transaction?rahs 2018-03-28T10:25:29.183