Blockchain Technologies
Module 2
Define Blockchain
Blockchain is a constantly growing ledger that keeps a permanent record of all
transactions in a secure, chronological, and immutable way. It enables the
secure transfer of money, property, contracts, etc., without requiring a third-
party intermediary such as a bank or government. The key attributes of
blockchain are:
Ledger: A file that continuously grows with new transactions.
Permanent: Once a transaction is added, it is permanent and cannot be
altered.
Secure: Uses advanced cryptography to secure information.
Chronological: Transactions are recorded in the order they occur.
Immutable: The ledger cannot be changed once transactions are added.
Explain the architecture of blockchain with the help
of a neat diagram.
Blockchain Technologies Module 2 1
Detailed Explanation of Blockchain Architecture Layers
1. Network Layer:
Description: This is the foundational layer of the blockchain
architecture, usually consisting of the internet. It provides the basic
communication infrastructure required for blockchain networks to
function.
Function: Enables the transfer of data and messages between nodes in
the blockchain network.
2. Peer-to-Peer Network Layer:
Description: Built on top of the Network Layer, this layer is responsible
for the propagation of information across the blockchain network.
Function: Utilizes protocols such as gossip or flooding protocols to
distribute data efficiently among all nodes in the network.
3. Cryptography Layer:
Description: This layer comprises essential cryptographic protocols
that secure the blockchain.
Blockchain Technologies Module 2 2
Components:
Public Key Cryptography: Ensures secure transactions between
parties by providing mechanisms for encryption and decryption.
Digital Signatures: Validate the authenticity of transactions and the
identity of the participants.
Cryptographic Hash Functions: Ensure data integrity and create
unique identifiers for blocks.
Function: Secures information dissemination and supports the
blockchain's consensus mechanisms.
4. Consensus Layer:
Description: This layer handles the agreement processes among the
different nodes in the blockchain network.
Components:
State Machine Replication (SMR): Ensures consistency in
replicated states across different nodes.
Proof-based Consensus Mechanisms: Includes Proof of Work
(PoW), Proof of Stake (PoS), etc.
Byzantine Fault-Tolerant (BFT) Protocols: Ensures the system can
continue to operate correctly even if some nodes behave
maliciously.
Function: Achieves and maintains consensus across the network,
ensuring that all nodes agree on the current state of the blockchain.
5. Execution Layer:
Description: This layer provides the environment where blockchain
operations and smart contracts are executed.
Components:
Virtual Machines: Examples include the Ethereum Virtual Machine
(EVM) which executes smart contracts.
Blocks and Transactions: Basic units of blockchain containing
transaction data.
Smart Contracts: Self-executing contracts with the terms directly
written into code.
Blockchain Technologies Module 2 3
Function: Manages the execution of transactions, the generation of
blocks, and the execution of smart contracts.
6. Applications Layer:
Description: The topmost layer consisting of user-facing applications
that interact with the blockchain.
Components:
Smart Contracts: Automated and enforceable agreements.
Decentralized Applications (dApps): Applications that run on the
blockchain without centralized control.
Decentralized Autonomous Organizations (DAOs): Organizations
run by smart contracts.
Autonomous Agents: Programs that perform tasks automatically
based on predefined conditions.
Function: Provides a platform for users to interact with the blockchain
through various applications, enabling functionalities like value transfer,
contract execution, and more.
Decentralization in Blockchain
Decentralization in blockchain technology is achieved through a combination of
key principles and mechanisms:
1. Distributed Ledger: Blockchain employs a distributed ledger, which means
that copies of the entire blockchain database are stored across multiple
nodes in a network. Each node has a complete copy of the blockchain,
ensuring redundancy and decentralization of data storage.
2. Peer-to-Peer Network: Blockchain operates on a peer-to-peer (P2P)
network architecture, where nodes communicate directly with each other
without the need for a central authority or intermediary. This network
structure enables decentralized communication and consensus among
participants.
3. Consensus Mechanisms: Decentralization is maintained through
consensus mechanisms that ensure agreement among network participants
on the validity of transactions and the state of the blockchain. Various
consensus algorithms, such as Proof of Work (PoW), Proof of Stake (PoS),
Blockchain Technologies Module 2 4
and Delegated Proof of Stake (DPoS), distribute decision-making power
across the network without relying on a central authority.
4. Decentralized Governance: Many blockchain networks implement
decentralized governance models, where decisions regarding protocol
upgrades, network rules, and other governance matters are made
collectively by network participants through consensus mechanisms or
community voting processes. This approach ensures that no single entity
has control over the direction of the network.
5. Open Access: Blockchain networks typically allow anyone to join and
participate as a node in the network without requiring permission. This
open-access principle promotes inclusivity and decentralization by allowing
anyone to contribute to the network's operation and security.
6. Cryptography: Cryptography plays a crucial role in ensuring
decentralization by providing security and privacy mechanisms that protect
the integrity of transactions and prevent unauthorized access to the
blockchain. Techniques such as public-key cryptography and
cryptographic hashing help maintain the trustworthiness of the
decentralized network.
Types of Blockchain
1. Public Blockchains:
Permissionless and completely decentralized.
Anyone can join and access the blockchain.
Examples include Bitcoin, Ethereum, and Litecoin.
Primarily used for cryptocurrency exchange and mining.
2. Private (or Managed) Blockchains:
Permissioned and controlled by a single organization.
Central authority determines node access and rights.
Examples include Ripple and Hyperledger.
Partially decentralized with restricted public access.
3. Consortium Blockchains:
Governed by a group of organizations, not a single entity.
Blockchain Technologies Module 2 5
More decentralized and secure compared to private blockchains.
Challenges in setup due to cooperation requirements.
Examples include R3 for financial services and CargoSmart for supply
chain.
4. Hybrid Blockchains:
Controlled by a single organization with public blockchain oversight.
Public blockchain required for certain transaction validations.
Example: IBM Food Trust, aimed at enhancing food supply chain
efficiency.
Features of Blockchain
Blockchain technology encompasses several key features that contribute to its
robustness, security, and efficiency. Here are the primary features:
1. Decentralization:
Definition: Blockchain operates on a decentralized network where no
single entity has control over the entire network.
Benefits: This ensures that no single point of failure exists, enhancing
the network's security and resilience.
2. Immutability:
Definition: Once data is recorded on the blockchain, it cannot be
altered or deleted.
Benefits: This ensures the integrity and trustworthiness of the data,
making it tamper-proof.
3. Transparency:
Definition: All transactions are recorded on a public ledger that is
visible to all participants.
Benefits: This feature enhances accountability and trust among
participants as all transactions are traceable and auditable.
4. Security:
Definition: Blockchain uses advanced cryptographic techniques to
secure data.
Blockchain Technologies Module 2 6
Benefits: This ensures that the data is protected from unauthorized
access and cyber-attacks. Hash codes are a critical security feature in
blockchain technology, helping to verify transaction integrity and
authentication 【67:0†source】【67:4†source】.
5. Consensus Mechanisms:
Definition: Blockchain relies on consensus mechanisms like Proof of
Work (PoW) or Proof of Stake (PoS) to validate transactions.
Benefits: These mechanisms ensure that all participants agree on the
validity of transactions, maintaining the integrity of the blockchain
【 67:4†source . 】
6. Efficiency and Cost Reduction:
Definition: Blockchain removes intermediaries from transactions.
Benefits: This reduces transaction costs and improves efficiency by
streamlining processes and reducing the potential for errors
【 67:1†source . 】
7. Tighter Security:
Definition: Blockchain transactions are secured using hashing
techniques, such as SHA-256.
Benefits: This tight security measure ensures that each transaction is
linked and verified, making it highly secure against fraud
【 67:1†source .】
Disadvantages of Blockchain
1. Scalability Issues:
Disadvantage: Blockchain networks can suffer from limited
scalability, with slower transaction speeds as the network grows.
Example: Bitcoin and Ethereum have faced challenges with
transaction congestion and high fees during peak usage times.
2. Energy Consumption:
Disadvantage: Proof of Work (PoW) consensus mechanisms used
by many blockchains are highly energy-intensive.
Blockchain Technologies Module 2 7
Example: Bitcoin mining consumes a significant amount of
electricity, raising environmental concerns.
3. Complexity and Implementation:
Disadvantage: Blockchain technology is complex and requires
significant technical expertise to implement and maintain.
Example: Businesses may face challenges in integrating blockchain
with existing systems and processes.
4. Regulatory Uncertainty:
Disadvantage: The legal and regulatory framework for blockchain is
still evolving, leading to uncertainty.
Example: Different countries have varying regulations regarding
cryptocurrencies, which can impact their adoption and use.
5. Data Privacy:
Disadvantage: While transactions are transparent, the data privacy
of participants can be a concern.
Example: Sensitive information recorded on a public blockchain
may be exposed to unauthorized parties if not properly secured.
6. Irreversibility:
Disadvantage: Transactions on a blockchain are immutable, which
means errors cannot be easily corrected.
Example: If a transaction is mistakenly sent to the wrong address, it
cannot be undone, potentially leading to loss of funds.
7. Integration with Legacy Systems:
Disadvantage: Integrating blockchain with existing legacy systems
can be challenging and may require significant changes.
Example: Companies may need to overhaul their IT infrastructure to
incorporate blockchain, leading to high implementation costs.
Elements of Blockchain
1. Blocks:
Blockchain Technologies Module 2 8
Blocks are the backbone of blockchain technology. They
permanently store data, which cannot be changed or deleted once
recorded.
Each block contains a block header, transaction data, a timestamp,
the previous block's hash, and the Merkle root of the transactions.
Blocks are linked together in a chronological and immutable chain
using cryptographic methods.
2. Hash Codes:
Hash codes are vital for blockchain security, providing a fixed-
length representation of data.
They ensure data integrity by verifying that the data has not been
altered. If any change is made to the data, the hash code will
change, indicating tampering.
Hash codes are crucial for adding new blocks, as they must match
certain criteria to be considered valid.
3. Nodes:
Nodes are storage units in the blockchain network, storing copies of
the blockchain data. They can be computers, servers, or laptops.
Nodes can be full nodes or light nodes.
Full Nodes: Store the complete copy of the blockchain and can
accept, reject, and validate transactions.
Light Nodes: Store only recent blocks and access older blocks
as needed, requiring less computing power and memory.
4. Ledger:
The ledger in blockchain technology is a record-keeping
mechanism. It can be public, decentralized, or distributed.
Public Ledger: Accessible to all participants in the blockchain
network without central authority.
Distributed Ledger: Each node has a copy of the database,
managed by a group of nodes.
Decentralized Ledger: Allows real-time access to data without
relying on a central authority, enhancing consistency and
Blockchain Technologies Module 2 9
performance.
5. Nonce:
A nonce is a 32-bit number used only once in cryptographic
communication, crucial for block creation and transaction validation.
It helps create secure transactions by ensuring that each
transaction and block are unique and verified.
6. Consensus Mechanism:
Consensus mechanisms ensure that all participants in the
blockchain network agree on the validity of transactions.
Examples include Proof of Work (PoW), Proof of Stake (PoS), and
others, which help maintain the integrity and security of the
blockchain.
With neat diagram explain the working of
blockchain.
These are the core blockchain architecture components:
Node — Any computer or machine, which holds the complete copy of the
blockchain ledger.
Transaction — Every data or information which we store on the block
change is in the form of transactions.
Block — Block consists of Block Header, Hash of Previous Block Header,
Merkle root of the transaction. Chain — Sequence of blocks in a specific
order.
Miners — The nodes who produce a block and perform the block
verification process before addinganythingto the blockchain structure.
Miners will compete with each other to solve the puzzle to earn rewards
Consensus (consensus protocol) — Consensus is a way of reaching an
agreement in a group. Where a set of rules and arrangements to carry out
blockchain operations. Any transaction within the blockchain should follow
the rules and arrangement of Consensus.
1. Transaction is Initiated.
2. The Transaction is placed in a Block.
Blockchain Technologies Module 2 10
3. The block of a transaction is sent to every node in the network.
4. Miners validate the transaction using consensus mechanism Proof of
Work
5. Miners who successfully crack the puzzle in “Proof of Work” will
receive the reward.
6. The Block is now successfully placed on the existing Blockchain.
7. The transaction is Successfully Completed.
Aspect Centralized System Decentralized System
Managed by a single central Managed by multiple authorities
Control
authority or nodes
Decision-Making Limited to top-level Freedom at all levels of
Freedom management management
Flow of Open and free flow of
Vertical flow of information
Information information
Generally higher due to
Employee Generally lower due to lack of
increased involvement and
Motivation decision-making freedom
decision-making freedom
Least chances of conflict as
Conflict in Higher chances of conflict as
only top-level management is
Decision many people are involved
involved
Burden is not shared and only Burden is shared among all
Burden of Work
one group carries the burden levels
Requires trust in the central Trust is built into the system, no
Trust
authority need to trust a central authority
Blockchain Technologies Module 2 11
Data can be siloed and requires Data is copied across ledgers
Data Accuracy
reconciliation ensuring integrity
Higher risk of failure due to Reduced downtime as
Downtime
single point of failure everything is distributed
High transparency, as records
Transparency Limited transparency
are public
Users have full control over their
Control Over Data Central authority controls data
information and access
Data is hard to alter as each
Immutability Data can be altered or deleted change must be confirmed by
network nodes
Security depends on central Higher security through
Security authority and can be vulnerable distributed encryption
to single points of attack mechanisms
Can be more expensive due to
Cost Often less expensive to maintain need for more systems and
people to manage
Single voice of authority, clear Consensus can be difficult to
Consensus
and fast decision-making reach due to multiple voices
Potential for lack of clarity and
Clarity and Clear chain of command and
discipline as the system
Discipline discipline
operates on mutual agreement
Explain the different methods to achieve
decentralization
Decentralization in blockchain can be achieved through various methods, each
with unique mechanisms:
1. Consensus Mechanisms
Proof of Work (PoW): Miners solve puzzles to add blocks. Examples:
Bitcoin, Ethereum (pre-2.0).
Proof of Stake (PoS): Validators stake tokens to add blocks. Examples:
Ethereum 2.0, Cardano.
Delegated Proof of Stake (DPoS): Token holders vote for delegates to
validate blocks. Examples: EOS, Tron.
Blockchain Technologies Module 2 12
Proof of Authority (PoA): Pre-approved validators add blocks. Examples:
VeChain, private Ethereum networks.
2. Distributed Network Architecture
Full Nodes: Maintain complete blockchain copies.
Light Nodes: Maintain partial copies, relying on full nodes.
Peer-to-Peer (P2P) Network: Nodes connect directly without a central
server.
3. Smart Contracts
Automated Execution: Rules are encoded in the blockchain and execute
automatically.
Decentralized Applications (dApps): Run without a central control point.
Examples: Uniswap, Compound.
4. Decentralized Governance
On-Chain Governance: Token holders vote on protocol changes. Examples:
Tezos, Decred.
Off-Chain Governance: Decisions made outside the blockchain. Examples:
Bitcoin, Ethereum.
5. Decentralized Identity (DID)
Self-Sovereign Identity: Users control their digital identities. Examples:
Sovrin, uPort.
6. Decentralized Storage
InterPlanetary File System (IPFS): Files stored across nodes.
Filecoin: Incentivizes storage providers using IPFS.
7. Tokenization
Utility Tokens: Provide access to services. Examples: Ethereum (ETH),
Binance Coin (BNB).
Security Tokens: Represent real-world asset ownership. Examples: tZERO,
Polymath.
Blockchain Technologies Module 2 13
8. Interoperability
Cross-Chain Protocols: Enable blockchain communication. Examples:
Polkadot, Cosmos.
Atomic Swaps: Direct exchange of cryptocurrencies.
9. Decentralized Autonomous Organizations (DAOs)
Community Governance: Managed by stakeholders via smart contracts.
Examples: MakerDAO, Aragon.
10. Federated Networks
Consortium Blockchains: Controlled by multiple organizations. Examples:
Hyperledger, R3 Corda.
Explain how a block is generated in blockchain
Generating a block in a blockchain involves a series of steps that ensure the
integrity, security, and immutability of the data being added to the blockchain.
Here’s an overview of how a block is generated:
1. Transaction Creation
Initiation: Users create transactions, such as transferring cryptocurrency or
executing a smart contract.
Broadcasting: These transactions are broadcasted to the network.
2. Transaction Validation
Verification: Nodes (or miners) in the network validate the transactions to
ensure they are legitimate. This includes checking digital signatures and
ensuring the sender has sufficient funds.
Pooling: Valid transactions are added to a memory pool (mempool) where
they await inclusion in the next block.
3. Block Formation
Selection: A subset of transactions from the mempool is selected to form a
new block. The selection criteria can be based on transaction fees, size,
and other factors.
Blockchain Technologies Module 2 14
Block Header Creation: The block header is created, which includes the
previous block’s hash, a timestamp, a nonce (in PoW systems), and the
Merkle root of the selected transactions.
4. Proof of Work (PoW) Consensus Mechanism (Example)
Puzzle Solving: Miners compete to solve a cryptographic puzzle. They
repeatedly adjust the nonce in the block header and hash the header until
they find a hash that meets the network’s difficulty target.
Difficulty Adjustment: The network adjusts the difficulty of the puzzle to
ensure that blocks are generated at a consistent rate (e.g., every 10 minutes
for Bitcoin).
5. Block Validation and Propagation
Validation: Once a miner (in PoW) or validator (in PoS) finds a valid solution
or proposes a block, the block is broadcast to the network. Other nodes
validate the block to ensure it adheres to the network’s rules.
Propagation: If the block is valid, it is propagated through the network, and
nodes add it to their copy of the blockchain.
6. Block Finalization
Incorporation: The new block is incorporated into the blockchain, making
the transactions within it immutable.
Chain Update: Nodes update their chain to reflect the addition of the new
block. The process then begins again for the next block.
Consensus Mechanisms
Consensus mechanisms are protocols used in blockchain networks to achieve
agreement on a single data value or a single state of the network among
distributed processes or systems. They ensure that all nodes in the network are
synchronized and agree on the transactions to be included in the blockchain,
thus maintaining the integrity and security of the network.
Key Consensus Mechanisms in Blockchain
1. Proof of Work (PoW)
Blockchain Technologies Module 2 15
Description: PoW requires miners to solve complex mathematical
puzzles to validate transactions and create new blocks. The first miner
to solve the puzzle gets to add the new block to the blockchain and is
rewarded with cryptocurrency.
Example: Bitcoin, Ethereum (before transitioning to PoS).
2. Proof of Stake (PoS)
Description: PoS selects validators to create new blocks based on the
number of coins they hold and are willing to "stake" as collateral.
Validators are chosen proportionally to their stake.
Example: Ethereum 2.0, Cardano.
3. Delegated Proof of Stake (DPoS)
Description: DPoS is a variation of PoS where stakeholders vote to
elect a small number of delegates who will validate transactions and
create blocks. This makes the process more democratic and scalable.
Example: EOS, Tron.
4. Practical Byzantine Fault Tolerance (PBFT)
Description: PBFT is designed to tolerate Byzantine faults and ensure
consensus is reached even if some nodes act maliciously. It works by
having a primary node propose a block and a series of voting rounds
among nodes to reach consensus.
Example: Hyperledger Fabric.
5. Proof of Authority (PoA)
Description: PoA relies on a small number of validators with a known
and reputable identity. These validators are pre-approved and
responsible for creating new blocks.
Example: VeChain, POA Network.
6. Proof of Burn (PoB)
Description: PoB involves miners burning (sending to an unspendable
address) a portion of their cryptocurrency to earn the right to mine new
blocks. This is seen as a way to show long-term commitment to the
project.
Example: Counterparty, Slimcoin.
Blockchain Technologies Module 2 16
Explain how decentralization of computing or
processing power is achieved by a blockchain
Decentralization of computing or processing power in blockchain is achieved
through several key mechanisms and principles, ensuring that no single entity
has control over the entire network. This decentralization is foundational to the
security, transparency, and trustless nature of blockchain technology. Here’s
how it is achieved:
1. Distributed Ledger Technology (DLT)
Description: The blockchain itself is a distributed ledger that is maintained
by a network of nodes. Each node has a copy of the entire blockchain,
which means the data is not stored in a central location but is distributed
across many computers.
Impact: This distribution ensures that no single point of failure exists and
that the network is resilient to attacks or failures of individual nodes.
2. Consensus Mechanisms
Description: Consensus mechanisms like Proof of Work (PoW), Proof of
Stake (PoS), and others ensure that all nodes agree on the state of the
blockchain. These mechanisms require nodes to work together to validate
transactions and add new blocks to the chain.
Impact: Consensus mechanisms prevent any single node from having
undue influence over the blockchain, promoting fairness and
decentralization.
3. Mining and Staking
Description: In PoW, miners compete to solve cryptographic puzzles, with
the winner adding a new block to the blockchain. In PoS, validators are
chosen based on the number of coins they hold and are willing to lock up
as collateral.
Impact: Both mining and staking distribute the process of adding new
blocks across many participants, rather than concentrating it in a single
entity.
4. Node Distribution
Blockchain Technologies Module 2 17
Description: Nodes are spread out globally, operated by individuals and
organizations from different locations and backgrounds. These nodes can
participate in the network as full nodes, mining nodes, or validating nodes.
Impact: Geographic and operator diversity reduces the risk of
centralization and enhances network security and robustness.
5. P2P Network Architecture
Description: Blockchain operates on a peer-to-peer (P2P) network
architecture where each node communicates directly with others without
relying on a central server.
Impact: The P2P nature ensures that the network remains decentralized
and resilient, as the failure or compromise of a single node does not affect
the overall network.
6. Incentive Structures
Description: Blockchain networks often have built-in incentives for nodes
to participate in the consensus process. For example, miners are rewarded
with cryptocurrency for solving puzzles in PoW, and validators earn
rewards in PoS.
Impact: These incentives encourage wide participation, ensuring that the
network remains decentralized and secure.
7. Governance Models
Description: Some blockchain networks implement decentralized
governance models where decisions about protocol changes are made by
the community through voting mechanisms.
Impact: This decentralizes the control over the network’s rules and future
development, preventing central authority control.
8. Decentralized Applications (DApps)
Description: DApps run on decentralized networks like Ethereum, relying
on smart contracts and blockchain for their operation rather than
centralized servers.
Impact: The development and deployment of DApps further the principle of
decentralization by creating applications that do not depend on centralized
Blockchain Technologies Module 2 18
infrastructure.
Practical Example: Bitcoin
Distributed Ledger: Bitcoin's blockchain is replicated across thousands of
nodes worldwide.
Consensus Mechanism: Bitcoin uses PoW, where miners solve complex
puzzles to validate transactions and add blocks.
Node Distribution: Bitcoin nodes are geographically and operationally
diverse.
P2P Network: Bitcoin transactions are broadcast in a P2P network.
Incentives: Miners are rewarded with newly minted bitcoins and transaction
fees.
Blockchain Technologies Module 2 19