Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (1 vote)
1K views52 pages

Unit 2

unit 2 pdf

Uploaded by

shreya kharola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
1K views52 pages

Unit 2

unit 2 pdf

Uploaded by

shreya kharola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Unit 2

Unit II: Blockchain: Introduction, Advantage over conventional distributed


database,
Blockchain Network, Mining Mechanism, Distributed Consensus, Merkle Patricia
Tree, Gas
Limit, Transactions and Fee, Anonymity, Reward, Chain Policy, Life of Blockchain
application, Soft & Hard Fork, Private and Public blockchain.
Blockchain technology is a revolution in systems of record. It is a foundational
technology that has the potential to create new foundations for our economic and
social systems. In comparison to conventional distributed databases, blockchain
has several advantages such as decentralization, transparency, and immutability.
A blockchain network is a decentralized and distributed digital ledger that records
transactions across many computers. The mining mechanism is a process used to
validate new transactions and record them on the global ledger. On the other
hand, distributed consensus refers to the agreement achieved by multiple nodes
on the value of a data item.
Merkle Patricia Trees are a type of tree data structure used in peer-to-peer
systems for efficient data verification. Gas limit refers to the maximum amount of
gas the user is willing to spend on a transaction. Transactions and fees are crucial
parts of the blockchain network as they facilitate the transfer of assets and the
reward for miners.
Anonymity in a blockchain network ensures that the identities of the participants
are hidden. Rewards are given to miners for validating transactions. The chain
policy governs how the blockchain operates, and the life of a blockchain
application refers to its lifecycle from development to deployment.
A soft fork is a change to the blockchain protocol that is backward compatible,
while a hard fork is a permanent divergence from the previous version of the
blockchain. Finally, blockchains can be either public, meaning accessible to
everyone, or private, meaning accessible only to selected participants.
Moreover, blockchain technology has a strong impact on different sectors. In the
financial sector, it can significantly reduce the cost and speed of transactions by

Unit 2 1
eliminating the need for intermediaries. In the supply chain, it can improve
traceability and transparency, reducing the chances of counterfeit goods and
fraud.
In the healthcare sector, blockchain can enhance data security, privacy,
interoperability and consent management in health information exchanges. For the
energy sector, blockchain could enable innovative and efficient ways of energy
distribution like peer-to-peer energy trading.
Furthermore, understanding blockchain technology is not complete without
discussing Smart Contracts. These are self-executing contracts with the terms of
the agreement directly written into code. They automatically execute transactions
when pre-set conditions are met, reducing the need for intermediaries and
increasing efficiency.
In summary, blockchain technology offers a decentralized, transparent, and
immutable method of recording data, making it a groundbreaking technology with
the potential to disrupt many sectors of the economy. As with any technology, it
comes with its own challenges and limitations, such as scalability and privacy
issues, but its potential benefits make it a very promising field of study and
development.

Introduction to Blockchain technology


Blockchain could be a data structure that could be a growing list of information
blocks. The knowledge blocks area unit coupled along, such recent blocks can’t
be removed or altered. Blockchain is the backbone Technology of the Digital
CryptoCurrency BitCoin.

What is Blockchain?
The blockchain is a distributed database of records of all transactions or digital
events that have been executed and shared among participating parties. Each
transaction is verified by the majority of participants of the system.
It contains every single record of each transaction. Bitcoin is the most popular
cryptocurrency an example of the blockchain. Blockchain Technology first came
to light when a person or group of individuals name ‘Satoshi Nakamoto’ published
a white paper on “BitCoin: A peer-to-peer electronic cash system” in 2008.

Unit 2 2
Blockchain Technology Records Transaction in Digital Ledger which is distributed
over the Network thus making it incorruptible. Anything of value like Land Assets,
Cars, etc. can be recorded on Blockchain as a Transaction.

How does Blockchain Technology Work?


One of the famous use of Blockchain is Bitcoin. Bitcoin is a cryptocurrency and is
used to exchange digital assets online. Bitcoin uses cryptographic proof instead of
third-party trust for two parties to execute transactions over the Internet. Each
transaction protects through a digital signature.

Unit 2 3
Blockchain Decentralization
There is no Central Server or System which keeps the data of the Blockchain. The
data is distributed over Millions of Computers around the world which are
connected to the Blockchain. This system allows the Notarization of Data as it is
present on every Node and is publicly verifiable.

Unit 2 4
Blockchain nodes
A node is a computer connected to the Blockchain Network. Node gets connected
with Blockchain using the client. The client helps in validating and propagating

Unit 2 5
transactions onto the Blockchain. When a computer connects to the Blockchain, a
copy of the Blockchain data gets downloaded into the system and the node comes
in sync with the latest block of data on Blockchain. The Node connected to the
Blockchain which helps in the execution of a Transaction in return for an incentive
is called Miners.

Disadvantages of the current transaction system:


Cash can only be used in low-amount transactions locally.

The huge waiting time in the processing of transactions.

The need for a third party for verification and execution of Transactions makes
the process complex.

If the Central Server like Banks is compromised, the whole system is affected
including the participants.

Organizations doing validation charge high process thus making the process
expensive.

Building trust with Blockchain: Blockchain enhances trust across a business


network. It’s not that you can’t trust those who you conduct business with it’s that

Unit 2 6
you don’t need to when operating on a Blockchain network. Blockchain builds
trust through the following five attributes:

Distributed: The distributed ledger is shared and updated with every incoming
transaction among the nodes connected to the Blockchain. All this is done in
real time as there is no central server controlling the data.

Secure: There is no unauthorized access to Blockchain made possible through


Permissions and Cryptography.

Transparent: Because every node or participant in Blockchain has a copy of


the Blockchain data, they have access to all transaction data. They themselves
can verify the identities without the need for mediators.

Consensus-based: All relevant network participants must agree that a


transaction is valid. This is achieved through the use of consensus algorithms.

Flexible: Smart Contracts which are executed based on certain conditions can
be written into the platform. Blockchain Networks can evolve in pace with
business processes.

What are the benefits of Blockchain?


Time-saving: No central Authority verification is needed for settlements
making the process faster and cheaper.

Cost-saving: A Blockchain network reduces expenses in several ways. No


need for third-party verification. Participants can share assets directly.
Intermediaries are reduced. Transaction efforts are minimized as every
participant has a copy of the shared ledger.

Tighter security: No one can tamper with Blockchain Data as it is shared


among millions of Participants. The system is safe against cybercrimes and
Fraud.

Collaboration: It permits every party to interact directly with one another while
not requiring third-party negotiation.

Reliability: Blockchain certifies and verifies the identities of every interested


party. This removes double records, reducing rates and accelerating
transactions.

Unit 2 7
Application of Blockchain
Leading Investment Banking Companies like Credit Suisse, JP Morgan Chase,
Goldman Sachs, and Citigroup have invested in Blockchain and are
experimenting to improve the banking experience and secure it.

Following the Banking Sector, the Accountants are following the same path.
Accountancy involves extensive data, including financial statements
spreadsheets containing lots of personal and institutional data. Therefore,
accounting can be layered with blockchain to easily track confidential and
sensitive data and reduce human error and fraud. Industry Experts from
Deloitte, PwC, KPMG, and EY are proficiently working and using blockchain-
based software.

