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

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

UNIT 2: BLOCKCHAIN TECHNOLOGIES & DISTRIBUTED SYSTEMS


A. FOUNDATIONAL CONCEPTS & ARCHITECTURE

1. Blockchain as a Distributed Ledger

  • Definition: A public ledger is a decentralized, immutable database shared across a network of nodes. It records all transactions in a verified, chronological order without a central authority.

  • Core Properties:

    • Immutability: Once recorded, data cannot be altered retroactively. Achieved via cryptographic hashing and chaining.

    • Transparency: All participants can view the ledger's history (in public/permissionless blockchains).

    • Auditability: Complete, tamper-evident transaction history enables easy auditing.

  • Permissioned vs. Permissionless:

    | Feature | Permissionless (e.g., Bitcoin, Ethereum) | Permissioned (e.g., Hyperledger Fabric) | | :--- | :--- | :--- | | Access | Open to anyone (read/write). | Restricted, known participants (identity required). | | Consensus | Typically PoW/PoS (resource-intensive). | Often BFT-based (efficient, deterministic). | | Privacy | Pseudonymous, fully transparent. | Configurable privacy (channels, private data). | | Use Case | Censorship-resistant, public applications. | Enterprise, B2B, regulated environments. |

2. Block Structure and Chaining

  • Anatomy of a Block:

    • Block Header: Contains metadata (Version, Previous Block Hash, Merkle Root, Timestamp, Difficulty Target, Nonce).

    • Transaction List (Body): The actual set of transactions.

    • Nonce: A number changed by miners to solve the PoW puzzle.

  • "Block within a Block" / Genesis Block:

    • The Genesis Block is the first block in the chain (block height 0). It is hardcoded into the client software.

    • It has no previous_block_hash (often set to all zeros). It "contains within it" the foundation of the entire ledger.

  • Cryptographic Hashing & Hash Pointer:

    • Each block header contains the hash of the previous block's header.

    • This creates a linked list secured by cryptography. Changing any transaction in a past block alters its hash, breaking all subsequent links.

    • Key Property: Hash functions are deterministic, pre-image resistant, and exhibit the avalanche effect (tiny input change → completely different output).

3. Smart Contracts

  • Definition: Self-executing contracts with the terms of the agreement directly written into lines of code. They automatically enforce and execute actions when predefined conditions are met.

  • Key Features:

    • Self-executing & Autonomous: No intermediary needed for enforcement.

    • Turing Completeness: The underlying virtual machine (e.g., EVM - Ethereum Virtual Machine) can solve any computational problem given enough resources.

    • Immutable & Verifiable: Deployed code cannot be changed; execution is publicly verifiable.

  • Applications:

    • Finance: Automated loans, decentralized exchanges (DEX), stablecoins.

    • Insurance: Parametric insurance (automatic payout on flight delay).

    • Logistics: Automated payments upon IoT sensor confirmation of delivery.

    • Legal: Escrow services, royalty distribution.

4. Data Structures for Efficiency: Merkle Trees

  • Construction:

    1. Leaf nodes = hashes of individual transactions (e.g., H(Tx1), H(Tx2)).

    2. Parent nodes = hash of concatenated child hashes (e.g., H(H(Tx1) + H(Tx2))).

    3. Repeat recursively until a single root hash: the Merkle Root stored in the block header.

    
    
    DiagramCANVAS: A binary tree. Bottom layer: Tx1, Tx2, Tx3, Tx4 hashed. Next layer: Hash12 = H(H1+H2), Hash34 = H(H3+H4). Top: MerkleRoot = H(Hash12+Hash34).
  • Purpose & Role:

    • Efficient Verification (Merkle Proofs): A light client (SPV node) can verify a transaction's inclusion in a block without downloading the entire block. It only needs the transaction hash, the Merkle Root (from block header), and a few sibling hashes (the proof).

    • Data Integrity: Any change to a single transaction changes its leaf hash, propagating up to alter the Merkle Root, which would not match the header's root.

    • Scalability: Reduces bandwidth and storage requirements for nodes, improving network scalability.


B. NETWORKING & CONSENSUS MECHANISMS

1. Peer-to-Peer (P2P) Network Architecture

  • Structure (Bitcoin Model):

    • Decentralized network of nodes (computers running Bitcoin client).

    • Uses a gossip protocol: Nodes randomly propagate new transactions/blocks to their peers, who then rebroadcast, ensuring rapid, decentralized dissemination.

  • Node Types:

    • Full Node: Stores entire blockchain, validates all transactions/blocks. Backbone of security.

    • Light Node (SPV): Stores only block headers. Relies on full nodes for transaction verification via Merkle Proofs.

    • Mining Node: A full node that also competes to solve the PoW puzzle.

  • Facilitation: P2P removes single point of failure/censorship. New transactions are broadcast, validated by nodes, and queued in the mempool for inclusion in a block.

