Now, let’s come to the most interesting part of the blockchain tutorial that is how does blockchain work? By far, we have learned that blockchain is a concept of a decentralized network and distributed digital ledger. In this ledger system, legitimate and secure transactions can take place as a point-to-point exchange. So, let us understand the working of this technology and how is it used to record information and carry out secure transactions.
Blockchain is a system of network of multiple nodes or computers which acts as a distributed network over the internet, worldwide. Each node has the authority to make a transaction, verify a transaction, receive a transaction and create a block. The blockchain is a cryptographically linked chain of blocks (set of records) such that no one can falsify or modify the data stored in it. Once we enter a set of transactions in a blockchain then it becomes a part of it forever. So, we can call blockchain to be a distributed database whose data is unchangeable. Each node on a blockchain network has a separate copy of this ledger or database. They can access the transaction history on the blockchain whenever they want and get it updated every time a node adds a set of new transactions (block) into the chain.
We will now understand the entire process by dividing it into individual steps.

Step 1: Suppose, two nodes in a blockchain network say node A and node B wants to make a new transaction.
Step 2: This transaction can only take place if all the other participant nodes in the network verify it as a legitimate transaction. Thus, each node will receive the request to verify the transaction to happen between A and B.
Step 3: Each node will check certain points about the transaction such as the authenticity of the two nodes, is the transaction amount within limits, does A have sufficient funds to make this transaction, etc.
Step 4: Once all the nodes check and verify all the aforementioned points, the transaction is ready to take place. Then that transaction gets added into a memory pool or mem pool.
Step 5: Several such verified transactions get aggregated into mem pools and multiple mem pools combine together to make a block. Every block has a defined memory limit to store transactions.
Step 6: Every new block will have a block header, that consists of transaction data summary, timestamp, hash code of the previous block and its own hash. Every block has its unique hash code which acts like its fingerprint.
Step 7: In order to add a new block into the existing blockchain, nodes in the network need to do proof-of-work. As we know, each block has its unique hash function which is an identification code created using SHA256. Doing proof-of-work is decrypting this code and finding the correct answer to this hash puzzle. To do proof-of-work, we need specialized computers that take on an average of 10 minutes to crack the code automatically.
Step 8: A block gets verified every time a node completes its proof-of-work and finds the correct answer to the hash puzzle for that block. More and more nodes must verify or complete the proof-of-work for the same block so that it finally gets added into the blockchain. Every block has a unique set of transaction records. To create a new block and add it to the blockchain, one must have a completely unique set of transactions in that.
Step 9: With this, a new block gets added and a transaction is completed between points A and B.
This process repeats itself and new blocks continue to get added in the blockchain permanently. There is a unique concept of rewards upon doing proof-of-work which we will learn in the lessons to come.
Leave a Reply