0% found this document useful (0 votes)
24 views52 pages

DR - Gayatri Module1 Intro To BC

Block chain 1module

Uploaded by

sahilangad0
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)
24 views52 pages

DR - Gayatri Module1 Intro To BC

Block chain 1module

Uploaded by

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

CSDC7022 – Blockchain

1 . Introduction to Block-chain

Dr. Gayatri Bachhav


Associate Professor
Dept. of Computer Engineering,
VPPCOE &VA , Sion.
Ledger It is a digital database of information. There are three types of ledger. They are:
● 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.
Dr.Gayatri Bachhav 2
What is a Blockchain ?

Blockchain : A blockchain is a constantly growing ledger which keeps a permanent record of all the transactions that
have taken place in a secure, chronological, and immutable way.

Let's breakdown the definition,

❑Ledger: It is a file that is constantly growing.

❑Permanent: It means once the transaction goes inside a blockchain, you can put up it permanently in the
ledger.

❑Secure: Blockchain placed information in a secure way. It uses very advanced cryptography to make sure that
the information is locked inside the blockchain.

❑Chronological: Chronological means every transaction happens after the previous one.

❑Immutable: It means as you build all the transaction onto the blockchain, this ledger can never be changed.
So, A blockchain is a chain of blocks which contain information. Each block records all of the recent transactions, and once
completed goes into the blockchain as a permanent database. Each time a block gets completed, a new block is
generated.
Dr.Gayatri Bachhav 3
Who uses the blockchain?

Blockchain technology can be integrated into multiple areas. The primary use of blockchains is as a distributed ledger for
cryptocurrencies. It shows great promise across a wide range of business applications like Banking, Finance, Government,
Healthcare, Insurance, Media and Entertainment, Retail, etc.

• Supply Chain: Tracks goods' origin and journey for transparency and fraud reduction.
• Walmart: Uses blockchain to enhance food safety by tracking product origins.
• Healthcare Records: Securely store and share patient records to improve data accuracy.
• MedRec: Blockchain system for managing electronic medical records.
• Finance Payments: Enables faster, cheaper international money transfers.
• Voting: Provides transparent, tamper-proof systems for casting and counting votes.
• Voatz: Mobile voting platform using blockchain for secure elections.
• Real Estate: Streamlines property transactions, reducing fraud and paperwork.
• Digital Identity: Provides secure, verifiable management of digital identities.
• Intellectual Property: Protects digital content and intellectual property rights.
• Gaming Assets: Securely manage and trade in-game assets and currencies.
• Insurance Claims: Automates claims processing, reducing fraud and errors.

Dr.Gayatri Bachhav 4
Need of Blockchain ?
Time reduction: In the financial industry, blockchain can allow the quicker
settlement of trades. It does not take a lengthy process for verification,
settlement, and clearance. It is because of a single version of agreed-upon
data available between all stakeholders.
Unchangeable transactions: Blockchain register transactions in a
chronological order which certifies the unalterability of all operations, means
when a new block is added to the chain of ledgers, it cannot be removed or
modified.
Reliability: Blockchain certifies and verifies the identities of each interested
parties. This removes double records, reducing rates and accelerates
transactions.
Security: Blockchain uses very advanced cryptography to make sure that the
information is locked inside the blockchain. It uses Distributed Ledger
Technology where each party holds a copy of the original chain, so the
system remains operative, even the large number of other nodes fall.
Collaboration: It allows each party to transact directly with each other
without requiring a third-party intermediary.
Decentralized: It is decentralized because there is no central authority
supervising anything. There are standards rules on how every node
exchanges the blockchain information. This method ensures that all
transactions are validated, and all valid transactions are added one by one.

Dr.Gayatri Bachhav 5
Origin of Blockchain :

The concept of blockchain was introduced in 2008 by an anonymous person or group of people using the pseudonym
Satoshi Nakamoto. The original idea was presented in a whitepaper titled "Bitcoin: A Peer-to-Peer Electronic Cash System."
This paper laid the foundation for Bitcoin, the first cryptocurrency that uses blockchain technology to enable decentralized
digital transactions.

Key milestones in the development of blockchain technology include:

1970s: The development of cryptographic hash functions, which are essential for the security and integrity of blockchain
data.

1990s: Ralph Merkle developed Merkle Trees, a data structure that is fundamental to the efficient and secure verification
of data in blockchain systems.

2008: Satoshi Nakamoto's whitepaper proposed the blockchain as the underlying technology for Bitcoin, solving the
problem of double-spending in digital currencies.

Dr.Gayatri Bachhav 6
Structure of Blockchain and Block