2. Proof-of-Work (PoW) & Mining

  • HashCash PoW Mechanism:

    • A Sybil attack deterrent. To prevent one entity from flooding the network with fake identities (Sybils), make network participation (mining) computationally expensive.

    • Puzzle: Find a nonce such that: Hash(BlockHeader) <= Target.

    • Target is a difficulty-adjusted number. Lower target = harder puzzle.

  • The Miner's Daily Routine:

    1. Transaction Collection: Pulls unconfirmed transactions from mempool, prioritizes by fee.

    2. Block Template Creation: Builds candidate block (header + selected transactions). Calculates Merkle Root.

    3. Nonce Search (Hashing): Iterates nonce value, hashes header repeatedly until finding a hash below Target. This is the computational lottery.

    4. Block Propagation: Upon finding a valid solution, broadcasts the new block to the P2P network.

    5. Orphan Handling: If two miners solve simultaneously, the network temporarily splits. The longest valid chain is accepted as truth; blocks on the shorter chain become orphan blocks.

    6. Reward Collection: Receives block subsidy (newly minted coins) + transaction fees from all transactions in the block.

  • Security & Implications:

    • 51% Attack: An entity controlling >50% of total hash power can censor transactions and double-spend. Extremely costly in large networks.

    • Energy Consideration: PoW's major criticism is high energy consumption ("proof of waste").

3. Distributed Consensus Algorithms (Beyond PoW)

  • The Byzantine General Problem:

    • A thought experiment: How to achieve agreement among a group of Byzantine Generals (some may be traitors) who can only communicate via messengers?

    • Relevance: Models real-world distributed systems where nodes can fail arbitrarily (crash, malicious, send conflicting messages). Byzantine Fault Tolerance (BFT) is the ability to reach correct consensus despite such faults.

  • Byzantine Fault Tolerance (BFT) Algorithms:

    • Lamport-Shostak-Pease (Oral Messages) Algorithm:

      • Assumption: Synchronous system (bounded message delay).

      • Idea: Recursive messaging. For m traitors among n generals, requires n > 3m to reach consensus.

      • Process: A commanding general sends an order to lieutenants. Lieutenants exchange the orders they received. Each decides based on majority of received orders.

      • Limitation: Impractical message overhead (O(n^m)).

    • Practical BFT (PBFT):

      • Optimized for asynchronous systems with low overhead.

      • Requires n >= 3f + 1 nodes to tolerate f Byzantine faults.

      • Operates in pre-prepare, prepare, commit phases. Used in Hyperledger Fabric (pre-PBFT), some modern blockchains.

  • Paxos Algorithm (Crash Fault Tolerance - CFT):

    • Solves consensus in environments where nodes only crash (fail-stop), not act maliciously.

    • Roles:

      • Proposer: Suggests a value.

      • Acceptor: Votes to accept values.

      • Learner: Learns the chosen value.

    • Phases:

      1. Prepare/Promise: Proposer gets promises from a majority of acceptors to not accept lower-numbered proposals.

      2. Accept/Accepted: Proposer sends a proposed value. Acceptors promise to accept if no higher-numbered prepare request arrived.

    • Outcome: A single value is chosen if a majority of acceptors accept the same proposal.


C. PERMISSIONED & ENTERPRISE BLOCKCHAINS

1. Design Considerations for Permissioned Blockchains

Consideration Key Questions & Implications
Identity & Access Who can join? How is identity managed? (Often via Membership Service Provider - MSP).
Consensus Not PoW. Choose deterministic, efficient BFT (PBFT, Raft) or CFT (Paxos) algorithms.
Privacy/Confidentiality How to hide transaction details from non-participants? Use channels (Fabric) or notaries (Corda).
Performance/Scalability Higher throughput (1000s TPS) and lower latency than public chains. Trade-off: Less decentralization.
Governance Who controls protocol upgrades? Defined by consortium agreement.

