Back to Blog

Blockchain Series #2

August 12, 2022 (3y ago)

Blockchain Technology

Blockchain

A blockchain is a continuously growing list of records, called blocks, which are linked and secured using cryptography.

Linked and Secured using cryptography

1. Linked

If you have heard about a linked list, then you have definitely heard about the term node. Likewise in blockchain, nodes are referred to as blocks. In Data Structures, we have different types of linked lists:1. Singly-linked lists.2. Doubly linked lists.3. Circular linked lists.4. Circular doubly linked lists.

In these four types of linked lists, blockchain uses the Singly linked list.

In Blockchain technology, new blocks always get inserted at the end.

In a singly linked list, each node holds the address of the next node and the last node holds the NULL pointer value. That value is used to know we have reached the end of the singly linked list. But in blockchain, the NULL pointer value is always present in the first block like Git and the rest of the blocks holds the address of the previous block. Even though Each block has the address of the previous block, we can't mutate the data in the previous block. In the blockchain, the first block is called a Genesis block.

A block contains data, the previous block's hash, and the current block's hash.

This is how the blocks are linked

2. Secured“Secured using Cryptography”. Yes, in the blockchain each block is hashed using SHA (Secure Hash Algorithm) 256.

Advantages of SHA256:

  1. One way

SHA256 is one-way cryptographic function

  1. Deterministic - Whenever we hash the same data, we get the same SHA256 hash. In the below image, assume both the docs are the same.

If we hash the same data lot of times, we will get only one hash value.

  1. Fast Computation

SHA256 is very fast

  1. The Avalanche Effect - If we make a minute change in the data the whole SHA256 hash should be changed. In the below image, you see +1 added in the docs, and note the entire hash get changed.

We made a tiny change, see how the hash got changed.

  1. Must Withstand Collision - Even though we can create a lots of unique hashes using SHA256. It is still limited, which means, it is not Infinite. But we have an infinite number of data are present in the world. Hence, a collision occurs in this algorithm. But, it is uncommon to see a collision. It will not ruin the algorithm.

Continuously growing list of records

A blockchain is a continuously growing list of records: which means we are able to do only two operations in the blockchain which is creating a new node and inserting that new node at the end. Hence, we are not able to delete or mutate any existing node.

We came to the end of Blockchain Series #2. (Blockchain is that simple!)

Now, we have learnt blockchain easily with the help of a single sentence. This is blockchain.

In the upcoming series, we are going to see where we can use blockchain and its scope. Stay connected. Thank you for reading.