Figure : The generic structure of a block

Fig: Blockchain Architecture Dr.Gayatri Bachhav 7


Address: Addresses are unique identifiers used in a blockchain transaction to denote senders and recipients. An address is usually a public
key or derived from a public key.

Transaction: A transaction is the fundamental unit of a blockchain. A transaction represents a transfer of value from one address to another.

Block: A block is composed of multiple transactions and other elements, such as the previous block hash (hash pointer), timestamp, and
nonce. A block is composed of a block header and a selection of transactions bundled together and organized logically.

A block contains several elements, which we introduce as follows:


Genesis block: A reference to a previous block is also included in the block unless it is a genesis block. This reference is the hash of the
header of the previous block. A genesis block is the first block in the blockchain that is hardcoded at the time the blockchain was first started.
The structure of a block is also dependent on the type and design of a blockchain.

Nonce: A nonce is a number that is generated and used only once. A nonce is used extensively in many cryptographic operations to provide
replay protection, authentication, and encryption. In blockchain, it's used in PoW consensus algorithms and for transaction replay protection.
A block also includes the nonce value.

Timestamp: A timestamp is the creation time of the block.

Merkle root: Merkle root is a hash of all of the nodes of a Merkle tree. In a blockchain block, it is the combined hash of the transactions in the
block. Merkle trees are widely used to validate large data structures securely and efficiently. In the blockchain world, Merkle trees are
commonly used to allow efficient verification of transactions. Merkle root in a blockchain is present in the block header section of a block,
which is the hash of all transactions in a block. This means that verifying only the Merkle root is required to verify all transactions present in
the Merkle tree instead of verifying all transactions one by one.
Dr.Gayatri Bachhav 8
Merkle Trees

Merkle Trees : A Merkle Tree, also known as a hash tree, is a tree structure in which every leaf node is a hash of a data block,
and every non-leaf node is a hash of its child nodes. This structure is crucial for ensuring the integrity and consistency of the
data in blockchain systems.

Structure of Merkle Trees :

Leaf Nodes: These are the hashes of the individual transactions or data blocks.

Non-leaf Nodes: These nodes are the hashes of their respective child nodes, combining to form the tree structure.

Root: The top node of the tree, known as the Merkle root, represents the entire data structure and is a single hash value.

Benefits of Merkle Trees:

Data Integrity: Merkle Trees ensure that data has not been altered or tampered with, as any change in the data would result
in a completely different Merkle root.

Efficient Verification: They allow for efficient and secure verification of the integrity of large sets of data.

Reduced Storage: Only the Merkle root needs to be stored to verify the integrity of all the underlying data.
Dr.Gayatri Bachhav 9
Enhanced Security: They provide a secure way to verify data without needing to access the entire dataset.
Specific block structure and Merkle Tree

Figure : The generic structure of a block Figure : The Merkle Tree

Dr.Gayatri Bachhav 10
Cryptographically Secure Hash Functions
A cryptographically secure hash function is an algorithm that takes an input (or message) and returns a fixed-size
string of bytes, typically a hash value. These functions are designed to be fast to compute and secure against certain
attacks.

Key properties of cryptographically secure hash functions include:

❑ Deterministic: The same input will always produce the same output.

❑ Fast Computation: The hash value can be quickly calculated.

❑ Preimage Resistance: It is infeasible to reverse-engineer the original input from its hash value.

❑ Small Changes in Input: Any small change in the input drastically changes the output hash.

❑ Collision Resistance: It is highly unlikely for two different inputs to produce the same hash value.
An example of a cryptographic hash function is SHA-256, which is used in Bitcoin and many other blockchain
systems.

Dr.Gayatri Bachhav 11
Validate the transactions using CryptoHash :

Blockchain uses the consensus (general agreement) method to


validate the transactions
Dr.Gayatri Bachhav 12
Cryptographically Secure Hash Functions

Dr.Gayatri Bachhav 13
Characteristics of Blockchain