Booking a Flight requires sensitive data ranging from the passenger’s name,
credit card numbers, immigration details, identification, destinations, and
sometimes even accommodation and travel information. So sensitive data can
be secured using blockchain technology. Russian Airlines are working towards
the same.

Various industries, including hotel services, pay a significant amount ranging


from 18-22% of their revenue to third-party agencies. Using blockchain, the
involvement of the middleman is cut short and allows interaction directly with
the consumer ensuring benefits to both parties. Winding Tree works
extensively with Lufthansa, AirFrance, AirCanada, and Etihad Airways to cut
short third-party operators charging high fees.

Barclays uses Blockchain to streamline the Know Your Customer (KYC) and
Fund Transfer processes while filling patents against these features.

Visauses Blockchain to deal with business-to-business payment services.

Unilever uses Blockchain to track all their transactions in the supply chain and
maintain the product’s quality at every stage of the process.

Walmart has been using Blockchain Technology for quite some time to keep
track of their food items coming right from farmers to the customer. They let
the customer check the product’s history right from its origin.

Unit 2 8
DHL and Accenture work together to track the origin of medicine until it
reaches the consumer.

Pfizer, an industry leader, has developed a blockchain system to keep track of


and manage the inventory of medicines.

The government of Dubai looking forward to making Dubai the first-ever city
to rely on entirely and work using blockchain, even in their government office.

Along with the above organizations, leading tech companies like Google,
Microsoft, Amazon, IBM, Facebook, TCS, Oracle, Samsung, NVIDIA,
Accenture, and PayPal, are working on Blockchain extensively.

Is Blockchain Secure?
Nowadays, as the blockchain industry is increasing day by day, a question arises
is Blockchain safe? or how safe is blockchain? As we know after a block has been
added to the end of the blockchain, previous blocks cannot be changed. If a
change in data is tried to be made then it keeps on changing the Hash blocks, but
with this change, there will be a rejection as there are no similarities with the
previous block.
Just imagine there is a who hacker runs a node on a blockchain network, he wants
to alter a blockchain and steal cryptocurrency from everyone else. With a change
in the copy, they would have to convince the other nodes that their copy was
valid.
They would need to control a majority of the network to do this and insert it at just
the right moment. This is known as a 51% attack because you need to control
more than 50% of the network to attempt it.
Timing would be everything in this type of attack—by the time the hacker takes
any action, the network is likely to have moved past the blocks they were trying to
alter.

Advantages of Blockchain Technology:


1. Decentralization: The decentralized nature of blockchain technology
eliminates the need for intermediaries, reducing costs and increasing
transparency.

Unit 2 9
2. Security: Transactions on a blockchain are secured through cryptography,
making them virtually immune to hacking and fraud.

3. Transparency: Blockchain technology allows all parties in a transaction to have


access to the same information, increasing transparency and reducing the
potential for disputes.

4. Efficiency: Transactions on a blockchain can be processed quickly and


efficiently, reducing the time and cost associated with traditional transactions.

5. Trust: The transparent and secure nature of blockchain technology can help to
build trust between parties in a transaction.

Disadvantages of Blockchain Technology:


1. Scalability: The decentralized nature of blockchain technology can make it
difficult to scale for large-scale applications.

2. Energy Consumption: The process of mining blockchain transactions requires


significant amounts of computing power, which can lead to high energy
consumption and environmental concerns.

3. Adoption: While the potential applications of blockchain technology are vast,


adoption has been slow due to the technical complexity and lack of
understanding of the technology.

4. Regulation: The regulatory framework around blockchain technology is still in


its early stages, which can create uncertainty for businesses and investors.

5. Lack of Standards: The lack of standardized protocols and technologies can


make it difficult for businesses to integrate blockchain technology into their
existing systems.

6. Overall, the advantages of blockchain technology are significant and have the
potential to revolutionize many industries. However, there are also several
challenges and disadvantages that must be addressed before the technology
can reach its full potential.

SN Blockchain Database

1. Blockchain is decentralized The database is centralized because


because there is no admin or in- it has admins and in-charge.

Unit 2 10
charge.

The database required permission


Blockchain is permissionless
2. because it can be accessed only by
because anyone can access it.
entities who have rights to access.

3. Blockchains are slow. Databases are fast.

It has a history of records and It has no history of records and


4.
ownership of digital records. ownership of records.

5. Blockchain is fully confidential. The database is not fully confidential.

Blockchain has only Insert The database has Create, Read,


6.
operation. Update, and Delete operation.

7. It is a fully robust technology. It is not entirely robust technology.

Disintermediation is allowed with Disintermediation is not allowed with


8.
blockchain. the database.

Anyone with the right proof of


Only entities entitled to read or write
9. work can write on the
can do so.
blockchain.

Blockchain is not recursive. The database is recursive. Here, we


10. Here, we cannot go back to can go back to repeat a task on a
repeat a task on any record. particular record.

Distributed Consensus in Distributed


Systems
A procedure to reach a common agreement in a distributed or decentralized multi-
agent platform. It is important for the message passing system.
Example –
A number of processes in a network decide to elect a leader. Each process begins
with a bid for leadership. In traditional or conventional distributed systems, we
apply consensus to ensure reliability and fault tolerance. It means, in a
decentralized environment when you have multiple individual parties, and they
can make their own decision, then it may happen that some node or some parties
are working maliciously or working as a faulty individual. So in those particular
cases, it is important to come to a decision or common point of view. So having a

Unit 2 11
common point of view in an environment where people can behave maliciously or
people can crash the work in a faulty way, is the main difficulty. So under this kind
of distributed environment, our objective is to ensure reliability which means to
ensure correct operation in the presence of faulty individuals.
Features :

It ensures reliability and fault tolerance in distributed systems.

In the presence of faulty individuals, it is Ensure correct operations.

Examples –
Commit a transaction in a database, State machine replication, Clock
synchronization.
How to achieve distributed consensus :
There are some conditions that need to be followed in order to achieve distributed
consensus.

Termination – Every non-faulty process must eventually decide.

Agreement – The final decision of every non-faulty process must be identical.

Validity – Every non-faulty process must begin and ends with the same value.

Integrity – Every correct individual decides at most one value, and the
decided value must be proposed by some individual.

Here is one validation criterion, So basically we should reach a decision with a


value that must be the initial value of some process because it is silly to reach an
agreement when the agreed value reflects nobody’s initial choice.

The correctness of Distributed Consensus Protocol :


It can be described by the following two properties as follows.

Safety Property – It ensures that you will never converge to an incorrect value
or correct individuals in a network will never converge to an incorrect value.

Liveness Property – It states that every correct value must be accepted


eventually which means something good will eventually happen.

Termination Property – It guarantees that every correct process will


eventually decide on a value. This ensures that the protocol will eventually

Unit 2 12
terminate.

Agreement Property – It guarantees that all correct processes will eventually


agree on a single value. This ensures that all correct nodes in the network will
come to a consensus.

