Longest Chain

From CryptoWiki

(Redirected from Longest chain)

" Imagine that the blockchain is 210000 blocks long and TWO miners both find valid blocks within a few seconds of each other and broadcast them to the network. This is perfectly normal as the Bitcoin network is peer to peer and global.

You now have two chains, each of length 210001. Neither of these are longer than each other. Some bitcoind nodes will see the first miner's block and some bitcoind nodes will see the second.

Temporarily you have two forks of the blockchain, each of length 210001 blocks long. They are identical for 210000 blocks, but the 210001st is different on the two forks.

Sometime later another miner finds another valid block, the 210002nd block, and that will be attached to exactly one of the forks.

This chain is now the longest at 210002 blocks and becomes the 'longest chain'. It becomes the "definitive" blockchain.

(The transactions in the alternate fork don't disappear - they simply get put back into the pool of unconfirmed transactions and miners will put them into a subsequent block)."

  • The Longest Chain Rule ensures that network will recognise the “chain with most work” as the main chain.

The Heaviest Chain Rule

"The longest chain rule & heaviest chain rule: When multiple chains exist, for instance due to attacks attempting to break ledger’s immutability, the chain with the longest string of blocks was originally selected as ‘the true version’ in Bitcoin. Since blocks can only be created through PoW, the longest version was considered to be the most difficult to create and could thus be the only ‘true version’ of the ledger. More recently, this was adjusted to the ‘heaviest chain rule’, where the chain that got hashed the most is selected, making this assumption more explicit."