Decentralization: In centralized transaction systems, each transaction needs to be validated in the central trusted
agency (e.g., the central bank), naturally resulting in cost and the performance jam at the central servers. In contrast to
the centralized mode, a third party is not needed in the blockchain. Consensus algorithms in blockchain are used to
maintain data stability in a decentralized network.
Persistency: Transactions can be validated quickly and invalid transactions would not be admitted by persons or miners
who mining the crypto. It is not possible to delete or roll back transactions once they are included in the blockchain
network. Invalid transactions do not carry forward further.
Anonymity: Each user can interact with the blockchain with a generated address, which does not disclose the real
identity of the miner. Note that blockchain cannot guarantee perfect privacy preservation due to the permanent thing.
Auditability: Blockchain stores data of users based on the Unspent Transaction Output (UTXO) model.
Every transaction has to refer to some previous unspent transactions. Once the current transaction is recorded into the
blockchain, the position of those referred unspent transactions switches from unspent to spent. Due to this process, the
transactions can be easily tracked and not harmed between transactions.
Transparency: The transparency of blockchain is like cryptocurrency, in bitcoin for tracking every transaction is done by
the address. And for security, it hides the person’s identity between and after the transaction. All the transactions are
made by the owner of the block associated with the address, this process is transparent and there is no loss for anyone
who is involved in this transaction.
Cryptography: The blockchain concept is fully based on security and for that, all the blocks on the blockchain network
want to be secure. And for security, it implements cryptography and secures the data using the cipher text and ciphers.

Dr.Gayatri Bachhav 14
Mining
Bitcoin Mining :

Bitcoin mining is the process of adding transaction records to Bitcoin's public ledger of past transactions. This ledger of
past transactions is called the blockchain as it is a chain of blocks. Bitcoin mining is used to secure and verify transactions
to the rest of the network.

Role of Bitcoin Miners :

Within the bitcoin networks, there are a group of people known as Miners. In miners, there was a process and confirm
transactions. Anybody can apply for a minor, and you could run the client yourself. However, these minors use very
powerful computers that are specifically designed to mine bitcoin transaction. They do this by actually solving math
problems and resolving cryptographic issues because every transaction needs to be cryptographically encoded and
secured. These mathematical problems ensure that nobody is tampering with that data.

Miners:

Blockchain mining is a process that validates every step in the transactions while operating all cryptocurrencies. People
involved in this mining they called miners. Blockchain mining is a process to validate each step in the transactions while
operating cryptocurrencies.

Dr.Gayatri Bachhav 15
How is the Bitcoin Blockchain built?

The role of a minor is to build the blockchain of records that forms the bitcoin ledger. These ledgers are called blocks,
and each block contains all the different transactions that have taken place. A new block is added in every 10 minutes
as a new Bitcoin Transaction takes place. So, as the minors process these different transactions, they build the block,
and when a block is confirmed, it gets added to the blockchain. The bitcoin blockchain provides a permanent record of
all bitcoin transactions to the beginning.

Dr.Gayatri Bachhav 16
Dr.Gayatri Bachhav 17
Dr.Gayatri Bachhav 18
Miners:
Miners are participants in a blockchain network who use their computational power to validate and add new transactions to the blockchain.
They compete to solve complex mathematical problems, and the first one to solve it gets to add the next block to the blockchain.

Explain life of miners in blockchain


● Anybody can apply for a miner, and you could run the client yourself.
● However, these miners use very powerful computers that are specifically designed to mine crypto transactions.
● They do this by actually solving math problems and resolving cryptographic issues because every transaction needs to be cryptographically
encoded and secured.
● These mathematical problems ensure that nobody is tampering with that data.
● The cryptocurrency is created by rewarding these miners for their work in solving the mathematical and cryptographical problems.

Roles of Miners
Transaction Validation:
Miners collect and validate transactions from the network.
They ensure that transactions are legitimate and comply with the network's rules, such as preventing double-spending.
Block Creation:
Once transactions are validated, miners group them into a block.
They must then solve a cryptographic puzzle to "mine" the block.
Consensus Mechanism:
By participating in the mining process, miners help achieve consensus in the network.
They ensure that all nodes agree on the state of the blockchain, maintaining its integrity and security.
Security:
Miners enhance the security of the blockchain by making it computationally expensive to alter the blockchain.
The more miners participate, the more secure the network becomes against attacks.
19
Dr.Gayatri Bachhav
Dr.Gayatri Bachhav 20
Dr.Gayatri Bachhav 21
Dr.Gayatri Bachhav 22
Types of Block
1. Genesis Block

Definition: The first block in any blockchain. It is unique because it does not reference a previous block.
Purpose: Serves as the foundation of the blockchain, from which all subsequent blocks are linked.
Example: Bitcoin’s Genesis Block, mined by Satoshi Nakamoto in January 2009. This block contains a unique message
embedded in its coinbase parameter: "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks." This
serves as a timestamp and a commentary on the financial instability at that time.

Example:
{
"index": 0,
"timestamp": "2009-01-03T18:15:05Z",
"transactions": [],
"previous_hash": "0",
"hash": "4a5e1e4baab89f3a32518a88ef76198b66f6293f",
"nonce": 2083236893
}