2. Hyperledger Fabric Architecture

  • Modular & Pluggable Design: Components (consensus, membership, smart contracts) are swap-out modules.

  • Key Components:

    • Peers: Host chaincode (smart contracts) and ledgers. Endorsing peers simulate transactions; committing peers update ledger.

    • Ordering Service: Deterministic consensus (e.g., Raft, Kafka). Orders transactions into blocks without executing them. Decouples ordering from execution.

    • Channels: Private sub-networks. Ledger data is partitioned; only members of a channel see its transactions.

    • Chaincode: Smart contracts, written in Go/Java/JS. Run in Docker containers.

  • Scalability Mechanism:

    1. Execute-Order-Validate: Transactions are executed (simulated) by endorsing peers before ordering. Invalid transactions are caught early.

    2. Channel Partitioning: Different business relationships operate on separate channels, distributing load and data.

  • Privacy: Achieved via channels (complete ledger isolation) and Private Data Collections (subset of peers on a channel store specific data).

3. Other Enterprise Platforms: Ripple & Corda

Feature Ripple (XRP Ledger) Corda
Primary Focus Cross-border payments & asset settlement. Regulated financial agreements (legal agreements modeled as code).
Consensus RPCA (Ripple Protocol Consensus Algorithm). Federated, trusted validators (not mining). BFT-like. Notary-based. Notaries are chosen per transaction/state to order and validate uniqueness. Can be BFT or simple.
Data Model Global ledger. All validators see all transactions (but amounts can be hidden via amendment). Point-to-point. Transactions are shared only with necessary counterparties. No global broadcast.
Smart Contracts Hooks (lightweight, WASM-based logic). CorDapps. Full JVM-based, with legal prose integration.
Key Differentiator Built-in digital asset (XRP) for liquidity. High speed (~3-5 sec). Privacy-by-design. Focus on legal enforceability and interoperability with legacy systems.

D. APPLICATIONS, INTEGRATION & REGULATORY ASPECTS

1. Financial Services & KYC/AML

  • KYC Process Components:

    1. Customer Identification (CIP): Collecting ID documents.

    2. Customer Due Diligence (CDD): Understanding customer's activities, risk profile.

    3. Enhanced Due Diligence (EDD): For high-risk customers.

    4. Ongoing Monitoring: Tracking transactions for suspicious activity.

  • Importance: Regulatory compliance (prevent money laundering, terrorist financing, fraud). Protects institution's reputation.

  • Blockchain's Potential:

    • Shared, Verifiable Credentials: Customer completes KYC once with a trusted entity. Result (hash/attestation) is stored on-chain. Other institutions can verify with customer's consent, reducing redundancy.

    • Reduced Cost/Time: Faster onboarding, lower operational overhead.

    • Audit Trail: Immutable record of all KYC checks and updates.

2. Supply Chain Management & Trade Finance

  • Impact on International Trade:

    • End-to-End Traceability: Every step (origin, processing, shipping) recorded on an immutable ledger. Combats counterfeit goods (e.g., pharmaceuticals, luxury items).

    • Automation via Smart Contracts: Letters of Credit (LCs) can be automated. Payment triggers automatically upon IoT sensor data confirming goods arrival at port.

    • Reduction in Fraud/Disputes: Single source of truth eliminates document tampering and conflicting records.

  • Supply Chain Financing:

    • Concept: Financing based on inventory, invoices, or receivables within a supply chain.

    • Challenges: Information asymmetry (lenders lack visibility), trust issues, slow processes.

    • Blockchain Solutions:

      • Invoice Financing: Verified, unspent invoices on a shared ledger allow faster, lower-cost financing.

      • Dynamic Discounting: Smart contracts enable automated early payment discounts based on real-time invoice status.

3. Cross-Cutting Themes

  • Interoperability: Ability of different blockchain networks to communicate and transfer value/data. Solutions: Cross-chain protocols (e.g., atomic swaps, relays, bridges).

  • Scalability Trilemma: The challenge of balancing:

    • Decentralization (many nodes)

    • Security (resistance to attacks)

    • Scalability (high TPS, low latency)

    • Solutions: Layer-2 (Lightning, Rollups), sharding, alternative consensus (PoS), permissioned designs.

  • Regulatory Frameworks: Evolving globally. Key areas:

    • Classification: Is a token a security, commodity, or utility?

    • AML/CFT: Applying traditional regulations to crypto-asset service providers.

    • Smart Contract Legality: Enforceability in court, code vs. legal prose.

[!TIP] Exam Focus: Be prepared to compare/contrast permissioned vs. permissionless, PoW vs. BFT, Fabric vs. Corda. Always link features (e.g., channels) to benefits (privacy, scalability). For application questions, state the traditional problem and how blockchain's core properties (immutability, transparency, automation) provide the solution.

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