0% found this document useful (0 votes)
7 views153 pages

Module 01

The document provides an introduction to Distributed Ledger Technology (DLT) and Blockchain, detailing their definitions, components, and key features. It explains the structure of blocks, consensus mechanisms, and the role of cryptographic techniques in ensuring security and immutability. Additionally, it covers various types of wallets and their functionalities within the blockchain ecosystem.
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 (0 votes)
7 views153 pages

Module 01

The document provides an introduction to Distributed Ledger Technology (DLT) and Blockchain, detailing their definitions, components, and key features. It explains the structure of blocks, consensus mechanisms, and the role of cryptographic techniques in ensuring security and immutability. Additionally, it covers various types of wallets and their functionalities within the blockchain ecosystem.
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

Subject: Blockchain and DLT

MODULE 01: INTRODUCTION TO DLT AND BLOCKCHAIN

Prof. Vijaya Umesh Pinjarkar


Assistant Professor, KJSIEIT
1
OUTLINE
 Introduction To Blockchain:
 Technical Definition of Blockchain
 Elements of a Blockchain
 Features of Blockchain
 Types of Blockchain
 What is DLT.
 DLT V/S Blockchain
 CAP Theorem

 Byzantine Generals Problem

 Consensus Mechanism and its Types

 Cryptographic Primitives and Data Structure Used In Blockchain.


 Block in a Blockchain: Structure of a Block
 Block Header Hash and Block Height
 The Genesis Block
 Linking Blocks in the Blockchain 2
 Merkle Tree.
INTRODUCTION TO BLOCKCHAIN:
 Technical Definition of Blockchain
 “Open, distributed ledger that records transactions between two parties
in a verifiable and immutable way”

 A blockchain is a datastructure, which is a growing list of data


blocks.
 The data blocks are linked together, such that old blocks cannot be
removed or altered. 3
WHAT IS BLOCKCHAIN?
Blo c k chain is a distributed ledger that…

➔ can contain financial and/or non-financial transactions.


➔ Contain a ledger that is replicated (distributed) across a number of systems in
near r e a l - time over a p e e r- to - p ee r network.
➔ Every participant “ o w n s ” the s a me copy of the ledger and gets updates when
any transaction is added to the ledger.
➔ Every participant helps determine the intrinsic “immutability ” of all
existing records.
➔ uses cryptography and digital signatures to prove identity, authenticity and
enforce read/write access rights.
➔ has me c h a n isms to ma k e it hard to change historical records, or at least
mak e it easy to detect when someone is trying to change it.

4
LITTLE HISTORY
➔ 1991 - Stuart Haber & W. Scott - cryptographically secured chain of
blocks.
➔ 1992 - Merkle trees + cryptographically secured chain of blocks
➔ 2004 - Hal Finley - Reusable Proof-of-work (RPoW) - Digital cash
➔ 2008 - Satoshi Nakamoto - Bitcoin
➔ 2014 - Vitalik Buterin - Ethereum 1.0
➔ 2022 - Vitalik Buterin - Ethereum 2.0

5
BLOCKCHAIN COMPONENTS

An open, public Blockchain is a combination of several components.

➔ Peer-to-peer network
➔ Public-key cryptography
➔ Distributed ledger
➔ Consensus protocol
➔ Smart contracts
➔ A one or more client softwares
➔ Wallets
➔ Node
6
PEER-TO-PEER NETWORK
➔ All the communications (transactions) occur directly between peers
without a central entity.
➔ Each peer stores and forwards information to all other peers.
➔ Advantages with P2P networks:
◆ Decentralization
◆ High Availability
◆ Immune to DoS attacks
◆ No censorship by central authorities
➔ E x a m p l e s : N a p s t e r, Bit t o r re n t , S k y p e

7
PUBLIC-KEY CRYPTOGRAPHY
➔ Every peer in the Blockchain network is associated with a public-private key
pair.
➔ The public key is used to identify a peer uniquely in the network. All the
assets are listed under the public key.
➔ But a corresponding private key is required to transfer the ownership of
the asset.

8
DISTRIBUTED LEDGER
➔ A distributed ledger can be described as a ledger of any transactions or
contracts maintained in a decentralized form across different locations and
peers.
➔ Every peer in the network has access to information stored at the
distributed ledger, and no single peer can control the data stored at the
ledger.

9
DISTRIBUTED LEDGER VS BLOCKCHAIN
➔ Distributed ledgers can be of many types and Blockchain is a specific
type of distributed ledger.
➔ A Blockchain distributed ledger is maintained as a set of blocks, such that
each block is cryptographically chained to its parent block (except first
block).

10
BLOCKCHAIN VS BLOCKCHAIN (LEDGER)
➔ In general, to differentiate between the distributed ledger in
Blockchain and the whole Blockchain technology, the following
terminology is used
➔ blockchain - represents distributed ledger in Blockchain
➔ Blockchain - Network + ledger + consensus

11
BLOCK
STRUCTURE

➔ A Block contains:
◆ Header
● Hash of the previous Block
● Merkle hash of the transactions
● Consensus information
◆ Body
● Contains transactions
➔ Bitcoin Block structure
◆ [Link]
➔ Ethereum Block structure
◆ [Link]

12
GENESIS BLOCK

Genesis Block is the name of the first block of Bitcoin ever mined. In
2009, a developer named Satoshi Nakamoto created the Genesis Block.

The Genesis Block forms the foundation of the Bitcoin trading system and
is the prototype of all other blocks in the Bitcoin blockchain.

Blockchains consist of many blocks linked to one another.


A block is a record. It is like a ledger page, while the whole ledger, i.e., the
entire record-keeping book, is the blockchain. Blocks hold files that store
unalterable data related to the network.

Regarding cryptocurrency transactions, for example, blocks hold all the records.
The blocks are hashed and encoded into a Merkle tree or hash tree. 13
CONT…

 Every block in a blockchain has the cryptographic hash of the preceding block.
 A block, plus all the blocks preceding and following it, form the blockchain.
 Each block replicates all the data contained in the previous block.
 Instead of having a central ledger with information of the whole system, each
block in the blockchain has all the data.
 In other words, the blockchain uses a distributed ledger system and
not a centralized one. A blockchain is a list of records that is expanding all the
time. It begins with the Genesis Block.

14
T h e gen esi s block o f Et h e re u m is as
follows: [Link]

15
CONSENSUS ALGORITHM
➔ If all the peers have their own copy of ledger, how do they all have the
same copy of the ledger?
➔ In Blockchain, a secure consensus algorithm is executed by a set of
decentralized peers known as miners to agree on a common global state of the
distributed ledger.
➔ Consensus algorithm also guarantees the security of the ledger.
Consensus algorithm example:
 P B F T ( Practical Byzantine Fault Tolerance (PBFT))
 P o W ( Proof-of-Work (PoW))
 P o S ( Proof-of-Stake (PoS))
 D P o S ( Delegated Proof-of-Stake (DPoS))
 P o A ( Proof-of-Activity (PoA))

16
SMART CONTRACTS
➔ A smart contract is a program deployed and stored in a Blockchain.
➔ A smart contract can hold many contractual clauses between
mutually distrusted parties.
➔ Similar to transactions, the smart contract is also executed by miners and, its
execution correctness is guaranteed by miners running the consensus protocol.
➔ Assuming that the underlying consensus algorithm of a Blockchain is secure, the
smart contract can be thought of as a program executed by a trusted global machine
that will faithfully execute every instruction.