Dr.Gayatri Bachhav 23
Types of Block
{
2. Main Blocks "index": 600000,
"timestamp": "2020-10-18T12:00:00Z",
Definition: Standard blocks added to the blockchain after "transactions": [
the genesis block. Each main block contains a list of {
transactions, a reference to the previous block, a "sender": "Alice",
timestamp, a nonce, and a cryptographic hash. "receiver": "Bob",
Purpose: To record and validate transactions, ensuring the "amount": 0.5
integrity and chronological order of the blockchain. },
{
Example: A typical Bitcoin block. "sender": "Charlie",
"receiver": "Dave",
"amount": 1.0
}
],
"previous_hash":
"0000000000000000000a7c7c4a9a5c8b0b8b1d8e",
"hash": "0000000000000000000c91a45e9a3e06b8a1d8b3"
"nonce": 304387
}

Dr.Gayatri Bachhav 24
Types of Block
3. Orphan Blocks
Definition: Valid blocks that are not part of the main
blockchain. They occur when two miners solve the proof-of-
work simultaneously, and one block is eventually discarded.
Purpose: Orphan blocks serve no purpose in the main chain
but illustrate the competitive nature of mining.

Example: An orphan block in Bitcoin.


{
"index": 500001,
"timestamp": "2017-12-01T08:00:00Z",
"transactions":
[
{ "sender": "Eve", "receiver": "Frank", "amount": 0.8 }
],
"previous_hash": "0000000000000000000b2c3d4e5f6a7b8c9d0e1f",
"hash": "0000000000000000000d4e5f6a7b8c9d0e1f2b3c",
"nonce": 54321
}

Dr.Gayatri Bachhav 25
Types of Block
4. Candidate Blocks
Definition: Blocks that are being mined and have not yet been
confirmed. These blocks are candidates to be added to the
blockchain but are not yet validated by the network.
Purpose: Represents the ongoing work of miners attempting to
add new blocks to the blockchain.
Example: A Bitcoin candidate block.
{
"index": 600001,
"timestamp": "2024-07-13T12:00:00Z",
"transactions": [
{
"sender": "Grace",
"receiver": "Heidi",
"amount": 0.3
}
],
"previous_hash":
"0000000000000000000c91a45e9a3e06b8a1d8b3",
"hash": "0000000000000000000f8a9b0c1d2e3b4c5d6e7f",
"nonce": 99999
} Dr.Gayatri Bachhav 26
Types of Blockchain / Types of Blockchain Architecture

1. Public Blockchain:

A public blockchain is a decentralized network that is open to anyone who wants to participate.
It operates on a consensus mechanism, such as proof-of-work (PoW) or proof-of-stake (PoS).

Characteristics:
Decentralized: No central authority or single point of control.
Transparent: Transactions are visible to everyone on the network.
Secure: High levels of security through cryptographic techniques and consensus algorithms.
Immutable: Once transactions are recorded, they cannot be altered.

Examples:
Bitcoin: The first and most well-known public blockchain, primarily used for peer-to-peer digital currency transactions.

Use Cases:
Cryptocurrencies: Bitcoin, Ethereum, and other digital currencies.
Decentralized Applications (dApps): Platforms like Ethereum support smart contracts and dApps.
Voting Systems: Transparent and tamper-proof voting mechanisms.

Dr.Gayatri Bachhav 27
Advantages:

Transparency: Complete transparency ensures trust and accountability.


Security: Robust security mechanisms protect against fraud and hacking.
Decentralization: Reduces the risk of centralized control and single points of
failure.

Disadvantages:

Scalability: Can suffer from slower transaction speeds and higher fees.
Energy Consumption: PoW-based blockchains can consume significant amounts
of energy.
Public Blockchain

Dr.Gayatri Bachhav 28
2. Private Blockchain

A permissioned network where access is restricted to specific


participants. Often used by businesses and organizations for
internal purposes.

Characteristics:
Controlled Access:
Only authorized entities can join and participate.
Faster Transactions:
Reduced number of nodes can lead to quicker transaction
processing.
Private:
Transactions are not visible to the public, ensuring
confidentiality.
Centralized:
Managed by a central entity or consortium.

Dr.Gayatri Bachhav 29
Advantages:
Privacy: Confidential transactions are maintained within the network.
Efficiency: Can handle a higher transaction volume with lower latency.
Governance: Easier to enforce regulations and policies.

Disadvantages:
Centralization: Reduced decentralization may lead to trust issues.
Limited Transparency: Lack of public transparency can be a drawback in some use cases.

