Skip to content
AL-802 (C) · Big Data Analytics/Quick Revision Short Notes

Big Data Analytics (AL-802 (C)) - Unit 1 Short Notes

UNIT 1: BLOCKCHAIN TECHNOLOGIES


I. BLOCKCHAIN FUNDAMENTALS & CORE CONCEPTS

Definition & Paradigm Shift

A blockchain is a distributed, immutable, decentralized digital ledger that records transactions across many computers.

  • Core Pillars:

    • Decentralization: No single central authority; control is distributed across a network of nodes.

    • Immutability: Once data is recorded, it cannot be altered retroactively without network consensus.

    • Transparency: All transactions are visible to participants (in public blockchains), ensuring auditability.

[!TIP] Exam focus: Be prepared to contrast this paradigm with traditional centralized databases (single point of control/failure).

Public Ledger

A public ledger is a type of blockchain that is open for anyone to read, write, and participate in (e.g., Bitcoin, Ethereum).

  • Function in Financial Transactions: It acts as a universal, shared record of all account balances and transaction history, eliminating the need for trusted intermediaries like banks.

  • Distributed Nature: Every participating node (full node) maintains a complete copy of the ledger. New transactions are broadcast, validated, and appended by consensus.

Block Structure & Chain Formation

A block is a container for a set of transactions. It consists of:

  1. Block Header: Contains metadata.

    • Previous Block Hash: The cryptographic hash of the previous block's header. This creates the "block within a block" linking mechanism.

    • Merkle Root: A single hash representing all transactions in the block's body.

    • Timestamp, Nonce, Difficulty Target, etc.

  2. Block Body: Contains the list of transactions.

  • Chain Formation: The Previous Block Hash field cryptographically links each block to its predecessor. Altering any block would change its hash, breaking all subsequent links, making the chain immutable.

[!TIP] The "block within a block" concept refers to this recursive cryptographic linking via the Previous Block Hash.

Smart Contracts

Smart contracts are self-executing contracts with the terms of the agreement directly written into code. They automatically execute actions when predefined conditions are met.

  • Key Features: Autonomy, Trustlessness, Immutability, Transparency.

  • Potential Applications:

    • Finance: Automated loans, insurance payouts, decentralized exchanges.

    • Logistics: Automatic release of payments upon delivery confirmation (via IoT sensors).

    • Legal: Automating escrow, royalty distribution, and compliance.

    • Governance: Transparent voting systems.


II. DATA STRUCTURES FOR VERIFICATION & INTEGRITY

Merkle Tree (Hash Tree)

A Merkle Tree is a binary tree structure where every leaf node is a hash of a data block (e.g., a transaction), and every non-leaf node is a hash of its two child nodes.

  • Construction:

    1. Hash each transaction (leaf nodes).

    2. Pair and hash the results recursively until a single root hash—the Merkle Root—is obtained.

    3. The Merkle Root is stored in the block header.

  • Role in Verification:

    • Efficiency: To prove a specific transaction (T) is in a block, only the hashes along the path from T to the Merkle Root (a Merkle Proof) are needed (~log₂(n) hashes), not the entire block.

    • Security: Any change to a transaction changes its hash, altering all hashes up the tree, thus changing the Merle Root. This mismatch with the root in the block header immediately signals tampering.

    • Enables Simplified Payment Verification (SPV) in Bitcoin—lightweight nodes can verify transactions without storing the full blockchain.

DiagramCANVAS: A binary Merkle Tree. Level 0 (leaves): Hash(Tx1), Hash(Tx2), Hash(Tx3), Hash(Tx4). Level 1: Hash(H1+H2), Hash(H3+H4). Level 2 (root): Hash(R1+R2). Highlight path for Tx2: Tx2 -> H2 -> R1 -> Root.

III. CONSENSUS MECHANISMS & FAULT TOLERANCE

The Distributed Consensus Problem

In a decentralized, peer-to-peer network with no central coordinator, achieving agreement among all honest nodes on a single, consistent history of transactions (the ledger state) is the consensus problem. Challenges include network latency, node failures, and malicious actors.

Byzantine General Problem (BGP)