23
WALLET
 A blockchain wallet is a cryptocurrency wallet that is used to
manage cryptocurrencies like Bitcoin and Ethereum.
 It helps to exchange funds easily and the transactions are more
secure as they are cryptographically signe.

24
HOW DO BLOCKCHAIN WALLETS WORK?
 First, let’s discuss what private and public keys are and how these keys are related
to a blockchain wallet.
 Whenever you create a blockchain wallet, you are provided a private key and a
public key that is associated with your wallet.
 Let’s use email as an example. If you want to receive an email from someone, you give him or
her your email address.
 But giving out your email address doesn’t mean someone will be able to send out emails via
your account. Someone would have to know your email account’s password to do that.
 Blockchain wallets follow a similar process using a public key and a private key
together. A public key is similar to your email address; you can give it to anyone.
 When your wallet is generated, a public key is generated, and you can
share the public key with anyone in order to receive funds.
 The private key is top secret. It’s similar to your password; it should not get hacked
and you should not disclose it to anyone.
 You use this private key to spend your funds. If someone gets access to your private
key, there is a high possibility that your account is compromised, and you might end
up losing all the cryptocurrency deposits in your account. 25
HOW DO BLOCKCHAIN WALLETS WORK?

26
BLOCKCHAIN WALLET FEATURES

 Easy to use. It’s just like any other software or a wallet that you
use for your day-to-day transactions.
 Highly secure. It is just a matter of securing your private key.

 Allows instant transactions across geographies. And these are


barrier-free, without intermediaries.
 Low transaction fees. The cost of transferring funds is much
lower than with traditional banks.
 Allows transactions across multiple cryptocurrencies. This helps
you do easy currency conversions.

27
TYPE OF WALLET
 There are two types of blockchain wallets based on private keys: hot wallets
and cold wallets.
 Hot wallets are like normal wallets that we carry for day-to-day transactions,
and these wallets are user-friendly.
 Cold wallets are similar to a vault; they store cryptocurrencies with a high level
of security.

28
TYPE OF WALLET CONT…..

 We can further break down wallets into three types:


 Software wallets ,Hardware wallets, which you plug into your
USB drive, and Typical paper-based wallets, for which you
print your public key and private key on a piece of paper and keep
it in a secure place.

29
SOFTWARE WALLETS
 A software wallet is an application that is downloaded on a device; it could be a desktop or
a mobile device, or it could be a web-based wallet that can be accessed online. Breadwallet,
Jaxx, and Copay are popular software wallets. We can further categorize software wallets
as desktop wallets, online wallets (web wallets), and mobile wallets.

30
CONT…

 Desktop Wallets: Desktop wallets are cold wallets in which the private keys are stored in
cold servers (in your desktop). You can unplug the wallet from the Internet, do some offline
transactions, and then bring it back online. In case the main server is lost, then a cold
server, basically your desktop, is used as a backup server.

 Online Wallets: These are other kinds of hot wallets that run on the Internet. Users have
the benefit of accessing these wallets across any device. It could be a tablet or a desktop, or
you can access it from your mobile browser. The private keys are stored online and are
managed by a third party. For example, Green Address is a Bitcoin wallet that is available
on the web, has an Android app, is available on a desktop, and also is available on iOS.

 Mobile Wallets: Mobile wallets are similar to online wallets except that they are built only
for mobile phone use and accessibility. These wallets have a user-friendly interface that
helps you do transactions easily. Mycelium is the best available mobile wallet.
31
HARDWARE WALLETS
 A hardware wallet is a type of cold storage device, typically like a USB,
that stores the user’s private key in a protected hardware device. These
wallets are similar to portable devices that can be connected to the
computer (plugged in).
 As noted earlier, they are less prone to malicious attacks and are hack-
proof. Ledger, Trezor, and KeepKey are the top hardware wallets on
the market.
 To make a transaction from your hardware wallet, you have to ensure
that the hardware wallet is plugged into your computer system.

32
PAPER WALLETS
 A paper wallet is an offline process for storing cryptocurrencies. This wallet is a
printed paper that has both your private key and public key, which are accessed
using a QR code. Since these wallets are safe, they are widely used for storing
large amounts of cryptocurrencies. Bitcoin Paper Wallet and MyEtherWallet are
two widely used paper wallets.
 A paper wallet works with your software wallet to transfer funds from your
software wallet to the public address shown on your paper wallet. First, you
park your funds in a software wallet, then you transfer the funds from your
software wallet to the public address printed on the paper wallet.

33
NODE
 Node is a electronic device (computer, mobile device, server etc.)
that is connected to the internet.
 All the nodes in the network have a copy the blockchain ledger
and are interconnected.
 Node supports the network by maintaining a copy of the
blockchain.
 A node can be :
 A full Node: Nodes maintain a full copy of transaction
history of blockchain.
 A Partial or Lightweight or Light Node: Nodes maintain
a partial copy of the ledger as they could be early users or
those who do not have sufficient space for the full blockchain.

34
ELEMENTS OF A BLOCKCHAIN

 Decentralization
 Immutability

 Transparency

 Persistency

 Public Auditability

 Privacy

 Programmability

35
FEATURES OF BLOCKCHAIN
 1. Increased Capacity
 This is the first and an important feature of Blockchain. The most remarkable thing about this Blockchain
technology is that it increases the capacity of the whole network. Because of the reason that there are a lot of
computers working together which in total offers a great power then few of the devices where the things are
centralized.
 A perfect example of this increased capacity is a project started by Stanford University which created a
supercomputer that simulates protein folding for medical research.
 2. Better Security
 Blockchain technology is considered more secure than its contemporaries because of lack of a single point of
failure. Blockchain operates on a well-distributed network of nodes, hence data at all times is circulated
through not one but multiple nodes, which makes sure that even if one node is hacked or faulty in any way the
integrity of the original data will not be compromised.
 3. Immutability
 Creating immutable ledgers is one of the main values of Blockchain. Any database that is centralised is
destined for hacks and frauds since it requires trust in some third party intermediary to keep the database
secure.
 Blockchain like Bitcoin keeps its ledgers in a never-ending state of forwarding momentum. Every node on the
system has a copy of the digital ledger. To add a transaction every node needs to check its validity. If the
majority thinks it’s valid, then it’s added to the ledger. This promotes transparency and makes it corruption-
proof. 36
CONT….

 Decentralized : it is refers to transferring control and decision making from


a central entity to distributed network.
 Decentralized blockchain networks uses transparency to reduce the need for
trust among participants. These networks also deter participants from exerting
authority or control one another in ways that degrade the functionality of the
network.
 Consensus: A blockchain system establishes rules about participant
consent for recording transactions.

37
HOW BLOCKCHAIN TECHNOLOGY WORKS
(Example : Joe sent 0.5 btc to ann through the block chain )

38
Figure: Public Key Cryptography
HOW BLOCKCHAIN TECHNOLOGY WORKS: STEP BY STEP
(EXAMPLE : JOE SENT 0.5 BTC TO ANN THROUGH THE BLOCK CHAIN )

39
HOW BLOCKCHAIN TECHNOLOGY WORKS: STEP BY STEP