Use Cases:
Supply Chain Management: Tracking and verifying the authenticity of goods.
Healthcare: Secure and private management of patient records.
Financial Services: Streamlined interbank settlements and transactions.

Examples:
Hyperledger Fabric

Dr.Gayatri Bachhav 30
3. Consortium Blockchains (Federated Blockchains)

A hybrid model where multiple organizations manage the


network. It is partially decentralized and provides controlled
access to participating entities. For Ex. A consortium
blockchain is a group of multiple financial institutions where
each financial institution has its private blockchain.

Characteristics:

Shared Control: Managed by a group of organizations.


Permissioned: Access is restricted to authorized participants.
Collaborative: Facilitates cooperation among organizations,
such as industry groups or business partners.
Efficient: Can achieve higher performance compared to public
blockchains due to limited node participation.

Dr.Gayatri Bachhav 31
Advantages:
Security: Combines the security of public blockchains with the privacy of private blockchains.
Scalability: Can handle a larger number of transactions with better performance.
Governance: Multiple entities share governance, reducing the risk of a single point of control.

Disadvantages:
Complexity: Coordinating multiple organizations can be complex.
Trust: Requires trust between participating entities.

Use Cases:
Banking: Interbank settlements and cross-border payments.
Supply Chain: Coordinating logistics and verifying provenance across multiple stakeholders.
Insurance: Streamlined claims processing and fraud detection.

Examples:
R3 Corda:

Dr.Gayatri Bachhav 32
4. Hybrid Blockchains
A combination of public and private blockchain features, allowing for customizable levels of accessibility and
transparency.

Characteristics:
Flexible Access: Can be configured to allow both public and private participants.
Controlled Transparency: Sensitive data can be kept private, while selected information is made public.
Scalable: Can handle a higher volume of transactions by leveraging both private and public blockchain
components.
Customizable: Organizations can tailor the blockchain to meet specific needs, such as regulatory compliance or
data privacy.
Example
A company wishes to conduct a private transaction with another company. The transaction is processed by the two
companies using a private blockchain. A digital record of the exchange is created and its validity is confirmed by the
private blockchain.
The private blockchain notifies the public blockchain that a transaction has happened once it has been confirmed.
The transaction data from the private blockchain is incorporated into a new block that is created on the public
blockchain.The transaction is made publicly apparent when the new block is added to the public blockchain’s
ledger.

Dr.Gayatri Bachhav 33
Advantages:

Customization: Tailored solutions that balance privacy and transparency.


Interoperability: Can interact with other blockchains, enhancing flexibility.
Scalability: Improved performance by using private and public blockchain elements.

Disadvantages:

Complexity: Implementation can be more complex than purely public or private blockchains.
Governance: Requires careful management of access and permissions.

Use Cases:

Financial Services: Combining public auditability with private transaction confidentiality.


Healthcare: Protecting patient data privacy while allowing public access to certain records for research.
Supply Chain: Public visibility of product origins with private business transactions.

Example:
Dragonchain

Dr.Gayatri Bachhav 34
Comparison of Public, Private, and Consortium blockchains

Dr.Gayatri Bachhav 35
Dr.Gayatri Bachhav 36
Components of Blockchain

Node: Nodes are network participants and their devices permit them to keep track of the distributed ledger and serve as
communication hubs in various network tasks. A block broadcasts all the network nodes when a miner looks to add a new
block in transactions to the blockchain.
● Full Node: It maintains a full copy of all the transactions. It has the capacity to validate, accept and reject the transactions.
● Partial Node: 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. These nodes have low storage and low computational power.
Transactions: A transaction refers to a contract or agreement and transfers of assets between parties. The asset is typically
cash or property. The network of computers in blockchain stores the transactional data as copy with the storage typically
referred to as a digital ledger.
Block: A block in a blockchain network is similar to a link in a chain. In the field of cryptocurrency, blocks are like records that
store transactions like a record book, and those are encrypted into a hash tree. There are a huge number of transactions
occurring every day in the world. It is important for the users to keep track of those transactions, and they do it with the
help of a block structure. The block structure of the blockchain is mentioned in the very first diagram in this article.
Chain: Chain is the concept where all the blocks are connected with the help of a chain in the whole blockchain structure in
the world. And those blocks are connected with the help of the previous block hash and it indicates a chaining structure.
Miners: Blockchain mining is a process that validates every step in the transactions while operating all cryptocurrencies.
People involved in this mining they called miners. Blockchain mining is a process to validate each step in the transactions
while operating cryptocurrencies.
Consensus: A consensus is a fault-tolerant mechanism that is used in computer and blockchain systems to achieve the
necessary agreement on a single state of the network among distributed processes or multi-agent systems, such as with
cryptocurrencies. It is useful in record keeping and other things.
37
Dr.Gayatri Bachhav
Consensus

