top of page

Blockchain Demystified: A Comprehensive Guide to Understanding Blockchain Technology (Part 1)

Bitcoin, the revolutionary and the most expensive cryptocurrency in the world, is a product of Blockchain technology, which, in turn, is based on the distributed ledger technology.

While these terms are making headlines, people are confused and do not have the proper understanding of the terms. Lawyers are not immune to this buzz either.

India is eyeing the recent developments and applications of Blockchain across the world. It is irrefutable that the Blockchain is getting a lot of attention from the regulatory authorities and central banks across the globe. After the adoption of Blockchain technology in Bitcoin, it has grown from the cryptocurrency adoption to its initial usage and found broader applications in some fields. Because of its breakneck pace of growth, many people are referring to Blockchain as the new internet.

Blockchain will play a crucial role in data and identity management. The European Union (the, “EU”) data strategy aims to make the EU a leader in a data-driven society and create a single market for data to allow it to flow freely within the EU and across sectors for the benefit of businesses, researchers and public administrations.[1] The tools for consent management and personal information management would be implemented through decentralized and Blockchain technology solutions. [2] India is also coming up with its own personal and non-personal data management legislations. The Blockchain might play a crucial role in fulfilling several mandates in the same.

Blockchain holds the potential for a great future in the times to come, and prominent names would venture into Blockchain technology and its applications. The industry would be transformed radically, and big technological giants like Walmart, IBM, Facebook, Infosys, Google are exploring its potential for implementing and leveraging the technology in their mainstream business. While developing the technology and coming up with their application, they are paving the way for the technology, which has the potential to be as revolutionary as the internet.

[1] https://ec.europa.eu/info/strategy/priorities-2019-2024/europe-fit-digital-age/european-data-strategy_en#:~:text=The%20European%20data%20strategy%20aims,businesses%2C%20researchers%20and%20public%20administrations. [2] The European Data Strategy Consultation paper


The SHA-256 HASH

Let us understand the fundamentals of Blockchain Technology with the help of some visuals. We must begin learning about Blockchain by first understanding the SHA-256 Hash. But to start with, SHA-256 Hash can be understood as a random number generated from an input.


FIGURE 1



[1]The Hash shown above in Figure 1 can be understood as a bunch of random numbers. It is a fingerprint of some digital data. So the Hash would be a digitally unique identification/fingerprint of the data (or text) that would be present in the Data textbox above.

[1] https://demoblockchain.org/hash


FIGURE 2


FIGURE 3


To prove that the Hash is unique for different strings, let us consider Figure 2 and Figure 3 above.

Figure 2 contains in the Data field “My name is Siddharth Dalmia”, and Figure 3 contains in the Data field “My name is Siddharth Dalmia.” (this one has a fullstop at the end of the sentence!) and you can see that both the Hash are entirely different. This proves the initial statement that Hash is a fingerprint to a particular Data, and hence, different data would have different Hash. Merely adding a full stop in Figure 3 entirely changed the Hash. To summarize, the Hash for different text or data would be different, and you would be able to test it out yourselves later.


BLOCK

We understood that Hash is a random number generated as the output by an input message.

Now, we would extend the idea of a Hash discussed in CHAPTER 10 and extend it to something that we are going to call a ‘Block.’ Figure 4 below shows a Block. It is the same as a Hash except that it’s Data field has been broken into three components, i.e., ‘Block,’ ‘Nonce,’ and ‘Data.’

Now, the second unit that goes into building what we know as ‘blockchain’ is a ‘Block’. How Hash is a representation of Data, a Block is a representation of ‘Block no.’, Nonce & Data combined.

Note: The word ‘Block’ would signify Figure 4, and ‘Block No.’ would mean the ’Block’ components of the Data field described above.


FIGURE 4



We will now figure out what does FIGURE 4 mean. Block No. signifies what is the numerical order of the Block in the chain. For example, Block No. value ‘1’ would signify that it is the first Block. We shall discuss Nonce in detail subsequently (right now, think of it as another number), and Data is similar to what we discussed.