40
HOW BLOCKCHAIN TECHNOLOGY WORKS: STEP BY STEP

41
HOW BLOCKCHAIN TECHNOLOGY WORKS
� One More example:

42
TYPES OF BLOCKCHAIN
 Public Blockchain
 Private Blockchain

 Hybrid Blockchain

 Consortium / Federated Blockchain

43
TYPES OF BLOCKCHAIN : PUBLIC BLOCKCHAIN
 It is a permissionless distributed ledger on which anybody can join
and conduct transactions.
 It is a non-restrictive form of the ledger in which each peer has a copy. This
also means that anyone with an internet connection can access the public Blockchain.
 This user has access to historical and contemporary records and the ability
to perform mining operations.
 These complex computations must be performed to verify transactions and
add them to the ledger.
 On the blockchain network, no valid record or transaction may be altered.
Because the source code is usually open, anybody can check the transactions,
uncover problems, and suggest fixes.

44
ADVANTAGES OF PUBLIC BLOCKCHAIN
 Trustable: Public Blockchain nodes do not need to know or trust each other
because the proof-of-work procedure ensures no fraudulent transactions.
 Secure: A public network can have as many participants or nodes as it wants,
making it a secure network. The higher the network's size, the more records are
distributed, and the more difficult it is for hackers to hack the entire network.
 Open and Transparent: The data on a public blockchain is transparent to all
member nodes. Every authorized node has a copy of the blockchain records or
digital ledger.

45
DISADVANTAGES OF PUBLIC BLOCKCHAIN
 Lower TPS: The number of transactions per second in a public blockchain is
extremely low. This is because it is a large network with many nodes which take
time to verify a transaction and do proof-of-work.
 Scalability Issues: Its transactions are processed and completed slowly. This
harms scalability. Because the more we try to expand the network's size, the
slower it will become.
 High Energy Consumption: The proof-of-work device is expensive and
requires lots of energy. Technology will undoubtedly need to develop energy-
efficient consensus methods.

USES OF PUBLIC BLOCKCHAIN


Voting: Governments can use a public blockchain to vote, ensuring openness and trust.

Fundraising: Businesses or initiatives can use the public Blockchain to improve transparency
and trust.
46
PRIVATE BLOCKCHAIN

 A blockchain network operates in a private context, such as a


restricted network, or is controlled by a single identity.
 While it has a similar peer-to-peer connection and decentralization
to a public blockchain network, this Blockchain is far smaller.
 They are often run on a small network within a firm or
organization rather than open to anybody who wants to contribute
processing power.
 Permissioned blockchains and business blockchains are two more
terms for them.

47
ADVANTAGES OF PRIVATE BLOCKCHAIN
 Speed: Private Blockchain transactions are faster. This is because a private
network has a smaller number of nodes, which shortens the time it takes to
verify a transaction.
 Scalability: You can tailor the size of your private Blockchain to meet your
specific requirements. This makes private blockchains particularly scalable since
they allow companies to easily raise or decrease their network size.

 DISADVANTAGES OF PRIVATE BLOCKCHAIN


 Trust Building: In a private network, there are fewer participants than in a
private network.
 Lower Security: A private blockchain network has fewer nodes or members,
so it is more vulnerable to a security compromise.
 Centralization: Private blockchains are limited in that they require a central
Identity and Access Management (IAM) system to function. This system
provides full administrative and monitoring capabilities 48
USES OF PRIVATE BLOCKCHAIN

 Supply Chain Management: A private blockchain can be used to


manage a company's supply chain.
 Asset Ownership: A private blockchain can be used to track and
verify assets.
 Internal Voting: Internal voting is also possible with a private
blockchain

49
HYBRID BLOCKCHAIN
 Organizations who expect the best of both worlds use a hybrid blockchain,
which combines the features of both private and public blockchains.
 It enables enterprises to construct a private, permission-based system
alongside a public, permissionless system, allowing them to choose who has
access to certain Blockchain data and what data is made public.
 In a hybrid blockchain, transactions and records are typically not made public,
but they can be validated if necessary by granting access via a smart contract.

50
ADVANTAGES OF HYBRID BLOCKCHAIN
 Secure: Hybrid Blockchain operates within a closed environment, preventing outside
hackers from launching a 51 percent attack on the network.
 Cost-Effective: It also safeguards privacy while allowing third-party contact.
Transactions are inexpensive and quick and scale better than a public blockchain
network.
 DISADVANTAGES OF HYBRID BLOCKCHAIN
 Lack of Transparency: Because information can be hidden, this type of blockchain isn't
completely transparent.
 Less Incentive: Upgrading can be difficult, and users have no incentive to participate in
or contribute to the network
 USES OF HYBRID BLOCKCHAIN
 Real Estate: Real-estate companies can use hybrid networks to run their systems and
offer information to the public.
 Retail: The hybrid network can also help retailers streamline their processes.
 Highly Regulated Markets: Hybrid blockchains are also well-suited to highly regulated 51
areas like the banking sector.
CONSORTIUM BLOCKCHAIN
 In the same way that a hybrid blockchain has both
private and public blockchain features, a
Consortium blockchain, also known as a federated
blockchain, does.
 However, it differs because it involves various
organizational members working together on a
decentralized network.
 Predetermined nodes control the consensus
methods in a consortium blockchain.
 It has a validator node responsible for initiating,
receiving, and validating transactions.
Transactions can be initiated or received by
member nodes.

52
 ADVANTAGES OF CONSORTIUM BLOCKCHAIN -
 Secure: A consortium blockchain is more secure, scalable, and efficient than a
public blockchain network.
 It, like private and mixed blockchains, has access controls.

 DISADVANTAGES OF CONSORTIUM BLOCKCHAIN


 Lack of Transparency: The consortium blockchain has a lower degree of
transparency. If a member node is infiltrated, it can still be hacked, and the
Blockchain's rules can render the network inoperable.

 USES OF CONSORTIUM BLOCKCHAIN


 Banking and Payments: A consortium can be formed by a group of banks
working together. They have control over which nodes will validate
transactions.
 Research: A consortium blockchain can be employed to share research data
and outcomes.
 Food Tracking: It is also apt for food tracking.
53
54
WHAT IS DLT
� “Distributed ledger technology (DLT) is defined as decentralized database that
can securely record and share financial , physical or electrical access across a
geographical network through transparent update of information ” ----book