Fault Tolerance – Distributed consensus protocols must be able to handle


failures and errors, both in the network and in the participating nodes. This
ensures that the system remains correct and functional even in the presence
of faults.

Byzantine Fault Tolerance – Some distributed consensus protocols, like PBFT,


have the additional property of Byzantine Fault Tolerance (BFT). This means
they can tolerate up to a certain number of malicious nodes in the network
without compromising safety and liveness properties.

Scalability – The protocol must be able to scale to handle large networks and
increasing numbers of nodes without sacrificing safety, liveness, or fault
tolerance. This ensures that the protocol can be used in real-world scenarios
with a large number of participants.

Application of Distributed Consensus :

Leader election in a fault-tolerant environment for initiating some global action


without introducing a single point of failure.

Maintaining consistency in a distributed network. Suppose you have different


nodes monitoring the same environment. If one of the nodes crashes, a
consensus protocol ensures robustness against such faults.

Blockchain technology: Distributed consensus is a fundamental concept in


blockchain technology, which allows multiple nodes to agree on a shared
database without relying on a central authority.

Distributed databases: Distributed consensus protocols can be used to


maintain consistency across multiple replicas of a distributed database.

Load balancing: Consensus protocols can be used to dynamically distribute


the workload across multiple nodes in a distributed system to ensure that no
node is overloaded.

Unit 2 13
Fault tolerance: Distributed consensus protocols can provide fault tolerance in
distributed systems by allowing nodes to recover from crashes or network
partitions.

Agreement protocols: Consensus protocols can be used to achieve agreement


among multiple nodes in a distributed system on a particular course of action
or decision.

What is Gas Limit?


The Ethereum network is getting more popular by the day as it supports the
creation of decentralized apps (DApps) and takes DeFi further ahead. Ethereum
chain-based transactions are increasing in number as well. Each transaction on
this chain requires some transactional cost, called the gas fees. Each user has a
certain limit up to which they are willing to pay for the transactions. This limit is
called the gas limit in blockchain.

Complex transactions require more gas and thus enhancement in the gas limit. If
you want to learn in detail regarding the whole transactional scenario around the
ETH chain, you need to know the answer to ‘what is a gas limit?’. Without further
ado, let’s find out about the cryptocurrency gas limit.
Table of Contents
• What is Gas Limit?

What is the Purpose of Gas Limit?

How do Gas Limits Work?

What is the Transaction Gas Limit?

Do I get my Gas back for a Failed Transaction (out of gas)?

Why are Ethereum Transaction Fees so High?

Calculating Ethereum Gas Costs

Unit 2 14
Conclusion

Popular Searches

What is Gas Limit?


The gas limit in blockchain technology refers to the maximum amount of
computational effort a user is willing to expend on a transaction or smart contract
execution. It prevents excessive use of network resources by setting a cap on the
work that can be done. Users set this limit to manage costs, as each operation
requires a certain amount of gas, with the price determined by network demand. A
transaction fails if the gas limit is too low, not completing its intended action, but
still consuming the set gas.
The gas limit is like setting a budget for how much you’re willing to spend on
sending a transaction or running a program on a blockchain, like Ethereum. It
stops your transaction from using up too much of the blockchain’s energy. Think
of it like telling a taxi driver the most you’ll pay for a ride. If the ride costs more
than your budget, you won’t get to your destination. If it costs less, you only pay
for the distance covered.

What is the Purpose of Gas Limit?


Over the ETH network, the processing of pending transactions depends on the
gas limit that each transaction is willing to spend on the block. The Ethereum
Virtual Machine processes every transaction and requires some amount of gas
fees for execution. Each block has its gas limit. While creating a block, designated
users must remember that the total transactional gas limit is not to exceed the
block’s gas limit. Thus, every transaction’s gas limit has to be carefully decided.

How do Gas Limits Work?

Unit 2 15
Source: Blockgeeks / What is a crypto gas limit in blockchain: purpose of
cryptocurrency block limit
Gas fees provide each node involved some incentive to add a new block to the
chain and execute a transaction. Now, they may charge very high depending upon
the traffic on the chain. The gas limit controls the users over how much they
spend on executing a transaction. A simulator suggests average gas fees to the
users, who can then decide whether they want to keep the gas limit equal to the
average, higher, or lower. A higher gas limit will get your transaction processed
faster since the designated node would get to charge more. A lower gas limit will
keep you in the queue until any willing node decides to execute the transaction.
Usually, people keep the cryptocurrency gas limit equal to the average gas fees.

What is the Transaction Gas Limit?


Users have the right to decide a cryptocurrency gas limit for each transaction
based on the gas fees required for transactions. The transaction gas limit in the
blockchain decides whether the transaction will get executed. The limit being

Unit 2 16
higher than or equal to the gas fees mandated by the authorized nodes means the
transaction will be successful. If the transaction gas limit is lower than the gas
fees, the transaction fails.

Do I get my Gas back for a Failed


Transaction (out of gas)?
If your transaction fails due to running out of gas, you lose the gas already
consumed. Therefore, setting gas limit low might result in the transaction getting
dropped from mempools or staying pending indefinitely.

Why are Ethereum Transaction Fees so


High?
The Ethereum chain has grown rapidly over the last few years. Creation
of DApp and other DeFi based transactions requires gas for execution. Due to high
traffic on the blockchain, miners on proof of work Ethereum had to keep adding
more blocks to the chain, which required a lot of time and computational power.
However, the Ethereum transaction fees are also decided by the complexity of the
transaction. Processing an ERC-20 token is easier and thus requires a lesser
crypto gas limit.

Calculating Ethereum Gas Costs


The Ethereum blockchain has no specific method to calculate the gas limit since
the whole process is based on supply and demand. Every transaction gets
processed by an authorized node, and the entire gas cost depends on how much
profit share they can earn from the transaction. So, ETH gas costs are usually set
by the competitive environment created by users lining up to get their transactions
processed.

Conclusion

Unit 2 17
In conclusion, the cryptocurrency gas limit is very important in deciding whether
an ETH block will have your transaction added. Ethereum’s recent
transformation to a proof of stake protocol from a proof of work one has many
plans to deal with issues PoW Ethereum was facing. However, the gas fees haven’t
come much lower yet. What the blockchain does to eradicate the high gas fees
issue still remains to be seen.

Blockchain Transaction Life-cycle


Blockchain technology is mostly about the transactions that we make digitally for
ourselves. Eventually, these transactions make their way to the various blocks that
become part of the Blockchain later on. So, it is important to understand
the transaction life cycle in Blockchain technology.
This lifecycle follows the journey of a single transaction as it makes its way
through each stage in the process of joining the blockchain. Transaction in simple
words is the process of sending money by the sender and the receiver receiving
it. The Blockchain transaction is also quite similar, but it is made digitally.
Let us understand the various stages in a blockchain transaction life cycle with the
help of an example.
Sourav and Suraj are two Bitcoin users. Sourav wants to send 1 bitcoin to Suraj.

1. First, Sourav gets Suraj’s wallet address (a wallet in the blockchain is a digital
wallet that allows users to manage their transactions). Using this information,
he creates a new transaction for 1 bitcoins from his wallet and includes a
transaction fee of 0.003 bitcoin.

