What is Blockchain Technology? How Blockchain Works

Last updated on Sep 06,2024 10.7K Views
Shashank is a Research Analyst at Edureka. He is an expert in... Shashank is a Research Analyst at Edureka. He is an expert in Blockchain technology with profound knowledge in Ethereum, smart contracts, solidity, distributed networks...

What is Blockchain Technology? How Blockchain Works

edureka.co

Is Blockchain The New Internet? Well, it certainly is!! 

Blockchain technology is the Internet 3.0 or the Internet of Protocols. What started as an evolution is gradually becoming a revolution. It has the potential to transform business as we currently know it, but understanding how is not so easy.  So Here’s a leaflet for you to perceive How Blockchain works. 

  1. What is Blockchain Technology?
  2. How Blockchain Works?
    2.1 Independent Verification of Transactions
    2.2 Aggregation of Verified Transactions
    2.3 Mining of a Block
  3. What if Someone Tries to Hack the System?

What is Blockchain Technology?

Blockchain is a decentralized distributed database of immutable records, where transactions are protected by strong cryptographic algorithms and the network status is maintained by the Consensus algorithm.

                Digital Timestamps

In simple words, Blockchain is a chain of blocks that contain information.

The technology was originally described in 1991 and was intended to timestamp digital documents to avoid backdate or tempering of any records.

However great the technology was, its true potential was not realized until Satoshi Nakamoto used it to create a digital cryptocurrency the Bitcoins“.

Blockchain Technology | Blockchain Tutorial for Beginners | Edureka

Now let’s see how Blockchain works.

 

How Blockchain Works?

Let’s try to understand how blockchain works with a simple transaction over a Blockchain network.

Suppose James wants to send 5 BTC to his friend Kevin. Now, this transaction is broadcasted in the form of a digital message.

The digital message has a unique signature. Just like your signature provides the proof of ownership of the document, similarly, digital signature provides the proof that the transaction is genuine.

Now this generated transaction is broadcasted to the network where it propagates peer to peer.

                   Transaction propagates peer to peer in the network

Suppose the above transaction is first received by node A in the network. 

Independent Verification of Transactions

Before sending transactions to its neighbors, each bitcoin node that gets the transaction will initially verify the transaction.This guarantees only valid transactions are propagated across the system while invalid transactions are disposed of at the first node which receives them. Every node confirms each transaction against a long agenda of criteria.

Aggregation of Verified Transactions

Independent aggregation of those transactions into new blocks by mining nodes combined with exhibited calculation through a proof-of-work algorithm.

Let’s understand this better with an example.

Let’s say Andy is a miner. (A mining node maintains a local copy of the blockchain, the list of all blocks created since the beginning of the bitcoin system in 2009)

Now, after collecting all the transactions in a block, Andy needs to construct the block header. Now this step is important to understand how blockchain works

Constructing a Block Header

To construct the block header, the mining node needs to fill in six fields, as listed in the table:

SizeFieldDescription
4 bytesVersionTo construct the block header, the mining node needs to fill in six fields, as listed
32 bytesPrevious Block HashA reference to the hash of the previous (parent) block in the chain
32 bytesMerkle RootA hash of the root of the Merkle tree of this block’s transactions
4 bytesTimestampThe approximate creation time of this block (seconds from Unix Epoch)
4 bytesDifficulty TargetThe proof-of-work algorithm difficulty target for this block
4 bytesNonceA counter used for the proof-of-work algorithm

Once Andy’s node has all the fields filled in the block header, Andy started Mining the block.

Mining of a Block

Now that a candidate block has been constructed by Andy’s node, it is time for Andy’s hardware mining rig to “mine” the block, to find a solution to the proof-of-work algorithm that makes the block valid.

Proof of work is a piece of data which is difficult(costly, time-consuming) to produce but easy for others to verify and which satisfies certain requirements.

Finding the Puzzle- Why is it hard?

To keep the coin distribution predictable, puzzles becoming increasingly difficult to solve when more people work on them.

Now, to validate the block according to the proof-of-work algorithm, Andy’s mining node has to reach the difficulty target. 

Let’s see how the difficulty is represented.

Difficulty Representation 

The formula to calculate the difficulty target from this representation is:

So, such is the difficulty coefficient that Andy’s mining node has worked really hard to reach the difficulty target. Let’s see what happens next.

Successfully Mining the Block

Now that that block is propagated in the network, each full nodes independently verifies the block

Independent Confirmation of Each Block

Assembling and Selecting Chains of Blocks

Once a node has validated a new block, it will then attempt to assemble a chain by connecting the block to the existing blockchain

 

In the network shown above, once the node (in orange) validates the      block, it assembles the chain by connecting the block to the existing blockchain

Once the block is verified by the network, it becomes the part of the blockchain and for successfully solving the block puzzle the miner is rewarded.

Miners Reward

Now, the question arises, what happens in the case when more than one block gets solved at the same time?

Yes, this is possible indeed! In such case, several branches exist.

Several Branches

The Blockchain quickly Stabilizes. Every node is in agreement with the current state of the ledger.

Alright, so consensus rules save the blockchain network from such ambiguity.

Now, another question arises here, what if someone tries to alter any transaction or records in the system?

What if Someone tries to Hack the System?

Once a block is solved the cryptographic hash output becomes the identifier of that block.

Since Blockchain is a back-linked distributed database of records. When a block is formed, the cryptographic hash output becomes the identifier of that block, which ties into the next block, creating a chain of blocks.

Hence, the blockchain is secured by the strong cryptographic algorithm and there is no way to alter any record.

If someone tries to alter any transaction in any of the blocks, the hash of the block changes and consequently hash of all the previous blocks will change. The nodes will not arrive at the consensus and hence, the fraud can easily be detected

So, this is it. Take pride, for now you stand out of the crowd after knowing this handsome technology. 

I hope this How Blockchain Works blog was informative for you.

Got a question for us? Please mention it in the comments section and we will get back to you at the earliest.

If you wish to learn about Blockchain Technology and master the concepts of Cryptography, Blockchain Networks, Smart Contracts, Ethereum and the Hyperledger, check out our interactive, live-online Edureka Blockchain Course here, that comes with 24*7 support to guide you throughout your learning period.

BROWSE COURSES