Blockchain Study Notes
Blockchain Study Notes
■ EVM is the engine that gives Ethereum its programmability — without it, Ethereum
would just be a ledger like Bitcoin.
Turing Completeness
• A system is Turing Complete if it can simulate any computation that a Turing machine can perform.
• Ethereum/EVM is Turing Complete — it supports loops, conditionals, and arbitrary computation.
• Bitcoin Script is NOT Turing Complete — intentionally limited to prevent infinite loops.
■ Turing Completeness in EVM means smart contracts can implement ANY computable logic,
enabling DeFi, DAOs, NFTs, etc.
■ The GAS mechanism prevents the 'Halting Problem' by limiting computation — every opcode
costs gas, so infinite loops simply run out of gas and revert.
Concept Detail
■ 'The Merge' = Ethereum mainnet merged with Beacon Chain PoS system. This did NOT
increase TPS immediately — that comes with sharding.
■ Key ETH 2.0 components: Beacon Chain (PoS coordination), Shard Chains (parallel
processing), eWASM (new VM).
Transaction Structure
• Nonce — Sequential counter for sender; prevents replay attacks.
• Gas Price — Amount of Wei sender pays per unit of gas (Gwei).
• Gas Limit — Max gas the sender is willing to consume.
• To — Recipient address (EOA or contract). Empty for contract creation.
• Value — ETH amount to transfer (in Wei).
• Data — Encoded function call + parameters for contract interaction.
• v, r, s — ECDSA signature components proving sender authenticity.
■ Transaction Nonce ≠ PoW Nonce! Tx Nonce = sequential account counter. PoW Nonce
= random number to solve hash puzzle.
Transaction Nonce
• Every account has a nonce starting at 0, incrementing with each tx.
• Ensures transactions are ordered and non-repeatable.
• A tx with nonce=5 will not be processed until nonce=4 is mined.
• Prevents double-spend / replay attacks.
Transaction GAS
• Gas = unit measuring computational effort of an operation.
■ Formula: Max Fee = Gas Limit × Max Fee Per Gas. Actual Fee = Gas Used × (Base Fee +
Priority Fee).
■ Simple ETH transfer: 21,000 gas. Smart contract calls: variable (depends on opcodes
executed).
■ Key visibility modifiers: public, private, internal, external. State mutability: view
(read-only), pure (no state), payable (accepts ETH).
■ ABI (Application Binary Interface) = JSON specification of contract functions and events —
required to interact with deployed contracts.
MetaMask
• Browser extension / mobile wallet for Ethereum and EVM-compatible chains.
■ Use 'Injected Provider - MetaMask' in Remix to deploy to real testnets. Get free testnet
ETH from faucets (e.g., [Link]).
Overview
• Hyperledger Fabric is an enterprise-grade, permissioned DLT framework hosted by the Linux
Foundation.
• Unlike public chains, participants are known and authenticated via MSP (Membership Service
Provider).
• Supports pluggable consensus, private data (channels), and chaincode (smart contracts).
Core Components
• Peers — Nodes that maintain the ledger and execute chaincode. Types: Endorsing Peer,
Committing Peer, Anchor Peer, Leader Peer.
• Orderer (Ordering Service) — Orders transactions into blocks and distributes to peers. Does NOT
execute chaincode.
• CA (Certificate Authority) — Issues X.509 certificates; implements MSP.
• Chaincode — Smart contracts in Fabric (Go, [Link], Java).
• Ledger — Composed of World State (current KV store, CouchDB/LevelDB) + Blockchain
(transaction log).
• Channel — Private sub-network for confidential transactions between specific members.
• MSP (Membership Service Provider) — Manages identities; defines who can participate.
■ Fabric separates Execution (peers), Ordering (orderers), and Validation — this is called
'Execute-Order-Validate' architecture.
■ Key difference from Ethereum: In Fabric, chaincode is executed BEFORE ordering (simulate
first). In Ethereum, execution happens AFTER ordering.
Kafka Uses Apache Kafka + ZooKeeper cluster. Crash fault tolerant (CFT).
Handles high throughput. Deprecated in Fabric v2.x (complex ops).
RAFT Details
• Leader Election: If leader fails, followers elect a new leader.
• Log Replication: Leader receives entries, replicates to followers.
• Majority Quorum: Needs (N/2)+1 nodes to agree.
• CFT (Crash Fault Tolerant) — NOT Byzantine Fault Tolerant.
■ Fabric currently does NOT support BFT consensus natively (all mechanisms are CFT).
BFT support is being researched.
■ 3. Network Components
Peers Nodes that host ledger copies and run chaincode. Endorsing peers simulate
transactions; committing peers validate and commit.
Orderers Form the ordering service. Receive endorsed transactions, order them,
create blocks, distribute to peers.
Clients Applications (SDK-based) that create and submit proposals. Use Fabric
SDK ([Link] / Go / Java).
CA / TLS CA Issues enrollment certificates (ECerts) and TLS certificates. Each org has its
own CA. Fabric CA is a default implementation.
Anchor Peer Gateway peer for cross-org gossip communication. At least one per org per
channel.
Gossip Protocol Peer-to-peer data dissemination for block distribution and peer discovery
within a channel.
■ MSP (Membership Service Provider) is central to Fabric — it maps certificates to org roles
(Admin, Member, Peer, Orderer).
■ 4. Implementation of Channels
■ One network can have MULTIPLE channels. Each channel = separate blockchain. Peers
can belong to multiple channels simultaneously.
Channel Policies
• Endorsement Policy: which orgs must endorse a transaction.
• Lifecycle Policy: controls chaincode deployment approvals.
• Access Control Lists (ACLs): fine-grained resource access.
■ Private Data Collections (PDC) provide even finer privacy than channels — share
hashed data on-chain but actual data only to authorised peers.
■ ERC-20 approve() + transferFrom() pattern enables DEXs and DeFi protocols to move tokens
on behalf of users (delegated transfers).
Use Case ERC-20: Currencies, voting tokens | ERC-721: NFTs, digital art, deeds
What is an NFT?
• A unique, indivisible digital asset whose ownership is recorded on a blockchain.
• The NFT itself = token on chain. Actual content (image/video) typically stored on IPFS or Arweave;
tokenURI points to it.
• NFTs prove provenance, authenticity, and ownership without centralised authority.
NFT Lifecycle
■ NFT Metadata Standard: {name, description, image, attributes[]}. Best practice: store
metadata on IPFS for decentralisation, not centralised servers.
Use Cases
• Digital Art (CryptoPunks, Bored Apes), Gaming (Axie Infinity), Music rights, Domain names (ENS),
Event tickets, Identity documents.
• An ICO is a fundraising method where a project issues new tokens to investors in exchange for
established cryptocurrencies (BTC/ETH).
• Analogy to IPO (Initial Public Offering) but for crypto tokens.
• Process: Whitepaper → Token Sale → Distribution → Listing on exchange.
• Tokens sold may be utility tokens (access to platform) or investment tokens.
■ ICOs are largely UNREGULATED — high risk of scams and 'rug pulls'. Many
jurisdictions (US SEC) classify ICO tokens as securities, requiring compliance.
Term Meaning
Regulation ICO: Unregulated / grey area | STO: Fully regulated (securities law)
■ STOs combine blockchain efficiency with regulatory compliance — seen as the 'next evolution'
of ICOs for institutional adoption.
Bitcoin (BTC) First crypto; store of value ('digital gold'). PoW (SHA-256). 21M supply cap.
~7 TPS. 10-min blocks. Script (not Turing complete).
Ethereum (ETH) Smart contract platform. PoS (post-Merge). No hard cap. ~15-30 TPS (L1).
EVM, Turing complete. Solidity.
Binance Coin (BNB) Native token of BNB Chain. PoSA (Proof of Staked Authority). ~160 TPS.
EVM compatible. Used for fees, staking, BNB ecosystem.
Solana (SOL) High-performance chain. PoH + PoS consensus. ~65,000 TPS. Low fees.
Rust/C smart contracts. Known for speed but had outages.
Ripple (XRP) Designed for cross-border payments. RPCA (Ripple Protocol Consensus).
~1,500 TPS. 3-5 sec finality. Centralisation concerns.
Litecoin (LTC) Bitcoin fork. PoW (Scrypt). Faster blocks (2.5 min). 84M supply cap. Often
called 'silver to Bitcoin's gold'.
■ For exams: Know BTC (PoW, 21M cap, 7 TPS), ETH (PoS post-merge, smart contracts,
EVM), and at least 2 others with their consensus mechanisms.
■ 1. Blockchain in IoT
■ IOTA Tangle — DAG-based (not blockchain) DLT designed specifically for IoT. Feeless
micropayments. Used in smart city projects.
Use Cases
• Supply chain tracking (temperature sensors + blockchain = cold chain integrity).
• Smart energy grids — P2P energy trading.
• Connected vehicles — secure V2V and V2I communication.
• Smart home automation with verifiable device logs.
■ 2. Blockchain in Cybersecurity
■ Blockchain does NOT prevent all attacks. Private key theft, smart contract bugs
(reentrancy, overflow), and 51% attacks remain significant threats.
■ 3. Blockchain in Healthcare
■ MedRec (MIT) — blockchain-based EHR system. Patients own their data; providers get
access tokens. Built on Ethereum.
■ HIPAA (US) compliance is critical — blockchain data is immutable, so sensitive data should be
stored off-chain with only hashes on-chain.
■ 4. Blockchain in Education
Current Challenges
• Credential fraud — fake degrees and certificates.
• Manual, slow verification processes for employers.
• Data silos — student records not portable across institutions.
■ Blockcerts (MIT + Learning Machine) — open standard for issuing, displaying, and verifying
blockchain-based educational credentials.
Supply Chain End-to-end traceability of goods. IBM Food Trust (Walmart, Nestle).
Reduces food fraud, recalls targeted precisely.
Finance & DeFi Decentralised Finance: lending (Aave), DEX (Uniswap), stablecoins.
Cross-border remittance (Ripple, Stellar). Trade finance.
Real Estate Tokenised property ownership. Smart contract-based escrow. Faster title
transfer. Fractional ownership of properties.
Energy P2P energy trading (Power Ledger). Carbon credit tracking. Renewable
energy certificates on blockchain.
■ For exam: be ready to explain at least 3 sectors in detail with real-world examples and
explain HOW blockchain specifically solves the problem (not just 'blockchain makes it
better').
Turing Complete Can compute anything; EVM uses GAS to prevent infinite loops
The Merge Sep 2022 — ETH switched from PoW to PoS; 99.95% energy reduction
Gas Computation unit; Fee = Gas Used × (Base Fee + Priority Tip)
Channel Private subnet in Fabric with own ledger; members have privacy
ICO vs STO ICO = unregulated utility token; STO = regulated security token
■ EXAM TIP: Always explain the PROBLEM blockchain solves, the MECHANISM it uses
(consensus, smart contracts, immutability, etc.), and a REAL-WORLD EXAMPLE or
project for full marks.
■ All the best for your exams! Remember: Understand concepts deeply — don't just
memorise.