0% found this document useful (0 votes)
6 views26 pages

CBT Unit - 1 Notes

Blockchain technology serves as a decentralized digital ledger for secure and transparent transaction recording, originally developed for Bitcoin but now applicable in various fields. Public blockchains ensure openness and trust among participants, while permissioned blockchains restrict access to authorized users, enhancing privacy and compliance. Key features of blockchain include decentralization, transparency, immutability, and security, making it suitable for applications in finance, supply chain, healthcare, and more.

Uploaded by

viswaaeswaran
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)
6 views26 pages

CBT Unit - 1 Notes

Blockchain technology serves as a decentralized digital ledger for secure and transparent transaction recording, originally developed for Bitcoin but now applicable in various fields. Public blockchains ensure openness and trust among participants, while permissioned blockchains restrict access to authorized users, enhancing privacy and compliance. Key features of blockchain include decentralization, transparency, immutability, and security, making it suitable for applications in finance, supply chain, healthcare, and more.

Uploaded by

viswaaeswaran
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/ 26

1.

​ Blockchain as Public Ledgers

Introduction:

Blockchain is an innovative technology that serves as a decentralized digital ledger for


recording transactions in a secure, transparent, and tamper-proof manner. Originally
introduced as the backbone technology behind Bitcoin, blockchain has now evolved far beyond
cryptocurrencies. When used as a public ledger, blockchain ensures openness, trust, and
security in environments where multiple participants are involved without relying on a
centralized authority.

Definition of Blockchain:

A blockchain is a continuously growing list of records, called blocks, which are linked and
secured using cryptographic techniques. Each block contains:

●​ A timestamp​

●​ Transaction data​

●​ A cryptographic hash of the previous block​

This structure makes the blockchain resistant to modification of the data once it has been
recorded.

Public Ledger in Blockchain Context:

A public ledger refers to a record that is accessible and viewable by anyone. In a public
blockchain, such as Bitcoin or Ethereum, the ledger is not only shared across multiple nodes
but also open to all. Anyone can participate in the network, view the transactions, and verify the
data.

Key Features of Blockchain as Public Ledger:

1. Decentralization:

●​ No single authority controls the data.​


●​ Instead, a network of computers (nodes) maintains and validates the ledger.​

●​ Eliminates the risk of a single point of failure.​

2. Transparency:

●​ All participants have access to the entire ledger.​

●​ Every transaction is visible and verifiable.​

●​ Builds trust among participants, especially in financial systems and supply chains.​

3. Immutability:

●​ Once a transaction is recorded on the blockchain, it cannot be altered or deleted.​

●​ Each block is linked to the previous one using cryptographic hashes.​

●​ Tampering with one block would require altering all subsequent blocks, which is
computationally infeasible in large networks.​

4. Security:

●​ Blockchain uses cryptographic hashing (SHA-256) and digital signatures to secure


data.​

●​ Unauthorized access is prevented, and only valid transactions are recorded.​

●​ Transactions are verified through consensus mechanisms before being added to the
ledger.​

5. Consensus Mechanism:

●​ Consensus algorithms ensure agreement among distributed nodes on the validity of


transactions.​

●​ Common mechanisms:​

○​ Proof of Work (PoW): Requires computational work to validate a block (used in


Bitcoin).​
○​ Proof of Stake (PoS): Validators are chosen based on the number of coins they
hold and are willing to "stake".​

Working of Public Blockchain Ledger:

1.​ A user initiates a transaction.​

2.​ The transaction is broadcast to the peer-to-peer (P2P) network.​

3.​ Nodes validate the transaction using a consensus mechanism.​

4.​ Validated transactions are grouped into a block.​

5.​ The new block is added to the blockchain.​

6.​ The updated ledger is shared with all nodes in the network.​

Real-world Applications:

a) Cryptocurrencies:

●​ Bitcoin, Ethereum, and other digital currencies use public blockchains to maintain
transparent records of all transactions.​

●​ Every coin's origin and transfer history are traceable on the public ledger.​