An abstraction of the consensus problem. Multiple Byzantine generals must agree on a common plan of attack (attack or retreat). Some generals may be traitors who send conflicting messages.

  • Byzantine Fault: A node that can fail in arbitrary ways (e.g., send conflicting information, not respond, act maliciously).

  • Implication: A consensus algorithm must tolerate up to f Byzantine faults in a network of 3f + 1 nodes to reach agreement.

Proof-of-Work (PoW) & HashCash

PoW is a consensus mechanism where participants (miners) compete to solve a computationally intensive but easily verifiable puzzle.

  • HashCash Mechanism (used in Bitcoin):

    1. Miners collect pending transactions.

    2. They repeatedly change a nonce value in the block header and hash the header (H(Header)).

    3. The goal: Find a hash value H(Header) that is less than a dynamically adjusted target difficulty (i.e., has a required number of leading zeros).

    4. Finding this nonce is the "puzzle." It requires massive trial-and-error (brute force).

    5. The first miner to find a valid nonce broadcasts the new block. Other nodes instantly verify the PoW by hashing the header once.

  • Security Contribution:

    • Sybil Attack Prevention: Creating computational power (hardware/electricity) is costly, preventing an attacker from easily creating thousands of fake identities.

    • Costly to Rewrite History: To alter a past block, an attacker must redo the PoW for that block and all subsequent blocks, requiring >50% of the network's total hash power (51% attack).

[!TIP] PoW is probabilistic finality—a block becomes more final as more blocks are built on top of it (6 confirmations in Bitcoin is considered secure).

Byzantine Fault Tolerance (BFT) Algorithms