2. Next, he verifies the information and sends the transaction. Each transaction
that is initiated is signed by a digital signature of the sender that is basically
the private key of the sender. This is done in order to make the transaction
more secure and to prevent any fraud.

3. Sourav’s wallet then starts the transaction signing algorithm which signs his
transaction using his private key.

4. The transaction is now broadcasted to the memory pool within the network.

Unit 2 18
5. This transaction is eventually accepted by the miners. These miners, group
this transaction into a block, find the Proof of Work, and assign this block
a hash value to be mapped into the blockchain.

6. This block is now placed on the Blockchain.

7. As this block gains confirmation, it is accepted as a valid transaction in the


network.

8. Once this transaction is accepted, Suraj finally gets his bitcoin.

The below diagram is a pictorial representation of the various stages in a


transaction life cycle as discussed above.

Transaction life-cycle in Blockchain

Blockchain Merkle Trees


A hash tree is also known as Merkle Tree. It is a tree in which each leaf node is
labeled with the hash value of a data block and each non-leaf node is labeled with

Unit 2 19
the hash value of its child nodes labels. This article focuses on discussing the
following topics in detail:

1. What is a Cryptographic Hash?

2. What is Hash Pointer?

3. Blockchain Structure

4. Block Structure

5. Merkle Tree Structure

6. How Do Merkle Trees Work?

7. Why Merkle Trees are Important For Blockchain?

8. Proof of Membership

9. Merkle Proofs

10. Simple Payment Verification(SPV)

11. Advantages of Merkle Tree

Let’s discuss each of these topics in detail.

What is a Cryptographic Hash?


A cryptographic hash is a function that outputs a fixed-size digest for a variable-
length input. A hash function is an important cryptographic primitive and
extensively used in blockchain. For example, SHA-256 is a hash function in which
for any variable-bit length input, the output is always going to be a 256-bit hash.

Unit 2 20
From the above picture, it is clear that even the slightest change in an alphabet
in the input sentence can drastically change the hash obtained. Therefore
hashes can be used to verify integrity.

Consider there is a text file with important data. Pass the contents of the text
file into a hash function and then store the hash in the phone. A hacker
manages to open the text file and changes the data.

Now when you open the file again, you can compute the hash again and
compare this hash with the one stored previously on the phone.

It will be clearly evident that the two hashes do not match and hence the file
has been tampered with.

What is Hash Pointer?


A regular pointer stores the memory address of data. With this pointer, the data
can be accessed easily. On the other hand, a hash pointer is a pointer to where
data is stored and with the pointer, the cryptographic hash of the data is also
stored. So a hash pointer points to the data and also allows us to verify the data. A
hash pointer can be used to build all kinds of data structures such as blockchain
and Merkle tree.

Blockchain Structure

Unit 2 21
The blockchain is a proficient combination of two hash-based data structures-

1. Linked list: This is the structure of the blockchain itself, which is a linked
list of hash pointers. A regular linked list consists of nodes. Each node has 2
parts- data and pointer. The pointer points to the next node. In the blockchain,
simply replace the regular pointer with a hash pointer.

2. Merkle tree: A Merkle tree is a binary tree formed by hash pointers, and
named after its creator, Ralph Merkle.

Blockchain as linked list with hash pointers

Block Structure
1. Block header: The header data contains metadata of the block, i.e information
about the block itself. The contents of the block header include-

Hash of the previous block header.

Hash of the current block.

Timestamp.

Cryptographic nonce.

Merkle root.

Unit 2 22
2. Merkle tree: A Merkle tree is a binary tree formed by hash pointers, and named
after its creator, Ralph Merkle.

As mentioned earlier, each block is supposed to hold a certain number of


transactions. Now the question arises, how to store these transactions within a
block? One approach can be to form a hash pointer-based linked list of
transactions and store this complete linked list in a block. However, when we
put this approach into perspective, it does not seem practical to store a huge
list of hundreds of transactions. What if there is a need to find whether a
particular transaction belongs to a block? Then we will have to traverse the
blocks one by one and within each block traverse the linked list of
transactions.

This is a huge overhead and can reduce the efficiency of the blockchain. Now,
this is where the Merkle tree comes into the picture. Merkle tree is a per-block
tree of all the transactions that are included in the block. It allows us to have a
hash/digest of all transactions and provides proof of membership in a time-
efficient manner.

So to recap, the blockchain is a hash-based linked list of blocks, where each


block consists of a header and transactions. The transactions are arranged in
a tree-like fashion, known as the Merkle tree.

Each block comprises of block header + Merkle tree

Unit 2 23
Merkle Tree Structure

Structure of Merkle tree

1. A blockchain can potentially have thousands of blocks with thousands of


transactions in each block. Therefore, memory space and computing power are
two main challenges.
2. It would be optimal to use as little data as possible for verifying transactions,
which can reduce CPU processing and provide better security, and this is exactly
what Merkle trees offer.
3. In a Merkle tree, transactions are grouped into pairs. The hash is computed for
each pair and this is stored in the parent node. Now the parent nodes are grouped
into pairs and their hash is stored one level up in the tree. This continues till the
root of the tree. The different types of nodes in a Merkle tree are:

Root node: The root of the Merkle tree is known as the Merkle root and this
Merkle root is stored in the header of the block.

Unit 2 24
Leaf node: The leaf nodes contain the hash values of transaction data. Each
transaction in the block has its data hashed and then this hash value (also
known as transaction ID) is stored in leaf nodes.

Non-leaf node: The non-leaf nodes contain the hash value of their respective
children. These are also called intermediate nodes because they contain the
intermediate hash values and the hash process continues till the root of the
tree.

4. Bitcoin uses the SHA-256 hash function to hash transaction data continuously
till the Merkle root is obtained.
5. Further, a Merkle tree is binary in nature. This means that the number of leaf
nodes needs to be even for the Merkle tree to be constructed properly. In case
there is an odd number of leaf nodes, the tree duplicates the last hash and makes
the number of leaf nodes even.

How Do Merkle Trees Work?


A Merkle tree is constructed from the leaf nodes level all the way up to the
Merkle root level by grouping nodes in pairs and calculating the hash of each
pair of nodes in that particular level. This hash value is propagated to the next
level. This is a bottom-to-up type of construction where the hash values are
flowing from down to up direction.

Hence, by comparing the Merkle tree structure to a regular binary tree data
structure, one can observe that Merkle trees are actually inverted down.

Binary tree direction vs Merkle tree direction

Unit 2 25
Example: Consider a block having 4 transactions- T1, T2, T3, T4. These four
transactions have to be stored in the Merkle tree and this is done by the following
steps-
Step 1: The hash of each transaction is computed.

H1 = Hash(T1).

Step 2: The hashes computed are stored in leaf nodes of the Merkle tree.
Step 3: Now non-leaf nodes will be formed. In order to form these nodes, leaf
nodes will be paired together from left to right, and the hash of these pairs will be
calculated. Firstly hash of H1 and H2 will be computed to form H12. Similarly, H34
is computed. Values H12 and H34 are parent nodes of H1, H2, and H3, H4
respectively. These are non-leaf nodes.

