0% found this document useful (0 votes)
7 views17 pages

Blockchain Unit4 Unit5 Notes

The document covers Units 4 and 5 of Blockchain Technology, focusing on Bitcoin and Ethereum. It details Bitcoin's blockchain architecture, challenges, and consensus mechanisms like Proof of Work and Proof of Stake, as well as Ethereum's smart contracts and their Turing completeness. Additionally, it discusses verification challenges for smart contracts and various approaches to ensure their correctness.

Uploaded by

ayushnarela16
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views17 pages

Blockchain Unit4 Unit5 Notes

The document covers Units 4 and 5 of Blockchain Technology, focusing on Bitcoin and Ethereum. It details Bitcoin's blockchain architecture, challenges, and consensus mechanisms like Proof of Work and Proof of Stake, as well as Ethereum's smart contracts and their Turing completeness. Additionally, it discusses verification challenges for smart contracts and various approaches to ensure their correctness.

Uploaded by

ayushnarela16
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Blockchain Technology — Unit 4 & 5 Notes

BLOCKCHAIN TECHNOLOGY
Unit 4 & Unit 5

Unit 4: Bitcoin Blockchain and Alternatives


Unit 5: Ethereum, Smart Contracts & Advanced Blockchain Concepts

Page 1 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

UNIT 4: Bitcoin Blockchain and Alternatives

4.1 Bitcoin Blockchain


Bitcoin is the world’s first decentralized digital currency, introduced in 2009 by the pseudonymous
Satoshi Nakamoto. The Bitcoin blockchain is a distributed, immutable ledger that records all
transactions across a peer-to-peer network without any central authority.

Core Architecture
• Block Structure: A blockchain is a chain of blocks where each block contains a set of
transactions, a timestamp, a nonce, and the cryptographic hash of the previous block.
• Decentralization: Every participant (node) maintains a full copy of the blockchain, making it
highly resilient to failures and attacks.
• Immutability: Once data is written to the blockchain, it cannot be altered without changing all
subsequent blocks and gaining consensus from the majority of the network.
• Chaining: Each block references the previous block’s hash, creating a cryptographically linked
chain of records.

📚 Key The Bitcoin blockchain achieves trust without a central authority by using
Concept cryptographic proofs and economic incentives. It was the first application of
blockchain technology and remains the most widely recognized.

Transaction Lifecycle
• Initiation: A user initiates a transaction by broadcasting it to the network using their private key
to sign it.
• Validation: Network nodes validate the transaction’s digital signature and check for double-
spending.
• Pooling: Valid transactions are grouped into a candidate block by miners.
• Mining: Miners compete to solve a computational puzzle (Proof of Work) to add the block.
• Confirmation: Once added, the transaction is confirmed; more subsequent blocks increase
finality.

4.2 Challenges and Solutions


The Bitcoin blockchain, despite its revolutionary design, faces several significant challenges that have
spurred research into alternative approaches and optimizations.

Scalability Challenge

Page 2 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Throughput Limitation: Bitcoin processes only about 7 transactions per second (TPS), while
Visa processes thousands per second.
• Block Size Limit: Each Bitcoin block is limited to 1 MB (or ~4 MB with SegWit), restricting how
many transactions fit per block.
• Fee & Congestion Issues: Increased demand leads to longer wait times and higher transaction
fees as users compete for limited block space.

Solutions to Scalability
• Lightning Network: An off-chain payment channel allowing two parties to transact many times
without recording each transaction on-chain. Only the opening and closing are on-chain.
• SegWit: Segregated Witness (SegWit) separates signature data from transaction data, allowing
more transactions per block.
• Transaction Batching: Batching multiple transactions into one on-chain transaction to reduce
fees and space.

Other Key Challenges


