Chapter 1
Chapter 1
🧱 What is Blockchain?
A blockchain is a distributed and decentralized digital ledger that stores data (like transactions) in
blocks, which are linked together in a chain using cryptographic hashes.
✅ Key Features:
Block number
Timestamp
List of transactions
This structure helps detect tampering. If even one value changes, the hash changes.
💰 What is Bitcoin?
Bitcoin is the first and most famous cryptocurrency, introduced by Satoshi Nakamoto in 2008. It’s a
digital currency that:
Runs on a blockchain
📝 Real-World Analogy:
You can add to it, but not delete old content (immutable)
Blockchain helps remove intermediaries, ensures security, and creates audit trails — which is why
Bitcoin and other apps rely on it.
3
Example: IBM Food Trust used by Walmart to track food from farm to shelf.
2. Healthcare
Problem: Patients' medical records are scattered across hospitals, often duplicated or outdated.
Blockchain Benefit: Single, tamper-proof record for each patient. Doctors can access real-time
data with the patient’s permission.
3. Voting Systems
Blockchain Benefit: Each vote is verifiable, immutable, and anonymized. Voters can track their
vote without revealing identity.
Blockchain Benefit: Peer-to-peer transfers, 24/7 access, and no intermediaries. Faster cross-
border payments and loan systems.
5. Identity Management
Problem: Passwords are insecure, and people often lose access to accounts.
Blockchain Benefit: Decentralized digital identity (DID) where users control their data, and it's
never stored in one place.
Example: Andhra Pradesh and Sweden piloted blockchain for land registry.
7. Education
Blockchain Benefit: Degrees and certificates are stored as verifiable credentials on blockchain.
Blockchain Benefit: Non-Fungible Tokens (NFTs) assign unique ownership to digital assets.
Decentralization means removing central control from a system. Instead of one entity (like a bank,
company, or government) being in charge, control is distributed across a network of participants
(nodes).
In blockchain:
If one server crashes or gets hacked, the system still runs smoothly because data is replicated across all
nodes.
✅ 2. Trustless Environment
You don’t need to trust a person or organization — you trust the system's rules and code (smart
contracts, consensus mechanisms).
✅ 3. Tamper-Resistance
Once data is agreed upon by the network and added to the blockchain, it cannot be changed by one
party.
Centralized:
6
PayPal processes payments. You trust PayPal to record transactions, protect your data, and
allow/refuse payments.
Decentralized (Bitcoin):
🧱 1. Immutability
Any attempt to change data would break the hash chain and be instantly noticeable.
📌 Use-case relevance: Useful in audit trails, financial records, land registries, where tamper-proof data
is critical.
🌍 2. Decentralization
There is no central authority; all nodes have equal power in decision-making and validation.
🧾 3. Transparency
All transactions are visible to the network participants (fully or partially, depending on whether
it's public or permissioned).
📌 Use-case relevance: Enhances trust in public services, donation tracking, and supply chain
traceability.
🔐 4. Security
Attacks are nearly impossible unless one gains control over the majority of the network (e.g.,
51% attack in PoW).
📌 Use-case relevance: Ideal for digital identity, banking, and document verification.
🛡️5. Consensus
All nodes agree on a single version of truth through a consensus mechanism like PoW, PoS,
PBFT, etc.
8
📌 Use-case relevance: Ensures accuracy and reliability of shared ledgers (e.g., in finance, health,
logistics).
You can automate agreements and complex workflows without needing intermediaries.
📌 Use-case relevance: Essential for insurance claims, DeFi protocols, and automated supply chains.
🔁 7. Distributed Ledger
Even if one or several nodes fail, the ledger continues to exist on others.
📌 Use-case relevance: Useful in multi-organization ecosystems like consortiums, inter-bank systems, etc.
Cryptographic primitives are the basic building blocks of cryptography — like Lego bricks — used to
design secure systems. In blockchain, they help with:
9
Data integrity
Authentication
Proof of ownership
Consensus validation
1. Hash Functions
A hash function takes any input and produces a fixed-length output (hash). It's:
📌 Use in Blockchain:
Involves a public key (shared with others) and a private key (kept secret).
📌 Use in Blockchain:
3. Digital Signatures
A mathematical scheme to prove that a message came from a specific user and was not changed.
📌 Use in Blockchain:
4. Merkle Trees
A hash-based data structure that organizes transactions in a block. Only the root hash (Merkle root) is
stored in the block header.
📌 Use in Blockchain:
Saves space
5. Hash Pointers
A combination of:
Data
📌 Use in Blockchain:
Used in some consensus models (like PoET) to introduce randomness and fairness in block selection.
If a case involves data sharing, identity verification, or consensus, cryptographic primitives are the core
of how the system stays secure and trustless.
A hash function is a mathematical function that takes an input of any size and returns a fixed-size string
of characters (called a hash or digest).
In blockchain, hash functions ensure data integrity, detect tampering, and link blocks together.
1. Deterministic
2. Fast Computation
3. Pre-image Resistance
o Impossible to reverse the process (you can't find the input from the hash).
4. Collision Resistance
5. Avalanche Effect
🔗 1. Linking Blocks
If any data in the block changes, the hash changes → breaking the chain.
In Bitcoin, miners try to find a nonce (random number) so that the hash of the block starts with a specific
number of zeros.
This is like playing a guessing game until you find a “winning” hash.
All transaction hashes are combined into a Merkle root. This allows quick verification of transactions
without storing all of them.
🔐 4. Data Integrity
Any change to data changes its hash. So, you can check whether data has been tampered with just by
comparing the stored hash.
🧮 Example: SHA-256
Example:
o Input: hello
If you're asked how blockchain ensures security, immutability, or tamper detection, hash functions are
the answer.
🔐 What is SHA-256?
🔗 1. Block Hashing
Miners must find a nonce such that the SHA-256 hash of the block starts with a certain number
of leading zeros.
💸 3. Transaction Integrity
2. Each block goes through 64 rounds of processing using bitwise operations (AND, OR, XOR,
ROTATE).
You don’t need to memorize the math — just know it’s fast, secure, and used for data verification.
Property Explanation
Property Explanation
💡 Example:
Input: "blockchain"
Securing transactions
Hashing can be used in various structures and patterns based on the need. In blockchain, it's used not
just to generate hashes, but to secure structures, verify data quickly, and maintain integrity.
15
So instead of "types" meaning different algorithms (like MD5, SHA-1, SHA-256), here we focus on how
hashing is applied in different formats.
🔹 Use:
📌 Example:
Hash of "Bitcoin" → Unique 256-bit value
✅ 2. Repeated Hashing
🔹 Use:
📌 Example:
Hash(Hash("data"))
✅ 3. Combined Hashing
🔹 Use:
When you want to group transactions or data points into a single hash
📌 Example:
Hash("Tx1" + "Tx2") = Combined hash of two transactions
Each piece of data is hashed and linked to the hash of the previous one.
🔹 Use:
📌 Example:
Block B → Hash includes Block A’s hash
Block C → Hash includes Block B’s hash
Hashes are built in a tree structure, combining hashes of data at each level until a single Merkle Root is
formed.
🔹 Use:
📌 Example:
A hash chain is a sequence where each data element includes the hash of the previous one. This
creates a linked structure — like a chain of locks. If one link is broken (i.e., changed), the entire chain
becomes invalid.
📦 In Blockchain:
17
Each block contains the hash of the previous block, forming a hash chain.
To ensure immutability
If someone tries to change data in Block 17, they must also change the hash in Block 18, 19, 20… all the
way to the end. That’s practically impossible.
Has no previous block, so the “previous hash” is usually all zeros or predefined.
Contains:
o Timestamp
3. Includes a timestamp
That new hash will then be referenced by the next block — and so on.
18
Field Description
Current Hash Hash of all the block data (computed after mining)
So, changing one block means re-mining every following block, which is computationally
infeasible
🔁 Real-World Analogy:
Imagine each block is a page in a notebook. At the bottom of each page, you write the summary of the
previous page. If someone tries to change an earlier page, all future pages will have incorrect
summaries — making the tampering obvious.
Secure transactions
Authenticate users
Prevent tampering
🔁 They are mathematically linked, but you can’t reverse-engineer the private key from the public key.
🔐 Uses:
Digital Signatures
🔒 Encryption:
🔓 Decryption:
✅ Ensures confidentiality — even if someone intercepts the message, they can't read it.
✍️Digital Signature
🔑 How It Works:
RSA is one of the most famous public-key algorithms (used in digital signatures, encryption).
🧠 Key Concepts:
🔄 Process:
To encrypt:
Cipher = Message^e mod n
To decrypt:
Message = Cipher^d mod n
A distributed system is a network of multiple independent computers (nodes) that work together to
appear as a single system to the user.
Each node:
⚙️Example: Google Drive, cloud storage, multiplayer games, and blockchain are all distributed systems.
Property Description
Fault Tolerance The system keeps working even if some nodes fail
Transparency Users don’t see or care which node does the work
Validate transactions
Use consensus mechanisms (like PoW or PoS) to agree on the next block
🧠 Real-World Examples
✅ Advantages
High availability
Fault tolerance
❌ Challenges
Reaching consensus
💰 What is a Cryptocurrency?
A cryptocurrency is a type of digital or virtual currency that uses cryptography for security and operates
on a blockchain network.
Are decentralized
The first and most popular cryptocurrency is Bitcoin, created by Satoshi Nakamoto in 2009.
Feature Description
Limited Supply Many cryptocurrencies have a cap (e.g., Bitcoin has a 21 million limit)
🧠 Why Is It “Crypto”?
Uses Hash Functions (SHA-256) for creating unique transaction IDs and blocks
📊 Popular Cryptocurrencies
✅ Advantages
❌ Challenges
Open consensus is a process where anyone can participate in verifying and agreeing on the state of a
blockchain — no invitation or permission required.
Longest Chain Rule Network accepts the chain with most accumulated PoW
❗ Challenges
Slower transactions