Consensus: A consensus is a fault-tolerant mechanism that is used in computer and blockchain systems to achieve the
necessary agreement on a single state of the network among distributed processes or multi-agent systems, such as with
cryptocurrencies. It is useful in record keeping and other things.

Common Consensus Protocols: There are different kinds of consensus mechanism algorithms, each of which works on
different principles are as follows.

1. Proof of Work (PoW): Proof of Work required a stakeholder node to prove that the work is done and submitted by
them certifying them to receive the right to add new transactions in the blockchain.

1. Proof of Stake (PoS): The proof of Stake is also a common consensus algorithm that evolved as a low-cost low-energy-
consuming, low-energy-consuming alternative for the PoW algorithm. For providing the responsibilities the public
ledger provides by the virtual currency token like Bitcoin and Ethereum.

1. Proof of Capacity (PoC): Proof of Capacity (PoC) allow sharing of memory space of the nodes in the blockchain
network.

1. Proof of Elapsed Time (PoET): It encrypts the passage of time cryptographically to reach an agreement without
expending many resources.

Dr.Gayatri Bachhav 38
Blockchain – Proof of Work (PoW)

Proof of Work (PoW) is a consensus algorithm used in blockchain technology to ensure the integrity and security of the network.
It is the mechanism that allows decentralized networks to reach agreement, or consensus, on the state of the blockchain.
How PoW Works:
Mining:
Definition: Mining is the process by which transactions are verified and added to the blockchain.
Miners: Individuals or entities called miners compete to solve a complex mathematical puzzle, which is part of the PoW
process.
Puzzle Solving:
Hash Function: The puzzle involves finding a hash value that meets certain criteria, typically starting with a certain number
of leading zeros, using a cryptographic hash function like SHA-256.
Nonce: Miners modify a small piece of data called a nonce within the block and repeatedly hash the block until the hash
meets the required criteria.
Difficulty: The difficulty of the puzzle adjusts periodically based on the network's overall computational power to ensure
blocks are mined at a consistent rate.
Block Verification:
First to Solve: The first miner to solve the puzzle broadcasts the solution, along with the block, to the network.
Validation: Other miners and nodes validate the solution and the transactions in the block. If the solution is correct and the
transactions are valid, the block is added to the blockchain.
Reward:
Incentive: Miners are rewarded with newly minted cryptocurrency (e.g., bitcoins) and transaction fees for their work. This
reward provides the economic incentive for miners to participate in the network.
39
Dr.Gayatri Bachhav
Security:
Difficulty and Cost: The PoW process is resource-intensive, requiring significant computational power and energy.
This makes it prohibitively expensive for attackers to gain control of the network.
51% Attack: For an attacker to tamper with the blockchain, they would need to control more than 50% of the
network’s total computational power, which is highly unlikely due to the high cost and resources required.

Benefits of PoW:

Security: The computational effort required makes it difficult for malicious actors to alter the blockchain, providing strong
security guarantees.
Decentralization: PoW supports a decentralized network by allowing anyone with the necessary computational resources
to participate in the mining process.
Immutability: Once a block is added to the blockchain, altering it would require re-mining all subsequent blocks, making it
practically immutable.

The most widely used proof-of-work consensus is based on SHA-256 and was introduced as a part of Bitcoin. Others
include Scrypt, SHA-3, scrypt-jane, scrypt-n, etc.

Dr.Gayatri Bachhav 40
Blockchain – Proof of Stake (PoS)

Proof of Stake (PoS) is a consensus algorithm used in blockchain networks as an alternative to Proof of Work (PoW). PoS aims to provide the
same essential functions as PoW—securing the network and reaching consensus—while addressing some of PoW's significant drawbacks,
such as high energy consumption.
How PoS Works:
Validators:
Definition: In PoS, validators (sometimes referred to as "stakers" or "forgers") are responsible for validating transactions and creating
new blocks.
Selection: Validators are chosen to create new blocks based on the number of cryptocurrency tokens they hold and are willing to
"stake" as collateral.
Staking:
Stake: Validators must lock up a certain amount of cryptocurrency in a special contract. This stake acts as a financial incentive to behave
honestly.
Weight: The probability of being chosen to validate a block is proportional to the amount of cryptocurrency staked. The more tokens a
validator stakes, the higher the chances of being selected.
Block Creation:
Selection Process: When it's time to create a new block, the network randomly selects a validator from the pool of stakers. The
selection process can be influenced by factors like the amount staked and the validator's past performance.
Validation: The chosen validator creates the new block, validates transactions, and broadcasts the block to the network.
Reward:
Incentive: Validators earn rewards for their participation, typically in the form of transaction fees and, in some PoS systems, newly
minted cryptocurrency.
Penalties: Misbehaving validators can lose part or all of their staked tokens as a penalty, which discourages malicious activity and
ensures network security.
Dr.Gayatri Bachhav 41
Benefits of PoS:
Energy Efficiency: PoS is significantly less energy-intensive than PoW because it does not require massive computational
power to solve complex puzzles.
Decentralization: PoS can be more accessible to a wider range of participants since it doesn't require expensive mining
equipment.
Security: By making it costly to act maliciously (since validators risk losing their stake), PoS helps secure the network
against attacks.
Scalabilit: PoS can potentially handle a higher transaction throughput compared to PoW systems.

