Are all Blockchain array implementations incorrect?

I found many Blockchain implementations on the web, but are they true Blockchain that can scale?Here we can see that the blockchain is started as an array

var blockchain = [getGenesisBlock()];

Here we can see the same implementation:

constructor() {
        this.chain = [this.createGenesis()];
    }

This article also recommends it:

constructor(genesisNode) {
     this.chain = [this.createGenesisBlock()];

However, are any of these implementations ready to scale?

Technically, according to maerics,

the maximum length of an array according to the ECMA-262 5th Edition specification is bound by an unsigned 32-bit integer due to the ToUint32 abstract operation, so the longest possible array could have 232-1 = 4,294,967,295 = 4.29 billion elements.

The size is not a problem. Ethereum has used'only' 7 millions blocks, Bitcoin 'only' 500k, therefore there is enough space for the future. The real problem that I'm thinking is, how long would it take to read the last element of the array and would this be scalable? In blockchain, the 'Block' structure always needs to read the hash of the last block, therefore I assume that as it scales it takes longer and longer to do it.

What would Bitcoin and/or Ethereum do if their Blockchain array of Blocks doesn't have any more space to store blocks? Would the Blockchain just end there?

#blockchain #javascript #bitcoin

3 Likes1.70 GEEK