� Distributed ledger technology (DLT) is a digital system for recording the transaction of
assets in which the transactions and their details are recorded in multiple places at the
same time. (Unlike traditional databases, distributed ledgers have no central data store or administration
functionality.)
� In a distributed ledger, each node processes and verifies every item, thereby generating a
record of each item and creating a consensus on its veracity.
� Distributed ledger technology (DLT) refers specifically to the technological infrastructure
and protocols that allow the simultaneous access, validation and updating of
records that characterizes distributed ledgers. It works on a computer network spread
over multiple entities or locations.
� DLT uses cryptography to securely store data, cryptographic signatures and keys to
allow access only to authorized users.
� The technology also creates an immutable database, which means information, once 55
stored, cannot be deleted and any updates are permanently recorded for posterity.
56
DLT FEATURES
� Decentralized: It is a decentralized technology and every node will maintain the ledger, and if any
data changes happen, the ledger will get updated. The process of updating takes place independently
at each node. Even small updates or changes made to the ledger are reflected and the history
of that change is sent to all participants in a matter of seconds.
� Immutable: Distributed ledger uses cryptography to create a secure database in which data
once stored cannot be altered or changed.
� Append only: Distributed ledgers are append-only in comparison to the traditional database where
data can be altered.
� Distributed: In this technology, there is no central server or authority managing the database, which
makes the technology transparent. To counter the weaknesses of having one ledger to rule all, So that
there is no one authoritative copy and have specific rules around changing them. This would make the
system much more transparent and will make it a more decentralized authority. In this process,
every node or contributor of the ledger will try to verify the transactions with the various consensus
algorithms or voting. the voting or participation of all the nodes depends on the rules of that ledger.
In the case of bitcoin, the Proof of Work consensus mechanism is used for the participation
of each node.
� Shared: The distributed ledger is not associated with any single entity. It is shared among the
nodes on the network where some nodes have a full copy of the ledger while some nodes have57
only the necessary information that is required to make them functional and efficient.
BENEFITS OF DLT
� Transparent and Secure: Data is shared and visible to all nodes, it not easy to
make unauthorized changes. Every node that participate in the network maintain a
copy of ledger, thereby preventing a single point of failure . Any entry has to be agreed
upon by all parties making a distributed ledger secure and tamper proof.
� Efficient : with trustless and distributed nature of blockchain's DLT, the efforts of
capturing, validating , and synchronizing individual sets of information by mediators
can be eliminated, thereby reducing the chances of human error and improvement of
operational efficiency.
� Cost Saving : Dis-intermediated system can save on additional/bottom-line costs
while realizing near-time transaction and efficiency.

58
� How DLT Can Replace Traditional Book-Keeping Methods?
� Distributed ledger technology has the potential to effectively improve these traditional methods
of bookkeeping by updating and modifying fundamental methods of how data is collected,
shared, and managed in the ledger. To understand this, traditionally paper-based and
conventional electronic ledgers were used to manage data that had a centralized point of
control. This types of the system require high computing resource and labor to maintain ledgers
and also had many points of failure. Points of failure like:
⚫ Mistakes made during data entry.
⚫ Manipulation of data could happen which increases the risk of errors.
⚫ Other participants contributing data to the central ledger will not able to verify the legitimacy of data
coming from other sources.
� However, DLT allows real-time sharing of data with transparency which gives trust that data in
the ledger is up to date and legitimate. Also Distributed Ledger Technology eliminates the
single point of failure which prevents data in the ledger from being manipulations and errors. In
DLT, there is no need for a central authority to validate transactions here different consensus
mechanisms are used to validate transactions which eventually makes this process very fast and
real-time. Similarly, DLT can reduce the cost of transactions because of this process
59
TYPES OF DISTRIBUTED LEDGER TECHNOLOGY

The Distributed Ledgers can be categorized into three main categories:


 Permissioned DLT: Nodes have to take permission from a central authority to access or make any
changes in the network. Mostly these types of permissions include identity verification.
 Permissionless DLT: There is no central authority to validate transactions, rather existing nodes
are collectively responsible for validating the transactions. Various consensus mechanisms are used
to validate transactions based on predefined algorithms. In the case of bitcoin proof of work
consensus mechanism is used.
 Hybrid DLT: It is combined with both permissionless and permissioned DLTs and can benefit from
both of them

60
TYPES OF DISTRIBUTED LEDGER TECHNOLOGY

Below are some additional types of DLT:


� Blockchain: In this type of DLT, transactions are stored in the form chain of blocks and each block produces a unique
hash that can be used as proof of valid transactions. Each node has a copy of the ledger which makes it more
transparent.
� Directed Acyclic Graphs (DAG): This uses a different data structure to organize the data that brings more consensus.
In this type of DLT, validation of transactions mostly requires the majority of support from the nodes in the network.
Every node on the network has to provide proof of transactions on the ledger and then can initiate transactions. In this
nodes have to verify at least two of the previous transactions on the ledger to confirm their transaction.
� Hashgraph: In this type of DLT, records are stored in the form of a directed acyclic graph. It uses a different
consensus mechanism, using virtual voting as the form consensus mechanism for gaining network consensus. Hence
nodes do not have to validate each transaction on the network.
� Holochain: Holochain is termed as the next level of blockchain by some people because it is much more decentralized
than blockchain. It is a type of DLT that simply proposes that each node will run on a chain of its own. Therefore
nodes or miners have the freedom to operate autonomously. It basically moves to the agent-centric structure. Here
agent means computer, node, miner, etc.
� Tempo or Radix: Tempo uses the method of making a partition of the ledger this is termed sharding and then all the
events that happened in the network are ordered properly. Basically, transactions are added to the ledger on basis of
the order of events than the timestamp. 61
TYPES OF DISTRIBUTED LEDGER TECHNOLOGY

62
ADVANTAGES OF DISTRIBUTED LEDGER TECHNOLOGY

� High Transparency: Distributed ledger presents a high level of transparency because all the transaction records
are visible to everyone. The addition of data needs to be validated by nodes by using various consensus
mechanisms. and if anyone tries to alter or change data in the ledger then it is immediately reflected across all
nodes of the network which prevents invalid transactions.
� Decentralized: In a centralized network, there may be a single point of failure and it can disrupt the whole
network because of mistakes at the central authority level. But in the case of distributed networks, there is no risk
of a single point of failure. because of the decentralized structure trust factor also increases in participating nodes.
This decentralized nature of validation reduces the cost of transactions drastically.
� Time Efficient: As this network is decentralized so there is no need for a central authority to validate transactions
every time. Hence this time for validation of each transaction reduces drastically. In the case of DLT, transactions
can be validated by members of the network itself by using various consensus mechanisms.
� Scalable: Distributed ledger technology is more scalable because many different types of consensus mechanisms
can be used to make it more reliant, fast, and updated. Because these many advanced DLT technologies are
introduced in the last few years. Such as Holochain, hashgraph are considered to be advanced and more secure
versions of Blockchain DLT. Blockchain itself is advanced and secure but DLT provides a way to more advanced
technologies.
63
DISADVANTAGES OF DISTRIBUTED LEDGER TECHNOLOGY

� 51% Attack: The 51% attack is a bit concerning part of this distributed ledger technology that is to be checked
routinely.
� Costs of Transaction: The connected nodes are expected to validate the transaction of a given Distributed Ledger
Technology which gives high transaction cost as the other nodes are paid incentives to validate the transaction.
� Slow Transaction Speed: The major disadvantage of this DLT is the slow speed of transactions as multiple nodes
are attached to this network and it takes time to validate the transaction by all the other nodes.
� Scalability Issues: Due to low speed and high transaction costs DLT faces very difficulties to expand on a large
scale.

64
EXAMPLES OF A 51% ATTACK

� A 51% attack is an attack on a cryptocurrency blockchain by a group of miners


who control more than 50% of the network's mining hash rate. Owning 51% of the
nodes on the network gives the controlling parties the power to alter the blockchain.
� 51% attacks are not just a theoretical concern. There have been a few notable examples of
51% attacks in the past, including:
⚫ A 2018 attack on Bitcoin Gold (BTG) resulted in over $18 million worth of the currency being double spent.
⚫ Multiple attacks on Vertcoin (VTC) in 2018 resulted in doubling spending of more than $100,000 worth of
VTC.
⚫ A 2019 attack on Ethereum Classic (ETC) resulted in over $1 million of the currency double spent.
Additionally, the crypto faced three attacks in 2020.
⚫ A 2020 attack on Grin (GRIN), though the blockchain was able to regain control.
⚫ Three attacks on Bitcoin SV (BSV) occurred in 2021, damaging its reputation.