Examples of PoS Blockchains:

Ethereum 2.0: Transitioning from PoW to PoS to improve scalability and reduce energy consumption.
Cardano (ADA): Utilizes the Ouroboros PoS protocol to secure its network.
Tezos (XTZ): Implements a self-amending PoS blockchain, allowing for on-chain governance and upgrades.

Dr.Gayatri Bachhav 42
Blockchain - Proof of Capacity (PoC)

Proof of Capacity (PoC), also known as Proof of Space, is a consensus algorithm used in blockchain networks that leverages
the storage capacity of participants' hard drives rather than computational power or stake. PoC aims to provide a more
energy-efficient and accessible alternative to traditional consensus mechanisms like Proof of Work (PoW) and Proof of Stake
(PoS).

How PoC Works:

Plotting:
Definition: Plotting is the initial process where participants (miners) generate and store large datasets (plots) on their
hard drives. These plots contain all possible solutions to the mathematical puzzles required for mining blocks.
Process: The plotting phase involves generating a series of cryptographic hashes and storing them on the hard drive.
This process can take several hours to complete but is done only once.

Mining:
Definition: Mining in PoC involves searching through the pre-generated plots to find a solution that meets the required
criteria for creating a new block.
Selection: When a new block needs to be mined, the network broadcasts a challenge to all miners. Each miner searches
their plots to find the closest matching solution.
Winner: The miner with the closest match wins the right to create the new block and is rewarded with transaction fees
and possibly new cryptocurrency tokens.
Dr.Gayatri Bachhav 43
Verification:
• Block Creation: The winning miner creates the new block, includes the transaction data, and broadcasts it to the network.
• Validation: Other nodes in the network validate the new block and the included transactions. If the block is valid, it is added to the
blockchain.

Benefits of PoC:

• Energy Efficiency: PoC is significantly less energy-intensive than PoW since it relies on storage capacity rather than continuous high-power
computations.
• Accessibility: PoC mining can be done using standard consumer hardware, making it more accessible to a wider range of participants.
• Decentralization: Lower entry barriers can promote greater decentralization by enabling more participants to join the network.
• Criticisms of PoC:
• Initial Plotting: The plotting process can be resource-intensive and time-consuming, although it is only required once.
• Storage Waste: Large amounts of storage are required to participate effectively in PoC mining, which can lead to potential wastage of hard
drive space.
• Centralization Risk: Entities with large storage capacities might dominate the network, leading to potential centralization.

Examples:

• Burstcoin (BURST): First cryptocurrency to use PoC, enabling energy-efficient mining via hard drive space.
• Chia Network (XCH): Uses Proof of Space and Time (PoST) for a secure and sustainable blockchain.
• SpaceMint: Conceptual cryptocurrency utilizing Proof of Space for energy-efficient and secure consensus.
Dr.Gayatri Bachhav 44
Blockchain – Proof of Elapsed Time (PoET)
It leverages trusted computing to ensure fairness and efficiency in the selection of leaders who propose new blocks. PoET is
designed to be an energy-efficient alternative to Proof of Work (PoW) and is primarily associated with permissioned
blockchain networks.
How PoET Works:
Trusted Execution Environment (TEE):
Definition: PoET relies on a trusted execution environment (TEE), such as Intel's Software Guard Extensions (SGX), to
generate random wait times.
Security: The TEE ensures that the wait times cannot be tampered with, providing a secure and trusted method for
leader selection.
Random Wait Time:
Generation: Each node in the network requests a random wait time from the TEE.
Sleep: Nodes "sleep" for the specified wait time, during which they do not perform any other tasks related to block
creation.
Leader Selection:
First to Wake: The node with the shortest wait time wakes up first and becomes the leader, gaining the right to
propose a new block.
Block Proposal: The selected node creates a new block and broadcasts it to the network for validation.
Validation and Verification:
Block Validation: Other nodes in the network validate the proposed block to ensure it contains valid transactions and
adheres to the network's rules.
Attestation: The TEE provides a cryptographic proof, known as an attestation, which verifies that the node indeed
waited for the specified time. Dr.Gayatri Bachhav 45
Fairness and Efficiency:

