Skip to main content

Introduction to Blockchain - Basics (Part 1)

The blockchain isn't just the backbone of cryptocurrency - it could change the world. Applications are endless. It is one of the most sought-after skills these days. Blockchain developers are in huge demand but there are only a few who can elegantly develop a blockchain application.

I will admit that I am a newbie to this field and all the related terminology. Recently I have decided to dive into this field and after learning a few nuances, I thought it would be a good idea to share my understanding with everyone. Hence, this blog.

This is the first blog of this series and without further ado let's learn together the awesome concepts of Blockchain technology. 

What is a blockchain?

It is a decentralized platform which enables multiple domains, who do not trust each other to collaborate in a decision-making process.

Main keywords from the above definition are - 
  1. Decentralized - There is no single centralized authority that makes decisions on behalf of all the concerned parties. Instead, each party, also called a peer, makes local autonomous decisions towards its individual goals.
  2. Domains - Parties who are skeptical about the authenticity of other parties.
  3. Decision-Making Process - A common process executed by all the peers such as validating a transaction. 

Types of systems

There are broadly three types of systems - centralized, distributed and decentralized. Below is the most widely used diagram that depicts these three.


Centralized Systems

It is kind of multiple client-single server like architecture where the server computer is the one where all of the major processing is done.

Client machines connect to the server computer (master computer) and submit their requests. For e.g. a web application server that hosts all the business logic, runs the database etc. Various client machines connect to the web application server and send/receive requests/responses through the HTTP application layer protocol.

This mechanism poses the following problems - 
  1. Single point of failure - If the master goes down, clients won't be able to serve user request since the machine that runs core logic is dead.
  2. Limited scalability - Only vertical scaling is possible i.e. to add more storage, I/O bandwidth, CPU processing power for the master. Surely, there will be a limit after which increasing these parameters is not feasible.

Distributed Systems

A distributed system is a model in which components located on networked computers communicate and coordinate their actions by passing messages.

Thus, it is a system where components might span geographical boundaries but are owned and controlled by a single entity (cloud computing). Trust in such a system is still centralized. For e.g. Google.

Decentralized Systems

Here all the processing is not done by a single machine instead they allow to distribute work among various nodes and each of them can serve requests equally. For e.g. Cassandra data store.

  1. There isn’t really any single point of failure because client machines aren’t relying on a single server to fulfill all requests. The system comprises multiple nodes which might be still available to process user requests.
  2. We can scale-out the system by adding more nodes - Horizontal Scaling.

Working of Blockchain

In blockchain, everyone works on their local copy of a common document and it is the responsibility of the underlying process to ensure the consistency. Let us understand this with an example - 
  • Suppose, there are four friends Alice, Bob, Carol, and Dwayne. 
  • There is one public ledger which holds records of bank accounts of these four friends.
  • Let's say one entry in that public ledger shows Alice has $100 in her account.
  • Since each of the above four persons has a separate copy of the public ledger, each one now knows that Alice has $100 in her account.
  • Now, suppose Alice transfers $40 to Bob. This is a transaction and it will be updated as a new entry in the public ledger copy of Alice (after successful validation).
  • Due to the underlying blockchain mechanism, this entry will be validated first by Bob, Carol, and Dwayne and if successful, they update the same in their respective copies of public ledger.
  • Now as a second transaction, suppose Alice tries to transfer $80 to Carol. This is an invalid transaction as Alice only has $60 left in her account. Thus, the validity of transaction fails and this entry will not be added in the public ledger. 
From above, when a new transaction or an edit to an existing transaction comes in to a blockchain, generally a majority of the nodes within a blockchain implementation must execute algorithms to evaluate and verify the history of the individual blockchain block that is proposed. 

If a majority of the nodes come to a consensus that the history and signature are valid, the new block of transactions is accepted into the ledger and a new block is added to the chain of transactions. If a majority does not concede to the addition or modification of the ledger entry, it is denied and not added to the chain. 

This distributed consensus model is what allows blockchain to run as a distributed ledger without the need for some central, unifying authority saying what transactions are valid and (perhaps more importantly) which ones are not.

Aspects of Blockchain

  1. Protocols for Commitment - This ensures that every valid transaction from the clients are committed and included in the blockchain in a finite time.
  2. Consensus - This ensures that local copies are consistent and updated.
  3. Security - The data needs to be tamper proof. Note that the clients may act maliciously or can be compromised.
  4. Privacy and Authenticity - The privacy and authenticity of transactions need to be ensured.

Overall, the blockchain technology has the potential to revolutionize several industries from advertising to energy distribution. Its main power lies in its abilities of not requiring trust and being decentralized. 

In future posts, we will dive deeper into the various concepts of this technology. Stay tuned! šŸŒ

Comments

Popular posts from this blog

Introduction to Blockchain - Conceptualization and Applications (Part 4)

It's been a long time since my last post as I got stuck in some work. This is the last part of the introduction to blockchain series. In this post, we will touch upon a few more concepts of blockchain and their applications.
At the end of the post, we will also look into the concept of Hyperledger Fabric in brief.
Permission-less model In this model, anyone can join the network, participate in the process of block verification to create consensus and also create smart contracts. For e.g. Bitcoin and Ethereum network.  In a permissionless world, one does not have to prove their identity to the ledger. As long as you are willing to commit processing power to be part of the network and extending the blockchain, you are allowed to play. Any miner who is playing the game by the rule may be able to solve the hash puzzle and verify the block of transactions to win the mining reward (Higher the mining power, better the chances of winning the mining reward).It is good for financial applica…

Introduction to Blockchain - Evolution (Part 2)

In the last part of this series, we discussed the basic concepts of blockchain technology. In this post, we are going to discuss the evolution of blockchain and it the latter part of the post, I will introduce the concept of bitcoin technology at a high level.

Hashing and Hash Functions The concept of hashing is the backbone of the blockchain technology and it helps us to speed up the searching process. Hashing allows us to map any data to a fixed size. The entity which performs hashing is called a Hash Function. For e.g, H(x) = x%n (% is the modulo operator - returns remainder when x is divided by n), as it is evident that x can be of any value but H(x) will always be in the range [0, n-1]. x is called Message H(x) is called Message Digest
Cryptographic Hash Function It is a mathematical algorithm that maps data of arbitrary size to a bit string of a fixed size (a hash). It is a one-way function i.e. we can find H(x) if x and n are given but if H(x) and n are given, we cannot find x. …