� Most 51% attacks occur on smaller cryptocurrencies. Experts say it’s unlikely that major
cryptocurrencies will face a successful 51% attack because it is prohibitively expensive to
take control of more than half of mining power. 65
USES OF DISTRIBUTED LEDGER TECHNOLOGY

� Because of all these benefits from distributed ledger technology and this
technology has the potential to revolutionize many sectors like Financial,
energy, healthcare, governance, supply chain management, real
estate, cloud computing, etc.

66
BLOCKCHAIN AND DISTRIBUTED LEDGER DIFFERENT

Basis Distributed Ledger Blockchain Technology


In Blockchain, blocks are added in the form of a
Block Structure In DLT, blocks can be organized in different forms.
chain.

It is more scalable because it does not need the It is a subset of DLT, the power of the work
Power of Work power of a work consensus mechanism for the consensus mechanism adds more functionalities and
validation of each transaction. security.

In it, tokens must be considered while working with


Tokens It does not require any tokens or digital currency.
Blockchain.

Sequence It does not require any specific sequence of data. All blocks are arranged in a particular series.

Trust among participating nodes is less than DLT.


Trustability
Trust among participating nodes is high. Decision-making powers can be on one hand
because everyone can mine.

67
� Advantages of Using Distributed Ledger Technology In Blockchain

� Security: All records of every transaction are securely encrypted. Once the transaction is validated, it is completely secure and
no one can update or change it. It is a permanent process.
� Decentralization: All network members or nodes have a copy of the ledger for complete transparency. A decentralized private
distributed network improves the reliability of the system and gives assurance of continuous operations without any
interruption. It gives control of information and data in the hand of the user.
� Anonymity: The identity of each participant is anonymous and does not possibly reveal their identity.
� Immutable: Any validated transactions can not be changed as they are irreversible.
� Transparency: Distributed technologies offer a high level of transparency. Which is necessary for the sectors like finance,
medical science, banking, etc.
� Speed: Distributed Ledger Technology can handle large transactions faster than traditional methods.

68
CAP THEOREM

� C: Consistency — At any given time, all nodes in the


network have exactly the same (most recent) value.
� A: Availability — Every request to the network receives
a response, though without any guarantee that returned
data is the most recent.
� P: Partition tolerance — The network continues to
operate, even if an arbitrary number of nodes are failing.
It describes the ability of cluster to function even in the
face of numerous communication failures between
system node.
� CAP theorem stand for consistency, availability,
partition tolerance. According to theorem, a distributed
system cannot always ensure consistency, availability,
and partition tolerance.
� When things go wrong, one must prioritize at most two
distributed system features and trade-offs between them.
69
CAP THEOREM CONT….
� It can be observed from the diagram that Consistency and
Availability are connected by a database CA, Availability and
Partition Tolerance by a database AP, and Consistency and Partition
Tolerance by a database CP. Let us discuss what CA, AP, and CP
mean..
� CA: CA database provides availability and consistency among all the
nodes. However, it cannot accomplish this if there is a partition
between any two system nodes, hence it is unable to provide fault
tolerance.
� For eg: Applications used in banking and finance demand available and
consistent data.
� AP: AP database means that the system continues to operate even in
the presence of node failures. AP-based systems compromise
consistency and availability.
� Non- distributed databases like PostgreSQL uses AP-based database systems.
� CP: CP database means that the system continues to operate
even though network failures are occurring in the database. CP
systems are strongly consistent but they are not properly available.
70
� Due to the nature of distributed data stores (such as blockchain), Partition
tolerance is a given fact; there will always be failing/unreachable nodes in
the network (not least because of the unstable nature of the internet).
� CAP Theorem states that one has to choose between C (Consistency) or A
(Availability) when in the presence of P (Partition):

⚫ Availability over Consistency (A + P)


⚫ Consistency over Availability (C + P)

71
AVAILABILITY OVER CONSISTENCY (A + P)
� Every request to the network receives a response,
even if the network cannot guarantee it is up to date
due to network partitioning (failing nodes).
� Choosing Availability over Consistency for a world-
wide distributed system will make it highly available,
but its data will be out of date for 99.99% of the time.
� Furthermore, no-one will be able to guarantee that the
data returned is in fact the most recent.
� The best example is Facebook, as it’s much more
important to get into the network, than to see the latest
updates of a particular person.

72
CONSISTENCY OVER AVAILABILITY (C + P)

� The system will return an error or a time-out


if particular information cannot be guaranteed
to be up to date due to network partitioning
(failing nodes).
� Choosing Consistency over Availability for a
world-wide distributed system will make it
highly accurate, but it will most likely be
unavailable for 99.99% of the time.

74
CAP THEOREM EXAMPLES
� Example 1: A mobile phone has been designed in such a way that it has space for only
one sim card which means no sharing.
Solution: This system guarantees Consistency, Availability, and Tolerance to Partitions.

� Example 2: Immediately after sending a message to someone, that individual might not
get it.
Solution: With this system, availability and partition tolerance are compromised
without compromising consistency, or AP.

� Example 3: When we build a form for a group of individuals, the others can only access it
once we provide them permission to do so.
Solution: CP, or Consistency and Partition Tolerance without Compromising Availability,
is ensured by this system.

76
WHY DOES BLOCKCHAIN VIOLATE CAP THEOREM?

� Blockchain obviously violates the CAP theorem. As discussed both


partition tolerance and availability are “income-producing” characteristics.
� If the blockchain system is unavailable, businesses that use it will begin to
lose money. In other words, it’s critical to record new transactions on a
node in the blockchain system whenever they are submitted, such as when
money is transferred from one business to another.
� In the absence of blockchain, the new transaction is lost. This is the reason
why Blockchain violates the CAP theorem.

77
BYZANTINE GENERALS PROBLEM

� “several divisions of the


Byzantine army are camped
outside an enemy city, each
division commanded by its
own general. The generals can
communicate with one
another only by messenger.
After observing the enemy,
they must decide upon a
common plan of action.”

[Link] 78
ATTACK!
Byzantine generals problem
● Generals should reach ATTACK!
a consensus on the plan
● It could be ATTACK

ATTACK!
ATTACK!
RETREAT!
Byzantine generals problem
● Generals should reach RETREAT!
a consensus on the plan
● Or RETREAT

RETREAT!
RETREAT!
ATTACK!
Byzantine generals problem
● But there might be ATTACK!
traitors
● All loyal generals should
reach a consensus

ATTACK!
ATTACK!
ATTACK!
Byzantine generals problem
● But traitors can act ATTACK!
randomly
● All loyal generals
should reach a
consensus

Let’s RETREAT!

ATTACK!
ATTACK!
Opps!
Byzantine generals problem
● But traitors can act Opps!
randomly
● All loyal generals
should reach a
consensus

Haha!
???
Byzantine generals problem
● A simplified version

“A commanding general sends an


order to his n-1 lieutenant generals
such that