H12 = Hash(H1 + H2) H34 = Hash(H3 + H4)

Step 4: Finally H1234 is computed by pairing H12 and H34. H1234 is the only hash
remaining. This means we have reached the root node and therefore H1234 is the
Merkle root.

H1234 = Hash(H12 + H34)

Unit 2 26
Merkle tree works by hashing child nodes again and again till only one hash
remains.
Key Points:

In order to check whether the transaction has tampered with the tree, there is
only a need to remember the root of the tree.

One can access the transactions by traversing through the hash pointers and
if any content has been changed in the transaction, this will reflect on the hash
stored in the parent node, which in turn would affect the hash in the upper-
level node and so on until the root is reached.

Hence the root of the Merkle tree has also changed. So Merkle root which is
stored in the block header makes transactions tamper-proof and validates the
integrity of data.

With the help of the Merkle root, the Merkle tree helps in eliminating duplicate
or false transactions in a block.

It generates a digital fingerprint of all transactions in a block and the Merkle


root in the header is further protected by the hash of the block header stored
in the next block.

Why Merkle Trees are Important For Blockchain?


In a centralized network, data can be accessed from one single copy. This
means that nodes do not have to take the responsibility of storing their own
copies of data and data can be retrieved quickly.

However, the situation is not so simple in a distributed system.

Let us consider a scenario where blockchain does not have Merkle trees. In
this case, every node in the network will have to keep a record of every single
transaction that has occurred because there is no central copy of the
information.

This means that a huge amount of information will have to be stored on every
node and every node will have its own copy of the ledger. If a node wants to
validate a past transaction, requests will have to be sent to all nodes,
requesting their copy of the ledger. Then the user will have to compare its own
copy with the copies obtained from several nodes.

Unit 2 27
Any mismatch could compromise the security of the blockchain. Further on,
such verification requests will require huge amounts of data to be sent over
the network, and the computer performing this verification will need a lot of
processing power for comparing different versions of ledgers.

Without the Merkle tree, the data itself has to be transferred all over the
network for verification.

Merkle trees allow comparison and verification of transactions with viable


computational power and bandwidth. Only a small amount of information
needs to be sent, hence compensating for the huge volumes of ledger data
that had to be exchanged previously.

Merkle trees use a one-way hash function extensively and this


hashing separates the proof of data from data itself

Proof of Membership
A very interesting feature of the Merkle tree is that it provides proof of
membership.
Example: A miner wants to prove that a particular transaction belongs to a Merkle
tree Now the miner needs to present this transaction and all the nodes which lie
on the path between the transaction and the root. The rest of the tree can be
ignored because the hashes stored in the intermediate nodes are enough to verify
the hashes all the way up to the root.

Unit 2 28
Proof of membership: verifying the presence of transactions in blocks using the
Merkle tree.
If there are n nodes in the tree then only log(n) nodes need to be examined. Hence
even if there are a large number of nodes in the Merkle tree, proof of membership
can be computed in a relatively short time.

Merkle Proofs
A Merkle proof is used to decide:

1. If data belongs to a particular Merkle tree.

2. To prove data belongs to a set without the need to store the whole set.

3. To prove a certain data is included in a larger data set without revealing the
larger data set or its subsets.

Merkle proofs are established by hashing a hash’s


corresponding hash together and climbing up the tree until you
obtain the root hash which is or can be publicly known.

Consider the Merkle tree given below:

Unit 2 29
Let us say we need to prove that transaction ‘a’ is part of this Merkle tree.
Everyone in the network will be aware of the hash function used by all Merkle
trees.

1. H(a) = Ha as per the diagram.

2. The hash of Ha and Hb will be Hab, which will be stored in an upper-level


node.

3. Finally hash of Hab and Hcd will give Habcd. This is the Merkle root obtained
by us.

4. By comparing the obtained Merkle root and the Merkle root already available
within the block header, we can verify the presence of transaction ‘a’ in this
block.

From the above example, it is clear that in order to verify the presence of ‘a’, ‘a’
does not have to be revealed nor do ‘b’, ‘c’, ‘d’ have to be revealed, only their
hashes are sufficient. Therefore Merkle proof provides an efficient and simple
method of verifying inclusivity, and is synonymous with “proof of inclusion”.
A sorted Merkle tree is a tree where all the data blocks are ordered using an
ordering function. This ordering can be alphabetical, lexicographical, numerical,
etc.
Proof of Non-Membership:

Unit 2 30
It is also possible to test non-membership in logarithmic time and space using
a sorted Merkle tree. That is, it is possible to show that a given transaction
does not belong in the Merkle tree.

This can be done by displaying a path to the transaction that is immediately


before the transaction in question, as well as a path to the item that is
immediately following it.

If these two elements in the tree are sequential, this proves that the item in
issue is not included or else it would have to go between the two things shown
if it was included, but there is no room between them because they are
sequential.

Coinbase Transaction:
A coinbase transaction is a unique Bitcoin transaction that is included in the
Merkle tree of every block in the blockchain. It is responsible for creating new
coins and also consists of a coinbase parameter that can be used by miners to
insert arbitrary data into the blockchain.

Simple Payment Verification(SPV)


SPV makes it extremely easy for a client to verify whether a particular
transaction exists in a block and is valid without having to download the
entire blockchain. The users will only require a copy of the block headers of
the longest chain.

This copy of headers is stored in the SPV wallet and this wallet uses the SPV
client to link a transaction to a Merkle branch in a block. SPV client
requests proof of inclusion(Merkle proof), in the form of a Merkle branch.
The fact that the transaction can be linked to a Merkle branch is proof that the
transaction exists.

Now by assessing the blocks which are being mined on top of the
transaction’s block, the client can also conclude that majority of the nodes
have built more blocks on top of this chain by using consensus mechanisms
like Proof of Work, and hence this is the longest, valid blockchain.

Advantages of Merkle Tree

Unit 2 31
1. Efficient verification: Merkle trees offer efficient verification of integrity and
validity of data and significantly reduce the amount of memory required for
verification. The proof of verification does not require a huge amount of data
to be transmitted across the blockchain network. Enable trustless transfer of
cryptocurrency in the peer-to-peer, distributed system by the quick
verification of transactions.

2. No delay: There is no delay in the transfer of data across the network. Merkle
trees are extensively used in computations that maintain the functioning of
cryptocurrencies.

3. Less disk space: Merkle trees occupy less disk space when compared to
other data structures.

4. Unaltered transfer of data: Merkle root helps in making sure that the blocks
sent across the network are whole and unaltered.

5. Tampering Detection: Merkle tree gives an amazing advantage to miners to


check whether any transactions have been tampered with.

Since the transactions are stored in a Merkle tree which stores the hash of
each node in the upper parent node, any changes in the details of the
transaction such as the amount to be debited or the address to whom the
payment must be made, then the change will propagate to the hashes in
upper levels and finally to the Merkle root.

The miner can compare the Merkle root in the header with the Merkle root
stored in the data part of a block and can easily detect this tampering.

