DEV Community

Cover image for How does the Blockchain work?
Saroj
Saroj

Posted on

How does the Blockchain work?

Any idea about Blockchain?

Well,

Let's see first, what Blockchain is! and then we will discuss how it works.

Blockchain is a chain of data blocks stored in hundred or thousands or even millions of computers (servers) distributed over a wide geographical area. It is a complete ledger that maintains a copy of all the credit/debit transactions of digital assets. It is based on decentralized technologies.

Eg. Bitcoin is a great example of a blockchain application or we can say it works on decentralized principle. That means when a new Node(server) is added to the bitcoin network, it is impossible to modify or delete that node. It works on a Peer-to-Peer(P2P) network, where each Peer acts as a server.

Image description

This diagram describes how a P2P network is established in a blockchain network.

I'm pretty sure, now you have got an idea about blockchain and P2P networks.

Great!

Now, let's see how blockchain works.

Excited?

Me too!

We can define the blockchain as a system that allows the group of connected computers to maintain a single updated and secured ledger. As we know blockchain is consists of a chain of blocks, for every new transaction, a new block needs to create.

So, how a block(node) is created inside the blockchain network?

The very first step of creating a block is, a user must request for a transaction to be added to the blockchain network, also that transaction must include some required information(like transaction id, hash id, timestamp, etc).

After the transaction is verified, the second step is, a new block is created into the blockchain network(but not added).

Once a block is created, then it will broadcast to a P2P(Peer-to-Peer) network. P2P networks also consist of blocks(nodes). Then, the one P2P node verifies the transaction.

After successfully verifying, the transaction again moves to the next stage, that is, other nodes in that network also need to verify, since all nodes are interlinked with each other.

and here comes to the last stage, that is

Once the transaction is validated by other nodes in the network, then the block is ready to go. And now, the block(transaction) is added to the existing blockchain network.

That is how the blockchain works.

I know it is kind of a bit confusing if you are new to blockchain. But trust me, once you understand it, it will be fun for you.

Like me :) haha

Cool!

Thanks for reading my article.

See you soon with a new topic!

Till then, drink coffee and write code

Top comments (4)

Collapse
 
cindy_bahl profile image
Cindy Bahl

Interesting! I often have non-tech people ask me this question as well.
I kind of struggled with it, so I did some Googling to give me some ideas. And found this explanation to give....

"A Blockchain (or block chain) is a method of storing a list of entries, which cannot be changed easily after they are created. This also applies to the list. This is done by using several concepts from cryptography, including digital signatures and hash functions."

It was literally written to help you explain it to a child.
Sometimes, even for coders or tech people (when they are first learning about something) - when you're explaining it to them, start initially with something this absolutely basic. At least as part of beginning the explanation.
Starting with a concept's most high-level and most simple explanation can give them a better base in order to later absorb the more complex concepts as you cover them.

Collapse
 
sarojvrc profile image
Saroj

Thanks for the feedback Cindy.

 
sarojvrc profile image
Saroj

Thanks for the information Leonid

Collapse
 
sarojvrc profile image
Saroj

Yes exactly. Blockchain is just starting now, but defenitly in futute it will be sky limit.