What happens if the 10% fork (chain A) now extracts a block and sends it to the network?
When a miner under construction over A has found a valid block, he will relay it to the rest of the network. By convention, suppose that the fork (chain A and chain B) has reached the height of the block
N. This is how the different nodes in the chain will react.
- Nodes already use channel A: For them, this block
N + 1is a natural progression of the blockchain and therefore they will only add this block to their blockchain.
- Nodes using string B but having the block of string A: Some nodes might have received the string A block in height
Nafter receiving the block in height
NThis block received later is not rejected, but is processed and kept on the disk in the format. Thus, when a block of height N + 1 is received from the version of the chain A, these nodes simply reverse the height string N and use the other block kept on the disk.
- Nodes with only the B string: When they receive a block of height A + 1 of the string A, these nodes will see that they have no parent. As a result, these nodes will query the parent block using the
previousblockhashand see if that exists. Nodes with this block then pass this block to nodes that do not have it. When this block is received, these nodes will see that this string is the proof of the longest proof of the chain of work. They will now operate on channel A. The block located at the N height of the B-channel becomes out of date, but it is not ignored and remains on the disk.
How do they know this chain is longer?
Nodes accept the longest proof of the chain of work (in most cases, the longest chain). The nodes first synchronize the headers and check the proof of the work of the chain before asking the real blocks to the other nodes. When the version B nodes of the string receive the N + 1 block header of version A, they will see that the
chainwork the received block is greater than that of the other string and will use it to query the block associated with it.
How do they know that the block is not part of DDoS attacks?
When they receive the block header, proof of work is checked first. So, if the attacker wants to spam the network with invalid blocks, he will have to do it with valid proof of work. This means spending a huge amount of energy like other miners, but not receiving a reward (the block having no ancestor, it will be rejected). If the node receives a block header with an invalid proof of work, the node that sent this block header will be placed on a blacklist after some attempts of this bad. This is actually the basis of the war program in the 90s, when it was used to prevent spam.