IC1. All loyal lieutenants obey the


same order.

IC2. If the commanding general is


loyal, then every loyal lieutenant
obeys the order he sends.”
What is the byzantine generals problem
● IC1. All loyal lieutenants obey the same order
● IC2. If the commanding general is loyal, then every loyal
lieutenant obeys the order he sends.
What is the byzantine generals problem
● Consistency/Agreement
● IC2. If the commanding general is loyal, then every loyal
lieutenant obeys the order he sends.
What is the byzantine generals problem
● Consistency/Agreement
● Validity
What is the byzantine generals problem
● Consistency/Agreement
● IC2. If the commanding general is loyal, then every loyal
lieutenant obeys the order he sends.
What is the byzantine generals problem
● Consistency/Agreement
● Validity
● Liveness/Termination?
Impossibility Result
Impossibility result
“if the generals can send only oral messages, then no solution will work unless
more than ⅔ of the generals are loyal.”
Impossibility result
“if the generals can send only oral messages, then no solution will work unless
more than ⅔ of the generals are loyal.”

what are oral messages?


Impossibility result
oral messages:

● every message that is sent is delivered correctly


● the receiver of a message knows who sent it
● the absence of a message can be detected
Impossibility result
oral messages:

● every message that is sent is delivered correctly


● the receiver of a message knows who sent it
● the absence of a message can be detected
Impossibility result
oral messages:

● every message that is sent is delivered correctly


● authenticated channel
● the absence of a message can be detected
Impossibility result
oral messages:

● every message that is sent is delivered correctly


● authenticated channel
● the absence of a message can be detected
Impossibility result
oral messages:

● every message that is sent is delivered correctly


● authenticated channel
● synchronous network
Impossibility result
“if the generals can send only oral messages, then no solution will work unless
more than ⅔ of the generals are loyal.”

in a synchronous network, with authenticated channel, when m generals are


traitors, no solution will work unless there are more than 3m generals
impossibility result - proof
● case m = 1:
impossibility result - proof
● case m = 1:
○ scenario 1:
■ the commander is loyal
■ one lieutenant is a traitor
impossibility result - proof
● case m = 1:
○ scenario 1:
■ the commander is loyal
■ one lieutenant is a traitor
■ the left lieutenant should ATTACK!
ATTACK!
ATTACK

the commander said “RETREAT!”


impossibility result - proof
● case m = 1:
○ scenario 2:
■ the commander is a traitor

RETREAT!
ATTACK!

the commander said “RETREAT!”

the commander said “ATTACK!”


Three scenarios

RETREAT! RETREAT!
ATTACK!
ATTACK! ATTACK! RETREAT!

the commander said “RETREAT!” the commander said “ATTACK!”


the commander said “RETREAT!”

the commander said “ATTACK!”

I should ATTACK! I should RETREAT!


impossibility result
prove m > 1 by contradiction

● assume we have a solution protocol f for 3m generals when m > 1


● we can solve m = 1 case by leveraging f
impossibility result
prove m > 1 by contradiction

● assume the three generals are x, y, z, and x is the commander;


● according to protocol f
○ x simulates one commander and m-1 lieutenants
○ each of y and z simulates m lieutenants
impossibility result
prove m > 1 by contradiction

● assume the three generals are x, y, z, and x is the commander;


● according to protocol f
○ x simulates one commander and m-1 lieutenants
○ each of y and z simulates m lieutenants
● at most one of x, y, z is a traitor
○ at most m simulated traitors
○ protocol f can solve the case when there are at most m traitors
impossibility result
prove m > 1 by contradiction

● if we can solve case m > 1 then we can solve m = 1


● we proved case m = 1 cannot be solved
● contradiction!
Oral messages’ fault
● With only oral messages, traitors can lie by telling the wrong command they
received
Three scenarios

RETREAT! RETREAT!
ATTACK!
ATTACK! ATTACK! RETREAT!

the commander said “RETREAT!” the commander said “ATTACK!”


the commander said “RETREAT!”

the commander said “ATTACK!”

I should ATTACK! I should RETREAT!


Signed message
● With only oral messages, traitors can lie by telling the wrong command they
received
● Signed messages
○ cannot be forged
○ anyone can verify the authenticity
Solutions:
oral messages and signed messages
Solutions - with oral messages
● OM(k)
○ k == 0
■ commander sends the value to every one
■ everyone return the value they received
Solutions - with oral messages
● OM(k)
○ k == 0
■ commander sends the value to every one
■ everyone return the value they received
○ k>0
■ commander sends the value to every one
■ everyone start a smaller bgp OM(k-1) containing all ones but the current commander
and become the new commander
■ everyone participated n-1 OM(k-1) and get n-1 values, return the majority
OM(1)

ATTACK!
ATTACK!
ATTACK!
OM(1) - 3*OM(0)

ATTACK!
ATTACK!
ATTACK!

ATTACK!

ATTACK! RETREAT!

RETREAT!

ATTACK!
Solutions - with oral messages
● OM(k)
○ k == 0
■ commander sends the value to every one
■ everyone return the value they received
○ k>0
■ commander sends the value to every one
■ everyone start a smaller bgp OM(k-1) containing all ones but the current commander
and become the new commander
■ everyone participated n-1 OM(k-1) and get n-1 values, return the majority
● Intuition: for every message M received, solve a smaller bgp containing all but
the current commander to tell others you received M
Solutions - with oral messages
● OM(k)
○ k == 0
■ commander sends the value to every one
■ everyone return the value they received
○ k>0
■ commander sends the value to every one
■ everyone start a smaller bgp OM(k-1) containing all ones but the current commander
and become the new commander
■ everyone participated n-1 OM(k-1) and get n-1 values, return the majority
● Intuition: for every message M received, solve a smaller bgp containing all but
the current commander to tell others you received M
● OM(m) for m traitors when 3m < n
Solutions - with oral messages
● OM(k) - Message complexity: (n-1)*MC(OM(k-1)) + n-1 = O(n^m)
○ k == 0
■ commander sends the value to every one
■ everyone return the value they received
○ k>0
■ commander sends the value to every one
■ everyone start a smaller bgp OM(k-1) containing all ones but the current commander
and become the new commander
■ everyone participated n-1 OM(k-1) and get n-1 values, return the majority
● Intuition: for every message M received, solve a smaller bgp containing all but
the current commander to tell others you received M
● OM(m) for m traitors when 3m < n
Solutions - with signed messages
● SM(k)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
Solutions - with signed messages
● SM(k)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
○ for every lieutenant
■ every time it receive a new value v
■ put it in V(i)
■ if v is associated with less than m lieutenants’ signatures, sign it and send to everyone
Solutions - with signed messages
● SM(k)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
○ for every lieutenant
■ every time it receive a new value v
■ put it in V(i)
■ if v is associated with less than m lieutenants’ signatures, sign it and send to everyone
○ when there will be no more messages, return choice(V(i))
○ choice(V)
■ return v then V = {v}
■ return RETREAT when |V| = 0
SM(1)
0

RETREAT!:0
ATTACK!:
0

2
1
SM(1)
0

RETREAT!:0
ATTACK!:
0

RETREAT!:0:2

ATTACK!:0:1
2
1
SM(1)
0

RETREAT!:0
ATTACK!:
0

RETREAT!:0:2