Equity: PoET ensures that all nodes have an equal chance of being selected as the leader by generating random wait times.
Energy Efficiency: Since nodes are idle during their wait times, PoET consumes significantly less energy compared to PoW,
where nodes continuously perform intensive computations.

Benefits of PoET:

Energy Efficiency: PoET significantly reduces energy consumption compared to PoW, making it a more sustainable option.
Fairness: The use of random wait times ensures that all nodes have an equal opportunity to propose new blocks, promoting
fairness in the network.
Security: The TEE provides a secure environment for generating and verifying wait times, preventing tampering and ensuring the
integrity of the consensus process.
Scalability: PoET can handle a high transaction throughput, making it suitable for enterprise applications and permissioned
blockchain networks.
Examples :

• Hyperledger Sawtooth: Enterprise blockchain platform using PoET for energy-efficient and fair consensus.
• Intel SGX: Trusted execution environment used in PoET to generate secure random wait times for leader selection.
• Intel Blockchain Framework: Framework leveraging PoET to ensure secure and efficient consensus in permissioned blockchain
networks.
Dr.Gayatri Bachhav 46
Limitations / Challenges of blockchain
Scalability:
• Transaction Throughput: Blockchain networks often struggle to handle a high volume of transactions, leading to slower
processing times and higher fees.
• Network Congestion: Popular blockchains like Bitcoin and Ethereum experience congestion during peak times, impacting
performance.

Energy Consumption:
• Proof of Work (PoW): PoW-based blockchains consume significant amounts of energy due to the computational power
required for mining.
• Environmental Impact: The high energy usage of PoW blockchains has raised concerns about their environmental
sustainability.

Latency:
• Confirmation Times: Transactions in blockchain networks can take several minutes to hours to be confirmed, depending
on network conditions and consensus mechanisms.
• User Experience: The delay in transaction confirmation can affect user experience, especially for applications requiring
instant transactions.

Cost:
• Transaction Fees: Transaction fees can vary widely and become prohibitively expensive during periods of high demand.
• Infrastructure Costs: Setting up and maintaining blockchain infrastructure, including nodes and mining equipment, can
be costly.

Dr.Gayatri Bachhav 47
Security:
• 51% Attacks: If a single entity gains control of more than 50% of the network’s hashing power, it can manipulate the
blockchain, leading to double-spending and other malicious activities.
• Smart Contract Vulnerabilities: Bugs and vulnerabilities in smart contracts can lead to significant financial losses and
security breaches.

Regulatory and Legal Issues:


• Unclear Regulations: The regulatory landscape for blockchain and cryptocurrencies is still evolving, leading to uncertainty
and potential legal challenges.
• Compliance: Ensuring compliance with existing financial regulations, such as anti-money laundering (AML) and know your
customer (KYC) requirements, can be complex.

Interoperability:
• Fragmented Ecosystem: Different blockchain networks often operate in silos, making it challenging to transfer assets or
data between them.
• Standards: Lack of standardized protocols for interoperability hinders the integration of various blockchain platforms.

Data Privacy:
• Public Ledgers: Transactions on public blockchains are transparent and immutable, which can conflict with data privacy
regulations like GDPR.
• Sensitive Information: Storing sensitive information on a blockchain can raise privacy and confidentiality concerns.

Dr.Gayatri Bachhav 48
Complexity:
Technical Knowledge: Implementing and managing blockchain solutions requires specialized technical
knowledge and expertise.
User Adoption: The complexity of blockchain technology can be a barrier to user adoption, especially for non-
technical users.

Governance:
Decentralized Governance: Achieving consensus on network upgrades and protocol changes can be difficult in
decentralized blockchain networks.
Forks: Disagreements within the community can lead to hard forks, resulting in split chains and duplicated efforts.

Storage Requirements:
Blockchain Size: The size of the blockchain grows over time, requiring more storage capacity for full nodes.
Data Management: Efficiently managing and accessing large amounts of data stored on the blockchain can be
challenging.

Dr.Gayatri Bachhav 49
Block Chain
Block Chain

Dr.Gayatri Bachhav 50
Dr.Gayatri Bachhav 51
Dr.Gayatri Bachhav 52

You might also like