Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Blockchain: Understanding basics - part 1
Vishnu Prasaath
Vishnu Prasaath

Posted on • Originally published atblog.vishnuprasaath.dev on

     

Blockchain: Understanding basics - part 1

In this article let's try to demystify and understand the basics of the blockchain infrastructure and see how it contributes to theweb3 ecosystem.

What is a blockchain?

Basically, blockchain is a Data Structure. Very similar to other data structures like databases (rows, columns, tables), text files, CSV, images, lists, and so on. Blockchain competes most closely with a database.

For an analogy, let's visualize blockchainas pages in a book

Chain = Book

Block = Page

Blocks in Chain = Pages in Book

Each page in a book contains:

  • text : content/story

  • information about the page : chapter number/title, page number

Similarly in a blockchain block, each block has:

  • contents of the block: Transaction details in cryptocurrency, or any data which we prefer to store

  • header :Metadata - data about the block. Some sort of technical info about the block, a reference to the previous block, and a fingerprint (hash) of the data for the current block

In blockchains, each block references the previous block by a computed hash value called theblocks fingerprint. The fingerprint is computed based on thecontents of the block.

The concept of maintaining a reference to the previous blocks can be visualized as alinked list structure. In the linked list each node holds a reference to the next node, whereas in the blockchain each block holds a reference to the previous block.

books_and_blocks

This creates the fancy structure called theblockchain!


The fingerprint in each block is responsible for taking care of the consistency and validity of the data. If someone tries to meddle with any of the data, they have to end up regenerating all the fingerprints from that point forwards and the blockchain will look different. This is basically impossible as the process of creating fingerprints is difficult and slow. Therefore, if someone wants to re-write parts of the blockchain, it will take them a long time, and they have to catch up with and overtake the rest of the honest network. Which is not feasible.

Hence the blockchain is calledimmutable (as it cannot be changed).

The below image shows the inside of a blockchain block: the fingerprints are unique to the blocks contents.

block-chain-inside


Data Distribution

There are two ways of distributing data in a network: Client-Server and Peer to peer. Blockchain is built on top of thepeer-to-peer model.

peer-to-peer and client-server

Client-server

This is a traditional approach where the server holds 100% of the data, and the clients connect via required protocols to access/consume the data.

Peer-to-peer

In peer-to-peer models, each peer has 100% of the data (or as close to it as possible), and updates are shared around. This is less efficient than client-server, as data is replicated many times. However, it's more robust as there is no central server that can be controlled, so closing down peer-to-peer networks is harder.

But on the contrary, the peer-to-peer model comes with its downsides. In the real world each peer on the network is gonna process and update at its own speed and latency and end up having varied states at a given timestamp. Deciding on which peer holds the valid data and which peer has stale or tampered data is ambiguous.

This conflict is resolved by a rule called thelongest chain rule - If you see multiple blocks, treat the longest chain as legitimate. We can discuss in-depth on this conflict resolution and consensus in a separate article.
blockchain-understanding-basics-part-2


Conclusion

Blockchain is not something that is associated with onlyBitcoin.Ethereum is a great variant of blockchain withsmart contracts. There are significant challenges involved.

On the other hand, private or internally distributed ledgers and blockchains can be deployed to solve a wide range of problems and use cases.

Top comments(2)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
parth51199 profile image
parth51199
At Codezeros, we are committed to delivering innovative blockchain solutions that help our clients achieve their business goals.
  • Location
    Ahmedabad
  • Work
    Blockchain developer
  • Joined

One minor improvement that could be made is to provide a bit more context on the challenges involved with blockchain technology, as mentioned in the conclusion.

CollapseExpand
 
pvishnuprasaath profile image
Vishnu Prasaath
Curious tech junkie. Breaking keyboards to build software from 'Hello World' 🌍 to 'cloud' 🚀!
  • Location
    Bangalore, India
  • Work
    SDE at Intel
  • Joined

Thanks for pointing it out. I am putting it out as a separate article soon. Will link here as a series.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Curious tech junkie. Breaking keyboards to build software from 'Hello World' 🌍 to 'cloud' 🚀!
  • Location
    Bangalore, India
  • Work
    SDE at Intel
  • Joined

More fromVishnu Prasaath

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp