Module-2 Block Chain and Its Applications
Module-2 Block Chain and Its Applications
• Early ideas about cryptography, digital signatures, and secure timestamping laid the
groundwork.
• 1979: David Chaum proposed concepts of digital cash and privacy.
• 1991: Stuart Haber and W. Scott Stornetta introduced a cryptographically secured chain
of blocks for timestamping digital documents.
Summary Table:
Early Blockchain Ideas 1998 – 2008 b-money, Bit Gold, theoretical models
Expansion & New Cryptos 2011 – 2014 New coins, smart contract concepts
1. Block
2. Chain
3. Node
4. Transaction
5. Consensus Mechanism
• A protocol that nodes use to agree on the validity of transactions and the state of the
blockchain.
• Examples include:
o Proof of Work (PoW): Requires solving complex puzzles (used in Bitcoin).
o Proof of Stake (PoS): Validators are chosen based on stake in the network.
• Ensures all nodes agree on a single version of the blockchain.
6. Cryptographic Hash Function
• A mathematical function that converts input data into a fixed-size string of characters
(hash).
• Used to:
o Link blocks securely.
o Verify transaction integrity.
• Any small change in input results in a completely different hash.
7. Digital Signature
8. Distributed Ledger
Table:
Element Description
Block Contains transaction data and metadata
Chain Linked sequence of blocks via hashes
Node Network participant that stores and verifies blockchain
Transaction Transfer of assets or data within the blockchain
Consensus Mechanism Protocol for agreement on blockchain state
Cryptographic Hash Secures data integrity and links blocks
Digital Signature Authenticates transactions
Distributed Ledger Shared database across all network nodes
1. Transaction Collection
• Miners gather pending Bitcoin transactions from the network into a candidate block.
• They validate these transactions to ensure they follow the Bitcoin protocol rules (e.g.,
no double spending, valid signatures).
• Miners repeatedly run the block data through a cryptographic hash function (SHA-
256).
• Their goal is to find a nonce (a random number) that, when combined with the block
data and hashed, produces a hash value below a specific target set by the network
difficulty.
• This process requires trial and error, making mining computationally intensive.
3. Difficulty Adjustment
• The Bitcoin network adjusts the difficulty target approximately every two weeks
(every 2016 blocks) to keep the average block creation time around 10 minutes.
• If blocks are found too quickly, difficulty increases; if too slowly, it decreases.
• When a miner finds a valid hash, it broadcasts the new block to the entire network.
• Other nodes verify the block and its transactions.
• If valid, the block is added to their local copy of the blockchain.
5. Reward and Incentive
• Other miners begin working on the next block, building on top of the newly added
block.
• The longest valid chain is considered the authoritative blockchain.
Summary:
Step Description
Collect transactions Gather and validate pending transactions
Proof of Work Solve cryptographic puzzle by hashing
Difficulty adjustment Network adjusts mining difficulty
Verify and add block Network nodes validate and append block
Miner reward Miner earns bitcoins and transaction fees
Continue mining Process repeats for next blocks
Summary:
Feature Proof-of-Work (PoW) Proof-of-Stake (PoS)
Self-executing: Once the predefined conditions are met, the smart contract automatically
executes the agreed-upon actions without the need for intermediaries.
Decentralized: They operate on a blockchain, meaning they are not controlled by a single
entity. Instead, a network of computers verifies and executes the contract, making it highly
secure and resistant to censorship.
Immutable: Once deployed on the blockchain, the code of a smart contract cannot be altered
or tampered with. This ensures that the terms of the agreement remain fixed and transparent.
Transparent: The code and all transactions related to a smart contract are publicly visible
on the blockchain, allowing anyone to inspect and verify its functionality.
Automated: They automate workflows and transactions, eliminating the need for manual
processes, paperwork, and the associated delays and errors.
Example:
Imagine a smart contract for crop insurance. Here's how it could work:
1. Agreement: A farmer and an insurance company agree on a smart contract. The terms
specify that if a certain weather condition (e.g., rainfall below a defined threshold for a
specific period, or hail damage verified by an oracle) occurs in the farmer's region, an
automatic payout will be triggered.
2. Code & Deployment: The terms are coded into a smart contract and deployed on a
blockchain (like Ethereum). This contract would be linked to external data sources
(oracles) that provide real-time, verified weather data for the specified location.
3. Execution: If the oracle feeds data to the smart contract indicating that the pre-defined
adverse weather condition has been met, the smart contract automatically executes.
4. Payout: The contract then automatically releases the agreed-upon insurance payout to
the farmer's digital wallet, without any manual claims processing, verification, or
delays.
Ethereum expands blockchain functionality by enabling developers to build and deploy smart
contracts and decentralized applications, making it a programmable platform beyond just
money transfer.
Primary Purpose Digital currency / store of value Decentralized platform for smart
contracts and dApps
Monetary Policy Fixed supply capped at 21 million No fixed supply; Ether issuance rate
BTC varies
Miners play a crucial role in maintaining the security, integrity, and operation of the
Bitcoin blockchain. Their main responsibilities include:
1. Transaction Verification
2. Block Creation
• By performing PoW, miners make it extremely difficult and costly to alter past blocks.
• The decentralized nature of mining ensures no single entity controls the network.
5. Earning Rewards
Permissioned blockchain models are blockchain networks where access and participation are
restricted to a predefined group of participants. Unlike public blockchains, which are open to
anyone, permissioned blockchains control who can:
1. Restricted Access: Only authorized users can read, write, or validate data on the
blockchain.
2. Controlled Governance: Network rules and permissions are managed by a central
authority or a consortium.
3. Faster Transactions: With fewer trusted participants, consensus can be reached more
quickly using efficient algorithms.
4. Privacy: Transaction data can be kept confidential among permitted participants.
5. Use Cases: Commonly used in enterprise settings like supply chains, finance,
healthcare, and consortiums where trust is limited to known parties.
• Hyperledger Fabric
• R3 Corda
• Quorum
Features
3. Deployment
• Developers compile the smart contract code into bytecode.
• Users interact with the smart contract by sending transactions to its address.
• The EVM executes the contract's code using inputs from these transactions.
• Execution changes the contract’s internal state or triggers other actions.
5. Gas Mechanism
• Every operation in the EVM consumes gas, a fee paid in Ether (ETH).
Process:
Step Description