• Energy Consumption: Bitcoin’s Proof of Work consumes enormous amounts of electricity,
raising environmental and sustainability concerns.
• Usability: New users find wallets, private keys, and transaction mechanics complex, limiting
adoption.
• Privacy Concerns: Blockchain analytics can often de-anonymize users, despite Bitcoin being
pseudonymous rather than truly anonymous.
• Interoperability: Different blockchain networks cannot natively communicate or exchange value
with each other.

4.3 Proof of Work (PoW)


Proof of Work is the consensus mechanism used by Bitcoin. It requires network participants (miners) to
perform computationally intensive work to earn the right to add a new block to the blockchain.

How Proof of Work Works


• Step 1 – Block Assembly: Miners gather pending transactions from the mempool and
assemble a candidate block.
• Step 2 – Hash Puzzle: Miners repeatedly change a field called the ‘nonce’ and hash the block
header using SHA-256 until they find a hash below the network’s current target value.
• Step 3 – Broadcasting: The first miner to find a valid hash broadcasts the block to the network
for verification.
• Step 4 – Reward: Other nodes verify the solution quickly (one hash check) and add the block to
their chain. The winning miner receives a block reward + transaction fees.

Difficulty Adjustment

Page 3 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

Bitcoin automatically adjusts mining difficulty every 2016 blocks (~2 weeks) to maintain a 10-minute
average block time. If more miners join, difficulty increases; if miners leave, it decreases. This self-
regulating mechanism ensures predictable issuance.

⚠️ The SHA-256 hash function is deterministic but unpredictable — small changes in


Important input produce completely different outputs. This property makes PoW verifiable by
anyone but hard to cheat, as there is no shortcut to finding a valid nonce other than
brute force.

Advantages and Disadvantages of PoW


• Advantage: Proven security model; extremely expensive to attack (51% attack requires
enormous hash power).
• Advantage: Truly decentralized — anyone with hardware can participate.
• Disadvantage: Enormous energy consumption (Bitcoin’s annual energy use rivals that of some
countries).
• Disadvantage: Specialized ASIC hardware creates centralization pressure among large mining
pools.
• Disadvantage: Slow throughput due to the deliberate difficulty of block creation.

4.4 Proof of Stake (PoS)


Proof of Stake is an alternative consensus mechanism designed to address the energy inefficiency of
PoW. Instead of computational work, validators are chosen based on the amount of cryptocurrency
they ‘stake’ (lock up as collateral).

How Proof of Stake Works


• Staking: A validator must lock a certain amount of cryptocurrency as collateral (e.g., 32 ETH in
Ethereum 2.0).
• Validator Selection: Validators are chosen to propose and attest to new blocks. Selection may
be pseudo-random, weighted by stake size.
• Slashing: If a validator behaves dishonestly or goes offline, they lose a portion of their stake as
penalty.
• Rewards: Honest validators earn transaction fees and staking rewards proportional to their
stake.

Variants of Proof of Stake


• DPoS: Delegated PoS: Token holders vote for delegates who validate on their behalf (used in
EOS, TRON).
• LPoS: Liquid Proof of Stake: Stakers can delegate without locking funds permanently (used in
Tezos).
• Bonded PoS: Bonded PoS: Validators must bond (lock) tokens for a fixed period before
validating.
Page 4 | Blockchain Technology Study Notes
Blockchain Technology — Unit 4 & 5 Notes

📊 PoW vs PoS: PoW uses energy to secure the network; PoS uses economic value
Comparison (staked tokens). PoS is far more energy-efficient (up to 99.9% less energy than
PoW) but introduces different trade-offs around wealth concentration and initial
distribution.

4.5 Alternatives to Bitcoin Consensus


Beyond PoW and PoS, researchers and developers have proposed numerous consensus mechanisms
to address specific limitations around speed, energy, decentralization, and finality.

Delegated Proof of Stake (DPoS)


• Mechanism: Token holders vote for a fixed number of block producers (delegates/witnesses)
who take turns producing blocks.
• Advantages: High throughput (thousands of TPS), fast block times, energy efficient.
• Disadvantages: More centralized than PoW; vote buying and cartel formation are risks.
• Examples: EOS, TRON, BitShares.

