0% found this document useful (0 votes)
9 views62 pages

Blockchain Technology

Blockchain technology is a decentralized digital ledger that securely records transactions in linked blocks using cryptography, making it difficult to alter past records. Key components include nodes, ledgers, transactions, and consensus mechanisms, with applications ranging from cryptocurrencies like Bitcoin to various industries. Merkle trees enhance data integrity and verification efficiency within blocks, while digital signatures ensure the authenticity of transactions.

Uploaded by

Prerana Patil
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)
9 views62 pages

Blockchain Technology

Blockchain technology is a decentralized digital ledger that securely records transactions in linked blocks using cryptography, making it difficult to alter past records. Key components include nodes, ledgers, transactions, and consensus mechanisms, with applications ranging from cryptocurrencies like Bitcoin to various industries. Merkle trees enhance data integrity and verification efficiency within blocks, while digital signatures ensure the authenticity of transactions.

Uploaded by

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

Blockchain Technology

# Definition of blockchain: A blockchain is a decentralized, distributed, and


often public digital ledger consisting of records called blocks that are linked
together using cryptography. Each block contains a cryptographic hash of the
previous block, a timestamp, and transaction 2 data. This structure makes it
extremely difficult to alter or delete any information once it has been recorded
on the blockchain.
The blockchain is a distributed database of records of all transactions or digital
events that have been executed and shared among participating parties. Each
transaction is verified by the majority of participants of the system.
It contains every single record of each transaction. Bitcoin is the most popular
cryptocurrency an example of the blockchain. Blockchain Technology first came
to light when a person or group of individuals name ‘Satoshi Nakamoto’
published a white paper on “BitCoin: A peer-to-peer electronic cash system” in
2008.
Blockchain Technology Records Transaction in Digital Ledger which is distributed
over the Network thus making it incorruptible. Anything of value like Land
Assets, Cars, etc. can be recorded on Blockchain as a Transaction.
How does Blockchain Technology Work?
One of the famous use of Blockchain is Bitcoin. Bitcoin is a cryptocurrency and is
used to exchange digital assets online. Bitcoin uses cryptographic proof instead
of third-party trust for two parties to execute transactions over the Internet.
Each transaction protects through a digital signature.
Key elements of blockchain:
1. Decentralization: This is the bedrock. Distributing the ledger across many
nodes removes central control, making the system more resilient to
censorship, single points of failure, and manipulation. It's what gives
blockchain its trustless nature.
2. Cryptography: This underpins the security and integrity of the blockchain.
Hashing ensures data integrity (any change alters the hash), while digital
signatures verify transaction authenticity. Without robust cryptography,
the whole system would be vulnerable.
3. Immutability: This is a direct result of cryptography and the chain
structure. Once a transaction is recorded in a block, it's incredibly difficult
to alter due to the need to change all subsequent blocks and overcome
the consensus mechanism. This creates a permanent, auditable record.
4. Distributed Ledger Technology (DLT): This is the core concept of having
multiple, synchronized copies of the ledger across the network. It provides
transparency (everyone with permission can view the data), redundancy
(if one copy is lost, others remain), and contributes to decentralization.
5. Consensus Mechanisms: These are the rules the network uses to agree
on the validity of transactions and the order of blocks. They prevent
double-spending and ensure that only legitimate transactions are added
to the blockchain. Different mechanisms (like PoW or PoS) have different
trade-offs in terms of security, energy consumption, and speed.

# Core components of blockchain network:


The core components of blockchain networks are essential for their operation
and functionality. Each component plays a critical role in maintaining the
integrity, security, and efficiency of the blockchain. Here are the core
components of the blockchain network:
1. Nodes
Nodes are individual computers that participate in the blockchain network. Each
node stores a copy of the entire blockchain or part of it.
• Full Nodes: It maintains a full copy of all the transactions. It has the
capacity to validate, accept and reject the transactions.
• Partial Nodes: It is also called a Lightweight Node because it doesn’t
maintain the whole copy of the blockchain ledger. It maintains only the
hash value of the transaction. The whole transaction is accessed using this
hash value only. These nodes have low storage and low computational
power.
• Mining Nodes: Nodes that validate transactions and add them to the
blockchain, typically through a process called mining (in Proof of Work
systems).
2. Ledger
The blockchain itself serves as a distributed ledger that records all transactions
in a secure and immutable manner. The ledger is composed of blocks, each
containing a set of transactions, a timestamp, and a reference (hash) to the
previous block, forming a chronological chain.
• Public Ledger: It is open and transparent to all. Anyone in the blockchain
network can read or write something.
• Distributed Ledger: In this ledger, all nodes have a local copy of the
database. Here, a group of nodes collectively execute the job i.e verify
transactions, add blocks in the blockchain.
• Decentralized Ledger: In this ledger, no one node or group of nodes has a
central control. Every node participates in the execution of the job.
3. Transactions
Transactions are the fundamental units of data in a blockchain, representing the
transfer of value or information. A transaction is created, verified by nodes, and
then recorded on the blockchain. It typically includes the sender’s and receiver’s
addresses, the amount, and a digital signature for authenticity.
4. Consensus Mechanisms
Consensus mechanisms are algorithms that allow the network to agree on the
validity of transactions and maintain a consistent state of the ledger.
• Proof of Work (PoW): Requires participants to solve complex
mathematical problems to validate transactions (e.g., Bitcoin).
• Proof of Stake (PoS): Validators are chosen based on the number of coins
they hold and are willing to “stake” as collateral (e.g., Ethereum 2.0).
• Delegated Proof of Stake (DPoS): Participants vote for a small number of
delegates to validate transactions on their behalf.

# Difference between public and private blockchain:

Basis of Public BlockChain


S.no Comparison Private BlockChain

In this type of blockchain In this type of


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

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

Decentralized A public blockchain is A private blockchain is


3. Vs Centralized decentralized. more centralized.

The order of magnitude of a


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

5. Native Token Yes Not necessary

6. Speed Slow Fast

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.

A public blockchain consumes


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

Proof of Elapsed Time


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

In a public blockchain, no one In a private


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