ATTACK!:0:1
2
1
V(1) = V(2)
SM(1)
0

RETREAT!:0
ATTACK!:
0

RETREAT!:0:2

ATTACK!:0:1
2
1
Choice(V(1)) = Choice(V(2))
Solutions - with signed messages
● SM(k)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
○ for every lieutenant
■ every time it receive a new value v
■ put it in V(i)
■ if v is associated with less than k lieutenants’ signatures, sign it and send to everyone
○ when there will be no more messages, return choice(V(i))
○ choice(V)
■ return v then V = {v}
■ return RETREAT when |V| = 0
● intuition: ensure every message received by a loyal lieutenant is sent to every
loyal lieutenant
Solutions - with signed messages
● SM(k)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
○ for every lieutenant
■ every time it receive a new value v
■ put it in V(i)
■ if v is associated with less than k lieutenants’ signatures, sign it and send to everyone
○ when there will be no more messages, return choice(V(i))
○ choice(V)
■ return v then V = {v}
■ return RETREAT when |V| = 0
● intuition: ensure every message received by a loyal lieutenant is sent to every
loyal lieutenant
● SM(m+1) for m traitors
Solutions - with signed messages
● SM(k) - message complexity: O(n^2)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
○ for every lieutenant
■ every time it receive a new value v
■ put it in V(i)
■ if v is associated with less than k lieutenants’ signatures, sign it and send to everyone
○ when there will be no more messages, return choice(V(i))
○ choice(V)
■ return v then V = {v}
■ return RETREAT when |V| = 0
● intuition: ensure every message received by a loyal lieutenant is sent to every
loyal lieutenant
● SM(m+1) for m traitors
Solutions - with signed messages
● SM(k) - message complexity: O(n^2)
○ every lieutenant maintains a value set V(i)
○ the commander sends the value to every lieutenant with its signature
○ for every lieutenant
■ every time it receive a new value v
■ put it in V(i)
■ if v is associated with less than k lieutenants’ signatures, sign it and send to everyone
○ when there will be no more messages, return choice(V(i))
○ choice(V)
■ return v then V = {v}
■ return RETREAT when |V| = 0
● intuition: ensure every message received by a loyal lieutenant is sent to every
loyal lieutenant
● SM(m+1) for m traitors
Minimum number required for which an f-resilie
consensus protocol exists
synchrony asynchrony partial synchrony

fail-stop f+1 inf 2f+1

crash f+1 inf 2f+1 (Paxos)


byzantine with digital f+1 (SM(f+1)) inf
signature

byzantine with 3f+1 (OM(f)) inf


authenticated channel
Minimum number required for which an f-resilie
consensus protocol exists
synchrony asynchrony partial synchrony

fail-stop f+1 inf 2f+1

crash f+1 inf 2f+1 (Paxos)


byzantine with digital f+1 (SM(f+1)) inf ???
signature

byzantine with 3f+1 (OM(f)) inf


authenticated channel
Byzantine with digital signature in partial synchrony
● No partial synchronous protocols can tolerate ⅓ faults.
● Sound familiar?
● Assume there exist a protocol that can solve it.
Byzantine with digital signature in partial synchrony

RETREAT! RETREAT!
ATTACK!
ATTACK! ATTACK! RETREAT!

the commander said “RETREAT!” It takes less than T_r to reach a consensus
It takes less than T_l to reach a consensus

the commander said “ATTACK!”

I should ATTACK! I should RETREAT!


It takes more than max(T_l, T_r) for messaged to be delivered
Practical Byzantine Fault Tolerance
● Commander sends the value to every lieutenant
● Every lieutenant
○ if it receives a new value v, broadcast (prepare, v)
○ if it receives 2f+1 (prepare, v), broadcast (commit, v)
○ if it receives 2f+1 (commit, v), broadcast (committed, v)
○ if it receivers f+1 (committed, v), broadcast (committed, v)
Practical Byzantine Fault Tolerance
● Commander sends the value to every lieutenant
● Every lieutenant
○ if it receives a new value v, broadcast (prepare, v)
○ if it receives 2f+1 (prepare, v), broadcast (commit, v)
○ if it receives 2f+1 (commit, v), broadcast (committed, v)
○ if it receivers f+1 (committed, v), broadcast (committed, v)
● Ensure agreement
● Ensure liveness under an loyal commander
Practical Byzantine Fault Tolerance
● Commander sends the value to every lieutenant
● Every lieutenant
○ if it receives a new value v, broadcast (prepare, v)
○ if it receives 2f+1 (prepare, v), broadcast (commit, v)
○ if it receives 2f+1 (commit, v), broadcast (committed, v)
○ if it receivers f+1 (committed, v), broadcast (committed, v)
● Ensure agreement
● Ensure liveness under an loyal commander
● What if the commander is faulty?
○ we need view change
Minimum number required for which an f-resilie
consensus protocol exists
synchrony asynchrony partial synchrony

fail-stop f+1 inf 2f+1

crash f+1 inf 2f+1 (Paxos)


byzantine with digital f+1 (SM(f+1)) inf 3f+1(PBFT)
signature

byzantine with 3f+1 (OM(f)) inf


authenticated channel
Thoughts
● Defined Byzantine generals problem
● Proved lower bound in synchronous environment with authenticated channel
● Introduced solutions in synchronous environment with authenticated channel
and with digital signature
● But today we usually discuss about the case when in partial
synchronous/asynchronous environment with digital signature where PBFT
works
Timeline

The Byzantine Generals Practical Byzantine ??


Problem Fault Tolerance ?
OM() sync/authenticated channel ??
PBFT: partial sync/ ?
digital signature/ state
SM() sync/digital signature machine replication

1990 2008

1982 1998 ???


The part-time Bitcoin: A peer-to-peer ?
parliament electronic cash system
Paxos:
async/non-byzantine(crash-failure) Blockchain: partial sync/
proof of work/ state
machine replication
BYZANTINE GENERALS PROBLEM
RELATION OF BLOCKCHAIN AND BYZANTINE GENERALS PROBLEM-SOLUTION

� There is no commander in the network of blockchain. Each node is


promoted at the rank of lieutenant and is place in the same
hierarchy.
� Each communication sent between the node must be approved by
all participating nodes.
� Even if a group of nodes is compromised or if the message they send
is compromised, the network as whole should not be harmed and
should be able to fend off this “attack”.
� In other word , every communication sent over the network must be
approved by the entire system.
140
CONSENSUS MECHANISM AND ITS TYPES
� What is Consensus?
� Consensus means achieving a state of a decision on which all network
participants agree.
⚫ For example, a group of friends decides on a trip to Goa without conflicts. Here, reaching a
decision to visit Goa together is a state of consensus or mutual agreement.
� What is Consensus Mechanism?
� A consensus algorithm is a way to keep network members synchronized under
democracy. With decentralization, each network member has equal power to make
decisions in the system. Hence, rules need to be established for network members
(or nodes) to implement new changes to the system with a global agreement.
� “The purpose of the Consensus mechanism in a decentralized network is
to allow a group of independent nodes to distribute the right to update
as well as validate the change in the network equally. Therefore, decide
on the next update of a decentralized network.”
141
CONSENSUS MECHANISM

� How Does Consensus Work?