b) Supply Chain Management:

●​ Blockchain tracks goods from origin to destination.​

●​ Increases efficiency and trust by showing proof of origin and movement history.​

c) Voting Systems:

●​ Digital voting systems built on blockchain ensure transparency, security, and


tamper-proof voting records.​
●​ Reduces fraud and enhances voter trust.​

d) Healthcare:

●​ Patient records can be shared securely among doctors and hospitals.​

●​ Ensures data accuracy, access control, and tamper resistance.​

e) Intellectual Property (IP):

●​ Artists and creators can register their work on a blockchain.​

●​ Ensures proof of ownership and enables fair royalty distribution.​

Advantages of Blockchain as Public Ledger:

●​ Enhanced trust: All users can independently verify transactions.​

●​ Data integrity: Tamper-proof records prevent fraud and manipulation.​

●​ Reduced cost: Eliminates intermediaries in processes like money transfer.​

●​ Real-time updates: Transactions are updated and reflected across the network
instantly.​

●​ Increased efficiency: Automation using smart contracts saves time and resources.​

Challenges and Limitations:

●​ Scalability: As the number of transactions increases, the size of the blockchain grows,
requiring more storage and computational power.​

●​ Energy consumption: Proof of Work-based systems (like Bitcoin) consume high


energy.​
●​ Privacy concerns: Although public blockchains are transparent, sensitive data may be
exposed.​

●​ Regulatory issues: Many governments are still working on frameworks to regulate


public blockchain use.​

Conclusion:

Blockchain as a public ledger represents a revolutionary shift in data management. It


combines transparency, security, and decentralization, making it ideal for a wide range of
applications, especially in trustless environments. Despite some challenges, its potential to
transform industries is immense and still growing.
Block in a Blockchain

Introduction:

A block is the basic building unit of a blockchain. Just as pages form a book, blocks form a
blockchain. Each block securely stores a group of transactions, and all blocks are linked
together in a linear, chronological order using cryptographic techniques.

In essence, a block functions as a digital record book page, and once filled with transactions,
a new block is created and connected to the previous one — thus forming a "chain" of blocks.

Structure of a Block:

A typical block in a blockchain consists of the following three main parts:

1. Block Header:

Contains metadata (information about the block) such as:

●​ Block Number / Index: Unique ID of the block in the chain.​

●​ Timestamp: The date and time when the block was created.​

●​ Previous Block Hash: The cryptographic hash of the previous block, ensuring the
chain’s linkage.​

●​ Merkle Root Hash: A single hash that summarizes all transactions in the block,
generated using a Merkle Tree.​

●​ Nonce: A number used in the mining process to generate a valid hash (mainly used in
Proof of Work).​

●​ Difficulty Target: The complexity of the mining puzzle.​

2. Transactions:

●​ This is the main content of the block.​


●​ A block holds a list of verified and validated transactions.​

●​ The number of transactions in a block varies depending on the size and the blockchain
(e.g., Bitcoin block = ~1 MB).​

3. Hash of the Block:

●​ A unique digital fingerprint of the block’s contents.​

●​ Any change in block data alters the hash, alerting the network to tampering.​

●​ Ensures data integrity and immutability.​

Working of a Block:

1.​ Transaction Initiation:​

○​ A user initiates a transaction (e.g., sending cryptocurrency).​

2.​ Transaction Validation:​

○​ The network nodes (miners/validators) verify the transaction.​

3.​ Block Formation:​

○​ Validated transactions are grouped into a new block.​

4.​ Block Mining / Confirmation:​

○​ Miners solve a cryptographic puzzle (Proof of Work) to add the block to the chain.​

5.​ Block Addition:​

○​ The new block is linked to the previous block using its hash.​

6.​ Ledger Update:​

○​ All network participants receive the updated copy of the blockchain.​


Diagram: Structure of a Block

(You can draw this during the exam)