Potential to disrupt current Reduces transaction


business models through cost and data
disintermediation. There is redundancies and
12. Effects
lower infrastructure cost. No replace legacy
need to maintain servers or systems, simplifying
system admins radically. Hence documents handling
reducing the cost of creating and getting rid of semi
and running decentralized manual compliance
application (dApps). mechanisms.

Bitcoin, Ethereum, Monero, R3 (Banks), EWF


Zcash, Dash, Litecoin, Stellar, (Energy), B3i
13. Examples Steemit etc. (Insurance), Corda.

# 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.

How do Merkle trees work?


A Merkle tree stores all the transactions in a block by producing a digital
fingerprint of the entire set of transactions. It allows the user to verify whether
a transaction can be included in a block or not.
Merkle trees are created by repeatedly calculating hashing pairs of nodes until
there is only one hash left. This hash is called the Merkle Root, or the Root Hash.
The Merkle Trees are constructed in a bottom-up approach.
Every leaf node is a hash of transactional data, and the non-leaf node is a hash
of its previous hashes. Merkle trees are in a binary tree, so it requires an even
number of leaf nodes. If there is an odd number of transactions, the last hash
will be duplicated once to create an even number of leaf nodes.
The above example is the most common and simple form of a Merkle tree,
i.e., Binary Merkle Tree. There are four transactions in a block: TX1, TX2, TX3,
and TX4. Here you can see, there is a top hash which is the hash of the entire
tree, known as the Root Hash, or the Merkle Root. Each of these is repeatedly
hashed, and stored in each leaf node, resulting in Hash 0, 1, 2, and 3. Consecutive
pairs of leaf nodes are then summarized in a parent node by
hashing Hash0 and Hash1, resulting in Hash01, and separately
hashing Hash2 and Hash3, resulting in Hash23. The two hashes
(Hash01 and Hash23) are then hashed again to produce the Root Hash or the
Merkle Root.
Merkle Root is stored in the block header. The block header is the part of the
bitcoin block which gets hash in the process of mining. It contains the hash of
the last block, a Nonce, and the Root Hash of all the transactions in the current
block in a Merkle Tree. So having the Merkle root in block header makes the
transaction tamper-proof. As this Root Hash includes the hashes of all the
transactions within the block, these transactions may result in saving the disk
space.
The Merkle Tree maintains the integrity of the data. If any single detail of
transactions or order of the transaction's changes, then these changes reflected
in the hash of that transaction. This change would cascade up the Merkle Tree
to the Merkle Root, changing the value of the Merkle root and thus invalidating
the block. So everyone can see that Merkle tree allows for a quick and simple
test of whether a specific transaction is included in the set or not.
# Merkle trees have three benefits:
o It provides a means to maintain the integrity and validity of data.
o It helps in saving the memory or disk space as the proofs, computationally
easy and fast.
o Their proofs and management require tiny amounts of information to be
transmitted across networks.

# Advantages and disadvantages of cryptocurrency


Advantages:---
• Decentralization: Cryptocurrencies operate independently of central
banks and governments. This reduces the risk of censorship,
manipulation, and single points of failure.
• Transparency: All transactions are recorded on a public blockchain,
making them visible to anyone. This promotes accountability and trust.
• Security: Cryptography is used to secure transactions and prevent fraud.
This makes it extremely difficult to counterfeit or double-spend
cryptocurrencies.
• Faster and cheaper transactions: Cryptocurrency transactions can often
be processed faster and at lower cost than traditional bank transfers,
especially for international transactions.
• Financial inclusion: Cryptocurrencies can provide access to financial
services for people who are unbanked or underbanked. Anyone with an
internet connection can potentially use cryptocurrencies.
• Borderless transactions: Cryptocurrencies can be easily sent and received
across borders without the need for intermediaries or currency exchange.
• Potential for appreciation: Some cryptocurrencies have seen significant
price appreciation over time, making them attractive as an investment.
• Programmability (with smart contracts): Some cryptocurrencies, like
Ethereum, support smart contracts, which are self-executing contracts
with the terms of the agreement directly written into code. This allows for
the automation of complex agreements and the development of
decentralized applications (dApps).
Disadvantages:---
• Volatility: Cryptocurrency prices can be highly volatile, leading to
significant gains or losses.
• Regulatory uncertainty: The regulatory landscape for cryptocurrencies is
still evolving, which can create uncertainty for investors and businesses.
• Security risks: While the blockchain itself is secure, exchanges and
individual wallets can be vulnerable to hacking and theft.
• Use in illicit activities: Cryptocurrencies can be used for illegal activities
such as money laundering and tax evasion.

# Compare hash pointer and Markle tree and its application in blockchain
security.

Feature Hash pointer Markel tree


Structure Points to data and its Tree-like structure of
hash hashes

Purpose Linking data structures Efficiently verifying the


and verifying integrity of integrity of large
single data points datasets and individual
data within them

Data Scope Single data point Multiple data points


(dataset)

Verification Recalculate hash and Traverse a branch of the


compare to stored hash tree from leaf to root,
comparing hashes along
the path
Blockchain Application Linking blocks in the Organizing transactions
blockchain, creating the within a block, enabling
chain efficient transaction
verification (SPV)

Focus Integrity of the chain Integrity of the block


(history) (contents) and efficient
verification

Analogy Like a secure link in a Like a table of contents


chain with cryptographic
proofs for each chapter

# 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.

# Benefits of Digital Signatures


• Legal documents and contracts: Digital signatures are legally binding. This
makes them ideal for any legal document that requires a signature
authenticated by one or more parties and guarantees that the record has
not been altered.
• Sales contracts: Digital signing of contracts and sales contracts
authenticates the identity of the seller and the buyer, and both parties can
be sure that the signatures are legally binding and that the terms of the
agreement have not been changed.
• Financial Documents: Finance departments digitally sign invoices so
customers can trust that the payment request is from the right seller, not
from a attacker trying to trick the buyer into sending payments to a
fraudulent account.
• Health Data: In the healthcare industry, privacy is paramount for both
patient records and research data. Digital signatures ensure that this
confidential information was not modified when it was transmitted
between the consenting parties.
# Operations involved in public key cryptography:
1. Key Generation:
• The Process: This is the most mathematically intensive part. It involves
complex algorithms that generate a pair of keys:
o Private Key: This key is kept secret by the owner and is used for
decryption and signing.
o Public Key: This key is distributed widely and is used for encryption
and signature verification.
• Mathematical Basis: The algorithms used for key generation rely on "one-
way functions" – mathematical operations that are easy to perform in one
direction but extremely difficult to reverse. Common examples include:
o Integer factorization: Factoring large numbers into their prime
factors is computationally hard. This is the basis for RSA
cryptography.
o Discrete logarithm problem: Finding the discrete logarithm in a
finite group is also computationally hard. This is the basis for Diffie-
Hellman and elliptic curve cryptography.
• Key Size: The security of public key cryptography depends on the key size.
Larger key sizes provide greater security but also require more
computational resources.
2. Encryption:
• The Process:
1. The sender obtains the recipient's public key.
2. The sender uses the recipient's public key and an encryption
algorithm (e.g., RSA, ECC) to transform the plaintext message into
ciphertext.
3. The ciphertext is then transmitted to the recipient.
• Mathematical Basis: The encryption algorithm uses the public key to
perform a mathematical operation on the plaintext, making it unreadable
without the corresponding private key.
• Example (Simplified RSA):
o Plaintext (M) is raised to the power of the public key exponent (e)
and then taken modulo a public key modulus (n): C = M^e mod n
(where C is the ciphertext).
3. Decryption:
• The Process:
1. The recipient receives the ciphertext.
2. The recipient uses their private key and a decryption algorithm
(corresponding to the encryption algorithm used) to transform the
ciphertext back into the original plaintext message.
• Mathematical Basis: The decryption algorithm uses the private key to
reverse the mathematical operation performed during encryption.
• Example (Simplified RSA):
o Ciphertext (C) is raised to the power of the private key exponent (d)
and then taken modulo the same public key modulus (n): M = C^d
mod n (recovering the plaintext M).
4. Digital Signatures:
• The Process:
1. Hashing: The sender uses a hash function (e.g., SHA-256) to create
a hash of the message. This hash is a fixed-size string that represents
the message's content.
2. Signing: The sender uses their private key and a signing algorithm
(e.g., RSA, ECDSA) to encrypt the hash, creating the digital
signature.
3. The digital signature is then attached to the message.
• Mathematical Basis: The signing algorithm uses the private key to
perform a mathematical operation on the hash, creating a unique
signature that is specific to the message and the sender's private key.
5. Signature Verification:
• The Process:
1. The recipient receives the message and the digital signature.
2. The recipient uses the sender's public key to decrypt the signature,
recovering the original hash.
3. The recipient independently hashes the received message using the
same hash function.
4. The recipient compares the decrypted hash with the independently
calculated hash. If they match, the signature is valid.
• Mathematical Basis: The verification process uses the sender's public key
to reverse the mathematical operation performed during signing. If the
decrypted hash matches the independently calculated hash, it proves that
the message was signed by the owner of the corresponding private key
and that the message has not been altered.
6. Key Exchange:
• The Process: Key exchange protocols allow two parties to establish a
shared secret key over an insecure channel. This shared secret key can
then be used for symmetric encryption, which is generally faster than
asymmetric encryption.
• Example (Diffie-Hellman):
1. Two parties agree on a public prime number (p) and a public
generator (g).
2. Each party chooses a private number (a and b, respectively).
3. Each party calculates a public value (A = g^a mod p and B = g^b mod
p) and exchanges these values.
4. Each party then calculates the shared secret key (K = B^a mod p or
K = A^b mod p).
5. Both parties arrive at the same shared secret key (K) without ever
transmitting their private numbers.
# Layered architecture of blockchain system:
In the domain of blockchain technology, an ecosystem is a collection of
components that work together to produce a unique environment. Blockchain-
based ecosystems have a collection of distributed nodes where immutable
transactions are repeated. The blockchain (or digital ledger) technology is built
upon a layered architecture as shown in the below figure.

• Infrastructure or Hardware Layer


A data server securely backups the Blockchain data. Our computers seek access
to this data from the server when we surf the web or use any Blockchain apps.
Blockchain platforms rely on P2P, i.e., peer-to-peer network architecture, where
one node connects with other nodes to share data quickly and easily. The client-
server architecture is the structure that allows for this data exchange.
It is nothing more than a large network of devices connecting with one another
and exchanging data and information. A distributed ledger is constructed in this
manner. A node communicates with another device on the network where each
node is authorized to monitor the transactional data randomly.
• The Data Layer
A Blockchain is a series of hashed blocks carrying transactional records. The first
block of the Blockchain is the Genesis block. After that, every new block added
to the Blockchain is linked to the Genesis block through an iterative process. And
thus, in this way, the Blockchain keeps on expanding.
Every transaction is ‘digitally signed’ using the sender’s wallet private key. This
key is only accessible by the sender, guaranteeing that the data cannot be viewed
or modified by anyone else. The owner’s identity is further protected by the
digital signature, which is encrypted, assuring utmost security. In Blockchain
terminology, this is referred to as ‘finality.’
The data encryption makes it inaccessible. In the case of data access, tampering
it is nearly impossible. A digital signature also protects the sender’s or owner’s
identity. As a result, a signature is legally associated with the person who signed
it and cannot be ignored.
• The Network Layer
The P2P framework allows several nodes to communicate transaction data in
order to reach an agreement on the transaction’s legitimacy. This implies that
every node on the network must be able to discover other nodes in order to
communicate quickly. This ‘inter-node communication’ is made possible by the
network layer. This layer is also known as the ‘Propagation Layer’ since it
manages node detection, block generation, and block addition.
• The Consensus Layer
One of the most important layers in Blockchain functionality, this layer is
responsible for transaction authentication. Without this layer, the transaction
validation will not take place, thus leading to system failure. This layer
implements the protocol, which needs a specific number of nodes to validate a
single transaction. As a result, each transaction is processed by numerous nodes,
all of which must reach the same conclusion and agree on its legitimacy.
Because no node has exclusive authority over any transactional data, and the
role is dispersed. It is also referred to as a consensus mechanism and maintains
the Blockchain’s decentralized characteristic.
Multiple blocks may be formed concurrently, resulting in a branch in the
Blockchain due to a large number of nodes processing transactions, bundling
them, and adding them to the Blockchain. However, a single chain block addition
is required at all times, and the consensus layer guarantees that this dispute is
addressed.
• Application and presentation layer
The application layer consists of the programs that end-users take advantage of
to establish Blockchain network communication. Smart contracts, Dapps
(decentralized applications), chaincode, scripts, UIs (user interfaces), APIs
(application programming interfaces), and frameworks constitute the
application layer.
The application layer and the execution layer are subdivisions of the application
layer’s protocols. The Blockchain network acts as the back-end mechanism for
the applications and communicates with the help of APIs. However, smart
contracts, chaincode, and underlying protocols form the execution layer.
The constituting applications instruct the execution layer for the proper
execution of transactions while ensuring the deterministic aspect of
the Blockchain platform.

# 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.

# Properties of a good cryptographic hash function:


1. Deterministic: For a given input, the hash function will always produce
the same output. This is essential for consistency and verification.
2. Fast Computation: It should be relatively easy and fast to compute the
hash of any input. This is important for practical applications.
3. Pre-image Resistance (One-way property): Given a hash value, it should
be computationally infeasible to find the original input (pre-image) that
produced that hash. This prevents attackers from reversing the hash to
obtain the original data.
4. Second Pre-image Resistance (Weak collision resistance): Given an input
and its hash, it should be computationally infeasible to find a different
input that produces the same hash. This prevents an attacker from
substituting a different message with the same hash as the original.
5. Collision Resistance (Strong collision resistance): It should be
computationally infeasible to find any two different inputs that produce
the same hash. This is the strongest security property and is crucial for
preventing attacks where an attacker creates two different messages with
the same hash, potentially for fraudulent purposes.

# 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

Public Private Hybrid Consortium


Feature Blockchain Blockchain Blockchain Blockchain

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

Supply chain, Various


Cryptocurrencie Enterprise
banking, applications
s, decentralized solutions,
collaboration need
apps data privacy
Use Cases s flexibility
# What is bitcoin:
Bitcoin is a decentralized digital currency, operating independently of a central
bank, that uses cryptography for security and is recorded on a public, distributed
ledger called a blockchain. It enables peer-to-peer transactions without
intermediaries.
Bitcoin (BTC) is a cryptocurrency (a virtual currency) designed to act as money
and a form of payment outside the control of any one person, group, or entity.
This removes the need for trusted third-party involvement (e.g., a mint or bank)
in financial transactions.

# What is Bitcoin Mining:


Bitcoin mining is a computation-intensive process that uses complicated
computer code to generate a secure cryptographic system. The bitcoin miner is
the person who solves mathematical puzzles(also called proof of work) to
validate the transaction. Anyone with mining hardware and computing power
can take part in this. Numerous miners take part simultaneously to solve the
complex mathematical puzzle, the one who solves it first, wins 6.25 bitcoin as a
part of the reward. Miner verifies the transactions(after solving the puzzle) and
then adds the block to the blockchain when confirmed. The blockchain contains
the history of every transaction that has taken place in the blockchain network.
Once the minor adds the block to the blockchain, bitcoins are then transferred
which were associated with the transaction.
For the miners to earn rewards from verifying the bitcoin Transactions, two
things must be ensured:
1. The miners must verify the one-megabyte size of the transaction.
2. For the addition of a new block of transaction in the blockchain, miners
must have the ability to solve complex computational maths problems
called proof for work by finding a 64-bit hexadecimal hash value.
# What is Proof of Burn?
Proof of Burn (PoB) is a consensus algorithm used in blockchain networks to
validate transactions and secure the network by requiring participants to “burn”
a portion of their cryptocurrency holdings. This process involves sending coins
to an unspendable address, effectively removing them from circulation.
1. Concept of Burning Coins: In PoB, participants demonstrate their
commitment to the network by burning their coins. This action signifies a
long-term investment in the network’s health and stability. The coins sent
to a burn address cannot be retrieved or spent, ensuring that they are
permanently removed from circulation.
2. Mining Rights: By burning coins, participants earn the right to mine new
blocks or validate transactions. The more coins a participant burns, the
greater their influence on the network. This creates an economic incentive
for users to engage with the blockchain and contribute to its security.
3. Environmental Efficiency: Unlike Proof of Work (PoW), which requires
extensive computational power and energy consumption to solve complex
mathematical problems, PoB does not involve resource-intensive mining.
This makes it a more environmentally friendly alternative for achieving
consensus.
4. Decentralization: PoB helps reduce the risk of centralization often
associated with other consensus mechanisms. By requiring a commitment
through burning coins rather than accumulating wealth or computing
power, PoB encourages broader participation from various stakeholders in
the network.
• How Proof of Burn Works?
Proof of Burn (PoB) is a consensus algorithm that allows participants to validate
transactions and secure the blockchain by “burning” a portion of their
cryptocurrency holdings.
1. Burning Coins: Participants send a specified amount of cryptocurrency to
an unspendable address, permanently removing those coins from
circulation. This act demonstrates their commitment to the network.
2. Earning Mining Rights: By burning coins, participants earn the right to
mine new blocks. The amount of cryptocurrency burned typically
influences their chances of being selected for mining.
3. Block Creation: When a participant is chosen to mine a block, they
validate transactions and create a new block, which is then added to the
blockchain.
4. Rewards Distribution: The successful miner receives rewards, often in the
form of newly created coins or transaction fees, directly linked to the
amount of cryptocurrency burned.
5. Enhanced Security: The commitment involved in burning coins helps
secure the network, as participants have a vested interest in maintaining
the integrity and health of the blockchain.
• Benefits of Proof of Burn
1. Resource Efficiency: Proof of Burn (PoB) requires significantly less energy
than Proof of Work, as it does not involve intensive computational tasks.
This makes it a more environmentally friendly consensus mechanism.
2. Decentralization: PoB reduces the risks of centralization by tying mining
rights to the act of burning coins rather than wealth accumulation,
encouraging broader participation from various stakeholders.
3. Long-Term Commitment: Participants demonstrate their investment in
the network by permanently removing coins from circulation, which
discourages malicious behavior and promotes a stable network
environment.
4. Simplified Validation: The validation process is more straightforward,
leading to faster block confirmations compared to PoW, where complex
mathematical puzzles must be solved.
5. Economic Stability: Burning coins can help control the cryptocurrency
supply, potentially increasing its value over time and contributing to
overall economic stability.
• Challenges and Limitations
1. Economic Waste: Burning coins is often seen as wasteful since
participants permanently lose their investment without any return, which
may deter involvement.
2. Reduced Liquidity: The process of burning decreases the total supply of
the cryptocurrency, potentially leading to reduced market liquidity and
instability.
3. Incentive Structure: The rewards for burning coins may not be compelling
enough for some users, limiting participation compared to more lucrative
consensus mechanisms.
4. Market Manipulation: Large holders could manipulate the system by
burning significant amounts of coins to gain excessive mining influence,
threatening decentralization.
5. Limited Adoption: PoB is not as widely adopted as Proof of Work or Proof
of Stake, which can hinder the development of a robust ecosystem.

