By now I assume you have a fair idea of what a blockchain is and why it is important today and what makes it so indispensable in the data driven world today.
In this section, you will get a better visualization of how a blockchain looks like and how a transaction is validated on the blockchain. However, before moving on, let’s do a quick recap.
Blockchain is a sequence of records where every record contains details of transactions performed in the network. Every block is linked which creates a chain of blocks and thus the name blockchain. The entire database is decentralized making it safer and more secure.
And this is how it looks! Do not get confused by the chains below. This is just to have a very basic idea of how it looks. In reality, the chain is maintained by the blocks which stores information of the previous block. I will come to it later.
Blockchain Transaction Explained
Now let us look at how a transaction would happen on the blockchain theoretically. To do that let us consider an example involving toons from our childhood days – Shaggy, Pikachu, Donald Duck and Minion
In the image below you can see that Shaggy has 1000 bucks and this information is present across all the nodes (or participants) in the network. There are 4 participants in the network.
Shaggy decides to transfer 500 bucks to Pikachu. This information is relayed across the network and every participant of the network receives this information. Consensus mechanism is triggered and every participant can either approve or reject this request. In our case, the request can be approved only if Shaggy has equal to or more than 500 bucks in his account. Every participant sees that Shaggy has the necessary balance and approves the request individually.
A consensus is reached as all participants agree and a block is added to the blockchain as you can see in the image below. The block contains details of the transaction like sender, receiver, amount, date and time of the transaction, etc.
Now remember that for the sake of our example, the block contains only one transaction. However, in a real life application, every block can contain hundreds of transaction and it depends on the block size which we will discuss later on.
Shaggy now decides to transfer 400 bucks to Donald Duck’s account.
All the nodes reach a consensus and the transaction is validated and approved by the participants or nodes of the network. A block with information of the transaction is added.
Now Shaggy decides to transfer another 300 bucks
The other participants see that Shaggy does not have enough balance to transfer the amount to Pikachu. Each of these participants send in their denial of the request to the network. The network records each of these response and based on the consensus algorithm coded in it, decides against approving Shaggy’s transaction. Shaggy’s transfer request is rejected by the blockchain network.
Based on the above example, a couple of points to remember when it comes to blockchain –
- Blockchain records transaction, not the final outcome – As you can see, in the above example, the transaction is recorded, the bank balance of Shaggy is never recorded. This presents a tamper proof network where data security is guaranteed.
- Decentralized network – Blockchain ledger does not remain in a centralized location. Instead it remains on every participant’s computer. Depending on the nature of the network it can be public or private. We will discuss this in more details later on. This prevents a single point of failure and ensures that the network is always up and running.