Proof of Authority (PoA)


• Mechanism: Only approved, known validators can create blocks. Validators stake their
identity/reputation rather than coins.
• Advantages: Extremely fast and efficient; suitable for private/consortium blockchains.
• Disadvantages: Highly centralized; validators are known entities, undermining the trustless
property.
• Examples: Used in many enterprise blockchain networks.

Practical Byzantine Fault Tolerance (PBFT)


• Mechanism: A classical distributed systems algorithm. Nodes communicate to reach
consensus even if up to one-third of nodes are faulty or malicious.
• Advantages: Low energy, fast finality, works well in permissioned networks.
• Disadvantages: Does not scale well to large numbers of nodes; requires known validator set.
• Examples: Hyperledger Fabric, Tendermint.

Proof of Elapsed Time (PoET)


• Mechanism: Used by Intel’s Sawtooth Lake. Nodes wait a random time (generated by trusted
hardware) and the node whose timer expires first gets to produce the next block.
• Advantages: Energy efficient, fair, and scalable.
• Disadvantages: Requires trusted hardware (Intel SGX), introducing hardware dependence.

Proof of Capacity / Space

Page 5 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Mechanism: Miners allocate disk space to store precomputed plot files. Faster disk access
wins the right to produce a block (e.g., Chia Network).
• Advantages: Much more energy-efficient than PoW; leverages unused disk space.
• Disadvantages: Led to shortages of hard drives when Chia launched.

4.6 Bitcoin Scripting Language


Bitcoin includes a built-in, stack-based scripting language that defines the conditions under which
transaction outputs can be spent. It is intentionally simple, non-Turing-complete, and designed for
security.

Key Characteristics
• Stack-Based: Bitcoin Script operates on a Last-In-First-Out (LIFO) stack. Instructions push data
or perform operations on the stack.
• Non-Turing Complete: Bitcoin Script deliberately lacks loops and recursion, preventing infinite
loops and making scripts predictable and safe.
• Stateless: Scripts are stateless — each script is evaluated independently with no persistent
memory between transactions.
• Deterministic: Scripts execute deterministically, ensuring all nodes reach the same conclusion
when validating.

Common Script Types


• P2PKH: Pay-to-Public-Key-Hash (P2PKH): The most common Bitcoin transaction type. The
recipient must provide their public key and a valid signature.
• P2SH: Pay-to-Script-Hash (P2SH): The sender pays to the hash of a script, allowing complex
redemption conditions like multi-signatures.
• MultiSig: Multi-signature (MultiSig): Requires M of N private keys to sign before funds can be
spent (e.g., 2-of-3 multisig for shared accounts).
• OP_RETURN: OP_RETURN: Allows embedding small amounts of arbitrary data (up to 80
bytes) in the blockchain, used for timestamps and metadata.

Uses of Bitcoin Scripting


• Multi-party Transactions: Escrow arrangements requiring multiple parties to agree before
funds are released.
• Time-Locked Contracts: Payments that only unlock after a certain block height or timestamp
has passed.
• Token Protocols: Provably unspendable outputs used for token creation (e.g., colored coins).
• Proof of Existence: Storing hashed data on-chain to prove existence of a document at a given
time.

💡 Note Bitcoin Script is NOT Turing-complete by design. This is a security feature — it


for Exam prevents denial-of-service attacks through infinite loops and makes script behavior

Page 6 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

predictable. Ethereum’s EVM, by contrast, IS Turing-complete, which enables more


powerful but riskier programs.

Page 7 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

UNIT 5: Ethereum, Smart Contracts & Advanced Blockchain


Concepts

5.1 Ethereum and Smart Contracts