# 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.

# Difference between bank system and bitcoin system


Feature Traditional Bank System Bitcoin System

Centralization Centralized Decentralized

Governed by laws and Not bound by single country's


Regulations
regulations laws

Banks, clearinghouses, No intermediaries, peer-to-


Intermediaries
payment processors peer

Private transactions but


Transparency Public ledger (blockchain)
records maintained

High level of privacy for


Privacy Pseudonymous user identities
individual transactions

Various fees for transfers,


Fees Lower transaction fees
maintenance, etc.
Feature Traditional Bank System Bitcoin System

Requires personal Accessible to anyone with


Accessibility
information and documents internet and digital wallet

Typically faster, though


Speed of Can be slow for
network congestion can slow
Transactions international transfers
down

Advanced security
Cryptographic security, private
Security measures, still vulnerable to
key risks, hacking on exchanges
fraud

Innovation Slower to innovate due to


Rapid innovation and evolution
Flexibility regulatory oversight

Users have more control over


Control Banks control user accounts
their funds

# Difference between POW and POS


S.No. Proof of Work (PoW) Proof of stack
(POS)
1. The probability of mining a block The probability of validating a new
is determined by how much block is determined by how large of a
computational work is done by stake a person holds (how many coins
miner. they possess).
2. A reward is given to first miner to The validator donot receive a block
solve cryptographic puzzle of reward instead they collect network
each block. fee as their reward.

3. To add each block to chain, miners There is no competition as block


must compete to solve difficult creator is .chosen by an algorithm
puzzles using their computer based on user stake.
process power
4. Hackers would need to have 51% Hackers would need to own 51% of
of computation power to add all cryptocurrency on network, which
malicious block. is practically impossible.
5. Proof of work systems are less Proof of Stake systems are much more
energy efficient and are less costly cost and energy efficient than POW
but more proven. systems but less proven.
6. Specialized equipment to Standard server grade unit is more
optimize processing power. than enough.
7. Initial investment to buy Initial investment to buy stake and
hardware. build reputation.
8. Bitcoin is most well known crypto Some of cryptocurrencies that use
with a Proof-of-Work consensus different variants of proof-of-stake
building algorithm which uses consensus are: EOS (EOS), Tezos (XTZ),
most well known proof-of-work Cardano (ADA), Cosmos (ATOM), Lisk
function is called SHA256. (LSK).

# 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.

# Byzantine general problem


