Blockchain - Know About It

Let's know about Blockchain.

What is it?

Blockchain is a continuosly growing list of blocks which are linked and secured to each other. It is just like a database with some differences. In a traditional database, you store data on a central server which is trusted to maintain the centralised database. But blockchain is just opposite. In a blockchain, the database is decentralized so that the burden of trust is not upon one server but instead on a network of systems. Such a model takes help of numerous computers, each managing a copy of the same database. Blockchain is generally intended to be made for cryptocurrencies.

How does it work?

As I mentioned before that a blockchain consists of a database. It keeps the record of the history of transactions of bitcoin or the data that has taken place. The database is shared among the nodes through a peer-to-peer network used by the same nodes to communicate and update the database whenever there's a new transaction. The database will be accessible to other nodes as long as the network is online even if one or two of them leave the network.

How is it maintained?

In its initial state, generally called genesis state(what a cool name!), the entire network is notified and nodes are initialised. Now transactions are broadcasted to the network so that the database can be modified with the required entries. These new entries aren't added directly. A colleection of these ebtries are called blockchain. The transactions inside a block together generate a hash key unique to the block and set of transactions. The hash key creates a link to its previous state. This linking is essential to the security of the transactions in the first block. The integrity of the first block is also maintained since if any changes were to be made, the corresponding hash will change. This would result in a mismatch of the hash and everyone will be able to notice it and flag it off as fraudulent. 

If an attacker tries to modify a block, it will be a foolish trick. If someone modified a block in between, the hash value of that block will change and break its link to the previous block. This will render all the blocks following the newly modified block to become invalid. The nodes already store the database across the network and when the new block is broadcasted, a mismatch will be detected. This is practically how a blockchain works.

Why do we need it?

The simple answer would be security. A distributeed system is difficult to penetrate.