+-----------------------------+
| Block Header |
|----------------------------|
| Previous Hash |
| Timestamp |
| Nonce |
| Merkle Root |
|----------------------------| (or)
| Transactions List |
| - Txn 1 |
| - Txn 2 |
| - ... |
+-----------------------------+

Importance of a Block in Blockchain:

●​ Data Integrity: Each block is secured with a unique hash.​

●​ Transparency: Stores all transaction data in a verifiable manner.​

●​ Security: The block’s hash and linkage to the previous block make tampering almost
impossible.​

●​ Traceability: Each block contains historical data that helps track asset movement.​

●​ Decentralization: Copies of the block exist across all network nodes.​

Merkle Tree and Merkle Root in a Block:

●​ Transactions in a block are hashed and arranged in a Merkle Tree structure.​


●​ The Merkle Root is the top hash that represents all transactions.​

●​ Useful for quick verification and reducing data size.​

Example:

mathematica
CopyEdit
Txn A + Txn B -> Hash AB
Txn C + Txn D -> Hash CD
Hash AB + Hash CD -> Merkle Root

Types of Blockchains (in context of blocks):

●​ Public Blockchain: Anyone can participate and view the block data (e.g., Bitcoin).​

●​ Private Blockchain: Only authorized users can view or add blocks.​

●​ Consortium Blockchain: A group of organizations manage the chain together.​

Block Size and Block Time:

●​ Block Size: Determines how many transactions a block can hold (e.g., Bitcoin ≈ 1 MB).​

●​ Block Time: The average time it takes to create a new block (e.g., Bitcoin ≈ 10 minutes,
Ethereum ≈ 15 seconds).​

Challenges Related to Blocks:

1.​ Scalability:​

○​ Limited block size can slow transaction speed.​

2.​ Orphan Blocks:​


○​ Blocks that are not included in the main chain due to a fork.​

3.​ Storage Requirements:​

○​ More blocks = larger blockchain = higher storage demand.​

Conclusion:

A block is the heart of blockchain technology. It is a secure, immutable container of


transactions linked to other blocks through cryptographic hashes. Each block ensures
transparency, trust, and decentralization, forming the foundation for various blockchain
applications like cryptocurrencies, supply chain, healthcare, and more. Understanding the
structure and function of a block is essential to understanding how blockchain works as a whole.
Permissioned Model of Blockchain

Introduction:

Blockchain technology is known for its decentralized and distributed nature, where data is
recorded securely across a network of nodes. Based on accessibility and control, blockchains
are classified into two major models:

●​ Permissionless (Public) Blockchains​

●​ Permissioned (Private/Consortium) Blockchains​

The Permissioned Model is a type of blockchain where only authorized participants are
allowed to join the network, access data, or perform transactions. It is widely used in enterprise
and business applications where control, privacy, and compliance are crucial.

Definition:

A Permissioned Blockchain is a restricted-access blockchain where


participants need prior approval or permission to join the network. It is governed
by one or more centralized entities that control who can:

●​ Read the ledger​

●​ Submit transactions​

●​ Participate in the consensus process​

Key Characteristics of Permissioned Blockchain:

1.​ Access Control:​

○​ Only authorized entities can participate in the network.​

○​ Identities are known and verified.​

2.​ Governance:​
○​ Maintained by a single organization (private) or a group of organizations
(consortium).​

○​ Rules and operations are predefined and enforceable.​

3.​ Privacy:​

○​ Transactions and data are visible only to authorized parties.​

○​ Suitable for business processes involving sensitive data.​

4.​ Scalability and Speed:​

○​ Fewer nodes and simpler consensus mechanisms (like Practical Byzantine Fault
Tolerance or RAFT).​

○​ Allows faster transactions than permissionless systems.​

5.​ Customizable Consensus:​

○​ Consensus algorithms are designed to fit organizational needs.​

○​ No mining is required as identities are trusted.​

Comparison: Permissioned vs Permissionless Blockchain


Feature Permissioned Blockchain Permissionless Blockchain

Access Restricted Open to all

Identity Known, verified Anonymous or pseudonymous

Speed High Slower