Designed for permissioned settings with known, limited nodes. They aim for deterministic finality (once decided, it's final).

Practical Byzantine Fault Tolerance (PBFT - Lamport-Shostak-Pease)
  • Overview: A state machine replication algorithm for asynchronous networks. Operates in view changes with a primary (leader) and backups.

  • Process (3-Phase Commit for each request):

    1. Pre-Prepare: Primary assigns a sequence number and broadcasts <<PRE-PREPARE, view, seq-no, digest>> to all backups.

    2. Prepare: Each backup, if valid, broadcasts <<PREPARE, view, seq-no, digest, node-id>> to all others. A node enters prepared state when it receives 2f+1 matching Prepare messages.

    3. Commit: Nodes broadcast <<COMMIT, view, seq-no, digest, node-id>>. A node commits and executes the request upon receiving 2f+1 matching Commit messages.

  • How it Handles Byzantine Faults: The 2f+1 threshold ensures that even if f nodes are faulty/Byzantine, the honest nodes (≥ 2f+1) can outvote them and agree on the same sequence of operations. View changes handle a faulty primary.

Paxos Algorithm
  • Role: The foundational protocol for achieving consensus in distributed systems (e.g., Google Chubby, Spanner). Focuses on agreeing on a single value.

  • Basic Principles:

    • Roles: Proposers (suggest values), Acceptors (vote to accept), Learners (learn the chosen value).

    • Two Phases:

      1. Prepare Phase: Proposer picks a proposal number n and asks acceptors to promise not to accept any proposal numbered < n.

      2. Accept Phase: If proposer receives promises from a majority (quorum) of acceptors, it sends an Accept request with a value (often the highest-numbered value from the promises). Acceptors accept unless they've promised a higher number.

    • Safety: Guarantees that only a single value is ever chosen.

    • Liveness: Requires a distinguished proposer (leader) to eventually make progress.

[!TIP] PBFT is more communication-intensive but provides fast finality. Classic Paxos is simpler for a single value but complex to implement for a log of operations (Multi-Paxos is used in practice).


IV. BITCOIN NETWORK & MINING ECOSYSTEM

Bitcoin Peer-to-Peer (P2P) Network

A decentralized network of nodes (full nodes, miners, SPV clients) communicating via the Bitcoin protocol.

  • Architecture: Unstructured P2P mesh. Nodes connect to a random set of peers (typically 8).

  • Node Discovery: Uses a hardcoded list of "seed" nodes. New nodes ask peers for more addresses.

  • Transaction/Block Propagation:

    1. A node creates a transaction, signs it, and broadcasts it to its peers (inv message).

    2. Peers validate it (signature, UTXO check) and rebroadcast (tx message).

    3. Miners collect transactions into a candidate block and begin PoW.

    4. Upon finding a valid PoW, the miner broadcasts the new block (block message).

    5. Nodes validate the block (PoW, transactions) and, if valid, add it to their local chain and propagate.

  • Facilitates Transfers: This gossip protocol ensures all honest nodes eventually converge on the same transaction history, allowing users to verify ownership (via digital signatures) without trusting a central party.

Mining: Role, Incentives & Challenges

  • Role & Incentives:

    • Block Creation: Assemble transactions, solve PoW, propose new blocks.

    • Issuance: New bitcoins are created as a block reward (currently 3.125 BTC, halves ~every 4 years). This is the primary incentive early on.

    • Transaction Fees: Miners collect all fees from transactions in the block they mine. As block reward diminishes, fees become the main incentive.

  • Daily Routines & Challenges:

    • Hardware: Use of specialized ASICs (Application-Specific Integrated Circuits) for efficient SHA-256 hashing. CPU/GPU mining is obsolete.

    • Pool Mining: Individual miners join pools to combine hash power and receive steady, proportional rewards (shares) instead of rare, full block rewards.

    • Energy Consumption: Massive global electricity usage (~0.5% of world consumption) due to PoW competition. Major environmental criticism.

    • Difficulty Adjustment: Every 2016 blocks (~2 weeks), the network adjusts the PoW target so that the average time between blocks remains ~10 minutes, regardless of total hash power.

    • Orphaned Blocks: When two miners find a valid block at nearly the same time, a temporary fork occurs. The network eventually adopts the longest chain; the "losing" block becomes an orphan (or stale). Miners lose its reward.


V. ENTERPRISE & PERMISSIONED BLOCKCHAIN ARCHITECTURES

Permissioned vs. Permissionless Blockchains

Feature Permissionless (e.g., Bitcoin, Ethereum) Permissioned (e.g., Hyperledger Fabric, Corda)
Access Open to anyone (read/write). Restricted, known participants (membership controlled).
Identity Pseudonymous. Real-world identities (PKI, certificates).
Consensus Often PoW/PoS (high cost, slow). Efficient BFT-style (PBFT, Raft), high throughput.
Privacy Low (all transactions public). High (channels, private data).
Governance Decentralized, community-driven. Centralized/consortium governance.
Use Case Public cryptocurrencies, censorship-resistant apps. Enterprise, B2B, regulated industries.

Design Considerations for Permissioned Blockchains

  • Identity & Membership: Robust Membership Service Provider (MSP) for issuing/revoking certificates.

  • Access Control: Fine-grained policies (e.g., which peers can endorse which chaincode).

  • Privacy & Confidentiality: Need for channels (Fabric) or confidential identities (Corda) to hide transaction details from non-parties.

  • Performance & Scalability: Target high TPS (transactions per second) and low latency. Consensus must be efficient.

  • Governance Model: Clear rules for member onboarding/offboarding, smart contract upgrades, and dispute resolution.

Hyperledger Fabric

  • Modular Architecture: Clear separation of concerns:

    • Ordering Service (Consensus): Orders transactions into blocks (runs Raft, Kafka, or BFT-SMaRt). Does not execute or validate.

    • Peers (Execution & Validation): Host chaincode (smart contracts). Execute transactions and validate against policies.

    • Clients: Submit transactions.

  • Scalability & Privacy Features:

    • Channels: Private sub-networks. Only members of a channel see its transactions/ledger. Enables multi-lateral privacy.

    • Execute-Order-Validate Paradigm: Transactions are executed (simulated) by endorsing peers before ordering. This allows validation of read-write sets during ordering, preventing invalid transactions from wasting consensus resources.

    • Pluggable Components: Consensus, membership services, and crypto (MSP) are replaceable.

Ripple (Ripple Protocol Consensus Algorithm - RPCA)

  • Consensus: Federated consensus using Unique Node List (UNL). Each node chooses a set of other trusted nodes (its UNL). Consensus is reached when >80% of a node's UNL agrees on the next ledger version.

  • Focus: Cross-border payments & settlements. Acts as a real-time gross settlement system (RTGS) and currency exchange.

  • Use of XRP: The native cryptocurrency (XRP) is used as a bridge currency to facilitate fast, low-cost conversions between fiat currencies. It can also be used to pay transaction fees (destroyed, not collected).

Corda

  • Consensus Model: Notary service provides uniqueness consensus (prevents double-spends). Transaction validity is agreed upon by the directly involved parties (their legal identities).

  • Point-to-Point Communication: No global broadcast. Transactions are shared only with necessary counterparties and the notary. Data is never seen by the whole network.

  • Focus: Privacy & Legal Agreement Representation. States represent legal agreements/obligations. Transactions consume and create states. Designed for regulated financial instruments and complex agreements where confidentiality is paramount.


VI. BLOCKCHAIN APPLICATIONS & IMPACT

Financial Services & Compliance: KYC Process

  • Key Components:

    1. Customer Identification: Collecting verified identity documents (passport, PAN, etc.).

    2. Document Screening: Checking against sanctions lists, PEP (Politically Exposed Person) lists, adverse media.

    3. Due Diligence: Understanding the nature of the customer's business and expected activity (CDD/EDD).

  • Importance for Financial Institutions: Mandatory for Anti-Money Laundering (AML) and Counter-Terrorist Financing (CTF). Prevents fraud, identity theft, and financial crime.

  • Blockchain's Potential for KYC Optimization:

    • Shared, Verifiable KYC: A customer's verified identity could be stored on a permissioned blockchain (with consent). Other institutions could request access, reducing redundant onboarding costs and time.

    • Immutable Audit Trail: All KYC document submissions and verifications are permanently logged.

    • Real-time Updates: Changes to a customer's risk profile (e.g., added to a sanctions list) could be securely and instantly propagated to all network participants.

Supply Chain Management

  • Impact on International Trade & Global Supply Chains:

    • Traceability & Provenance: Every step (origin, processing, shipping, customs) is recorded on an immutable ledger. Enables verification of ethical sourcing (e.g., conflict-free minerals) and authenticity (e.g., pharmaceuticals, luxury goods).

    • Automation: Smart contracts can automate payments upon delivery confirmation (via IoT sensor data), release letters of credit, and trigger customs documentation.

    • Reduction in Fraud & Paperwork: Single source of truth reduces disputes, document forgery, and administrative overhead. Digitizes bills of lading, certificates of origin.

  • Supply Chain Financing:

    • Concept: Financing based on supply chain assets (inventory, receivables) rather than just the borrower's credit.

    • Blockchain Enablement:

      • Invoice Financing: An invoice on the blockchain is a verifiable, unforgeable asset. Lenders can finance it with confidence, as its authenticity and repayment linkage to the buyer are transparent.

      • Dynamic Discounting: Suppliers can receive early payment discounts from buyers, with terms and approvals automated via smart contracts.

      • Improved Liquidity: Faster verification and settlement cycles unlock trapped working capital.

Comparative Notes: Ripple vs. Corda

Feature Ripple Corda
Primary Use Case High-speed, low-cost cross-border payments & remittances. Complex financial agreements (derivatives, trade finance) & regulated assets.
Consensus Model Federated Consensus (RPCA). Nodes agree on ledger updates via trusted UNL sets. Transaction-level consensus. Parties agree on transaction validity; a Notary service provides uniqueness (double-spend prevention).
Data Sharing All transactions on the network are public to all participants in a ledger (but not the whole internet). Point-to-point. Only counterparties to a transaction (and the notary) see its details. Extreme privacy.
Cryptocurrency Has native cryptocurrency XRP used as bridge currency and for fees. No native cryptocurrency. Tokens/Assets are representations of real-world value.
Architecture Shared ledger with all transactions. Not a traditional blockchain. No global ledger. Each node maintains its own vault of states.

[!TIP] Remember: Ripple is about moving money fast globally. Corda is about moving legal agreements privately and efficiently among known institutions.

Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in