Ethereum, proposed by Vitalik Buterin in 2013 and launched in 2015, extends blockchain beyond
simple currency transactions. It is a programmable blockchain — a decentralized world computer —
that allows developers to deploy and run arbitrary code (smart contracts).

What is Ethereum?
• Native Currency – Ether: Ethereum has its own native cryptocurrency called Ether (ETH),
used to pay for computation (gas fees).
• Ethereum Virtual Machine (EVM): The EVM is a sandboxed runtime environment present on
every Ethereum node. It executes smart contract code in isolation.
• Account Model: Ethereum maintains an account-based model (not UTXO like Bitcoin). Two
types: Externally Owned Accounts (EOAs) and Contract Accounts.
• Gas & Gas Fees: Gas is the unit measuring computational work in Ethereum. Users pay gas
fees to incentivize miners/validators to execute their transactions.

What are Smart Contracts?


A smart contract is a self-executing program stored on the blockchain whose terms are written directly
in code. Once deployed, the contract executes automatically when predefined conditions are met,
without requiring any intermediary.
• Stored on Chain: Code and state are stored permanently on the blockchain.
• Immutable: Once deployed, contract code cannot be altered (immutable).
• Decentralized Execution: All nodes execute the contract and verify results — no single point of
control.
• Autonomous: Execution is automatic when triggered by a transaction; no human intervention
needed.

Smart Contract Use Cases


• DeFi: Decentralized Finance: Lending, borrowing, trading (Uniswap, Aave, Compound).
• NFTs: Non-Fungible Tokens: Unique digital assets (art, collectibles, gaming items).
• DAOs: Decentralized Autonomous Organizations: Organizations governed by smart contracts
and token voting.
• Supply Chain: Supply Chain: Automatic payment release upon verified delivery.
• Insurance: Insurance: Automatic claims settlement based on verified real-world data (oracles).

Page 8 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

📚 Key Nick Szabo coined the term 'smart contract' in 1994, comparing it to a vending
Quote machine — it automatically executes a transaction when predefined conditions are
satisfied, without a trusted intermediary.

5.2 The Turing Completeness of Smart Contract Languages


Ethereum’s smart contract languages (Solidity, Vyper) and the EVM are Turing-complete, meaning they
can theoretically compute anything that a conventional computer program can compute, given enough
time and resources.

What is Turing Completeness?


• Definition: A system is Turing-complete if it can simulate a Turing machine — the theoretical
model of universal computation.
• Requirements: Requires support for conditional branching (if/else), loops (for/while), and
arbitrary memory access.
• Bitcoin vs Ethereum: Bitcoin Script is NOT Turing-complete (no loops). Ethereum’s EVM IS
Turing-complete.

The Halting Problem and Gas


A fundamental theoretical problem with Turing-complete systems is the Halting Problem: it is
mathematically impossible to determine in advance whether an arbitrary program will halt or run
forever. In a blockchain, an infinite loop would freeze all nodes.
Ethereum solves this with the Gas mechanism: every instruction costs a specific amount of gas. If a
contract runs out of gas, execution stops and all state changes are reverted (but the gas fee is kept).
This bounds computation time and prevents infinite loops.

Solidity — Ethereum’s Primary Language


• Syntax: Statically typed, curly-brace syntax similar to JavaScript/C++.
• Features: Contracts, functions, events, modifiers, inheritance, and interfaces.
• Compilation: Compiled to EVM bytecode for deployment.
• Alternative: Vyper: Vyper is an alternative: Python-like, more restrictive, designed for security.

5.3 Verification Challenges


Because smart contracts are immutable and control real financial value, bugs in contract code can lead
to catastrophic and irreversible losses. Verifying their correctness is therefore critical and extremely
difficult.

Key Verification Challenges

Page 9 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Specification Gap: Code may not correctly implement the intended business logic. What the
developer writes may differ from what they intended.
• State Space Explosion: Finding all possible inputs, states, and execution paths is
computationally intractable for complex contracts.
• Composability Issues: Contracts interact with other contracts, creating complex dependency
chains that are hard to reason about.
• Blockchain-Specific Exploits: Attackers may exploit the order of transactions within a block
(front-running, MEV).