6. Time Complexity: Merkle tree is the best solution if a comparison is done


between the time complexity of searching a transaction in a block as a Merkle
tree and another block that has transactions arranged in a linked list, then-

Merkle Tree search: O(logn), where n is the number of transactions in a


block.

Linked List search: O(n), where n is the number of transactions in a block.

Blockchain Forks

Unit 2 32
The decentralized nature of public blockchains (for example, Bitcoin and
Ethereum) means that participants on the network must be able to come to an
agreement as to the shared state of the blockchain(shared public ledger and
blocks and the blockchain protocol). Unanimous consensus amongst the
network nodes results in a single blockchain that contains verified
data(transactions) that the network asserts to be correct. However, many
times, the nodes in the network can’t come in a unanimous consensus
regarding the future state of the blockchain. This event leads to forks (like a
tuning fork used in experimental science), meaning that point in which the
ideal ‘single’ chain of blocks is split into two or more chains which are all valid.

FORKS IN BLOCKCHAIN:
In simple terms, Forks in blockchain means copying the code and modifying it
to create a new software or product. In open-source projects Forks are very
common and used widely. So, cryptocurrencies like Ethereum and Bitcoin are
decentralized and open software so that anyone can contribute. As they are
open-sources they rely on their communities to make the software more
secure and reliable. Also open source with the help of fork can make user
interface more interactive and look good, helping in gaining more users
worldwide. In open source the code is visible to everyone, anyone can modify,
edit, access there is no copyright claims for such actions.

For example: Tor browser is an open source software, Linux


one of the most widely use Operating system is an open sou
rce system, in similar way Bitcoin and Ethereum protocol a
re also open sourced.

Unit 2 33
An example GeeksforGeeks blockchain fork

Moving Ahead:

Lets us see the different types of FORKS one by one:

TYPES OF FORKS
Basically forks are divided into two categories i.e. Codebase Fork and Live
Blockchain Fork. And then Live Blockchain Fork is divided into further two
parts i.e. Intentional Fork and Accidental Fork, as you can see in the above

Unit 2 34
mentioned figure the Intentional fork is then further divided into two parts
i.e. Soft Fork and Hard Fork.

TYPES OF FORKS:
CODEBASE FORK: In codebase blockchain fork you can copy the entire code
of a particular software. Let us take BITCOIN as an example, so suppose you
copied the whole blockchain code and modified it according to your need, say
that you decreased the block creation time, made some crucial changes and
created a faster software than BITCOIN and publish / launch it has a new
whole software named against you, by completing the whole white paper work
process. So in these way a new BLOCKCHAIN will be created from an empty
blank ledger. It’s a fact that many of these ALT COINS which are now running
on the blockchain are been made in these way only by using the codebase
fork i.e. they have made little up and down changes in the code of BITCOIN
and created their whole new ALT COIN.
LIVE BLOCKCHAIN FORK: Live Blockchain fork means a running blockchain is
been divided further into two parts or two ways. So in live blockchain at a
specific page the software is same and from that specific point the chain is
divided into two parts. So in context to this fork the Live Blockchain Fork can
occur because of two reasons :

ACCIDENTAL FORK / TEMPORARY FORK: When multiple miners mine a


new block at nearly the same time, the entire network may not agree on
the choice of the new block. Some can accept the block mined by one
party, leading to a different chain of blocks from that point onward while
others can agree on the other alternatives (of blocks) available. Such a
situation arises because it takes some finite time for the information to
propagate in the entire blockchain network and hence conflicted opinions
can exist regarding the chronological order of events. In this fork, two or
more blocks have the same block height. Temporary forks resolve
themselves eventually when one of the chain dies out (gets orphaned)
because majority of the full nodes choose the other chain to add new
blocks to and sync with. Example (TEMPORARY FORK / ACCIDENTAL
FORK): Temporary forks happen more often than not and a usual event
that triggers this fork is mining of a block by more than one party at nearly
the same time.

Unit 2 35
INTENTIONAL FORK: In intentional fork the rules of the blockchain are
been changed, knowing the code of the software and by modifying it
intentionally. This gives rise to two types of forks which can occur based
on the backwards-compatibility of the blockchain protocol and the time
instant at which a new block is mined. So Intentional fork can be of two
types:

1. SOFT FORK: When the blockchain protocol is altered in a backwards-


compatible way. In soft fork you tend to add new rules such that they do
not clash with the old rules. That means there is no connection between
the old rules and new rules. Rules in soft fork are tightened. When there is
a change in the software that runs on the nodes (better called as ‘full
nodes’) to function as a network participant, the change is such that the
new blocks mined on the basis of new rules (in the Blockchain protocol)
are also considered valid by the old version of the software. This feature is
also called as backwards-compatibility. Example (SOFT FORK): The
Bitcoin network’s SegWit update added a new class of addresses
(Bech32). However, this didn’t invalidate the existing P2SH addresses. A
full node with a P2SH type address could do a valid transaction with a
node of Bech32 type address.

2. HARD FORK: When the blockchain protocol is altered in a non backwards-


compatible way. Hard fork is opposite of Soft fork, here the rules are
loosened. When there is a change in the software that runs on the full
nodes to function as a network participant, the change is such that the
new blocks mined on the basis of new rules (in the Blockchain protocol)
are not considered valid by the old version of the software. When hard
forks occur, new currency come into existence (with valid original
currency) like in the case of Ethereum (original : Ethereum, new : Ethereum
Classic) and Bitcoin (original : Bitcoin, new : Bitcoin cash). Equivalent
quantity of currency is distributed to the full nodes who choose to upgrade
their software so that no material loss occurs. Such hard forks are often
contentious (generating conflicts in the community). The final decision to
join a particular chain rests with the full node. If chosen to join the new
chain, the software has to be upgraded to make newer transactions valid
while the nodes who do not choose to upgrade their software continue
working the same. Example (HARD FORK): The new Casper update in the

Unit 2 36
Ethereum Blockchain in which the consensus protocol will change from a
type of Proof of Work (PoS) to a type of Proof of Stake (PoS). The nodes
which install the Casper update will use the new consensus protocol. Full
nodes that do not choose to install the Casper update will become
incompatible with the full nodes that do.

Reasons for the occurrence of a


blockchain fork:
Add new functionality: The Blockchain code is upgraded regularly. Since
most public blockchains are open source, it is developed by people from
around the world. The improvements, issues are created, resolved and
new versions are released when the time is suitable.

Fix security issues: Blockchain (and cryptocurrency on top of it) is a


relatively new technology as compared to the traditional currency (notes,
coins, cheque), research is still underway to fully understand it. So,
versions are bumped and updates are released to fix the security issues
that arise in the way.

Reverse transactions: The community can actually void all the transaction
of a specific period if they are found to be breached and malicious.

Future of the Blockchain Fork:


The future of blockchain forks is an area of great interest to many blockchain
enthusiasts and experts. While it is difficult to predict with certainty what will
happen in the future, there are some trends and developments that may give
us an idea of what to expect.

One possibility is that we may see more soft forks in the future, as they are
generally less disruptive to the network and require less consensus to
implement. Soft forks can be used to add new features to the blockchain
or to improve its efficiency, without creating a new cryptocurrency.