� There is a number of consensus mechanisms to operate on a decentralized
network.
� Each algorithm has its own way of reaching a global agreement on
a network update.
� Generally, consensus protocols form at least 51% of participants in the
network to agree on the upcoming change.
� If they agree, the network system gets updated with the new change. Else,
it rejects the change by mutual agreement.

142
CONSENSUS MECHANISM AND ITS TYPES

143
PROOF OF WORK (POW)

� PoW is a popular consensus algorithm used by Bitcoin and Ethereum


networks. Here, miners (or block adders) have to do heavy mathematical
computations to find a right hash by changing the nonce of the block.
The miner who finds the hash below the difficulty level gets the chance
to add his block to the network. Hence, takes the reward.
� It’s a puzzle-friendly way to reach consensus by using high
computational power. Afterward, already present network participants
valid transactions in the block added by the miner.

� Blockchains using PoW algorithm:


⚫ Bitcoin, Ethereum, Dogecoin, Litecoin,

Zcash, Horizon, and many more.


144
PROOF OF STAKE (POS)

� PoS consensus eliminates the high energy consumption by PoW. PoS


uses a staking mechanism in which miners (or validators) hold
some of their earned coins in the network to get selected for adding a
block.
� It’s not an initial consensus algorithm for a network. It can only be
implemented after a network gets a good amount of participants (or
nodes).
� Blockchains using PoS algorithm:
⚫ Polkadot, EOSIO, Cardano, Ethereum 2.0,
and many more.

145
DELEGATED PROOF OF STAKE (DPOS)

� DPoS improves the PoS mechanism by introducing voting for delegates.


Here, network participants vote for the trusted delegates (or
miners) using their coins. Then, based on a random selection, one voted
delegate gets the chance to add its block.
� Blockchains using the DPoS algorithm:
EOS, Lisk, Ark y Tron

146
PROOF OF IMPORTANCE (POI)

� PoI uses importance scores to select the one block harvester


out of all participants. It aims to eliminate favors toward rich
stakeholders in PoS consensus. The importance score depends on
your quality transactions and reputation in the network.
� Blockchain using PoI algorithm:
⚫ New Economy Movement (NEM)

147
PROOF OF CAPACITY (POC)

� PoC uses the disk or storage capacity for mining a block in a


decentralized network. It exchanges the computation factor with disk
space. The PoC motivates miners to collect a list of all the possible nonce
and block hashes before the actual mining.
� At the time, the miner just uploads the calculated files of possible hashes to
the network. PoC reduces the time taken to add and validate the block of
transactions.
� Blockchains using PoC algorithm:
⚫ Burstcoin, Storj, Chia, and SpaceMint.

148
PROOF OF ELAPSED TIME (POET)

� PoET mechanism uses time-lottery-based concepts. It distributes


random waiting times to each miner. For that waiting time the miner
node sleeps, the first woken up node (or short waiting time node) gets the
chance to add its block to the network.
� Afterward, the block verification takes place by network validators, and a
new block gets added.
� Blockchain using PoET algorithm:
⚫ Hyperledger Sawtooth

149
PROOF OF ACTIVITY (POA)

� Proof of Activity (PoA) combines PoW and PoS mechanisms. First, the
miners must do the heavy computation to add an empty block with header
information and reward address.
� Afterward, one empty block gets chosen based on the number of coins they
hold in their respective accounts. Then, the miner of that empty block gets
the chance to add its transactions to the block. Moreover, the transactions
are verified by network validators.

150
PROOF OF AUTHORITY (POA)

� Proof of Authority (PoA) consensus utilizes by private or permissioned


blockchain networks. PoA highly depends on the reputation of the
miner or the network participant who wishes to add a new block of
transactions. Here, miners stake their reputation instead of coins.
� Blockchain using PoA algorithm: VeChain

151
PROOF OF BURN (POB)

� PoB allows miners to add their block by sending some of their coins
to an unspendable account. This process of sending your earned
coins to an escrow account is called burning the coins.
� PoB eliminated the burnt coins permanently from regular transactions.
Hence, they become unspendable even by its owner.
� The more coins a miner burns, the higher his chances of adding his new
block of transactions to the network. Burning coins brings virtual
mining rights to the miner.
� Blockchain using PoB algorithm: Slimcoin

152
BYZANTINE FAULT TOLERANCE (BFT)
� BFT aims to resolve Byzantine Generals’ decisional puzzle. It’s
based on the communication problem generals of different armies might
have to decide to attack or retreat at the same time.
� BFT mechanism regulates the communication between nodes
using hashes, digital signatures, and metadata. It embraces the
synchronization among nodes of a decentralized network.
� Blockchains using BFT algorithm: Hyperledger Fabric and Zilliqa

153
PROS CONS

– Establishing global agreement in a


– Few of the mechanisms consume high power and
distributed network.
energy, leading to environmental hazards.
– Create protection and security against
– Some of the mechanisms are susceptible to 51% attacks
intruder attacks.
and Sybil attacks.
– Mechanisms are available for both
– The constant fear of turning a decentralized network
permission and permissionless blockchain
into a centralized one.
networks.

154
MERKLE TREE

� What Is a Merkle Tree?


� Merkle trees, also known as Binary hash trees, are a
prevalent sort of data structure in computer science.
� In bitcoin and other cryptocurrencies, they're used to
encrypt blockchain data more efficiently and
securely.
� It's a mathematical data structure made up of
hashes of various data blocks that summarize all the
transactions in a block.
� It also enables quick and secure content verification
across big datasets and verifies the consistency and
content of the data.

155
� What Is a Merkle Root?
� A Merkle root is a simple mathematical
method for confirming the facts on a
Merkle tree.
� They're used in cryptocurrency to ensure
that data blocks sent through a peer-to-
peer network are whole, undamaged, and
unaltered.
� They play a very crucial role in the
computation required to keep
cryptocurrencies like bitcoin and ether
running.
156
� Working of Merkle Trees
� A Merkle tree totals all transactions in a block and generates a digital fingerprint
of the entire set of operations, allowing the user to verify whether it includes a
transaction in the block.
� Merkle trees are made by hashing pairs of nodes repeatedly until only one hash
remains; this hash is known as the Merkle Root or the Root Hash.
� They're built from the bottom, using Transaction IDs, which are hashes of
individual transactions.
� Each non-leaf node is a hash of its previous hash, and every leaf node is a hash of
transactional data.

157
EXAMPLE OF A MERKLE TREE IN BLOCKCHAIN

� Consider the following scenario:


� A, B, C, and D are four transactions, all
executed on the same block.
� Each transaction is then hashed,
leaving you with:
⚫ Hash A
⚫ Hash B
⚫ Hash C
⚫ Hash D
� The hashes are paired together,
resulting in:
⚫ Hash AB and Hash CD
� And therefore, your Merkle Root is
formed by combining these two hashes:
Hash ABCD.
158
MERKLE TREE IN BLOCKCHAIN

159
BENEFITS OF MERKLE TREE IN BLOCKCHAIN

� Merkle trees provide four significant advantages -


� Validate the data's integrity: It can be used to validate the data's integrity
effectively.
� Takes little disk space: Compared to other data structures, the Merkle
tree takes up very little disk space.
� Tiny information across networks: Merkle trees can be broken down into
small pieces of data for verification.
� Efficient Verification: The data format is efficient, and verifying the data's
integrity takes only a few moments.

160
161

You might also like