Understanding the basics of blockchain – Nourish the roots of technology

FREE Online Courses: Knowledge Awaits – Click for Free Access!

After our introductory tutorial on Blockchain and before we move on to learn how blockchain works, let us understand some basics of it. The blockchain technology needs us to be familiar with a lot of key concepts and technical lingo. In this article, we have brought together every key element and concept that you need to know well before getting deeper into the blockchain technology. Let’s get started.

 Blockchain Basics – Key Elements

The entire concept of blockchain is a combination of a handful of different concepts and techniques i.e. a distributed ledger system, peer-to-peer network, key cryptography, hashing, and proof-of-work, etc.

1. Peer-to-peer Network

A peer-to-peer network is a decentralized and distributed network. In a P2P network, the participant’s nodes are not linked to a central body or server. Instead, all the nodes/computers are independent and are directly linked with one another to carry out transactions or information exchange. In a public blockchain, it is not necessary to know and trust each node in a network personally. The network and security are so designed such that authentic and legitimate transactions can take place even if the identities of sender and receiver stay anonymous. A peer-to-peer network is a secure network with direct contact between two nodes. A participant node of such a network has no geographical constraints, that is, it can be a part of the network from anywhere in the world.

Traditional Centralized Downloading vs Decentralized Peer-to-Peer Downloading

Traditional Centralized Downloading vs Decentralized Peer-to-Peer Downloading

Distributed Ledgers compared to centralised or decentralised ledgers - Blockchain Basics

Distributed Ledgers compared to centralized or decentralized ledgers

2. Distributed Ledger System

Blockchain works on a distributed ledger system. By distributed ledger, we mean that the data record is not kept by any one central authority rather, it is available at every node of a P2P network. Every participant node in a network keeps updated copies of the data record or ledger in a blockchain. For instance, if you and I are two nodes in the Bitcoin public network, we both will have the same copy of the record of bitcoin transactions that took place till date. The record will not just show us our individual transaction but the transactions that took place between any two nodes in the network. This makes the entire network fraud-proof because everyone has a legitimate copy of the records and no one can falsify the transactions or double-spend the same bitcoins.

In every scenario, where blockchain is used, they adopt the same concept of the distributed ledger system.

distributed ledger system in blockchain - basics of blockchain

3. Key Cryptography

Now, after understanding how a network is laid out to carry out transactions. The next natural question is of security of our data and the authenticity of participant nodes. If ‘A’ wants to send a message or confidential information to ‘B’ in a public network with hundreds of nodes, what is the guarantee that it reaches only ‘B’ and not ‘C’? How can ‘B’ assure that the message is coming from ‘A’? How can ‘A’ and ‘B’ both make sure that the message was not changed in the middle of transmitting?

Well, the answer to every question and solution to this problem of security, data integrity, and user authenticity is “Asymmetric key cryptography”. In such type of cryptographic arrangement, every node has two keys; Private key and Public key. The private key is known only to the node owner whereas the public key is known to all the nodes in the network. The combination of a private key and a public key makes a unique digital signature for every node. This makes the node authentic to carry out transactions and verifications. We will learn more about the cryptographic techniques in a separate post.

encoding and decoding public and private key - blockchain basics

Take a deep dive into Types of Blockchains and choose the best for you! 

4. Hashing

Hashing is a non-reversible process of encrypting a block’s information. Every block in a blockchain is composed of a block header and transaction data. Hashing is encrypting an input value of variable length into an output of fixed length using SHA256 (Secure Hash Algorithm 256) algorithm. For instance, look at the image below to see how hashing encrypts a text value into a hash value. We will not go deep into the technicalities of the hashing algorithm as it is beyond the scope of our general discussion.

hashing process in blockchain - basics of blockchain

Similarly, any kind of information contained in a block is encrypted by hashing. No two words or sentences or numbers have the same hash. There is a new hash for even a minor change in a message like change in case of an alphabet, etc. Hashing converts readable information into a non-readable form. This is how important information is secured in blockchain.

5. Proof-of-Work

Now, this is an interesting concept of ensuring the safety of data in a blockchain. By doing proof-of-work, nodes permanently add a block into the blockchain. The chain of blocks keeps the data securely by hashing and linking. We have already learned about hashing. If a node made a new block and it wants to add that block permanently into the blockchain as a legitimate block, the system gives a mathematical puzzle to each such node. The nodes must have significant computational power to solve this puzzle. A single node takes an average of 10 minutes to find the correct answer to a hash problem. When a node finds the correct answer, the block gets further in the race of getting added permanently in the blockchain.

If a good number of nodes solve the puzzle for the same block, it gets added in the blockchain instantly. There are several terms related to Proof-of-Work that we need to know such as Nonce, difficulty target, and Merkle root. We will learn about these terms in detail in later sections and in dedicated tutorials on Blockchain working and Mining.

6. Merkle Tree and Merkle Root

As we know, all the transactions taking place within a blockchain network stay in the blockchain as a flat file or in database. A particular set of transactions together forms a block and that block gets added into the blockchain.

Now, an interesting thing to note here is how to efficiently store a huge number of transactions in a block? If we take all the transactions as it is and keep it in a block, the block size will get unmanageably large.

Merkle tree and root are a solution to this problem. Merkle trees structure the data in such a way that at the end of it there is only one root representing the entire tree. The individual transaction makes the bottom-most tier of the Merkle tree and is known as leaf nodes. As we can see in the diagram below, Tx100, Tx101, etc. are transactions stored in the block.

transaction hashed in Merkle Tree - Blockchain Basics

