What is the maximum number of blocks in a blockchain?

  • 1
    Why was this question put on hold? It is a valid question for the Ethereum blockchain.
    – Ismael
    Sep 23 '17 at 13:44
  • @Ismael , thats what I am asking myself. Hate stackoverflow's rules, they treat us as bytes, not as humans
    – Nulik
    Sep 23 '17 at 14:48

Actually, there is no maximum limit on number of blocks, blocks just keep getting added to the end of the chain at an average rate of one every 10 minute this process will not stop even if all Bitcoin (21 million) get mined, because people will need blocks to store their daily transactions.

  • 1
    I think there must be a theoretical maximal number of block due to the fact that the field where the number of blocks is indicated has a finite size. I don't argue that we will get to this number before the end of the Earth, but still it is bounded. Moreover, it is Ethereum SE so I'm not sure the bitcoin example is so accurate.
    – Distic
    Sep 23 '17 at 9:02
  • @Distic In Bitcoin the block number is not stored in the block header (bitcoin.org/en/developer-reference#block-headers), so it is effectively not limited. In Ethereum the block number is stored as a scalar (Yellow Paper, Section 4.3 The Block) and scalars are serialized as their smallest big endian representation (Yellowo Paper, Appendix B Recursive Length Prefix), this implies the block numbers are no limited by any bound.
    – Ismael
    Sep 23 '17 at 15:04
  • Its 10 minutes for bitcoin and 15-20 seconds for Ethereum @Vijesh
    – Aditya
    Jan 22 '18 at 10:17

Vijesh's answer is correct at the blockchain level. Within smart contracts, block numbers are represented as a 256-bit unsigned integer, so the maximum block number is 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,935. This would take 3,671,743,063,080,802,746,815,416,825,491,118,336,290,905,145,409,708,398,004,109,081,935,347 years to reach at 15 second block times.

This is unlikely to be a problem in practice.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.