But before we move further with our discussion, we must observe the value of Hash, which begins with four ‘0s.’ To give an illustration, see the FIGURE 4 above, and observe the Hash value. It has 4 zeroes in the beginning but this is not always the case. This is an unusual Hash, and most of the hashes would not start with four ‘0s.’ And because it begins with four ‘0s’, and it was arbitrary, we would make a statement that “This Block is signed.”

Now, if we change any information in Block No., Nonce, or Data, the chances of another Hash beginning with four ‘0s’ is meager, and changing any information would lead to the Hash being changed. Remember, Block No., Nonce, and Data together constitute Data. The illustration has been shown in Figure 5 below.

FIGURE 5


Just adding the character ‘.’ resulted in changing of Hash and notice it does not begin with four ‘0s.’ Also, notice that the background in Figure 5 has turned red, which means that this Block, with the information shown in Figure 5, is not valid. And hence, because it is not valid, we would just say that this Block is not signed.

Now, the idea of Nonce becomes pertinent. A Nonce is a number that needs to be found such that the Hash begins with four ‘0s.’ This could only be done by hit and trial as the chances of typing a number that would result in a Hash that begins with four ‘0s’ are very low. It is probabilistically impossible to land a hit that meets the conditions above in a day, given that you are trying one Nonce each second. To perform the task, we would hit the ‘Mine’ button shown in Figure 4. After hitting the mine button, the following Block is obtained.

FIGURE 6



Pressing ‘Mine’ began the hit and trial process by first entering number ‘1,’ and all the way up till it found a Nonce value, in this case, 702, which resulted in the Hash beginning with four ‘0s.’ Now, because the Hash is starting with four ‘0s,’ we can say that Block is valid and signed again. So, the computer program tried 1, then 2, then 3… and finally 702 to meet the desired conditions. This system is just like winning a lottery and after the Nonce is found, the Block can be said to be valid. This process is called mining.

To put it concisely, mining is the process of adding transaction records to Bitcoin's public ledger of past transactions.


BLOCKCHAIN

we understood that a Block comprises of ‘Block,’ ‘Nonce,’ ‘Hash,’ and ‘Data.’ And we understand that Hash is a random number output that depends on input data.

FIGURE 7







NOTE: Now, the Block with Block No. x(x is a number) would be represented as ‘Block x.’ For example, the Block with Block No. 32 would be denoted by Block 32.

Apart from the ingredients of a Block, the Blockchain has multiple Blocks and contains a new data field ‘Prev’ which represents the Hash value of the previous Block, and any change in its value would lead to Hash being changed in the Block. Block 1 represents the first Block in the chain, Block with Block No. 2 represents the second Block in the chain, and so on. The Blockchain can have any number of Blocks, and the Block No. value would be changed accordingly.

Now, take notice that the value of Prev in Block 2 is equal to Hash of Block 1. We also need to take into notice that the Block 1 in the chain, cannot represent any Prev value because there is no Block before it and hence represents the value of Prev as ‘0’ for the sake of simplicity. Block 1 is also called the Genesis Block. Let us try to determine what happens when we change the contents of a Block. The consequences of the same are illustrated in Figure 8 below.


FIGURE 8