Another possibility is that we may see more contentious hard forks in the
future, as different groups within the community have different opinions on
the direction of the blockchain. This could lead to more splits in the

Unit 2 37
community, as some users choose to continue using the old version of the
blockchain while others switch to the new version.

In recent years, there has also been a trend towards the development of
interoperability protocols and multi-chain architectures, which may reduce
the need for forks. These solutions aim to make it easier for different
blockchain networks to communicate with each other and share data,
without the need for a hard fork.

It is also worth noting that as the blockchain ecosystem continues to


mature, there may be less need for major updates or changes that require
a fork. Instead, the focus may shift towards incremental improvements and
optimizations that can be implemented through soft forks or other means.

Overall, the future of blockchain forks is likely to be shaped by a


combination of technical developments, community dynamics, and market
forces. As blockchain technology continues to evolve, it will be interesting
to see how the role of forks evolves along with it.

Soft fork vs. hard fork


Blockchain is a decentralized peer-to-peer network. A blockchain network
consists of nodes following the protocols defined by the blockchain. Protocols
consist of everything from the transaction format to the consensus algorithm.
These protocols need to be upgraded to keep up with technological advances.

What is a fork?
Forks represent an upgrade to the blockchain’s underlying protocols initiated
by the blockchain community. Forks divide the blockchain into two chains.
Sometimes, the two chains are compatible, resulting in a soft fork. Other
times, the changes in the protocols are so significant that the two chains are
not compatible anymore, resulting in a hard fork.

Unit 2 38
The types of forks

Note: Hard forks and soft forks are intentional forks.


However, there is another type of fork
called accidental or natural fork. This happens when two
miners mine a block simultaneously, and both are deemed
valid by the validators. The blockchain accepts the longer

Unit 2 39
chain (the one of the two chains in which the most number
of blocks are added after the natural fork).

Soft fork vs. hard fork


The differences between a soft fork and a hard fork are listed below:

Soft fork Hard fork

Backward compatible Not backward compatible

Result in 1 chain Results in 2 chains

Updating to the new protocol is optional Updating to the new protocol is compulsory

Soft fork
A soft fork is considered to be the most reasonable of the two. It is an
intentional fork usually used to update the protocols slightly while ensuring
that the new protocol remains backward compatible with blocks formed prior
to the fork. This means that updating the new protocol is optional for nodes,
resulting in only one chain.

Unit 2 40
A soft fork

Hard fork
The hard fork is usually an intentional fork resulting in the chains being
incompatible. The chains continue following different paths from the point of
the fork. One chain follows the new protocol, while the other continues to
follow the old protocols.

Unit 2 41
A hard fork
Hard forks have been used previously to add functionalities, improve the
network’s speed, and decrease gas fees. The most famous examples of hard
forks are Bitcoin cash which was hard forked from the Bitcoin blockchain in
2017. Bitcoin cash increased the speed of the transactions and lowered the
gas fee as intended.

However, the hard fork is not performed at all times to add functionalities.
Sometimes, it is used to rectify security risks and hacks. The most famous
example is the decentralized autonomous organization (DAO) hack. Due to this
hack, Ether worth millions of dollars were stolen from the smart contracts of
DAO due to a security flaw caused by a bug in the smart contracts deployed
on the Ethereum network. Following the attack, Ethereum went through a hard
fork resulting in the Ethereum that we know today and Ethereum classic. The
hard fork enabled the network’s history to be reset to the pre-hack, therefore
nullifying the hack. However, Ethereum classic continued mining the original
chain where the hacker still possessed the stolen Ether.

Types of Blockchain
The basic application of the blockchain is to perform transactions in a secure
network. That’s why people use blockchain and ledger technology in different
scenarios. One can set up multichain to prevent unauthorized access to
sensitive data. It is not available to the public, and can only be available to
authorized entities in the organization. It depends on the organization which
type it requires to choose for their work.
By using blockchain we can track orders and payments from end to end.

Advantage using blockchain :


1. It provides greater trust among users.

2. It provides greater security among data.

3. Reduce the cost of production.

4. Improve Speed.

5. Invocation and tokenization.

Unit 2 42
6. It provides immutable records.

7. Smart contracts

Disadvantages using blockchain :


1. Data modification is not possible.

2. It requires large storage for a large database.

3. The owner cannot access the private key again if they forget or lose it.

Real life application of blockchain :


Here is a list of real world problem where we can use blockchain :

1. In a secure and full-proof voting management system.

2. To supply chain management.

3. In healthcare management.

4. Real estate project.

5. NFT marketplace.

6. Avoid copyright and original content creation.

7. In the personal identity system

8. To make an immutable data backup.

9. Internet of Things

Permissionless Blockchain
It is also known as trustless or public blockchains, are available to everyone to
participate in the blockchains process that use to validate transactions and
data. These are used in the network where high transparency is required.
Characteristics:

Permissionless blockchain has no central authority.

The platform is completely open-source.

Full transparency of the transaction.

Unit 2 43
Heavy use of tokens.

Advantages:

Everyone can participate only requirement is good hardware and internet.

Bring trust among users or entities.

It has a high level of transparency as it’s a larger network.

Broader decentralization of access to more participants.

Disadvantages:

Poor energy efficiency due to large network.

Lower performance scalability.

Less privacy as many of the things is visible.

Permissioned Blockchain
These are the closed network only a set of groups are allowed to validate
transactions or data in a given blockchain network. These are used in the
network where high privacy and security are required.
Characteristics:

A major feature is a transparency based on the objective of the


organization.

Another feature is the lack of anatomy as only a limited number of users


are allowed.

It does not have a central authority.

Developed by private authority.

Advantages:

This blockchain tends to be faster as it has some nodes for validations.

They can offer customizability.

Strong Privacy as permission is needed for accessing transaction


information.

Unit 2 44
As few nodes are involved performance and scalability are increased.

Disadvantages:

Not truly decentralized as it requires permission

Risk of corruption as only a few participants are involved.

Anytime owner and operator can change the rules as per their need.

Types of Blockchain
There are 4 types of blockchain:

Public Blockchain.

Private Blockchain.

Hybrid Blockchain.

Consortium Blockchain.

Let’s discuss each of these topics in detail.

Unit 2 45
1. Public Blockchain
These blockchains are completely open to following the idea of
decentralization. They don’t have any restrictions, anyone having a computer
and internet can participate in the network.

As the name is public this blockchain is open to the public, which means it
is not owned by anyone.

Anyone having internet and a computer with good hardware can


participate in this public blockchain.

All the computer in the network hold the copy of other nodes or block
present in the network

In this public blockchain, we can also perform verification of transactions


or records

Advantages:

Trustable: There are algorithms to detect no fraud. Participants need not


worry about the other nodes in the network

Secure: This blockchain is large in size as it is open to the public. In a


large size, there is greater distribution of records

Anonymous Nature: It is a secure platform to make your transaction


properly at the same time, you are not required to reveal your name and
identity in order to participate.

Decentralized: There is no single platform that maintains the network,


