Blockchains are built through a combination of linked lists and merkle trees. The linked list structure allows for the chain to continually build on top of itself and is …
A blockchain is a public database that consists out of blocks that anyone can read. Nothing special, but they have an interesting property: they are immutable. Once a block has been added to the chain, it cannot be changed anymore without invalidating the rest of the chain. That is the reason why cryptocurrencies are based on blockchains.
In this case, the blockchain is a very simple object that contains a property chain. This is an array containing all the blocks on the chain. Before we can add new blocks, we have to add what is called a "genesis block". This is the first block on the chain and its a bit special because it cannot point to a previous block (its the first one!)
After updating its hash, the new block is pushed into the blockchain array. In reality, adding a new block to a blockchain is not that easy because of the several checks that have been placed. Nonetheless, for this simple cryptocurrency, it’s enough to demonstrate how a blockchain …
How To Build A Simple Cryptocurrency Blockchain In Node.js
Esto se utiliza en la minería de BTC como su algoritmo de prueba de trabajo y en la creación de direcciones de BTC gracias a su seguridad. Para instalar la librería crypto-js, ve a tu terminal e ingresa a tu carpeta js-blockchain y luego instala la librería con npm con el siguiente código: npm install --save crypto-js.
Blockchain: A blockchain represents the linked list of blocks. A blockchain is immutable, which means once the block is added to the blockchain it cannot be …