In Chapter 3, Cryptography in Blockchain, we explored how a consensus can be achieved in a decentralized network with the help of algorithms such as proof-of-work. Since consensus algorithms ensure that the Byzantine failure problem can be solved, a global truth can be maintained in a decentralized network in which there is no trust between the peers. Although consensus algorithms provide a convenient way to maintain a public ledger, each node has to perform a set of operations to maintain the ledger in a distributed network.
We have already created a simple blockchain application that can continuously enlarge its records whenever we have new data to be inserted. Because our blockchain application was deployed and the blocks were created in a single system, we have not yet added any mechanisms to validate the blocks. But when we deploy...