As we change the contents of Block 2, we notice that the Hash of Block 2 has changed, and it has become invalid (as the Hash is not beginning with four ‘0s.’ This leads to Prev of Block 3 being changed, and because the value of the Hash is dependent on the Prev value, the Hash of Block 3 has also changed. So, changing the content of one Block would have a cascading effect on all the subsequent Blocks, and all the subsequent Blocks would become invalid if any of the Block is tampered with. For example, if we tamper the contents of Block 10 of a Blockchain, all the subsequent Blocks (from 10 onwards including 10) would become invalid.

Again, consider the questions below:

1. What happens if we change the contents of the last Block of the Blockchain and press the ‘Mine’ button?

2. What happens if I change the contents of any Block except the last Block of the Blockchain, and press the ‘Mine’ button?

If you have answered the questions above, test out your answers by taking the steps as follows:

1. Go to https://demoBlockchain.org/Blockchain.

2. Test whatever we have learned till now by navigating between different tabs in the Menu Bar (‘Hash,’ ‘Block,’ and ‘Blockchain’).

3. Test the scenarios as per the questions above.

The reason behind your observation is that the last Block does not affect the values of the Prev in any other Block. Therefore, changing the contents of the last Block and pressing the ‘Mine’ button would result in the last Block become validated with no cascading consequences. But changing the contents of any other Block would result in the change of Prev of subsequent Blocks and hence, the Hash of subsequent Blocks, which might not begin with four ‘0s’ and hence becoming invalidated. Each Block would need to be specifically ‘Mined’ for that Block to be validated. This is the mechanism through which the Blockchain resists the change.

When all Blocks have been mined, how would we determine if the Blockchain has been re-mined?


DISTRIBUTED BLOCKCHAIN

In Chapter 10.2 , we understood that the Blockchain is a chain of Blocks that are connected with each other through ‘Hash’ values. Block comprises of ‘Block,’ ‘Nonce,’ ‘Hash,’ and ‘Data.’ And Hash is a random number that cannot be reverse engineered.

The Distributed Blockchain can be understood in Figure 9, in which the Distributed Blockchain has been shown.


FIGURE 9


In Figure 9, Peer A, Peer B, and Peer C are three different people who have the same copies of the Blockchain. The Distributed Blockchain is the same as the Blockchain, but many people hold a copy of this Blockchain. Many peers on the internet have an identical copy of the Blockchain.

NOTE: Notation would now be- ‘Peer’ ‘Block no.’ For example, if I need to refer to Block 4 of Peer D, I would denote it as ‘Peer D Block 4.’

Before going further, we assume that the Blockchains above are 3 Blocks long. Let us experiment by changing the contents of Peer B Block 2, and we would Mine the Peer B Block 2 and 3 to make the change valid. This would result in Figure 10.


FIGURE 10



We need to keep in mind the lesser numbered Block we would be on, more the Blocks we would end up invalidating. For example, if, in a Blockchain, there are a hundred Blocks, if we change the Data of the 90th (ninetieth) Block, we would make all the 11 Blocks from 90 to 100 invalid, but, if we change the Data of tenth Block, we will end up invalidating the next ninety-one Blocks from 10 to 100. Remember, mining them would validate the Block in the Blockchain, but it would end up changing the Hash of the invalidated Blocks.

But if one peer changes or tampers with her/his Blockchain, the Hash for the last Block in the Blockchain that she/he has a copy of would be different than the Hash of the other peers having a copy of the Blockchain. This is illustrated in Figure 10 in which the Hash of the Peer B Block 3 is different from the Hash of the Peer A and Peer C Block 3, which were not tampered with. The Hash of Peer A and Peer C Block 3 is the same. This means that peer B is in disagreement with the other Peers. We can determine by just looking at the Hash of the last Block of each Peer to decide which Hashes are different. Voting happens where each Peer that hosts the Blockchain casts a vote of which version of Blockchain is correct. As the version of Blockchain preserved by Peer A and Peer C match along with their Hash of the last Block, they would vote that their version is correct. So the untampered version would have two votes while the tampered one will have one. Therefore, the Undistributed Blockchain would discard the Blockchain version of B. The peers are actually computers. And all the peers would be quickly able to compare their copies of Blockchain by simply comparing the Hash. Blockchains consist of numerous Blocks, and their validity can easily be verified just by the Hash of the last Block of the Blockchain.

PRACTICE: Testing out the distributed Blockchain

1. Go to https://demoBlockchain.org/Blockchain.

2. In the Menu bar, click on the Distributed tab.

3. Test out and play!

This practice would have made you learn and appreciate how the Blockchain works and how it cannot be tampered with in a Distributed Blockchain system as it would never have enough votes to validate. The Blockchain, which has the same Hash for the last Block, would vote for their version to be correct and would hence vote for the same version.

Till now we have discussed how the Block is added to the Blockchain after successfully determining that the contents are valid through the process of mining. This concept is used in complex networks such as Bitcoin network to determine that the transactions that are recorded are valid.

Now we have understood the concept behind the Blockchain and how it works. But still, the concept is lacking because we do not know what exactly constitutes the Data. We will now move ahead and try and determine that.


TOKENS

we understood that distributed Blockchain is a consensus based implementation of a Blockchain in which participants of the Blockchain have a copy of the contents of the Blockchain. They agree on what the correct contents are through a process that is analogous to voting. These Blockchains are the Blocks that are connected with Hashes.

Token is the currency used on various Blockchain networks. Some of the examples are Bitcoin, Ethereum, Ripple, etc. Let us understand what actually a Token is.

To understand the structure of a Token, refer to Figure 11 below. For illustrative purposes, although multiple peers are having a copy of the same Blocks, we would only be illustrating the concept of Token through a copy owned by a single peer.

FIGURE 11




Now, the Data has been labeled as ‘Tx’ which refers to Transactions and Tokens, in this case, are represented by ‘$.’ Token could be any Cryptocurrency that you might be aware of including Bitcoin and Ether. Therefore, the Blocks would just contain the relevant transactions; for example, the first transaction of Block 1 tells us that Darcy gave Bingle 25 $ Tokens. Now, this is the Data that is pertinent, and the money needs to be meticulously tracked for the Tokens to have value. As this is a Blockchain having a distributed ledger, it would have all the protections of the Blockchain. Considering this being a Blockchain, can you change the ‘Transaction’ of any Block unilaterally? The answer is no, and to know why, review Chapter IV, the Blockchains of this Course. To test out, take the following steps:

1. Go to https://demoBlockchain.org/Blockchain.

2. In the Menu bar, click on the Token tab.

3. Test out and play!

You would now have a better understanding of what is inside a Data (or Tx) field of a Blockchain. But there is one final problem with this mechanism. If Darcy gave Bingle 25 $ Tokens, how do we know Darcy owns 25 Tokens? How can Darcy pay someone if she does not own the money (in this case, the Tokens) in the first place?


COINBASE

We understood that a Token could be put on the distributed Blockchain that is accepted as consideration or replacement of money. All the participants agree that these Tokens hold certain value. The Blockchain is seen as a chain of Blocks connected with Hashes.

To understand the Coinbase, refer to Figure 12 below. For illustrative purposes, although multiple peers are having a copy of the same Blocks as we saw in Chapter IV, we would only be illustrating the concept of Coinbase through a copy owned by a single peer. We will try and understand it after that.


FIGURE 12


As we can see from Figure 12, apart from other Data that is already present, a Coinbase transaction is also added to the Block. Block 1 has no ‘Tx’ data and only a Coinbase transaction. But now, we have a record of ownership of Tokens before they are being transacted.

There are no transactions in Block 1 because previous to that, no one had any tokens/ money to part with.

If, in Block 2, a transaction Sophia -> Lucas is present, it would not be considered as a valid transaction but would be categorised as illegal because Sophia has no Tokens for herself. The Coinbase transaction is just specifying that at the creation of the Block, we are going to give $100 to Siddharth- this is totally random. In Block 2, again, $100 is given to Siddharth. They could have been given to any other person, but they are given to Siddharth again.

All the transactions in Block 2 originate from Siddharth because he is the only one with any money from Block 1 (Note that the Block 2 transactions have not been recorded yet, so Siddharth had only $100 to give). All the transactions in Block 2 do not exceed $100, so the transactions are valid because money spent is less than or equal to the money owned. Because we have Prev Hash, we could keep going backwards to see whether a person has enough Tokens to make the transaction. So, in Block 3, Emily can make a transaction, but it cannot exceed $15, and we know that by seeing Block 2.

Therefore, randomly, the Blockchain has been coded in such a way that it gives random amount of Tokens to a random participant in the Blockchain and that is how the Tokens come into existance on the Blockchain.

The Coinbase is derived from these transactions because these Coinbase transactions (that are totally random) lead to the genesis of the tokens on the Blockchain. As the ledger records that Siddharth has $100, only these Tokens would be transferred to the participants on the Blockchain.

This is an example of a particular Blockchain which has Currency as Token running on it. Many peers have a copy of it, and hence, it has all the benefits of the Blockchain

Therefore, it becomes an efficient way to agree on the events that have occurred in the past.


By Siddharth Dalmia

The StartUp Sherpa

+91-9971799250

dalmiasiddharth1994gmail.com

1 view0 comments
Recent Articles

Subscribe to Our Newsletter

Thanks for submitting!

bottom of page