Approaches to Verification
• Formal Methods: Formal Verification: Mathematically prove that a contract satisfies its
specification for all possible inputs (e.g., Certora, K Framework).
• Static Analysis: Automated security analysis tools that identify known vulnerability patterns
(e.g., Slither, Mythril).
• Testing: Writing comprehensive unit and integration tests, including fuzz testing with random
inputs.
• Security Audits: Professional review of contract code before deployment (e.g., OpenZeppelin
Audits).
• Bug Bounties & Staged Deployment: Gradual deployment with spending limits to reduce risk
during initial operation.

⛔ The 2016 DAO hack: An attacker exploited a re-entrancy vulnerability in a smart


Historical contract to drain approximately $60 million worth of Ether. This led to the
Example controversial Ethereum hard fork creating Ethereum (ETH) and Ethereum Classic
(ETC). It remains one of the most instructive examples of smart contract verification
failure.

5.4 Using Smart Contracts to Enforce Legal Contracts


Smart contracts can automate the enforcement of legal agreements, reducing reliance on courts,
lawyers, and intermediaries. However, mapping legal intent to code is a complex and evolving
challenge.

How Smart Contracts Enforce Agreements


• Automated Enforcement: Parties encode their agreement terms in code. The contract self-
executes when conditions are provably met.
• Escrow & Conditional Payment: Contract funds are held in the smart contract’s address and
released only when conditions are satisfied.
• Oracles for Real-World Data: External data (e.g., delivery confirmation, price feeds) is fed into
the contract via oracles to trigger execution.

Advantages

Page 10 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Trustless: Execution is automatic and cannot be stopped by either party once conditions are
met.
• Reduced Intermediaries: No need for courts or arbitrators for routine enforcement.
• Transparency: All terms are encoded and visible on a public blockchain.
• Speed: Execution is immediate upon condition satisfaction; no delays from paperwork.

Limitations & Challenges


• Ambiguity Gap: Legal language is inherently ambiguous; code is not. Translating nuanced
legal terms to code precisely is very difficult.
• Legal Recognition: Smart contracts are still not legally recognized in many jurisdictions.
• Oracle Problem: Real-world events must be reported by oracles; oracle failures or
manipulation can corrupt contract logic.
• Immutability vs. Flexibility: If parties wish to amend an agreement, immutability prevents easy
updates.

5.5 Comparing Bitcoin Scripting vs. Ethereum Smart Contracts

Feature Bitcoin Script Ethereum Smart Contracts


Turing Complete No (intentionally limited) Yes (full Turing completeness)
Language Bitcoin Script (low-level, stack-based) Solidity, Vyper, Rust (high-level)
Loops No Yes (bounded by gas)
State Stateless (UTXO model) Stateful (account model with storage)
Execution Validation only Full computation on EVM
Use Case Simple conditions (multisig, timelock) Complex DApps, DeFi, DAOs, NFTs
Security Simpler, smaller attack surface More powerful but more complex
attack surface
Gas Mechanism Transaction fees (by byte size) Gas per opcode executed

5.6 Hyperledger Fabric


Hyperledger Fabric is an enterprise-grade, permissioned blockchain framework hosted by the Linux
Foundation. Unlike Bitcoin or Ethereum, it is designed for business use cases where participants are
known and transactions may be confidential.

Key Features
• Permissioned: Only pre-approved, identified participants can join the network. No anonymous
miners.
• Private Channels: Transactions can be restricted to specific subsets of participants (channels),
invisible to others.

Page 11 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Chaincode: Smart contracts in Hyperledger Fabric are called chaincode, written in Go, Java, or
[Link].
• Flexible Consensus: Pluggable consensus: Supports various ordering services (Raft, Kafka)
instead of energy-intensive PoW.
• Modular Architecture: Separates transaction endorsement, ordering, and validation into
distinct phases.