In 1982, The Byzantine General’s Problem was invented by Leslie Lamport,
Robert Shostak, and Marshall Pease. Byzantine Generals Problem is an
impossibility result which means that the solution to this problem has not been
found yet as well as helps us to understand the importance of blockchain. It is
basically a game theory problem that provides a description of the extent to
which decentralized parties experience difficulties in reaching consensus
without any trusted central parties.
• The Byzantine army is divided into many battalions in this classic problem
called the Byzantine General’s problem, with each division led by a
general.
• The generals connect via messenger in order to agree to a joint plan of
action in which all battalions coordinate and attack from all sides in order
to achieve success.
• It is probable that traitors will try to sabotage their plan by intercepting or
changing the messages.
• As a result, the purpose of this challenge is for all of the faithful
commanders to reach an agreement without the imposters tampering
with their plans.
How Bitcoin Solves the Byzantine General’s Problem?
In the Byzantine Generals Problem, the untampered agreement that all the loyal
generals need to agree to is the blockchain. Blockchain is a public, distributed
ledger that contains the records of all transactions. If all users of the Bitcoin
network, known as nodes, could agree on which transactions occurred and in
what order, they could verify the ownership and create a functioning, trustless
money system without the need for a centralized authority. Due to its
decentralized nature, blockchain relies heavily on a consensus technique to
validate transactions. It is a peer-to-peer network that offers its users
transparency as well as trust. Its distributed ledger is what sets it apart from
other systems. Blockchain technology can be applied to any system that requires
proper verification.
Proof Of Work: The network would have to be provable, counterfeit-resistant,
and trust-free in order to solve the Byzantine General’s Problem. Bitcoin
overcame the Byzantine General’s Problem by employing a Proof-of-Work
technique to create a clear, objective regulation for the blockchain. Proof of work
(PoW) is a method of adding fresh blocks of transactions to the blockchain of a
cryptocurrency. In this scenario, the task consists of creating a hash (a long string
of characters) that matches the desired hash for the current block.
1. Counterfeit Resistant: Proof-of-Work requires network participants to
present proof of their work in the form of a valid hash in order for their
block, i.e. piece of information, to be regarded as valid. Proof-of-Work
requires miners to expend significant amounts of energy and money in
order to generate blocks, encouraging them to broadcast accurate
information and so protecting the network. Proof-of-Work is one of the
only ways for a decentralized network to agree on a single source of truth,
which is essential for a monetary system. There can be no disagreement
or tampering with the information on the blockchain network because the
rules are objective. The ruleset defining which transactions are valid and
which are invalid, as well as the system for choosing who can mint new
bitcoin, are both objectives.
2. Provable: Once a block is uploaded to the blockchain, it is incredibly
difficult to erase, rendering Bitcoin’s history immutable. As a result,
participants of the blockchain network may always agree on the state of
the blockchain and all transactions inside it. Each node independently
verifies whether blocks satisfy the Proof-of-Work criterion and whether
transactions satisfy additional requirements.
3. Trust-free: If any network member attempts to broadcast misleading
information, all network nodes immediately detect it as objectively invalid
and ignore it. Because each node on the Bitcoin network can verify every
information on the network, there is no need to trust other network
members, making Bitcoin a trustless system.
Byzantine Fault Tolerance (BFT)
The Byzantine Fault Tolerance was developed as inspiration in order to address
the Byzantine General’s Problem. The Byzantine General’s Problem, a logical
thought experiment where multiple generals must attack a city, is where the idea
for BFT originated.
• Byzantine Fault Tolerance is one of the core characteristics of developing
trustworthy blockchain rules or features is tolerance.
• When two-thirds of the network can agree or reach a consensus and the
system still continues to operate properly, it is said to have BFT.
• Blockchain networks’ most popular consensus protocols, such as proof-of-
work, proof-of-stake, and proof-of-authority, all have some BFT
characteristics.
• In order to create a decentralized network, the BFT is essential.
The consensus method determines the precise network structure. For instance,
BFT has a leader as well as peers who can and cannot validate.
In order to maintain the sequence of the Blockchain SC transactions and the
consistency of the global state through local transaction replay, consensus
messages must pass between the relevant peers.
More inventive approaches to designing BFT systems will be found and put into
practice as more individuals and companies investigate distributed and
decentralized systems. Systems that use BFT are also employed in sectors
outside of blockchains, such as nuclear power, space exploration, and aviation.
# RAFT consensus algorithm
Raft is a consensus algorithm that is designed to be easy to understand. It’s
equivalent to Paxos in fault-tolerance and performance. The difference is that it’s
decomposed into relatively independent subproblems, and it cleanly addresses
all major pieces needed for practical systems. We hope Raft will make consensus
available to a wider audience, and that this wider audience will be able to
develop a variety of higher quality consensus-based systems than are available
today.
Raft consensus algorithm explained
To begin with, Raft states that each node in a replicated state machine(server
cluster) can stay in any of the three states, namely, leader, candidate, follower.
The image below will provide the necessary visual aid.

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 :

• RequestVotes RPC is sent by the Candidate nodes to gather votes during


an election
• AppendEntries is used by the Leader node for replicating the log entries
and also as a heartbeat mechanism to check if a server is still up. If
heartbeat is responded back to, the server is up else, the server is down.
Be noted that the heartbeats do not contain any log entries.
1. Leader Election
In Raft, the cluster is composed of nodes that can be in three states: Leader,
Follower, or Candidate.
• Leader: Responsible for managing the replicated log and coordinating
activities.
• Follower: Passive, responds to requests from leaders or candidates.
• Candidate: Temporary state for nodes vying to become the new leader.
When an election starts (if the current leader fails or times out), candidates are
elected if they receive a majority of votes from the other nodes. This leader
election process ensures that there's exactly one authoritative node (leader) at
any given time1.
2. Log Replication
Once a leader is elected, it handles all client interactions involving updates to the
replicated log.
• The leader receives a command from a client and appends it to its local
log.
• It then sends AppendEntries RPCs (Remote Procedure Calls) to the
followers to inform them of the new entry.
• Followers acknowledge by replicating the entry in their own logs.
• When the leader has received acknowledgments from a majority of the
followers, it considers the entry committed and informs the followers
again.
3. Safety and Commitment
Raft ensures that all committed entries are durable even if the leader fails
immediately after commitment.
• Leader issues a heartbeat (empty AppendEntries RPCs) to keep followers
in sync and maintain their leader status.
• In a case of leader failure, committed entries are always preserved, and a
new leader's log must contain all committed entries.
4. Log Consistency
Raft maintains log consistency by enforcing rules on leaders and followers
regarding log entries:
• A leader can only commit a log entry if the entry is present on a majority
of nodes.
• A newly elected leader ensures its log is consistent by removing conflicting
entries from its followers, utilizing the entries it has.
explain each step
Sure! Let's break down each step of the Raft consensus algorithm in a detailed
manner:
1. Leader Election
When the system starts up or when the current leader fails, an election process
begins to select a new leader:
1. Timeout: When a follower doesn't hear from the leader for a pre-defined
"election timeout" period, it transitions to a candidate state.
2. Voting: The candidate increments its term (a logical counter used to
identify elections) and requests votes from all other nodes.
3. Majority Rule: Other nodes respond with their votes. If a candidate
receives votes from a majority of nodes, it becomes the new leader.
4. Heartbeat: The new leader sends heartbeat messages (AppendEntries
RPCs with no actual entries) to all followers to re-establish authority and
prevent new elections.
2. Log Replication
Once a leader is established, it begins handling client requests and replicating
the log across the followers:
1. Client Command: The client sends a command to the leader.
2. Log Entry: The leader appends this command as a new entry in its local
log.
3. AppendEntries RPC: The leader then sends this new log entry to all
followers using the AppendEntries RPC.
4. Acknowledgment: Followers append the entry to their own logs and send
an acknowledgment back to the leader.
5. Commitment: Once the leader receives acknowledgments from a
majority of followers, it considers the log entry as committed and applies
it to its state machine.
6. Notification: The leader notifies followers about the commitment via
subsequent AppendEntries RPCs, and followers update their state
machines accordingly.
3. Safety and Commitment
Raft ensures that committed entries are preserved and consistently applied
across all nodes:
1. Commitment Guarantee: A log entry is committed once a majority of
nodes have replicated it.
2. Durability: Committed entries survive leader failures. A new leader is
always selected from nodes that have the latest committed entries,
ensuring consistency.
3. Leader Match: The new leader synchronizes any missing entries with
followers, ensuring that the logs match.
4. Log Consistency
Raft enforces rules to keep logs consistent among all nodes:
1. Conflict Resolution: If a follower's log is inconsistent with the leader's, it
will be corrected. This happens if the follower has extra uncommitted
entries or misses some of the leader's entries.
2. Leader Responsibility: The leader maintains the log consistency by
ensuring that any entry at a given index is the same across all followers
before it’s committed.
3. Match Index: Each follower maintains a "match index" indicating the
highest log entry index it agrees with the leader.