As we move to the upper tiers, hashing and pairing of transactions occur. Firstly, it creates the hash of Tx100, then of Tx101 and so on. Then, these hash values are paired and hashed again. Like, it makes a pair of Hash of 100 and 101 and hashes it. This gives us a hash of 100-101. Similarly, it forms a pair of hash 102 and 103 and so on. In this way, after continued pairing of hash values there comes a final top-most tier where there remains only one root hash also known as Merkle Root. This Merkle root or root hash of all the transactions is an essential element of the block header as it saves block space.

Not convinced for learning blockchain? Check out the major reasons to blockchain technology

Blockchain Network

Moving forward in our blockchain basics guide, we will now understand how does transaction take place between two nodes in a network.

A blockchain network consists of multiple nodes that have a point-to-point or peer-to-peer connection. Each node in a blockchain network is capable of doing transactions, verifying other transactions and doing proof-of-work. Let us consider a scenario where there are 500 nodes spread across the globe making a blockchain network. Node A (from USA) wants to send some information to node B (in London). Both the nodes A and B will have their set of private and public keys. Before A sends the information packet to B, it will encrypt the message first with A’s private key and then again with B’s public key. This is to ensure that the message goes only to B and B can confirm that A has sent this message out of so many nodes.

encoding and decoding public & private key - Basics of Blockchain

On the receiving end, B will have to decrypt the message first using B’s private key and then with A’s public key. Also, a request of verification of this transaction between A and B is sent to all the 498 participant nodes in the network. As soon as all the nodes verify a transaction, the system adds it in a new block with other transactions.

Any doubts in blockchain basics tutorial till now? Share them in the comments below.  

Components of a Block/ Block structure

Now that we have gained a good understanding of the blockchain network and how does it operate, let us learn about the structure and components of a block. As we know, blockchain is made up of a series of interlinked blocks. Each block has several components which we will discuss in this section. Two main elements of a block are header and transaction data. The block header is an important component as it contains all the metadata (data about data) of that block.

Let us first learn about the structure of a block, then we will go further and understand what’s in a block header.

1. Block

A single block in the blockchain has a Block header, Transaction counter, Block size and Transaction data. Thus, a single block in the blockchain contains information about the data and other aspects of the block. Have a detailed look at the fields that a block contains.

FieldField SizeDescription
Block header80 bytesContains hash, previous block hash, timestamp, nonce, etc type metadata.
Block size4 bytesShows the size of the whole block.
Transaction counter1-9 bytesShows the total number of transactions contained in the block. 
Transactions Variable (at least 400 bytes)Contains all the transactions of the block. 

2. Block header

After learning about the contents of a block, let us have a closer look at the contents of a block header. A block header contains the metadata about a block and the transactions. The block header for each block is an important part as it has all the essential details for that block. It also has the unique fingerprint (hash) of the same and previous block which helps in maintaining the integrity of the blocks in the blockchain. In the table given below, you will find six main components or fields of a block header.

FieldField SizeDescription
Block version4 bytesThe version number of the block to keep a track of software or protocol updates. 
Previous block hash 32 bytesHash of the preceding block.
Merkle root32 bytesThe hash value of the root of the Merkle tree of the current block’s transactions. This hash of the root is known as Merkle root. 
Timestamp4 bytesThe time of the creation of the block.
Nonce4 bytesA number needed for Proof-of-Work process. 
Difficulty target 4 bytesThe difficulty target set for Proof-of-Work algorithm. 

The encrypted value of all these six fields is called the Block hash. Blockchain nodes use the block hash of one block (preceding) to link it with the next block. The system creates a block hash using cryptographic methods of SHA256 algorithm. It is an irreversible process where the contents of a block once hashed cannot be de-hashed or decrypted to its original value. The block hashes are like a digital fingerprint or signature for every block, making it secure.

For instance, the block hash of the first bitcoin block was 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f.

Given below is a diagram of a typical block in a blockchain.

structure of a blockchain - basics of blockchain

Blockchain Structure

Now in the blockchain basics tutorial, let us see how these blocks come together to make a blockchain. A blockchain is a series of interlinked blocks. Each block has its own hash value and one block is linked to the other blocks with the hash value of the previous/preceding/parent block. In this way, each block is securely linked to both its preceding and succeeding blocks.

Blockchain Structure - Blockchain Basics

Blocks are also indexed in a blockchain. The first block, also known as Genesis block which is numbered as 0, the next block 1 and so on. Every time when a node adds a new block by doing correct proof-of-work, the system creates a unique hash value for that block. The next incoming block takes this hash value as “previous block hash” to form a secure link in the chain of blocks. This structure of blockchain is tamper-proof because any change in the transaction data in one block of the blockchain is going to change the hash value of that block. Then that block’s hash value will not match with the “previous hash value” stored in the next block. This mismatch will spread across the entire chain, disrupting its integrity. Thus, for someone to make any change in the blockchain data, they need immense computing power to recalculate the hash of the entire blockchain.


This concludes our discussion on the basics of blockchain. We hope we were able to clear all the important concepts related to blockchain and its working. With the help of these learnings, we will move on to explore the working of blockchain and the process of mining.

Any kind of confusion in the Blockchain Basics article? Mention your queries in the comment section.

Happy Learning!

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

follow dataflair on YouTube

1 Response

  1. Obaid says:

    Firstly, it creates the hash of Tx100, then of Tx101 and so on.

    but i cant see any 100 and 101 instead there is 10 and 11.
    same as 102 and 103 there is 12 and 13 respectively. Is there any thing I am missing?

Leave a Reply

Your email address will not be published. Required fields are marked *