Architecture Components
• Peers: Peer: A node that hosts the ledger and executes chaincode.
• Orderers: Orderer: The ordering service that establishes the official sequence of transactions.
• MSP: MSP – Membership Service Provider: Manages identities and certificates for all
participants.
• Channels: Channel: A private subnet between a subset of peers, allowing confidential
transactions.
• Ledger: Ledger: Consists of the world state (current state, stored in a database like CouchDB)
and the transaction log (blockchain).

🏢 Hyperledger Fabric is widely used in supply chain (Walmart food safety), trade
Industry finance, healthcare records, and government applications where privacy,
Use compliance, and known participants are essential requirements.

5.7 Pseudo-Anonymity vs. Anonymity


A common misconception is that Bitcoin and Ethereum are anonymous. In reality, they are pseudo-
anonymous — transactions are publicly visible but linked to addresses rather than real identities. True
anonymity requires additional cryptographic techniques.

Pseudo-Anonymity (Bitcoin/Ethereum)
• Public Ledger: Every transaction is publicly visible on the blockchain; anyone can view
amounts and addresses.
• Address-Based Identity: Addresses are not tied to real identities by default — but once an
address is linked to an identity (via an exchange KYC), the entire transaction history is
traceable.
• Traceability: Blockchain analytics firms (e.g., Chainalysis) can often cluster addresses and de-
anonymize users.

True Anonymity
• Confidential Transactions: Techniques like Confidential Transactions hide transaction
amounts on the blockchain.
• CoinJoin: Multiple transactions are mixed together, breaking the transaction graph (used in
Wasabi Wallet for Bitcoin).

Page 12 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Privacy Coins (Monero): Cryptocurrencies like Monero use ring signatures, stealth addresses,
and RingCT to hide sender, receiver, and amount.
• Zero-Knowledge Proofs: Zcash uses zk-SNARKs to enable fully shielded transactions (see
next section).

5.8 Zcash and zk-SNARKs for Anonymity Preservation


Zcash is a cryptocurrency that enables fully private transactions using zk-SNARKs, a powerful
cryptographic primitive. It offers users the choice between transparent (public) and shielded (private)
transactions.

What are zk-SNARKs?


zk-SNARK stands for: Zero-Knowledge Succinct Non-interactive Argument of Knowledge
• Zero-Knowledge: The prover demonstrates knowledge of a secret (e.g., a valid transaction)
without revealing any information about the secret itself.
• Succinct: The proof is very small (a few hundred bytes) and fast to verify, regardless of
computation complexity.
• Non-interactive: No back-and-forth communication between prover and verifier is needed; the
proof is a single message.
• Argument of Knowledge: The prover cannot fake a valid proof without actually knowing the
secret.

How Zcash Uses zk-SNARKs


• Shielded Transactions: Shielded addresses (z-addresses) hide the sender, receiver, and
amount. The network only verifies that no new coins were created and the transaction is valid.
• Transparent Transactions: Users can also use transparent addresses (t-addresses) similar to
Bitcoin, allowing selective disclosure.
• Selective Disclosure: Users can share a viewing key to allow a third party (e.g., auditor) to see
transaction details without revealing the spending key.

🔍 zk-SNARKs require a one-time trusted setup ceremony (the 'toxic waste' problem). If
Technical the setup parameters are compromised, fake coins could be created undetectably.
Insight Newer schemes like zk-STARKs eliminate this requirement but produce larger
proofs.

5.9 Attacks on Blockchains

Sybil Attacks
A Sybil attack occurs when a single entity creates multiple fake identities (nodes) to gain
disproportionate influence over a peer-to-peer network.

