CBT Unit - 1 Notes
CBT Unit - 1 Notes
Introduction:
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
This structure makes the blockchain resistant to modification of the data once it has been
recorded.
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.
1. Decentralization:
2. Transparency:
● Builds trust among participants, especially in financial systems and supply chains.
3. Immutability:
● Tampering with one block would require altering all subsequent blocks, which is
computationally infeasible in large networks.
4. Security:
● Transactions are verified through consensus mechanisms before being added to the
ledger.
5. Consensus Mechanism:
● Common mechanisms:
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.
● Increases efficiency and trust by showing proof of origin and movement history.
c) Voting Systems:
d) Healthcare:
● Real-time updates: Transactions are updated and reflected across the network
instantly.
● Increased efficiency: Automation using smart contracts saves time and resources.
● Scalability: As the number of transactions increases, the size of the blockchain grows,
requiring more storage and computational power.
Conclusion:
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:
1. Block Header:
● 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).
2. Transactions:
● The number of transactions in a block varies depending on the size and the blockchain
(e.g., Bitcoin block = ~1 MB).
● Any change in block data alters the hash, alerting the network to tampering.
Working of a Block:
○ Miners solve a cryptographic puzzle (Proof of Work) to add the block to the chain.
○ The new block is linked to the previous block using its hash.
+-----------------------------+
| Block Header |
|----------------------------|
| Previous Hash |
| Timestamp |
| Nonce |
| Merkle Root |
|----------------------------| (or)
| Transactions List |
| - Txn 1 |
| - Txn 2 |
| - ... |
+-----------------------------+
● 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.
Example:
mathematica
CopyEdit
Txn A + Txn B -> Hash AB
Txn C + Txn D -> Hash CD
Hash AB + Hash CD -> Merkle Root
● Public Blockchain: Anyone can participate and view the block data (e.g., Bitcoin).
● 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).
1. Scalability:
Conclusion:
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:
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:
● Submit transactions
2. Governance:
○ Maintained by a single organization (private) or a group of organizations
(consortium).
3. Privacy:
○ Fewer nodes and simpler consensus mechanisms (like Practical Byzantine Fault
Tolerance or RAFT).
○ Data is selectively shared across the network based on roles and permissions.
Use Cases of Permissioned Blockchain:
○ Track goods across vendors, manufacturers, and retailers with verified identities.
3. Healthcare:
○ Patient data sharing among hospitals while ensuring privacy and security.
○ Land registry, identity documents, and digital voting where authorized access is
essential.
● Enhanced Privacy and Security: Only trusted parties can access sensitive data.
● High Efficiency: Faster transaction processing due to fewer nodes and lightweight
consensus.
● Auditability: Known identities and verified logs aid in tracking and governance.
● Centralization Risk: Control lies with specific parties; may contradict full
decentralization.
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:
● It is deterministic
● It is fast to compute
● It is irreversible
● It is collision-resistant
1. Deterministic:
2. Pre-image Resistance:
●
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:
6. Efficiency:
● Should be able to process data quickly and compute the hash efficiently.
1. Blockchain Technology:
● Hashes are used to ensure files have not been tampered with during transfer.
3. Digital Signatures:
4. Password Hashing:
Using SHA-256 →
Output Hash:
a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
● 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.
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:
● Every leaf node contains the cryptographic hash of a data block (e.g.,
transaction).
The topmost node of the tree is called the Merkle Root, which is a single hash that
summarizes all the transactions below.
css
CopyEdit
Merkle Root
/ \
H01 H23
/ \ / \
H0 H1 H2 H3
Tx0 Tx1 Tx2 Tx3
Where:
● H0 = Hash(Tx0)
● H1 = Hash(Tx1)
● H2 = Hash(Tx2)
● H3 = Hash(Tx3)
This hierarchy enables fast and efficient integrity checks and content verification.
Key Concepts:
1. Leaf Nodes:
2. Non-leaf Nodes:
3. Merkle Root:
● Scalability: Supports large numbers of transactions without needing full data replication.
● Data Integrity: Any change in transaction data changes the Merkle Root.
○ Instead of checking all transactions, only the branch of the tree required to verify
a transaction is used.
○ In Bitcoin, lightweight clients verify transactions using only the Merkle Root and
Merkle Proof instead of downloading full block data.
○ Any modification to a transaction changes its hash → changes all parent hashes
→ changes the Merkle Root → invalidates the block.
● A Merkle Proof is a minimal set of hashes required to verify that a particular transaction
belongs to the block.
● 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.