How does intial block download work at P2P layer?

1

2

A simple DOS attack while IBD could be as follows:

  1. The fresh client is currently downloading block 100.
  2. Then it is offered 10 blocks at height 101, each claiming they are the heaviest chain
  3. 9 out of 10 alternatives are with fake PoW but still the client will waste time in getting the entire block and validating their PoW.

How does the current implementation of P2P protocol in bitcoin-core handle this sort of DoS attack?

sanket1729

Posted 2017-09-15T04:54:31.003

Reputation: 755

Answers

2

Bitcoin Core does headers first sync so it downloads the headers first and partially validates them before downloading the blocks. So if a malicious node sends headers with invalid PoW's, the syncing node will disconnect from it and sync headers off of another node. If the it receives multiple headers for the same block height, that node will be considered to be misbehaving and stop syncing headers from it.

Andrew Chow

Posted 2017-09-15T04:54:31.003

Reputation: 40 910