What is a Block in the Blockchain? (Part 2- Blockchain Series)

Techskill Brew
Blockchain 101 by Techskill Brew
7 min readDec 26, 2021

This is the second part of the 100 part series on Blockchain. You can read the first part here to understand what is Blockchain and its components.

As the name indicates, Blockchain metaphorically consists of blocks linked together chronologically to comprise a chain known as the Blockchain. Every transaction or data is stored in the block. Let’s take a real-life scenario to understand it in a better way. Suppose I make a transaction of some amount in Steve’s account. There has to be a place where this transaction information will be stored. This place is called a block in the blockchain. A block records some or all of the most recent transactions that have not yet entered any prior blocks. Each time a block is ‘completed,’ it becomes part of the past and gives way to the next block in the Blockchain. A completed block is a permanent record of transactions, which, once written, cannot be altered or removed.

Block time

The average time it takes for the Blockchain network to generate a new block of transactions and add it to the Blockchain is called the block time. Some Blockchains create a new block as frequently as every five seconds, and some may even take a few minutes. For instance, the block time for Ethereum Blockchain is between 14 and 15 seconds, while the block time for bitcoin Blockchain is around 10 minutes. In cryptocurrency, a shorter block time means faster transactions.

Elements of a block

The first block in the Blockchain is known as the genesis block, as it is the block from where the chain originates.

Genesis block in the Blockchain

Each block has five elements.

1. Data and transactions: The first element is data and transactions. Let’s come to our example. The amount associated with that transaction and all the other related information like sender information, receiver information, etc., will be stored in the block. The data contained in each block depends on the type of Blockchain. For example, the food supply Blockchain will have information on all the processes involved in that specific food supply chain.

2. Hash: Each block also includes a Hash- a unique identifier for the block and all of its contents. To better understand, you can assume a hash to be equivalent to a fingerprint. It is always unique, and no two blocks can have the same hash, just like in the case of fingerprints. As soon as a block is created, its hash gets generated simultaneously. Tampering with a block changes its hash. Simply put, if fingerprints or hash of the block change, it indicates that the block has been tampered with and is no longer the same block. So hash can be a very powerful tool to detect any changes made in the block.

Tampering with block changes its hash

3. Hash of the previous block: Another important element that every block contains is the hash of the previous block. This piece of information is what links one block to another and makes the whole network safe and secure.

In the figure, block 4 contains the hash of block 3, block 3 contains the hash of block 2, and so on. As discussed earlier, any change in the data of a block leads to a change in its hash. In the given figure, when we change the data in block 2, the hash of block 2 gets changed as well, which makes the whole blockchain unstable. This happens because each block contains hash of the previous block. When block 2 is tampered with, the old hash becomes invalid, and a new hash is generated for the block. This affects all the subsequent blocks in the chain and thus making all of them invalid. This unique property of the blockchain makes it transparent and secure, as in any case of data tampering whole network gets to know which block got compromised in the blockchain.

Hash of the previous block links the block to another block in the Blockchain

4. Timestamp: The fourth essential element that every block contains is the timestamp. Timestamp simply means “a proof that some data existed at a particular date and time.” In other words, the timestamp can be referred to as “Proof of existence.” Any digital data can be timestamped. The hash of the block containing data and transactions is timestamped and is then published on the network. By doing so, it is ensured that the transactions have existed at this point in time. Implementing a timestamp on the block also makes the block impossible to be repeated in the future since, in addition to the time, the date of creation of the block is also stored. Therefore, there is no possibility that any block in the future can be assigned a repeated hash that was given to any of the previous blocks a week, two months, or a year ago.

Moreover, Blockchain-based timestamping is an entirely secure way of tracking the creation and modification time of a document. It is secure enough that even the owner of a document does not have the power to change any data once a document has been recorded on the Blockchain.

Timestamp, along with other information of blocks in the Blockchain

5. Nonce: The fifth element of a block is nonce. The nonce is an abbreviation for “number only used once.” The Nonce is an integer number that, along with the block number, data, and previous hash, serves as an input for the hashing algorithm to calculate the valid hash for the block. A valid hash for the block is a hash that meets a certain difficulty i.e. contains a number of predefined zeros at the beginning of the hash. Let’s take the example of Anders Brownworth Hash Program to understand how nonce value is used to generate a valid hash (https://andersbrownworth.com/blockchain/block).

In this case, the valid cryptographic hash contains 4 leading zeros.

Valid cryptographic hash contains 4 leading O’s

If any change is made in the data, the hashing algorithm generates a completely different hash for the block. If the newly generating hash does not have four leading zeroes, then it will not be a valid block.

Invalid hash if it does not contain 4 leading O’s

The block is made valid by the field called a nonce, which is not predetermined. Every time a new nonce is selected for the same block, the resulting hash will be a different value.

New nonce value results in a different hash of the same block

A nonce is basically a random number; it is important to find a nonce value as it helps to generate a valid hash containing 4 leading O’s to make the specific block valid. One way to obtain a nonce value is by changing the nonce manually. Thus, it may take several iterations until the desired hash with four leading O’s is generated. The other way is to click the mine button as shown in the figure, it will give a unique nonce that corresponds to a hash with leading four O’s to make a valid block. Once the block becomes valid, it becomes a part of the Blockchain, and new blocks are added to this block.

Mining gives a unique nonce that corresponds to a valid hash to make a valid block

Since the nonce value can only be used once, it plays an important role to keep the Blockchain immutable. Suppose the data is changed on Block 2, because of which the hash changes as data is used to calculate the hash. Also, Block 2 becomes invalid because its hash no longer has four leading 0’s. Block 3’s hash changes because Block 2’s hash was used to calculate Block 3’s hash. Also, Block 3 becomes invalid because its hash no longer has four leading 0’s. The same is the case with other blocks in the blockchain.

Change in the data of Block 2 makes other blocks invalid in the Blockchain

The only way to mutate Block 2 is to mine the block again to find a valid hash with four leading 0’s and then mine all the blocks after to find their valid hash because all the blocks are linked together with the hash of the previous block. Since new blocks are always being added, it’s nearly impossible to mutate the blockchain.

If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and their applications, click the below link.

Happy learning!

--

--