A blockchain is a decentralized distributed way of storing data. The main idea of blockchain technology is to eliminate the need of a central database or a server for storage of data.
Imagine having some valuable data stored in a single database. This data could be anything. Now wouldn’t it question the security , as it would take only one breach for an attacker, to steal or do anything with the data ?
And this is what the blockchain technology prevents. Instead of storing everything in one place, a copy of data is distributed among the participants or the users using a peer to peer (p2p) network (a p2p network is simply a network where each node connects to every other in order to exchange information, without the need of any server). Now imagine the work a hacker would have to go through to steal some data. To tamper with the data, one has to hack every computer in order to rule it out for everyone.
This concept has been widely adapted in the last 10 – 15 years. One of the most popular application of this technology is Cryptocurrency, which many of you might have heard of.
Lets try to understand how blockchains actually work in real life.
Seeing it practically
Imagine Tobey and John need to pay their rent to their landlord Harry. Tobey’s current balance is $ 20, John has $ 69 and Harry has $ 420. They both need to pay $ 20.
First Tobey sends $ 20 to Harry. This transaction is recorded in a block. This block also contains the old and new balance in Tobey and Harry’s accounts.
The same process is repeated with John. But here this new block will look at the Tobey’s transaction block to see Harry’s current balance. Notice here how this block links to the other block. This is what we call as a chain between the blocks.
Then a copy of this blockchain is sent to all the users in the p2p network.
But what if someone tries to send money they don’t have. Imagine if Tobey tells Harry he want’s to pay advanced of a month and half, which is $30, but actually he doesn’t have a penny left. When he’ll try to add the next block, or do the transaction, Harry, from the copy of the blockchain he has, will notice Tobey’s current balance is $0. And he’s trying to send $30. And this is how Tobey’s transaction would not be considered valid by any one.
NOTE: I USED DOLLAR AS THE CURRENCY, BUT IT WILL PROBABLY BE SOMETHING ELSE. LIKE A BITCOIN. AS THE WHOLE IDEA OF CRYPTOCURRENCY IS TO MAKE NEW CURRENCIES, WITHOUT ANY CENTRAL BANK REGULATING IT.
Everything written in this article is just to give you an idea of how blockchains function and why they are so useful. It does not explains the entire basic structure of a blockchain. There are many other things like Hash functions, Nonce, Public / Private Keys etc. which are also involved. I will be covering about them in the upcoming articles.
In the second part we’ll be talking more about a blockchain’s structure