# Advantages of RAFT algorithm

• 1. Simplicity and Understandability


Raft is designed to be straightforward and easy to implement. Its steps
and processes are clearly defined, making it easier for developers to
understand compared to more complex consensus algorithms like Paxos.
• 2. Strong Leadership Model
Raft utilizes a single authoritative leader to make decisions, which
simplifies the management of log replication and ensures consistency
across the network. This strong leadership model reduces the chances of
conflicting decisions and makes it easier to enforce log consistency.
• 3. Fault Tolerance
Raft ensures high availability and fault tolerance. Even if some nodes fail,
the system can still operate and eventually recover by electing a new
leader. This resilience is crucial for maintaining system stability in the
presence of node failures.
• 4. Efficient Leader Election
The election process in Raft is efficient, ensuring that a new leader is
elected quickly in the event of a leader failure. This minimizes downtime
and ensures continuity of service.
• 5. Log Consistency
Raft enforces rigorous rules to maintain log consistency across the nodes.
This consistency ensures that all committed entries remain durable and
that the system can recover from failures without data loss.
• 6. High Throughput
By centralizing the decision-making process to the leader, Raft can handle
a high number of transactions efficiently. This high throughput is
beneficial for applications requiring fast and reliable data processing.
• 7. Flexibility
Raft can be adapted to various applications and use cases. Its clear
architecture allows developers to tailor the consensus mechanism to their
specific needs, making it versatile for different environments.
• 8. Ease of Implementation
Raft's design prioritizes simplicity, making it easier to implement and
integrate into existing systems. This ease of implementation reduces the
development time and helps ensure that the system functions correctly.

# 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.

# Steps of smart contract:

Smart contract development is an elaborate process that necessitates a


planning, coding, testing, and then very critical launch on a blockchain. Below
are the steps followed in the smart contract development, designed to help you
build a smart contract that is secure, efficient, and effective.
• Step 1: Define the Contract Requirements
Determine the purpose and functionality of the contract. The contract must
specify which rules and what actions it will be applied to and automatically
perform. For instance, define the payment terms and set up triggers that allow
letting the funds know when to release them; surely, that prevents any
problems later on.
• Step 2: Choose a Blockchain Platform
As with the choice of tool, there also is a need for choosing the right option for
the platform for development. Ethereum is very well-known for its mature
implementation of support for Solidity, yet projects can also consider Binance
Smart Chain, Hyperledger, Solana, and so on. Research each blockchain, what it
can do, and fees it charges, and make your choice on how you should write your
smart contract in a blockchain.
• Step 3: Select the Programming Language
Every blockchain relies on at least one appropriate programming language. For
example, one most often makes use of Solidity in Ethereum and Chaincode in
Hyperledger in either Go or in Java. You will choose the appropriate language so
that it supports and is safe enough to make it easy for you to build your own
smart contract.
• Step 4: Write the Smart Contract Code
Specify the logic and conditions within your contract by using your preferred
programming language. Generating a smart contract by coding the
"if/when…then…" conditions would trigger action. At each stage, the contract
must be encoded in a leak-proof manner.
• Step 5: Test the Smart Contract
Testing is very important because, after all, you know what you want your smart
contract to do, right? And you can actually simulate real world condition test
networks like Rinkeby or Ropsten, which Ethereum already has. Testing will
catch bugs that might have otherwise locked up the specific amount of money
so that you won't lose it. That builds confidence, and that's exactly what you
need to make your own smart contract that works fine under any circumstances.
• Step 6: Audit the Code for Security
Security is paramount in smart contract development. Engage security auditors
to scan your code for vulnerable points or logic flaws or use the tools of
automated auditing. The best part is that once the contracts are deployed on
the blockchain, they are immutable; hence it is really important to take care of
the safety of your contract before its deployment.
• Step 7: Deploy the Smart Contract on the Blockchain
Once tested and audited, the contract is then deployed in that particular
blockchain. The term the deployment of a smart contract in this context means
publishing the smart contract. Publishing on a blockchain records the contract
permanently while publishing it. By this point, you will have built your own
smart contract solution that is ready to use.
• Step 8: Monitor and Maintain
Its performance must be checked at use to keep it at its smooth working stage.
Although it cannot be altered after deployment, there are a few that allow
upgradable contracts or layer-2 solutions to come in for improvement over time.
That helps trace the performance and thus you may come out with insights for
subsequent smart contract development.

# Benefits of smart contract:

1. Automation and Efficiency

• Self-Executing: Automatically enforce terms when conditions are met,


reducing manual effort.
• Reduced Costs: Eliminate intermediaries by automating processes, saving
time and money.
2. Transparency
• Immutable Records: Publicly accessible and unchangeable execution logs
ensure visibility.
• Trust: Transparent operations build trust since all actions are recorded on
the blockchain.
3. Security
• Tamper-Proof: Blockchain's cryptographic security protects against
tampering and fraud.
• Reliable Execution: Decentralized nature ensures consistent contract
execution even if nodes fail.
4. Accuracy
• Minimized Errors: Automation reduces human errors associated with
manual processes.
5. Savings
• Cost-Efficiency: Reducing intermediary and process costs leads to
significant savings.
• Reduced Legal Fees: Automating contract enforcement minimizes the
need for traditional legal services.
6. Speed
• Quick Execution: Faster transactions compared to traditional methods
involving multiple parties.

# How KYC can help on blockchain