Page 13 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• How It Works: In a P2P network, an attacker floods the network with fake nodes to isolate,
eclipse, or manipulate honest nodes.
• Bitcoin/Ethereum Defense: In PoW networks, Sybil attacks are costly because each identity
requires real computational work. PoS mitigates it through economic stake requirements.
• General Mitigations: Reputation systems, social proof, and identity verification.

Selfish Mining
Selfish mining is a strategy where a miner (or pool) withholds a newly discovered block from the
network, secretly mining on top of it to gain a head start, then releasing it strategically to waste honest
miners’ work.
• Phase 1: Attacker mines a block but does not broadcast it. Continues mining secretly.
• Phase 2: When honest miners find a block, the attacker releases their secret block (and any
subsequent blocks they’ve mined) to cause a fork.
• Result: Due to the longest-chain rule, honest miners’ blocks are orphaned. The attacker earns
more rewards than their fair share.
• Threshold: A pool with as little as ~25-33% of total hash power can profitably execute selfish
mining.

51% Attack
A 51% attack (also called a majority attack) occurs when a single entity or coalition controls more than
50% of the network’s mining power (PoW) or staked value (PoS), allowing them to manipulate the
blockchain.
• Double Spend: Double-spending: Attacker sends coins in a transaction, waits for confirmation,
then mines a longer chain that excludes the original transaction, recovering the coins.
• Transaction Censorship: Attacker can prevent any transactions from being confirmed,
effectively halting the network.
• Limitations: The attacker cannot alter old, deeply buried transactions or steal coins from other
addresses.
• Real-World Risk: Large, established networks (Bitcoin, Ethereum) are practically immune due
to massive network hashrate/stake. Smaller coins remain vulnerable.

⚠️ Exam Key distinction: A 51% attacker CANNOT create new coins out of thin air or forge
Note private keys. They CAN double-spend their own coins and censor transactions. The
economic cost of acquiring 51% of Bitcoin’s hashrate makes such attacks
economically irrational.

5.10 Advent of Algorand


Algorand, founded by Turing Award-winning cryptographer Silvio Micali at MIT in 2017, was designed
to solve the blockchain trilemma: achieving security, scalability, and decentralization simultaneously.

Page 14 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

Key Innovations
• Pure Proof of Stake (PPoS): Algorand uses Pure Proof of Stake (PPoS), where validators are
randomly and secretly selected proportional to their stake using a Verifiable Random Function
(VRF).
• Fast Finality: Byzantine Agreement: Uses a cryptographic sortition mechanism to randomly
select a committee that reaches consensus using a variant of Byzantine Agreement (BA*),
achieving finality in seconds.
• No Forks: Blocks are finalized immediately — there is no forking in Algorand. Once a block is
confirmed, it is permanent. No waiting for multiple confirmations.
• Scalability: Scalable to millions of users without sacrificing decentralization, targeting ~1000
TPS.

How Algorand Consensus Works


• Cryptographic Sortition: Each account privately checks if it has been selected as a block
proposer using a VRF. If selected, it proposes a block.
• Committee Voting: A random committee of validators is selected to vote on the proposed block
in multiple rounds.
• Finalization: The committee reaches Byzantine agreement, finalizing the block. Selection is
unpredictable, making targeted attacks impossible.

Algorand vs. Other Blockchains


• vs Bitcoin: Vs. Bitcoin: Far more energy efficient, much faster (seconds vs. 60 minutes for high
confidence), no mining.
• vs Ethereum: Vs. Ethereum PoS: No slashing risk, immediate finality, simpler participation
model.
• vs Hyperledger: Vs. Hyperledger: Permissionless (anyone can join), more decentralized.

5.11 Sharding-Based Consensus Algorithms


Sharding is a database scaling technique adapted for blockchains to dramatically increase throughput.
Instead of every node processing every transaction, the network is divided into smaller groups (shards),
each processing a subset of transactions in parallel.