instead every user has a copy of the ledger.

Disadvantages:

Processing: The rate of the transaction process is very slow, due to its
large size. Verification of each node is a very time-consuming process.

Energy Consumption: Proof of work is high energy-consuming. It requires


good computer hardware to participate in the network

Acceptance: No central authority is there so governments are facing the


issue to implement the technology faster.

Unit 2 46
Use Cases: Public Blockchain is secured with proof of work or proof of stake
they can be used to displace traditional financial systems. The more advanced
side of this blockchain is the smart contract that enabled this blockchain to
support decentralization. Examples of public blockchain are Bitcoin, Ethereum.

2. Private Blockchain
These blockchains are not as decentralized as the public blockchain only
selected nodes can participate in the process, making it more secure than the
others.

These are not as open as a public blockchain.

They are open to some authorized users only.

These blockchains are operated in a closed network.

In this few people are allowed to participate in a network within a


company/organization.

Advantages:

Speed: The rate of the transaction is high, due to its small size. Verification
of each node is less time-consuming.

Scalability: We can modify the scalability. The size of the network can be
decided manually.

Privacy: It has increased the level of privacy for confidentiality reasons as


the businesses required.

Balanced: It is more balanced as only some user has the access to the
transaction which improves the performance of the network.

Disadvantages:

Security- The number of nodes in this type is limited so chances of


manipulation are there. These blockchains are more vulnerable.

Centralized- Trust building is one of the main disadvantages due to its


central nature. Organizations can use this for malpractices.

Count- Since there are few nodes if nodes go offline the entire system of
blockchain can be endangered.

Unit 2 47
Use Cases: With proper security and maintenance, this blockchain is a great
asset to secure information without exposing it to the public eye. Therefore
companies use them for internal auditing, voting, and asset management. An
example of private blockchains is Hyperledger, Corda.

3. Hybrid Blockchain
It is the mixed content of the private and public blockchain, where some part is
controlled by some organization and other makes are made visible as a public
blockchain.

It is a combination of both public and private blockchain.

Permission-based and permissionless systems are used.

User access information via smart contracts

Even a primary entity owns a hybrid blockchain it cannot alter the


transaction

Advantages:

Ecosystem: Most advantageous thing about this blockchain is its hybrid


nature. It cannot be hacked as 51% of users don’t have access to the
network

Cost: Transactions are cheap as only a few nodes verify the transaction.
All the nodes don’t carry the verification hence less computational cost.

Architecture: It is highly customizable and still maintains integrity,


security, and transparency.

Operations: It can choose the participants in the blockchain and decide


which transaction can be made public.

Disadvantages:

Efficiency: Not everyone is in the position to implement a hybrid


Blockchain. The organization also faces some difficulty in terms of
efficiency in maintenance.

Transparency: There is a possibility that someone can hide information


from the user. If someone wants to get access through a hybrid blockchain
it depends on the organization whether they will give or not.

Unit 2 48
Ecosystem: Due to its closed ecosystem this blockchain lacks the
incentives for network participation.

Use Case: It provides a greater solution to the health care industry,


government, real estate, and financial companies. It provides a remedy where
data is to be accessed publicly but needs to be shielded privately. Examples of
Hybrid Blockchain are Ripple network and XRP token.

4. Consortium Blockchain
It is a creative approach that solves the needs of the organization. This
blockchain validates the transaction and also initiates or receives transactions.

Also known as Federated Blockchain.

This is an innovative method to solve the organization’s needs.

Some part is public and some part is private.

In this type, more than one organization manages the blockchain.

Advantages:

Speed: A limited number of users make verification fast. The high speed
makes this more usable for organizations.

Authority: Multiple organizations can take part and make it decentralized


at every level. Decentralized authority, makes it more secure.

Privacy: The information of the checked blocks is unknown to the public


view. but any member belonging to the blockchain can access it.

Flexible: There is much divergence in the flexibility of the blockchain.


Since it is not a very large decision can be taken faster.

Disadvantages:

Approval: All the members approve the protocol making it less flexible.
Since one or more organizations are involved there can be differences in
the vision of interest.

Transparency: It can be hacked if the organization becomes corrupt.


Organizations may hide information from the users.

Unit 2 49
Vulnerability: If few nodes are getting compromised there is a greater
chance of vulnerability in this blockchain

Use Cases: It has high potential in businesses, banks, and other payment
processors. Food tracking of the organizations frequently collaborates with
their sectors making it a federated solution ideal for their use. Examples of
consortium Blockchain are Tendermint and Multichain.
Difference between Public and Private blockchain :

Basis of
S.no Public BlockChain Private BlockChain
Comparison

In this type of blockchain


In this type of
anyone can read, write
blockchain read and
and participate in a
write is done upon
1. Access – blockchain. Hence, it is
invitation, hence it is
permissionless
a permissioned
blockchain. It is public to
blockchain.
everyone.

Network Actors
2. Don’t know each other Know each other

Decentralized
A public blockchain is A private blockchain
3. Vs Centralized
decentralized. is more centralized.

The order of magnitude of


a public blockchain is The order of
Order Of lesser than that of a magnitude is more
4.
Magnitude – private blockchain as it is as compared to the
lighter and provides public blockchain.
transactional throughput.

5. Native Token – Yes Not necessary

6. Speed – Slow Fast

Transaction per
Transactions per second
Transactions second is more as
7. are lesser in a public
pre second – compared to public
blockchain.
blockchain.

8. Security – A public network is more A private blockchain


secure due to is more prone to

Unit 2 50
decentralization and hacks, risks, and
active participation. Due data breaches/
to the higher number of manipulation. It is
nodes in the network, it is easy for bad actors
nearly impossible for ‘bad to endanger the
actors’ to attack the entire network.
system and gain control Hence, it is less
over the consensus secure.
network.

A public blockchain
consumes more energy
than a private blockchain
Private blockchains
Energy as it requires a significant
9. consume a lot less
Consumption – amount of electrical
energy and power.
resources to function and
achieve network
consensus.

Proof of Elapsed
Time (PoET), Raft,
Some are proof of work,
Consensus and Istanbul BFT
10. proof of stake, proof of
algorithms – can be used only in
burn, proof of space etc.
case of private
blockchains.

In a public blockchain, no
In a private
one knows who each
blockchain, there is
validator is and this
no chance of minor
increases the risk of
collision. Each
potential collision or a
11. Attacks – validator is known
51% attack (a group of
and they have the
miners which control
suitable credentials
more than 50% of the
to be a part of the
network’s computing
network.
power.).

12. Effects – Potential to disrupt Reduces transaction


current business models cost and data
through redundancies and
disintermediation. There replace legacy
is lower infrastructure systems,
cost. No need to maintain simplifying

Unit 2 51
servers or system admins documents handling
radically. Hence reducing and getting rid of
the cost of creating and semi manual
running decentralized compliance
application (dApps). mechanisms.

Bitcoin, Ethereum,
R3 (Banks), EWF
Monero, Zcash, Dash,
13. Examples – (Energy), B3i
Litecoin, Stellar, Steemit
(Insurance), Corda.
etc.

Unit 2 52

You might also like