Consensu Lightweight (PBFT, RAFT) Heavy (PoW, PoS)


s

Privacy High Low

Use Case Enterprises, Banks, Supply Cryptocurrencies, Open Networks


Chain
Types of Permissioned Blockchain:

1.​ Private Blockchain:​

○​ Controlled by a single organization.​

○​ Example: Internal audit ledger of a company.​

2.​ Consortium Blockchain:​

○​ Controlled by a group of organizations.​

○​ Example: Banking consortium sharing customer KYC data.​

How Permissioned Blockchain Works:

1.​ Participant Registration:​

○​ Entities request access.​

○​ Admin or governing authority approves them.​

2.​ Identity Verification:​

○​ Digital identities are linked with cryptographic keys.​

○​ Ensures accountability and auditability.​

3.​ Transaction Validation:​

○​ Only verified nodes can validate and commit transactions.​

○​ Validators are known and pre-approved.​

4.​ Data Distribution:​

○​ Data is selectively shared across the network based on roles and permissions.​
Use Cases of Permissioned Blockchain:

1.​ Banking and Finance:​

○​ Sharing transaction records, compliance data, or interbank transfers.​

○​ Example: JPMorgan’s Quorum, RippleNet.​

2.​ Supply Chain Management:​

○​ Track goods across vendors, manufacturers, and retailers with verified identities.​

○​ Example: IBM Food Trust.​

3.​ Healthcare:​

○​ Patient data sharing among hospitals while ensuring privacy and security.​

4.​ Government & Legal:​

○​ Land registry, identity documents, and digital voting where authorized access is
essential.​

5.​ Enterprise Systems:​

○​ Secure internal data management and audit trails in large corporations.​

Advantages of Permissioned Blockchain:

●​ Enhanced Privacy and Security: Only trusted parties can access sensitive data.​

●​ High Efficiency: Faster transaction processing due to fewer nodes and lightweight
consensus.​

●​ Better Compliance: Easier to implement regulatory policies.​

●​ Auditability: Known identities and verified logs aid in tracking and governance.​

●​ Reduced Energy Use: No need for mining, reducing resource consumption.​


Challenges and Limitations:

●​ Centralization Risk: Control lies with specific parties; may contradict full
decentralization.​

●​ Onboarding Cost: Requires identity verification and setup.​

●​ Trust Dependency: Needs trust in the managing authority or consortium.​

●​ Interoperability Issues: Hard to integrate with other blockchain networks.​

Popular Platforms Supporting Permissioned Blockchains:

●​ Hyperledger Fabric: Modular architecture developed by IBM and Linux Foundation.​

●​ R3 Corda: Designed specifically for financial institutions.​

●​ Quorum: Enterprise-focused version of Ethereum by JPMorgan.​

●​ Multichain: Used for deploying permissioned blockchains easily.​

Conclusion:

The Permissioned Model of Blockchain provides a controlled, secure, and efficient way to
implement blockchain in enterprise and institutional environments. It addresses the privacy and
compliance requirements that are crucial in sectors like finance, healthcare, and supply chain.
While it compromises on full decentralization, it strikes a balance between trust, transparency,
and performance — making it an ideal choice for many real-world business applications.
Cryptographic Hash Function

Introduction:

A Cryptographic Hash Function (CHF) is a special class of hash function that is used in
cryptography. It takes an input (or message) and returns a fixed-size string of bytes, typically
a digest that appears random. Cryptographic hash functions are a critical part of blockchain
technology, digital signatures, data integrity, password storage, and more.

It plays a vital role in ensuring data security, integrity, and trust without revealing the original
data.

Definition:

A cryptographic hash function is a mathematical algorithm that converts an


arbitrary length input into a fixed-length hash value, such that:

●​ It is deterministic​

●​ It is fast to compute​

●​ It is irreversible​

●​ It is collision-resistant​

Key Properties of Cryptographic Hash Functions:

1. Deterministic:

●​ The same input always produces the same output.​

