Sitemap

Blockchain : Introduction and Fundamentals

4 min read6 hours ago

--

Blockchain Prerequisites

1.Distributed Systems

Before understanding blockchain, we need to understand the simple concepts of distributed systems and how they differ from the contemporary client-server architecture.

What is a Distributed System?

For a layman, the simplest analogy of a distributed system is a common file shared on Google Drive or Microsoft OneDrive, which can be simultaneously accessed and updated by multiple people. It is stored centrally but gets updated simultaneously in real time, and each person accessing the document can view real-time changes made by other people.

Similarly, a distributed system is a collection of independent computers connected through a network. Each computer here is commonly called a node.

The key characteristic of this distributed system is that a workload is shared across multiple nodes, rather than depending on one node to perform all the work.

A rough analogy of a distributed system is a multi-server platform where the workload is shared across two or more servers to reduce the load.

The important idea is that multiple computers work together as one logical system.

How is Distributed Architecture Different from Traditional Client-Server Architecture?

A traditional 3-tier Client-Server Architecture, in its simplest form, has the Client layer, the Application layer and the Database layer hosted on a central server or in a central infrastructure managed by one party. The party here can be a vendor managing the infrastructure and application.

In this scenario, the client, application and database are managed centrally and act as the single source of truth. (For simplicity’s sake, we are not going to discuss the High Availability topic in this discussion.)

Now, in a Distributed Architecture, a copy of the client layer, a copy of the application layer and a copy of the database layer are shared across multiple nodes connected via a network.

2. Hash Function

A hash function is an algorithm or mathematical function which takes an input (text, numbers, files) and converts it into a string of characters called a Hash Value. For a certain input, the hash function will always generate the same hash value.

For example, consider the hash algorithm SHA-256.

If you give “Hello” as an input to SHA-256, it will always generate the same hash value.

SHA-256(Hello) -> 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969

Any change in the string “Hello”, for example, “hello”, will result in a different hash value.

SHA-256(hello) -> 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Get Debaraj Borah’s stories in your inbox

Join Medium for free to get updates from this writer.

One important point about hash values is that they can never be traced back or reversed to the original string/file.

SHA-256 is a specific type of cryptographic hash function which always produces a hash value of exactly 256 bits.

Blockchain Fundamentals

1. What is a Blockchain?

A Blockchain is basically a chain of blocks linked to each other by a hash value. To visualize it, consider the blocks below in a chain, with each block linked to the other block by the hash value. In the block, apart from the hash value, there are additional contents stored in the block (e.g., Timestamp, Nonce), which we will understand later.

Press enter or click to view image in full size

2. What is a Blockchain Network?

Put simply, a blockchain network is a set or group of computers (referred to as Nodes hereafter) agreeing to connect over the internet and participate in maintaining the same/latest blockchain data. Any change in one of the participating nodes will be propagated to all other nodes in the Blockchain network, and each node is responsible for validating and maintaining the updated blockchain. A change is approved to be accepted by the Blockchain network only when 51% of the nodes agree.

There are three different types of Blockchain networks:

Public Blockchain: Examples are Bitcoin and Ethereum.

Private Blockchain: An organization creates its own copy.

Consortium Blockchain: Multiple organizations can collaborate to participate in a closed user group network.

3. What are Nodes in the Context of Blockchain?

In simple terms, a node is a computer connected to a blockchain network. Depending on its purpose, it may store blockchain data, validate transactions and blocks, relay information, or only help produce new blocks.

4. What are the Different Types of Nodes?

There are two types of Nodes in a Blockchain network

Full Node: It downloads and maintains the full set of blockchain data, i.e., the complete transaction history.

Partial Node: A Partial Node, also called a Light Node, is a node that does not maintain the entire blockchain history but stores the block headers and requests the necessary data from full nodes.

5. Advantages of Blockchain

Based on our understanding of Blockchain so far, one of its key advantages is Decentralisation. Blockchain allows the same transaction data to be distributed and maintained across multiple nodes (i.e., multiple participants). This means that no single participant can unilaterally modify the data recorded on the blockchain.

Another important advantage is Immutability. As blocks are cryptographically linked using hash values, once a block is validated and accepted by the network, modifying its contents becomes extremely difficult, and any tampering can be detected.

There are exceptions and certain scenarios where changes or reversals may occur, which we will explore in upcoming articles.

--

--