• Enhanced Data Security: Blockchain technology ensures data security and
privacy using robust cryptographic techniques, making it nearly
impossible for unauthorized users to access sensitive information. This
means customer data is stored securely and transparently.
• Efficiency and Cost Reduction: Traditional KYC processes are often time-
consuming and costly due to repeated verifications by multiple financial
institutions. Blockchain can streamline this process by allowing data to be
verified once and then shared across authorized institutions, reducing
redundancy.
• Improved Data Quality and Accuracy: Blockchain provides an immutable
and transparent ledger. Any changes or updates in customer data are
recorded in real-time, ensuring that the information remains accurate and
up-to-date.
• Reduced Manual Labor: With the help of smart contracts, certain parts of
the KYC process can be automated. This reduces the need for manual
intervention and minimizes the risk of human error.
• Better Regulatory Compliance: As regulations worldwide demand stricter
KYC procedures, blockchain's inherent features of transparency and
immutability make it easier for institutions to comply with regulatory
requirements.
• Enhanced Customer Experience: By reducing the turnaround time for KYC
verifications, customers can enjoy a smoother and faster onboarding
process, leading to higher satisfaction.

# How Blockchain benefits food security in future:

Blockchain technology can significantly advance food security by transforming


supply chains and addressing critical issues:
1. Enhanced Traceability: Blockchain allows for complete traceability of food
products from farm to table. This transparency can help quickly identify
the source of contamination in case of foodborne illnesses and ensure
safer food supply chains.
2. Reduced Food Fraud: By providing an immutable record of food origin and
movement, blockchain helps verify the authenticity of food products,
reducing fraud, and ensuring that consumers receive genuine products.
3. Improved Efficiency: Blockchain streamlines the supply chain
management by eliminating intermediaries and automating processes
through smart contracts. This results in faster, more accurate deliveries
and reduced operational costs.
4. Decreased Food Waste: With better information on the movement and
shelf-life of products, blockchain can help optimize inventory
management and reduce food wastage.
5. Enhanced Transparency: Consumers can access detailed information
about the food products they purchase, such as where and how they were
produced, through QR codes linked to blockchain records. This builds trust
and allows for informed purchasing decisions
# Does digital identity works today using blockchain

Yes, blockchain technology is being actively used today to enhance digital


identity systems. Here are several ways how it works:

1. Decentralized Identity Management: Blockchain helps create


decentralized identity systems, often referred to as Self-Sovereign Identity
(SSI). This means individuals can own and control their identity data
without relying on any central authority.
2. Enhanced Security: Blockchain provides a secure framework for storing
and sharing identity information. The data is encrypted and distributed
across multiple nodes, making it extremely difficult for hackers to alter or
tamper with.
3. Interoperability: Blockchain-based digital identities can be used across
various platforms and services, reducing the need to repeatedly validate
identity. This interoperability streamlines processes and enhances user
convenience.
4. Immutable and Transparent Records: Any changes or updates to identity
information are recorded on the blockchain, ensuring an immutable and
transparent history. This helps in quickly verifying the authenticity and
integrity of the identity data.
5. Examples in Use: Many countries and organizations are adopting
blockchain for identity management. For instance, Estonia has a
blockchain-based national identity system, while companies like Microsoft
and IBM are developing blockchain identity solutions.

Blockchain-based digital identities are revolutionizing how we manage and


secure personal information, providing greater control, security, and efficiency

# 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

1. Open Source: Hyperledger fabric is an open-source blockchain


framework hosted by the Linux foundation. It has an active
community of developers The code is designed to be publicly
accessible. Anyone in the community can see, modify, and
distribute the code as they see fit. People across the world can
come and help to develop the source code.

2. Private and Confidential: In a public blockchain network each and


every node in the network is receiving a copy of the whole ledger.
Thus keeping privacy becomes a much bigger concern as everything
is open to everyone. In addition to this one, the identities of all the
participating members are not known and authenticated. Anyone
can participate as it is a public blockchain. But in the case of
Hyperledger fabric, the identities of all participating members are
authenticated. And the ledger is only exposed to the authenticated
members. This benefit is the most useful in industry-level cases, like
banking, insurance, etc where customer data should be kept
private.

3. Access Control: In the Hyperledger fabric, there is a virtual


blockchain network on top of the physical blockchain network. It
has its own access rules. It employs its own mechanism for
transaction ordering and provides an additional layer of access
control. It is especially useful when members want to limit the
exposure of data and make it private. Such that it can be viewed by
the related parties only. As an example when two competitors are
on the same network. The fabric also offers private data collection
and accessibility, where one competitor can control the access to its
own data such that the data do not get exposed to the other
competitor.

4. Chaincode Functionality: It includes a container technology to host


smart contracts called chain code that defines the business rules of
the system. And it’s designed to support various pluggable
components and to accommodate the complexity that exists across
the entire economy. This is useful for some of the specific types of
transactions like asset ownership change.

5. Performance: As the Hyperledger fabric is a private blockchain


network, There is no need to validate the transactions on this
network so the transaction speed is faster, resulting in a better
performance.

Feature Ripple (XRP) Ethereum (ETH)

Founded 2012 2015

Decentralized apps (DApps) and


Primary Purpose Cross-border payments
contracts

Native Token XRP Ether (ETH)

Consensus Federated Byzantine


Proof of Stake (PoS)
Mechanism Agreement

Transaction Speed Up to 1,500 TPS 15–30 TPS

Deflationary, 100 billion


Supply Model Inflationary, no max supply
max

Transaction Cost Very low Moderate to high

Use Cases Financial transfers DApps, NFTs, DeFi

Mainly used for


Token Economics Used for gas fees
transactions

Partnerships with banks, Widely used in DeFi and DApps


Notable Strengths
low fees ecosystem

Improved with PoS, but still


Energy Efficiency High
moderate
# Ripple consensus algorithm
Ripple Transaction protocol (RTXTP) is a blockchain protocol that possesses
most of the characteristics of the more popular protocols like Bitcoin and
Ethereum. But what makes it unique is its streamlining in accordance with the
aim of affordable and efficient transfer of funds, globally. The protocol achieves
this efficiency, especially in terms of speed, through the Ripple Protocol
Consensus Algorithm.

How does RPCA tackle the Problem?

• 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%

You might also like