●​ Example: Hash("hello") will always give the same result.​

2. Pre-image Resistance:

●​ It should be computationally infeasible to reverse-engineer the input from its hash


output.​
●​ Ensures one-wayness.​

3. Second Pre-image Resistance:


Given an input x1, it should be hard to find a different input x2 such that:​

mathematica​
CopyEdit​
Hash(x1) = Hash(x2)

●​

4. Collision Resistance:
It should be hard to find any two distinct inputs x1 ≠ x2 such that:​

mathematica​
CopyEdit​
Hash(x1) = Hash(x2)

●​

5. Avalanche Effect:

●​ A small change in input results in a completely different output hash.​

6. Efficiency:

●​ Should be able to process data quickly and compute the hash efficiently.​

Popular Cryptographic Hash Functions:


Name Output Size Use Case

MD5 128 bits Obsolete (not secure


now)

SHA-1 160 bits Also deprecated

SHA-256 256 bits Bitcoin, Blockchain

SHA-512 512 bits Secure applications


BLAKE2 Variable Faster than SHA-2

Use Cases in Real World:

1. Blockchain Technology:

●​ Each block in a blockchain contains the hash of the previous block.​

●​ Ensures immutability and security.​

●​ Example: Bitcoin uses SHA-256 to hash blocks and transactions.​

2. Data Integrity Verification:

●​ Hashes are used to ensure files have not been tampered with during transfer.​

●​ If the hash of downloaded file ≠ original hash → file is corrupted.​

3. Digital Signatures:

●​ Instead of signing a full document, the hash of the document is signed.​

●​ Ensures both integrity and authentication.​

4. Password Hashing:

●​ Passwords are hashed before storage in databases.​

●​ Even if the database is hacked, original passwords are not visible.​

5. Message Authentication Code (MAC):

●​ Ensures that a message was not altered in transmission.​

●​ Often combines secret keys with hashes (e.g., HMAC).​

How It Works: (Simple Example)


Input:​
Hello World

Using SHA-256 →​
Output Hash:​
a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

Change Input to Hello world →​


Hash changes completely due to Avalanche Effect.

Diagram to Illustrate (for exam drawing):


pgsql
CopyEdit
+---------------------+
| Input Message |
+---------------------+
|
v
+---------------------+
| Hashing Algorithm | (or)
| (e.g., SHA-256) |
+---------------------+
|
v
+---------------------+
| Fixed-length Hash |
| (Digest Output) |
+---------------------+

Advantages of Cryptographic Hash Functions:

●​ Security: Difficult to reverse or forge.​

●​ Data Integrity: Any change in data will change the hash.​

●​ Speed: Efficient for large data processing.​


●​ Non-reversible: Ensures confidentiality.​

●​ Storage efficiency: Fixed-length output.​

Limitations / Attacks on Weak Hash Functions:

●​ Collision Attacks: Easier to find two inputs with the same hash in weak algorithms like
MD5 or SHA-1.​

●​ Brute-force Attacks: Can be slowed down using salt (random data) with password
hashes.​

●​ Rainbow Table Attacks: Precomputed hashes used to reverse password hashes.​

Conclusion:

Cryptographic Hash Functions are the foundation of modern digital security systems. They
ensure integrity, confidentiality, and authenticity without needing to reveal the original data.
In blockchain systems, they link blocks securely and prevent tampering, making them essential
for building trustless, transparent systems.

As technology evolves, stronger and more secure hashing algorithms are being adopted to
combat evolving threats.
Merkle Tree

Introduction:

A Merkle Tree, also known as a Hash Tree, is a binary tree structure used to efficiently and
securely verify the contents of large data sets. It is a fundamental component of blockchain
technology, ensuring data integrity and quick verification of transactions.

The Merkle Tree is named after Ralph Merkle, who introduced it in 1979. It plays a major role in
cryptographic systems, blockchains, peer-to-peer networks, and distributed databases.

Definition:

A Merkle Tree is a binary tree in which:

●​ Every leaf node contains the cryptographic hash of a data block (e.g.,
transaction).​

