How does a #Bitcoin node know how many blocks to expect before validating them, since anyone can publish infinite invalid blocks?

#asknostr

Reply to this note

Please Login to reply.

Discussion

It first requests all the valid headers of the longest chain.

The first (or one of the first) thing to validate is the proof of work. It isn't difficult to validate, but even for bad data, it is hard to make correctly.

You burn the same amount of energy as everyone else (as much as you got) to conpete for the next block or even any block, and then you watch that work go to waste.