Let's start by answering the question: What Block-chain is and why should one be interested in it?
To start with, why did this concept fascinate me as a CS student? I was scrolling through my google feed with my morning brew and I came across a blog notification about a Digital painting that was sold for a whopping amount of 6.6 million dollars. The heading got my attention, and I quickly went through the post to find what made the painting so special to my astonishment I realized it was sold as NFT (Non-Fungible Token)
What is this NFT
NFT or Non-Fungible Tokens are cryptocurrency assets that represent a wide range of unique items, both physical and virtual, like real estate or digital art.
The technology behind NFT:
NFT tokens were built using two Ethereum token standards - ERC-721 and ERC-1155.
Let's now understand what is Ethereum?
Ethereum is an open-source, blockchain-based, decentralized software platform used for its own cryptocurrency.
What is a decentralized platform?
To understand this, let’s first see the current Application architecture, which all companies follow.
There will be a Front End (user interface) Build from any modern framework of JavaScript or frameworks of python.
The second half of the Application, which will include a server and a Database.
all the data the user generates goes into a centralized database hidden from the user.
And with no knowledge of what companies do with it.
So this is what Blockchain Primarily addresses: Providing a Decentralized platform.
There is no concept of the database here. Instead, we have Blocks (which are basically nodes).
The next Direct Question which might trigger your brain. Is it not just the other name for the database instead of storing it in tables you are storing the data in blocks.
The answer to this is yeah, it is also a form of a database but not a conventional database. Where the developer has access to the data and they can update it when required.
So once data enters a blockchain, it becomes immutable.
So how does data in blockchain become immutable?
As we have described earlier, blockchain is a chain of blocks connected in a peer-to-peer network.
Take the example of the most famous application of blockchain to understand what it is about and how it functions: Bitcoin
Bitcoin is a cryptocurrency build over blockchain It first came to knowledge in 2009 when a paper on it was published by a pseudo-name Satoshi Nakamoto. He mined the zeroth block known as the genesis block, on which the entire public blockchain is developed.
So how does it work?
Whenever a new bitcoin is mined, it is stored in a node. And whenever a user does a transaction using bitcoin, it generates a hash key for that transaction.
Common hash methods
MD5
SHA 256
SHA 512
Let's assume they use SHA 256 for hashing. Once the transaction is made, a hash-key is generated with a 256 character string. To represent the transaction and the hash-key of that block is stored in the previous block in the blockchain.
Below you can see Block 0, which is also called the genesis block, holds the hash-key to block 1 and the process continues.
So lets take an example where we have 300 blocks in a blockchain and a hacker wish to update data of block 1 which have a hash-key h2 . If by any chance hacker succeed to update in block 1 .It will trigger the hashing function which will generate a new hash-key
for block 1. this new key will be completely different from previous hash-key of block 1. Since the original hash-key of block 1 is stored in block 2 .If hackers wants his updates to be visible in blockchain he needs to update hash-key of block 2 and similarly following the pattern updating hash-key of all the blocks in the chain so that his changes are accepted by the block chain .However this is not possible as hacker can not access all the nodes in the block.
That makes updates in a public blockchain impossible and provide security to the data.
Types of Blockchain
Public Blockchain
Private Blockchain
Consortium Blockchain
Hybrid Blockchain
Advantages of Blockchain-based Applications
decentralization,
immutability,
security and transparency.
So getting back to the crucial question is blockchain, the future of technology?
Yes, it promises uncompromised security and transparency to user data. This is the basic need of every user.
But it is not perfect and does not fit all scopes and scenarios of usability. It can't handle multiple transactions at a time.
Do subscribe to our blog for future content on Getting started with your first Dapp and writing your first smart contract.
Blog Post by
Prashant Sharma
Comments