Blockchain Technology
Blockchain Technology
Network
2. Actors Don’t know each other Know each other
Transaction per
second is more as
Transactions Transactions per second are compared to public
7. pre second lesser in a public blockchain. blockchain.
A public network is more A private blockchain is
secure due to decentralization more prone to hacks,
and active participation. Due risks, and data
to the higher number of nodes breaches/
in the network, it is nearly manipulation. It is
impossible for ‘bad actors’ to easy for bad actors to
attack the system and gain endanger the entire
control over the consensus network. Hence, it is
8. Security network. less secure.
# Markel tree:
Merkle tree is a fundamental part of blockchain technology. It is a
mathematical data structure composed of hashes of different blocks of data,
and which serves as a summary of all the transactions in a block. It also allows
for efficient and secure verification of content in a large body of data. It also
helps to verify the consistency and content of the data. Both Bitcoin and
Ethereum use Merkle Trees structure. Merkle Tree is also known as Hash Tree.
The concept of Merkle Tree is named after Ralph Merkle, who patented the idea
in 1979. Fundamentally, it is a data structure tree in which every leaf
node labelled with the hash of a data block, and the non-leaf node labelled with
the cryptographic hash of the labels of its child nodes. The leaf nodes are the
lowest node in the tree.
# Compare hash pointer and Markle tree and its application in blockchain
security.
# Application in blockchain:
• Efficient transaction verification: In a blockchain block, transactions are
organized into a Merkle tree. The Merkle root is included in the block
header. This allows for efficient verification of transactions without
needing to download the entire block. A "Simplified Payment Verification"
(SPV) client, like a mobile wallet, only needs the Merkle root and a small
branch of the tree to verify a transaction, significantly reducing data
storage and bandwidth requirements.
• Data integrity within a block: If any transaction within a block is altered,
the Merkle root will change, indicating that the block has been tampered
with.
# Digital Signature
A digital signature is a mathematical technique used to validate the authenticity
and integrity of a message, software, or digital document. These are some of the
key features of it.
1. Key Generation Algorithms: Digital signatures are electronic signatures,
which assure that the message was sent by a particular sender. While
performing digital transactions authenticity and integrity should be
assured, otherwise, the data can be altered or someone can also act as if
he were the sender and expect a reply.
2. Signing Algorithms: To create a digital signature, signing algorithms like
email programs create a one-way hash of the electronic data which is to
be signed. The signing algorithm then encrypts the hash value using the
private key (signature key). This encrypted hash along with other
information like the hashing algorithm is the digital signature. This digital
signature is appended with the data and sent to the verifier. The reason
for encrypting the hash instead of the entire message or document is that
a hash function converts any arbitrary input into a much shorter fixed-
length value. This saves time as now instead of signing a long message a
shorter hash value has to be signed and hashing is much faster than
signing.
3. Signature Verification Algorithms: The Verifier receives a Digital Signature
along with the data. It then uses a Verification algorithm to process the
digital signature and the public key (verification key) and generates some
value. It also applies the same hash function on the received data and
generates a hash value. If they both are equal, then the digital signature
is valid else it is invalid.
# The steps followed in creating a digital signature are:
1. Message digest is computed by applying the hash function on the message
and then message digest is encrypted using the private key of the sender
to form the digital signature. (digital signature = encryption (private key of
sender, message digest) and message digest = message digest algorithm
(message)).
2. A digital signature is then transmitted with the message. (message +
digital signature is transmitted)
3. The receiver decrypts the digital signature using the public key of the
sender. (This assures authenticity, as only the sender has his private key so
only the sender can encrypt using his private key which can thus be
decrypted by the sender’s public key).
4. The receiver now has the message digest.
5. The receiver can compute the message digest from the message (actual
message is sent with the digital signature).
6. The message digest computed by receiver and the message digest (got by
decryption on digital signature) need to be same for ensuring integrity.
Message digest is computed using one-way hash function, i.e. a hash function in
which computation of hash value of a message is easy but computation of the
message from hash value of the message is very difficult.
# Hash Function
Hash functions in cryptography are extremely valuable and are found in
practically every information security application. A hash function transforms
one numerical input value into another compressed numerical value. It is also a
process that turns plaintext data of any size into a unique ciphertext of a
predetermined length.
• H(x) = x % n
• x & n are integers
• x can be of any arbitrary length
• H(x) will always in the range [0, n-1].
A cryptographic hash function (CHF) is an equation that is widely used to verify
the validity of data. It has many applications, particularly in information security
(e.g. user authentication). A CHF translates data of various lengths of the
message into a fixed-size numerical string the hash. A cryptographic hash
function is a single-directional work, making it extremely difficult to reverse to
recreate the information used to make it.
# How Does a Cryptography Hash Function Work?
• The hash function accepts data of a fixed length. The data block size varies
between algorithms.
• If the blocks are too small, padding may be used to fill the space. However,
regardless of the kind of hashing used, the output, or hash value, always
has the same set length.
• The hash function is then applied as many times as the number of data
blocks.
# What Does a Cryptography Hash Function Do?
A hash function in cryptography takes a plaintext input and produces a hashed
value output of a particular size that cannot be reversed. However, from a high-
level viewpoint, they do more.
• Secure against unauthorized alterations: It assists you in even minor
changes to a message that will result in the generation of a whole new
hash value.
• Protect passwords and operate at various speeds: Many websites allow
you to save your passwords so that you don't have to remember them
each time you log in. However, keeping plaintext passwords on a public-
facing server is risky since it exposes the information to thieves. Websites
commonly use hash passwords to create hash values, which they then
store.
# Types of Blockchain
Here are the 4 types of Blockchains:
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.
1. As the name is public this blockchain is open to the public, which means
it is not owned by anyone.
2. Anyone having internet and a computer with good hardware can
participate in this public blockchain.
3. All the computers in the network hold the copy of other nodes or blocks
present in the network
4. In this public blockchain, we can also perform verification of transactions
or records
• Advantages:
1. Trustable: There are algorithms to detect fraud. Participants need not
worry about the other nodes in the network.
2. Secure: This blockchain is large as it is open to the public. In a large size,
there is a greater distribution of records.
3. 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 to participate.
4. Decentralized: There is no single platform that maintains the network,
instead every user has a copy of the ledger.
• Disadvantages:
1. 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.
2. Energy Consumption: Proof of work is highly energy-consuming. It
requires good computer hardware to participate in the network.
3. Acceptance: No central authority is there so governments are facing the
issue of implementing the technology faster.
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 blockchains are Bitcoin and 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.
1. These are not as open as a public blockchain.
2. They are open to some authorized users only.
3. These blockchains are operated in a closed network.
4. In this few people are allowed to participate in a network within a
company/organization.
• Advantages:
1. Speed: The rate of the transaction is high, due to its small size. Verification
of each node is less time-consuming.
2. Scalability: We can modify the scalability. The size of the network can be
decided manually.
3. Privacy: It has increased the level of privacy for confidentiality reasons as
the businesses required.
4. Balanced: It is more balanced as only some users have access to the
transaction which improves the performance of the network.
• Disadvantages:
1. Security: The number of nodes in this type is limited so chances of
manipulation are there. These blockchains are more vulnerable.
2. Centralized: Trust building is one of the main disadvantages due to its
central nature. Organizations can use this for malpractices.
3. Count: Since there are few nodes if nodes go offline the entire system of
blockchain can be endangered.
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.
1. It is a combination of both public and private blockchain.
2. Permission-based and permissionless systems are used.
3. User access information via smart contracts
4. Even if a primary entity owns a hybrid blockchain it cannot alter the
transaction
• Advantages:
1. Ecosystem: The 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.
2. Cost: Transactions are cheap as only a few nodes verify the transaction.
All the nodes don’t carry the verification hence less computational cost.
3. Architecture: It is highly customizable and still maintains integrity,
security, and transparency.
4. Operations: It can choose the participants in the blockchain and decide
which transaction can be made public.
• Disadvantages:
1. Efficiency: Not everyone is in a position to implement a hybrid Blockchain.
The organization also faces some difficulty in terms of efficiency in
maintenance.
2. 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.
3. Ecosystem: Due to its closed ecosystem this blockchain lacks the
incentives for network participation.
Use Case:
It provides a greater solution to the healthcare 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
the 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.
1. Also known as Federated Blockchain.
2. This is an innovative method to solve the organization’s needs.
3. Some part is public and some part is private.
4. In this type, more than one organization manages the blockchain.
• Advantages:
1. Speed: A limited number of users make verification fast. The high speed
makes this more usable for organizations.
2. Authority: Multiple organizations can take part and make it decentralized
at every level. Decentralized authority, makes it more secure.
3. Privacy: The information of the checked blocks is unknown to the public
view. But any member belonging to the blockchain can access it.
4. Flexible: There is much divergence in the flexibility of the blockchain.
Since it is not a very large decision can be taken faster.
• Disadvantages:
1. 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.
2. Transparency: It can be hacked if the organization becomes corrupt.
Organizations may hide information from the users.
3. Vulnerability: If a 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.
Comparative Analysis of Blockchain Types
Limited to a
Restricted to Combinatio
Open to group of
specific n of public
Access everyone organization
participants and private
Control s
Semi- Mixed
Decentralized Centralized decentralize governance
Governance d structure
Low Variable
High Moderate
Transparenc transparenc transparenc
transparency transparency
y y y
Public Private Hybrid Consortium
Feature Blockchain Blockchain Blockchain Blockchain
High
Limited High Moderate
scalability
scalability scalability scalability
Scalability potential
Lower due
High due to to Moderate Variable
decentralization centralizatio security security
Security n
Faster than
Slower due to
Faster public, Variable
consensus
Transaction transactions slower than speed
mechanisms
Speed private
# Double Spending
Although Blockchain is secured, still it has some loopholes. Hackers or malicious
users take advantage of these loopholes to perform their activities.
1. Double spending means the expenditure of the same digital currency
twice or more to avail the multiple services. It is a technical flaw that
allows users to duplicate money.
2. Since digital currencies are nothing but files, a malicious user can create
multiple copies of the same currency file and can use it in multiple places.
3. This issue can also occur if there is an alteration in the network or copies
of the currency are only used and not the original one.
4. There are also double spends that allow hackers to reverse transactions
so that transaction happens two times.
5. By doing this, the user loses money two times one for the fake block
created by the hacker and for the original block as well.
6. The hacker gets incentives as well for the fake blocks that have been mined
and confirmed.
How does double spending happens:
Double spending happens when someone tries to spend the same digital
currency more than once. Here’s a brief overview of how it can occur:
1. Multiple Transactions: An attacker might attempt to make two separate
transactions with the same amount of digital currency. If the system
doesn’t quickly and accurately update transaction records, both
transactions might initially appear valid.
2. Network Delay: In decentralized systems like blockchain, there is a delay
between when a transaction is broadcast and when it is confirmed by the
network. During this time, an attacker could try to spend the same digital
currency in another transaction.
3. Fraudulent Techniques: Attackers might use techniques such as:
• Race Attack: Sending conflicting transactions to different nodes to
exploit the delay in transaction propagation.
• Finney Attack: Pre-mining a block with a conflicting transaction and
then spending the same funds before the pre-mined block is added
to the blockchain.
• 51% Attack: Gaining control of more than half of the network’s
computing power to reverse or alter transactions.
Example:
Imagine you have 1 digital token in your digital wallet, and you try to use that
same token to make two separate purchases.
• Purchase 1: You order a book online from Store A and use your digital
token to pay for it.
• Purchase 2: Before the transaction with Store A is confirmed and verified,
you use that same digital token to buy a video game from Store B.
Without a system to verify the validity of each transaction and ensure that digital
tokens aren't duplicated, you could effectively spend the same token twice. This
would result in you receiving both the book and the video game, even though
you only had one token to begin with. This undermines the trust and functioning
of the digital currency system.
# How to avoid double spending in bitcoin transactions:
1. Blockchain Verification
The blockchain acts as the backbone of Bitcoin transactions. It is a public ledger
that records all transactions in the network. Each transaction is added to a block,
and once a block is filled, it is verified and added to the chain of previous blocks.
This chronological order ensures that every transaction is unique and cannot be
duplicated or tampered with.
2. Proof-of-Work (PoW)
Proof-of-Work is a consensus mechanism that requires miners (specialized
computers) to solve complex mathematical puzzles. This process is
computationally intensive and requires significant resources. Once a puzzle is
solved, a new block is created and added to the blockchain. The expense and
effort involved in the PoW process make it extremely difficult for malicious actors
to alter transaction records or attempt double spending.
3. Timestamping
Every block in the blockchain is timestamped. This timestamp indicates when
the block was created and allows for the validation of the chronological order of
transactions. By maintaining this order, once a transaction is recorded, it cannot
be altered or reused, preventing the same Bitcoin from being spent twice.
4. Network of Nodes
The Bitcoin network consists of thousands of individual computers or nodes,
each holding a complete copy of the blockchain. These nodes validate every
transaction by checking it against their copy of the blockchain. If a discrepancy
or attempt at double spending is detected, it is rejected by the network, ensuring
that only legitimate transactions are added to the blockchain.
5. Confirmations
When a Bitcoin transaction is made, it does not become final immediately.
Instead, it must receive confirmations from the network. Each confirmation
means that a new block has been added to the blockchain after the block
containing your transaction. It is generally recommended to wait for six
confirmations, as this significantly reduces the likelihood of the transaction being
reversed or tampered with.
6. Secure Wallets
Using secure cryptocurrency wallets enhances the safety of your transactions.
Some wallets are designed to prevent unconfirmed transactions from being
spent until they have been fully confirmed on the blockchain. These wallets
include additional security features to protect against double spending attempts.
# Proof of work
Introduction to Proof-of-Work (PoW)
Proof-of-Work (PoW) is a consensus mechanism used by various blockchain
networks, including Bitcoin, to ensure the security, integrity, and
decentralization of the network. It requires participants (miners) to perform
complex computations to validate transactions and add new blocks to the
blockchain. This mechanism provides a way to achieve distributed consensus
and prevents malicious activities such as double spending.
Core Components of PoW
1. Hash Function: At the heart of PoW is a cryptographic hash function that
converts input data (of any size) into a fixed-size string of characters, which
looks like a random sequence. Bitcoin uses the SHA-256 hash function.
The hash function is deterministic, meaning the same input will always
produce the same output, yet even a slight change in input produces a
vastly different output. Importantly, it's computationally infeasible to
reverse-engineer the original input from the output hash.
2. Nonce: A nonce is a variable that miners alter. It stands for "number used
only once" and is a random or semi-random number that is different for
each block. When miners include the nonce in the block header (along
with the block’s data) and hash it, they aim to produce a hash that meets
specific network criteria.
3. Target Difficulty: The Bitcoin network sets a difficulty target for the hash.
This target determines how difficult it is for a miner to find a valid hash
below this threshold. The target is adjusted approximately every 2,016
blocks to ensure a consistent block creation time of about 10 minutes.
Steps in the Proof-of-Work Process
1. Transaction Compilation: Miners gather outstanding transactions from
the mempool (a collection of all pending transactions) into a new block.
They validate each transaction to ensure it is legitimate and not a double-
spend attempt.
2. Block Header Creation: The block header contains metadata about the
block, including:
o Previous block hash: Links to the previous block in the blockchain.
o Merkle root: A hash representing all the transactions in the block.
o Timestamp: Indicates when the block was created.
o Nonce: Starts as an arbitrary value.
3. Hashing: Miners repeatedly hash the block header by altering the nonce
until they find a hash that meets the target difficulty. This process requires
intensive computations since each attempt generates a completely new
hash.
4. Validation and Broadcasting: When a miner finds a valid hash, they
broadcast the new block to the network. Other miners and nodes verify
the block’s integrity and ensure all transactions are valid before adding it
to their copies of the blockchain.
5. Reward: The first miner to solve the hash puzzle is rewarded with newly
created bitcoins (block reward) and the transaction fees from the
transactions included in the block. This reward incentivizes miners to
continue securing the network.
Importance of Proof-of-Work
1. Security: The computational effort required for PoW makes it costly for
any single entity to gain control of the blockchain (e.g., executing a 51%
attack where an attacker controls the majority of the network’s hashing
power).
2. Decentralization: PoW ensures that control over the blockchain is
distributed among many miners worldwide, reducing the risk of
centralized control.
3. Immutability: Once a block is added to the blockchain and accepted by
the network, altering any information in that block would require redoing
the PoW for that block and all subsequent blocks, which is practically
infeasible due to the immense computational power required.
Challenges and Criticisms
1. Energy Consumption: PoW is notorious for its high energy consumption,
as miners operate powerful hardware continuously to solve hash puzzles.
This has raised environmental concerns.
2. Scalability: The time and resources required to mine new blocks can limit
the number of transactions the network can process, affecting its
scalability.
3. Centralization of Mining Power: Despite being designed to be
decentralized, the high costs of mining (hardware, electricity) can lead to
the centralization of mining power in large mining pools or regions with
cheaper energy.
Advanced security
Cryptographic security, private
Security measures, still vulnerable to
key risks, hacking on exchanges
fraud
# POS
Proof of Stake (PoS) is a type of algorithm which aims to achieve distributed
consensus in a Blockchain. This way to achieve consensus was first suggested by
Quantum Mechanic here and later Sunny King and his peer wrote a paper on it.
This led to Proof-of-Stake (PoS) based Peercoin.
What is POS:
As understandable from the name, nodes on a network stake an amount
of cryptocurrency to become candidates to validate the new block and earn the
fee from it. Then, an algorithm chooses from the pool of candidates the node
which will validate the new block. This selection algorithm combines the
quantity of stake (amount of cryptocurrency) with other factors (like coin-age
based selection, randomization process) to make the selection fair to everyone
on the network.
• Coin-age based selection:
The algorithm tracks the time every validator candidate node stays a
validator. The older the node becomes, the higher the chances of it
becoming the new validator.
• Random Block selection:
The validator is chosen with a combination of ‘lowest hash value’ and
‘highest stake’. The node having the best weighted-combination of these
becomes the new validator.
A typical PoS based mechanism workflow:
1. Nodes make transactions. The PoS algorithm puts all these transactions in
a pool.
2. All the nodes contending to become validator for the next block raise a
stake. This stake is combined with other factors like ‘coin-age’ or
‘randomized block selection’ to select the validator.
3. The validator verifies all the transactions and publishes the block. His stake
still remains locked and the forging reward is also not granted yet. This is
so that the nodes on the network can ‘OK’ the new block.
4. If the block is ‘OK’-ed, the validator gets the stake back and the reward
too. If the algorithm is using a coin-age based mechanism to select
validators, the validator for the current block’s has its coin-age reset to 0.
This puts him in a low-priority for the next validator election.
5. If the block is not verified by other nodes on the network, the validator
loses its stake and is marked as ‘bad’ by the algorithm. The process again
starts from step 1 to forge the new block.
Features:
• Fixed coins in existence:
There is only a finite number of coins that always circulate in the
network. There is no existence of bringing new coins into existence(as in
by mining in case of bitcoin and other PoW based systems). Note that
the network starts with a finite number of coins or ‘initially starts with
PoW, then shifts to PoS’ in some cases. This initiation with PoW is meant
to bring coins/cryptocurrency in the network.
• Transaction fee as reward to minters/forgers:
Every transaction is charged some amount of fee. This is accumulated
and given to the entity who forges the new block. Note that if the forged
block is found fraudulent, the transaction fee is not rewarded. Moreover,
the stake of the validator is also lost(which is also known as slashing).
• Impracticality of the 51% attack:
To conduct a 51% attack, the attacker will have to own 51% of the total
cryptocurrency in the network which is quite expensive. This deems
doing the attack too tedious, expensive and not so profitable. There will
occur problems when amassing such a share of total cryptocurrency as
there might not be so much currency to buy, also that buying more and
more coins/value will become more expensive. Also validating wrong
transactions will cause the validator to lose its stake, thereby being
reward-negative.
Advantages of PoS:
• Energy-efficient:
As all the nodes are not competing against each other to attach a new
block to the blockchain, energy is saved. Also, no problem has to be
solved( as in case of Proof-of-Work system) thus saving the energy.
• Decentralization:
In blockchains like Bitcoin(Proof of Work system to achieve distributed
consensus), an extra incentive of exponential rewards are in place to join
a mining pool leading to a more centralized nature of blockchain. In the
case of a Proof-of-Stake based system(like Peercoin), rewards are
proportional(linear) to the amount of stake. So, it provides absolutely no
extra edge to join a mining pool; thus promoting decentralization.
• Security:
A person attempting to attack a network will have to own 51% of the
stakes(pretty expensive). This leads to a secure network.
Weakness of a PoS mechanism:
• Large stake validators:
If a group of validator candidates combine and own a significant share of
total cryptocurrency, they will have more chances of becoming
validators. Increased chances lead to increased selections, which lead to
more and more forging reward earning, which lead to owning a huge
currency share. This can cause the network to become centralized over
time.
• New technology:
PoS is still relatively new. Research is ongoing to find flaws, fix them and
making it viable for a live network with actual currency transactions.
• The ‘Nothing at Stake’ problem:
This problem describes the little to no disadvantage to the nodes in case
they support multiple blockchains in the event of a blockchain
split(blockchain forking). In the worst-case scenario, every fork will lead
to multiple blockchains and validators will work and the nodes in the
network will never achieve consensus.
# Design issues for permissioned blockchain:
Permissioned blockchains, while offering enhanced security and privacy, present
unique design challenges that must be carefully addressed for successful
implementation. Let's delve deeper into each of these issues:
1. Centralization Risks:
• Limited Decentralization:
o Explanation: Unlike public blockchains where anyone can
participate, permissioned blockchains restrict access to a select
group. This centralized control can lead to concerns about:
▪ Abuse of Power: A small group holding significant control
could potentially manipulate the network, censor
transactions, or discriminate against certain participants.
▪ Lack of Transparency: Limited access can hinder
independent auditing and verification of transactions,
potentially reducing trust and accountability.
o Mitigations:
▪ Decentralized Governance Models: Implement mechanisms
for distributed decision-making, such as multi-signature
schemes or federated governance structures.
▪ Regular Audits: Conduct independent audits to ensure
transparency and identify potential centralization risks.
• Single Points of Failure:
o Explanation: Over-reliance on a central authority or a small set of
validators can create vulnerabilities. If these entities are
compromised (e.g., through hacking or malicious actions), the
entire network's security and integrity can be jeopardized.
o Mitigations:
▪ Redundancy and Fault Tolerance: Implement mechanisms
for redundancy and fault tolerance, such as multiple
validators and backup systems.
▪ Regular Security Audits and Penetration Testing: Conduct
rigorous security assessments to identify and mitigate
potential vulnerabilities.
2. Scalability Issues:
• Transaction Throughput:
o Explanation: As the number of participants and transaction volume
grows, permissioned blockchains can face challenges in processing
transactions efficiently. This can lead to delays and hinder the
network's overall performance.
o Mitigations:
▪ Sharding: Partition the blockchain into smaller sub-chains to
improve transaction processing speed.
▪ Off-Chain Solutions: Utilize off-chain channels or sidechains
to process transactions outside the main blockchain,
reducing the load on the main network.
• Consensus Mechanisms:
o Explanation: Some consensus mechanisms used in permissioned
blockchains may not be as scalable as others. For example,
mechanisms that require all nodes to participate in every
transaction can become inefficient as the network grows.
o Mitigations:
▪ Select Scalable Consensus Algorithms: Choose consensus
mechanisms that are designed for high transaction
throughput and can adapt to growing network sizes (e.g.,
Practical Byzantine Fault Tolerance (PBFT) variants, Raft).
▪ Optimize Consensus Parameters: Fine-tune the parameters
of the chosen consensus mechanism to optimize
performance and efficiency.
3. Interoperability Challenges:
• Data Silos:
o Explanation: Different permissioned blockchains often operate
independently, creating data silos that hinder seamless data
exchange and collaboration between different systems.
o Mitigations:
▪ Develop Interoperability Standards: Establish common
standards and protocols for data exchange between different
permissioned blockchains.
▪ Cross-Chain Communication Protocols: Implement protocols
that enable secure and efficient communication and data
transfer between different blockchain networks.
• Lack of Standards:
o Explanation: The absence of widely adopted standards for
interoperability can make it difficult to connect and integrate
different permissioned blockchain networks.
o Mitigations:
▪ Industry Collaboration: Encourage collaboration among
industry stakeholders to develop and promote common
interoperability standards.
▪ Open-Source Initiatives: Support open-source initiatives that
aim to develop and implement interoperability solutions.
4. Governance and Control:
• Decision-Making:
o Explanation: Determining how decisions are made within a
permissioned blockchain network can be complex, especially when
multiple organizations or stakeholders are involved.
o Mitigations:
▪ Establish Clear Governance Frameworks: Define clear
decision-making processes, roles, and responsibilities for all
stakeholders.
▪ Consensus Mechanisms for Governance: Utilize blockchain-
based mechanisms for decentralized decision-making, such
as token-weighted voting or multi-signature schemes.
• Membership Management:
o Explanation: Managing membership, granting and revoking access
rights, and ensuring fair and equitable participation can be
challenging.
o Mitigations:
▪ Develop Robust Access Control Mechanisms: Implement
fine-grained access control mechanisms to manage user
permissions and data access.
▪ Establish Clear Membership Policies: Define clear
membership criteria and procedures for joining and leaving
the network.
5. Regulatory Compliance:
• Meeting Industry Standards:
o Explanation: Permissioned blockchains, especially those used in
regulated industries like finance or healthcare, must comply with
relevant regulations and industry standards.
o Mitigations:
▪ Conduct Thorough Regulatory Assessments: Conduct
thorough assessments of relevant regulations and industry
standards.
▪ Engage with Regulators: Actively engage with regulators to
understand their expectations and seek guidance on
compliance requirements.
• Adapting to Evolving Regulations:
o Explanation: The regulatory landscape is constantly evolving, and
permissioned blockchain systems must be designed to adapt to new
rules and requirements.
o Mitigations:
▪ Build Flexibility into the System: Design systems that can be
easily updated and modified to accommodate changing
regulatory requirements.
▪ Monitor Regulatory Developments: Continuously monitor
regulatory developments and proactively adapt the system
as needed.
Under normal conditions, a node can stay in any one of the above three states.
Only a leader can interact with the client; any request to the follower node is
redirected to the leader node. A candidate can ask for votes to become the
leader. A follower only responds to candidate(s) or the leader.
To maintain these server status(es), the Raft algorithm divides time into small
terms of arbitrary length. Each term is identified by a monotonically increasing
number, called term number.
Term number
This term number is maintained by every node and is passed while
communications between nodes. Every term starts with an election to
determine the new leader. The candidates ask for votes from other server
nodes(followers) to gather majority. If the majority is gathered, the candidate
becomes the leader for the current term. If no majority is established, the
situation is called a split vote and the term ends with no leader. Hence, a term
can have at most one leader.
Raft algorithm uses two types of Remote Procedure Calls(RPCs) to carry out the
functions :
# Smart Contract
A Smart Contract (or cryptocontract) is a computer program that directly and
automatically controls the transfer of digital assets between the parties under
certain conditions. A smart contract works in the same way as a traditional
contract while also automatically enforcing the contract. Smart contracts are
programs that execute exactly as they are set up(coded, programmed) by their
creators. Just like a traditional contract is enforceable by law, smart contracts
are enforceable by code.
Features of Smart Contracts
The following are some essential characteristics of a smart contract:
1. Distributed: Everyone on the network is guaranteed to have a copy of all
the conditions of the smart contract and they cannot be changed by one
of the parties. A smart contract is replicated and distributed by all the
nodes connected to the network.
2. Deterministic: Smart contracts can only perform functions for which they
are designed only when the required conditions are met. The final
outcome will not vary, no matter who executes the smart contract.
3. Immutable: Once deployed smart contract cannot be changed, it can only
be removed as long as the functionality is implemented previously.
4. Autonomy: There is no third party involved. The contract is made by you
and shared between the parties. No intermediaries are involved which
minimizes bullying and grants full authority to the dealing parties. Also,
the smart contract is maintained and executed by all the nodes on the
network, thus removing all the controlling power from any one party’s
hand.
5. Customizable: Smart contracts have the ability for modification or we can
say customization before being launched to do what the user wants it to
do.
6. Transparent: Smart contracts are always stored on a public distributed
ledger called blockchain due to which the code is visible to everyone,
whether or not they are participants in the smart contract.
7. Trustless: These are not required by third parties to verify the integrity of
the process or to check whether the required conditions are met.
8. Self-verifying: These are self-verifying due to automated possibilities.
9. Self-enforcing: These are self-enforcing when the conditions and rules are
met at all stages.
# Features of Blockchain
Blockchain technology has several key features that make it unique and
powerful:
1. Decentralization: Unlike traditional centralized databases, blockchain
operates on a network of nodes, where each node has a copy of the entire
blockchain. This decentralization ensures that no single entity has control,
enhancing security and trust.
2. Immutability: Once data is added to the blockchain, it cannot be altered
or deleted. This feature ensures the integrity and trustworthiness of the
recorded data and helps prevent fraud.
3. Transparency: Every transaction on a blockchain is visible to all
participants. This transparency allows for easy verification and auditability
of transactions, enhancing trust among users.
4. Security: Blockchain uses advanced cryptographic techniques to secure
data, making it highly resistant to hacking and unauthorized access.
5. Consensus Mechanisms: To add a new block to the blockchain, a
consensus must be achieved among the network's nodes. Various
mechanisms such as Proof of Work (PoW), Proof of Stake (PoS), and others
ensure agreement on the validity of transactions.
6. Smart Contracts: These are self-executing contracts with the terms of
agreement directly written into code. Smart contracts automatically
execute and enforce the terms when predefined conditions are met,
reducing the need for intermediaries.
7. Ownership & Control: Blockchain gives users more control over their
digital assets and identity. Users can own and manage their data, deciding
who has access and to what extent.
8. Anonymity and Pseudonymity: Participants in a blockchain network can
remain anonymous or use pseudonyms, which provides privacy for
sensitive transactions while still maintaining transparency.
9. Distributed Ledger: Blockchain acts as a distributed ledger where all
transactions are recorded across multiple nodes. This protects the
network from a single point of failure, making it more resilient.
10.Tokenization: Blockchain allows for the tokenization of assets, which
means physical assets (like real estate) or digital assets can be represented
and traded as tokens on a blockchain.
# Benefits Of Hyperledger Fabric
• Let us say there are 100 generals (nodes) in the battalion (blockchain
network).
• There is a strategist(RPCA), that aims to ensure that each and every loyal
general either comes to the same conclusion, or no conclusion at all. They
cannot afford to have a different conclusion.
• So the strategist asks each of them to select the generals that they trust
(this does not guarantee their loyalty. It’s just the people they think they
can trust.) and make a list (UNL: Unique Node List).
• Now the strategist asks them to have a consensus with the people in their
list. If more than 80% of the people in their UNL come up with the same
decision, then it is finalized by the general. This is because the strategist
knows that their army can only handle the traitorship of less than 20% of
the generals (Byzantine fault tolerance = 20%). Similarly all the generals
consult with their UNLs and come to a consensus.
• Now let’s say there are 20 generals(all traitors), each of whom have the
rest of the 19 in their UNL. And there is another UNL of the same type but
with honest generals. So both of these UNLs will independently come to a
consensus, which will contradict each other. But the main motive of the
strategist was to ensure that every loyal general comes to the same
consensus in their UNLs.
• So the strategist made another rule: If we select any two UNL’s, they
should have at least 20% of the members in common. Hence there will
always be enough people in each UNL to stop them from reaching the
wrong decision.
• Eg. in the twenty faulty generals, if we replace 4 generals (20% of 20
generals) with honest ones, then the majority would not be more than
80%, thus preventing consensus.
• Hence none of the generals would ever come to the wrong consensus,
regardless of who is in their UNL, as long as the number of traitors is less
than 20%