Core Concept
• Parallel Processing: The blockchain network is divided into N shards. Each shard maintains its
own portion of state and processes its own transactions independently.
• Cross-Shard Transactions: A cross-shard communication protocol handles transactions that
span multiple shards.
• Linear Scalability: Throughput scales linearly with the number of shards — if each shard
processes 100 TPS and there are 10 shards, total throughput is ~1000 TPS.

Types of Sharding

Page 15 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

• Network Sharding: Network Sharding: The network of nodes is divided into smaller groups.
• Transaction Sharding: Transaction Sharding: Transactions are divided among shards based
on their hash or address.
• State Sharding (Hardest): State Sharding: Each shard is responsible for storing and updating
a portion of the global state.

Challenges of Sharding
• Security per Shard: If a shard has few nodes, an attacker can more easily compromise that
shard (single-shard takeover).
• Cross-Shard Transactions: Transactions involving addresses on different shards require
complex cross-shard protocols, adding latency.
• Data Availability: Maintaining a consistent global state across shards without a central
coordinator is extremely complex.
• Randomness for Assignment: Nodes need to be randomly and securely assigned to shards to
prevent targeted attacks.

Sharding in Practice
• Ethereum: Ethereum 2.0 / Danksharding: Ethereum’s roadmap includes danksharding to scale
data availability. Full execution sharding is a long-term goal.
• Zilliqa: Zilliqa: One of the first production blockchains to implement network and transaction
sharding.
• Near Protocol: Near Protocol: Uses a sharding mechanism called Nightshade, where each
block is a collection of ‘chunks’ from different shards.
• Harmony: Harmony: Uses Effective Proof of Stake with 4 shards for scalable, low-fee
transactions.

📝 Sharding is one of the most promising Layer 1 scaling solutions for blockchain. It
Summary trades simplicity for scalability, introducing complex engineering challenges around
security, state consistency, and cross-shard communication. Combined with Layer 2
solutions, sharding can enable blockchains to handle global-scale transaction
volumes.

Page 16 | Blockchain Technology Study Notes


Blockchain Technology — Unit 4 & 5 Notes

Quick Revision Summary

Topic Key Points to Remember


Bitcoin Blockchain Decentralized, immutable ledger. Blocks linked by cryptographic hashes.
UTXO model.
Proof of Work SHA-256 puzzle. Miners compete. Block reward + fees. Energy intensive.
Difficulty adjusts every 2016 blocks.
Proof of Stake Validators stake coins. Energy efficient. Slashing for misbehavior. PoS
variants: DPoS, LPoS.
Bitcoin Script Stack-based, non-Turing-complete. P2PKH, P2SH, MultiSig, OP_RETURN.
Stateless.
Ethereum/Smart Turing-complete EVM. Solidity language. Gas limits computation. Account
Contracts model.
Turing Can compute anything. Loops allowed. Gas prevents halting problem.
Completeness
Verification DAO hack. Re-entrancy, overflow, front-running. Formal verification, audits
Challenges needed.
Hyperledger Fabric Permissioned. Enterprise. Chaincode. Channels for privacy. Pluggable
consensus.
Pseudo vs. True Bitcoin = pseudo-anonymous. Monero = ring sigs. Zcash = zk-SNARKs
Anonymity shielded.
zk-SNARKs Zero-Knowledge + Succinct + Non-interactive. Zcash shielded transactions.
Sybil Attack Fake nodes to gain influence. Mitigated by PoW cost, PoS stake
requirements.
Selfish Mining Withhold block, mine secretly, orphan honest blocks. Works with ~25%+
hashrate.
51% Attack Control majority hash/stake. Can double spend, censor. Cannot forge keys or
create coins.
Algorand Pure PoS. VRF sortition. Immediate finality. No forks. Micali (MIT). Scalable.
Sharding Parallel shards = linear scale. Cross-shard complexity. Ethereum
(Danksharding), Zilliqa, Near.

Page 17 | Blockchain Technology Study Notes

You might also like