●​ Every non-leaf (parent) node contains the hash of the concatenation of


its child hashes.​

The topmost node of the tree is called the Merkle Root, which is a single hash that
summarizes all the transactions below.

Structure of a Merkle Tree:

Let’s consider a block with 4 transactions: Tx0, Tx1, Tx2, Tx3.

css
CopyEdit
Merkle Root
/ \
H01 H23
/ \ / \
H0 H1 H2 H3
Tx0 Tx1 Tx2 Tx3
Where:

●​ H0 = Hash(Tx0)​

●​ H1 = Hash(Tx1)​

●​ H01 = Hash(H0 + H1)​

●​ H2 = Hash(Tx2)​

●​ H3 = Hash(Tx3)​

●​ H23 = Hash(H2 + H3)​

●​ Merkle Root = Hash(H01 + H23)​

This hierarchy enables fast and efficient integrity checks and content verification.

Key Concepts:

1. Leaf Nodes:

●​ Bottom layer of the tree.​

●​ Contain the hash of individual transactions.​

2. Non-leaf Nodes:

●​ Store hashes of the combination of their child nodes.​

●​ Constructed until a single root hash remains.​

3. Merkle Root:

●​ The top hash of the Merkle Tree.​

●​ Represents the unique fingerprint of all the data in the tree.​

●​ Stored in the block header of each block in a blockchain.​


Properties of Merkle Trees:

●​ Efficiency: Only a few hashes are required to verify a transaction.​

●​ Security: Uses cryptographic hashing (e.g., SHA-256) to ensure tamper-resistance.​

●​ Scalability: Supports large numbers of transactions without needing full data replication.​

●​ Data Integrity: Any change in transaction data changes the Merkle Root.​

Use of Merkle Trees in Blockchain:

1.​ Transaction Verification:​

○​ Instead of checking all transactions, only the branch of the tree required to verify
a transaction is used.​

2.​ Efficient Light Nodes (SPV - Simplified Payment Verification):​

○​ In Bitcoin, lightweight clients verify transactions using only the Merkle Root and
Merkle Proof instead of downloading full block data.​

3.​ Tamper Detection:​

○​ Any modification to a transaction changes its hash → changes all parent hashes
→ changes the Merkle Root → invalidates the block.​

Advantages of Merkle Tree:


Feature Benefit

Efficient Proof Need to send only a few hashes

Scalable Handles millions of transactions

Secure Uses cryptographic hash functions


Saves Light clients do not download full data
Bandwidth

Fast Validation Easy to verify inclusion of transaction

Merkle Proof (Audit Path):

●​ A Merkle Proof is a minimal set of hashes required to verify that a particular transaction
belongs to the block.​

●​ For example, to prove that Tx0 is included in the tree:​

○​ Provide H1, H23, and Merkle Root.​

○​ Then: H0 = Hash(Tx0), H01 = Hash(H0 + H1), Merkle Root = Hash(H01 + H23)​

Applications of Merkle Trees:

1.​ Blockchain (Bitcoin, Ethereum):​

○​ Storing and verifying transactions efficiently.​

2.​ Git Version Control:​

○​ To check integrity of files.​

3.​ File Sharing (BitTorrent):​

○​ Verify blocks of data before accepting download.​

4.​ Distributed Databases:​

○​ Ensure consistency and detect differences between datasets.​


Limitations:

●​ If transaction count is odd, a dummy transaction or duplicate is added to balance the


tree.​

●​ Complexity increases slightly with very large trees.​

●​ Not ideal for dynamic data sets where constant updates are required.​

Conclusion:

The Merkle Tree is a vital data structure in blockchain and cryptographic systems. It enhances
security, efficiency, and scalability by allowing quick and secure verification of data
integrity. By using hash-based verification, Merkle Trees make blockchain tamper-proof and
trustworthy without needing all nodes to store every transaction. Understanding Merkle Trees is
essential for grasping the inner workings of any blockchain network.

You might also like