0% found this document useful (0 votes)
5 views

unit 2.pptx

The document provides an overview of blockchain architecture, including the differences between public, private, consortium, and hybrid blockchains, as well as the roles of nodes, miners, and validators. It also discusses major blockchain protocols such as Bitcoin and Ethereum, highlighting their functionalities, transaction processes, and smart contracts. Additionally, it covers other blockchain platforms like Stellar and Ripple, emphasizing their unique features and use cases.

Uploaded by

yadavyachandra2
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)
5 views

unit 2.pptx

The document provides an overview of blockchain architecture, including the differences between public, private, consortium, and hybrid blockchains, as well as the roles of nodes, miners, and validators. It also discusses major blockchain protocols such as Bitcoin and Ethereum, highlighting their functionalities, transaction processes, and smart contracts. Additionally, it covers other blockchain platforms like Stellar and Ripple, emphasizing their unique features and use cases.

Uploaded by

yadavyachandra2
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
You are on page 1/ 62

Blockchain and Web 3.

0 Security
Prof. Gazy Abbas
Cyber security trainer
Unit - 2
Blockchain Architecture and Protocols
Contents :

Blockchain Architecture:
• Public vs. private blockchains
• Nodes, miners, and validators

Blockchain Protocols:
• Bitcoin, Ethereum, and other major blockchain platforms
• Interoperability and cross-chain communication
Blockchain Architecture Overview

Blockchain architecture is the foundational design and


structure of a blockchain system.
It encompasses several critical
components and mechanisms that
together ensure the functionality,
security, and decentralization of
the network.
Components of Blockchain Architecture
Block
Structure: Each block contains a block header and a block body.
Block Header: Includes metadata such as the previous block's
hash, a timestamp, and a nonce (in PoW systems).
Block Body: Contains a list of validated transactions.
Linking: Blocks are cryptographically linked together, forming a
chain. Each block references the hash of the previous block,
ensuring the integrity and immutability of the entire blockchain.
Components of Blockchain Architecture
Chain

Formation: The blockchain is a sequential chain of blocks,


starting from the genesis block (the first block).

Integrity: The linking of blocks via cryptographic hashes


ensures that any alteration in a block would require re-mining
or re-validating all subsequent blocks, making tampering
computationally impractical.
Components of Blockchain Architecture
Nodes:

Full Nodes: Store the entire blockchain and participate in


transaction validation and propagation.
Light Nodes: Store only a subset of the blockchain, typically
used by lightweight clients that do not need full validation
capabilities.
Supernodes: Offer additional services like transaction
processing and maintaining the network's health.
Components of Blockchain Architecture
Distributed Ledger

Definition: A digital ledger that is shared across multiple nodes


in a network.
Function: Every node maintains a copy of the entire ledger,
ensuring data redundancy and resilience.
Features: The ledger is append-only, meaning that once data is
recorded, it cannot be altered or deleted.
Components of Blockchain Architecture
Smart Contracts

Definition: Self-executing contracts with the terms of the


agreement directly written into code.
Function: Automatically enforce and execute predefined rules
and agreements when certain conditions are met.
Use Cases: Automating transactions, creating decentralized
applications (dApps), and facilitating complex interactions
without intermediaries.
Components of Blockchain Architecture
Consensus Mechanism:
Purpose: To achieve agreement among distributed nodes on
the validity of transactions and the state of the ledger.
Types:
Proof of Work (PoW): Nodes (miners) compete to solve cryptographic
puzzles. The first to solve the puzzle gets to add a new block to the
chain and is rewarded.
Proof of Stake (PoS): Validators are chosen based on the amount of
cryptocurrency they hold and are willing to "stake" as collateral.
Components of Blockchain Architecture
Cryptographic Hashing

Function: Converts input data into a fixed-size string of


characters, which appears random.

Transactions
Structure: Contains details about the transfer of assets
between participants.
Validation: Nodes verify the authenticity and validity of
transactions before including them in a block.
Types of Blockchain
Public Blockchain

A public blockchain is a
non-restrictive, permission-less
distributed ledger system.
A node or user which is a part of the
public blockchain is authorized to
access current and past records, verify
transactions or do proof-of-work for
an incoming block and do mining.
Public Blockchain
Characteristics of Public Blockchain
• It is an open network where nodes can join and leave without the
permission of anyone.
• All nodes in the network can verify a new piece of data added to the
network.
• It is secure to the 51% rule.
• There is no need to use your real name, or identity, everything can be
hidden.
• In any network, the user has to follow rules that might not even be fair. But
not in public blockchain networks.
• No regulation hence no limit to how one can use the platform for
betterment.
• It offers anonymity, no one can track your transaction back to you.
Private Blockchain

A private blockchain is a restrictive or


permission blockchain operative only
in a closed network.
Private blockchains are usually used
within an organization or enterprises
where only selected members are
participants of a blockchain network.
Private Blockchain
Characteristics of Private Blockchain?

• By its nature, it performs better in database management and


auditing in other fields.
• Not everyone can run a full node and start mining.
• Everyone cannot make transactions on the chain.
• Not everyone can review the blockchain in the blockchain
explorer.
• A user has to be permitted by blockchain authority before he
could access the network thus making it Permissioned Network.
• Performance becomes faster as fewer nodes participate.
Cansortium Blockchain

Consortium blockchains are managed and run by a


number of organizations or entities. As a
permissioned blockchain, users must be asked to join
and have authorization before they can access the
network.

In a consortium blockchain, nodes from various


businesses or groups govern the network in a much
more private manner. They work together to
exchange and modify information in order to preserve
workflow, scalability, and accountability.
Hybrid Blockchain

A Hybrid blockchain is a blockchain that combines


elements of both public and private blockchains. It is
designed to reduce the disadvantages of both types
of blockchains while maximizing their benefits.

A hybrid blockchain essentially has two interfaces: a


private blockchain with its own ledgers and a public
blockchain that aids in data verification between the
private blockchain’s ledgers.
Comparison of all four types of Blockchain
What is a blockchain node?

Blockchain nodes represent network participants, and their devices are granted
authorization to maintain the distributed ledger and act as communication hubs for
various network functions.

One of the primary responsibilities of a blockchain node is to validate the legitimacy


of each successive set of network transactions, referred to as blocks. Furthermore,
assigning a distinct identifier to each node within the network facilitates easy
differentiation from other nodes.
What is a blockchain node?
Nodes receive and validate transactions, ensuring that they adhere to network
rules. They communicate with other nodes to reach a consensus on the state of
the blockchain. In Proof of Work (PoW) networks, nodes may also participate in
mining activities.
Types of Blockchain Nodes
Full Nodes
As they maintain a complete copy of the Blockchain
ledger, Full Nodes are the most essential type of
node in the Blockchain network. These nodes are
able to independently verify the entire Blockchain
history since they download and store copies of
every transaction and block that occurs on the
network.

It is responsible for saving the blockchain’s


transaction history. Prior to any changes or
additions being implemented, the network verifies
that all the full nodes are ready for the update.
Full Nodes
• Pruned Full Nodes
These nodes save blocks on a hard disk by discarding the oldest blocks first.
These nodes must initially download the blockchain onto their hard disks and
then gradually delete the oldest blocks until the storage limit is reached.
• Archival Full Node
Archive nodes in blockchain are nodes that store the complete blockchain data.
They keep a complete record of the entire blockchain history, including all
transactions, blocks and related data.
▪ Authority Nodes
In a public blockchain, someone becomes a node by downloading and synchronizing
the data on the blockchain network. By contrast, access to private and some
partially-centralized blockchains is limited to certain authority nodes, which can
control and restrict the access of the other nodes.
Full Nodes
▪ Miner Nodes
Blockchains that are based on the Proof of Work consensus model, such as Bitcoin are
required to have miner nodes. To approve transactions, they must solve difficult
mathematical problems, which require powerful computing devices and large
amounts of electricity. After the successful addition of blocks, the miner node receives
the incentive, which is newly-minted tokens.

▪ Staking Nodes
Nodes that verify the legitimacy of transactions in a blockchain using the Proof of
Stake model are known as staking nodes. To establish a staking node, users must lock
a specific amount of the underlying tokens of that blockchain ecosystem. The system
then randomly selects one of the staking nodes to process and register deals on the
ledger following some pre-defined criteria.
Light Node

A light node is a computer that is connected to a


blockchain network and stores a copy of the entire
blockchain, but does not process or validate
transactions.

It is also called Simplified Payment Verification (SPV)


nodes and is the second most common type of
blockchain node. The Light nodes are typically used by
end-users who are interested in using a blockchain
platform, but do not need to process or validate
transactions.
Light Nodes

They are lightweight and easy to set up, making them suitable for individuals who
do not have the technical know-how or resources to run a full node.

These nodes are designed to enable faster transactions and daily activities, and
are thus equipped with the ability to store only the essential information from the
blockchain, such as blockheaders, thereby saving users time and storage. Light
nodes are also useful for applications which require quick access to a blockchain,
such as decentralized applications (dApps).
Blockchain Miners
Blockchain Miners
Blockchain miners are participants in a blockchain network who use
computational resources to validate and add new transactions to the
blockchain. They perform complex calculations to solve cryptographic puzzles,
and the first one to solve the puzzle gets the right to add a new block to the
blockchain and receive a reward.

Here are the main roles of a blockchain Miner:


▪ Transaction Validation
▪ Block Creation
▪ Proof of Work
▪ Consensus Achievement
▪ Reward Collection
Blockchain Validators
Blockchain validators are participants in a blockchain network responsible for
verifying transactions and ensuring the integrity of the blockchain. Unlike
miners in PoW systems, validators do not solve complex mathematical puzzles.
Instead, they are selected based on criteria like the amount of cryptocurrency
they hold and are willing to "stake."

Let’s understand by taking the example of Ethereum. When a user on the


Ethereum Network initiates a transaction, the transaction enters a queue to be
included in the next block. Validators play a key role in this process. To become
a validator, a participant is required to deposit 32 ETH into a specific contract
and run three types of software: an execution client, a consensus client, and a
validator client. Once set up, the validator starts receiving transactions to verify
and validate.
Section - 2
Blockchain Protocols
Bitcoin
e
Launched in 2009, bitcoin is the
world's largest cryptocurrency by
market capitalization, created by an
anonymous person or group known
as Satoshi Nakamoto in 2008 and
launched in 2009. It introduced the
concept of a decentralized digital
currency and a distributed ledger
technology that operates without a
central authority.
Working of Bitcoin
Choose a Wallet Type: Decide whether you want a software wallet,
hardware wallet, mobile wallet, or paper wallet.
• Software Wallet: Electrum, Bitcoin Core
• Hardware Wallet: Ledger, Trezor
• Mobile Wallet: Mycelium, Trust Wallet
• Paper Wallet: Generated offline and printed
Acquiring Bitcoin:
• Purchase from an Exchange:
• Sign up on a cryptocurrency exchange (e.g., Coinbase, Binance).
• Verify your identity if required.
• Deposit funds (USD, EUR, etc.) into your exchange account.
• Buy Bitcoin (BTC) with your deposited funds.
Working of Bitcoin
Sending and Receiving Bitcoin:
Receiving Bitcoin:
• Open your wallet application.
• Click on “Receive” to generate your Bitcoin address.
• Share this address with the sender.

Sending Bitcoin:
• Open your wallet application.
• Click on “Send” and enter the recipient’s Bitcoin address.
• Specify the amount of Bitcoin to send.
• Adjust the transaction fee if needed (higher fees result in faster
confirmation).
• Confirm and send the transaction.
Bitcoin mining hardware

Setting Up Mining Hardware:

Choose Hardware:

ASIC Miners:Specialized hardware for Bitcoin mining


(e.g., Antminer S19, Whatsminer M30S).

Set Up Hardware:
- Connect the ASIC miner to a power source and internet.
- Follow the manufacturer’s instructions to configure the miner.
Bitcoin Mining Pool
Joining a Mining Pool:
Choose a Pool:
- Popular mining pools include F2Pool, AntPool, Slush Pool, and
BTC.com.

Create an Account:
- Sign up on the mining pool’s website.
- Configure your miner to connect to the pool by entering the
pool’s URL, your worker ID, and password.

Start Mining:
- Begin mining, and your hardware will contribute its hash power to
the pool.
- Pool rewards are distributed based on your contribution.
Working of Bitcoin Transaction
Initiate Transaction: User creates and signs a transaction.
Broadcast: Transaction is broadcast to the network.
Validation: Nodes validate the transaction and add it to the mempool.
Mining: Miners form blocks, search for a valid nonce, and solve the PoW puzzle.
Propagate Block: Valid block is propagated to the network.
Consensus: Network verifies the block and extends the blockchain.
Reward: Miner receives a block reward and transaction fees.
Confirmation: Transactions are confirmed and secured through additional blocks.
Ethereum
e
Ethereum is a widely used open
blockchain platform that extends the
functionalities of Bitcoin by
introducing smart contracts and
decentralized applications (dApps).
Created by Vitalik Buterin and
launched in 2015, Ethereum is
designed to be a versatile platform
for developers to build and deploy
blockchain-based applications
Ethereum
e
Setting Up a Wallet:
Choose a Wallet Type:
• Software Wallet: MetaMask, MyEtherWallet (MEW), Trust Wallet
• Hardware Wallet: Ledger, Trezor
• Mobile Wallet: Coinbase Wallet, Trust Wallet
• Web Wallet: MetaMask, MyEtherWallet
Ethereum
e
Acquiring Ether (ETH):
Purchase from an Exchange:
• Sign up on a cryptocurrency exchange (e.g., Coinbase, Binance).
• Verify your identity if required.
• Deposit funds (USD, EUR, etc.) into your exchange account.
• Buy Ether (ETH) with your deposited funds
Ethereum
eInteracting with Smart Contracts:
Using DApps:
• Access decentralized applications (DApps) through wallets like MetaMask.
• Connect your wallet to the DApp.
• Interact with the DApp’s interface to perform actions like trading, lending, or
gaming.
Deploying Smart Contracts:
• Use Remix IDE or Truffle Suite to write smart contracts in Solidity.
• Compile and deploy the contract to the Ethereum network.
• Interact with the deployed contract using a wallet like MetaMask or a
command-line interface.
Key Components of Ethereum
Ether (ETH): The native cryptocurrency used to pay for transactions and
computational services.
Ethereum Virtual Machine (EVM): Executes smart contracts and ensures
consistent computation across the network.
Gas Fees: Paid by users to compensate for the computational effort required to
process transactions and smart contracts.
Smart Contracts: Self-executing contracts with terms directly written into code.
dApps (Decentralized Applications): Applications built on top of Ethereum using
smart contracts.
Other Major Blockchain Platforms
1. Stellar
Stellar is an open-source, decentralized protocol
designed to facilitate fast, low-cost cross-border
transactions. It aims to connect financial institutions
and streamline international transfers. Stellar's
native cryptocurrency is called Lumens (XLM).
Key Features:
Lumens (XLM): The native cryptocurrency of the
Stellar network, used to facilitate multi-currency
transactions and prevent spam.
Decentralized Exchange (DEX): Stellar includes a
built-in DEX where users can trade any currency or
asset directly on the blockchain.
Stellar
Multi-Currency Transactions: Stellar allows transactions between different
currencies by using Lumens as a bridge.
Anchors and Trust Lines: Anchors are entities that people trust to hold their
deposits and issue credits into the Stellar network. Trust lines are connections
that users establish to hold assets issued by these anchors.
Federated Byzantine Agreement (FBA): A consensus mechanism used by
Stellar to reach agreement across the network quickly and efficiently.

Use Cases:
• Cross-border payments
• Remittances
• Micropayments
• Mobile banking
Stellar
Setting Up a Wallet

Choose a Wallet: Options include Stellar’s official wallet (StellarX), Lobstr,


or hardware wallets like Ledger.

Create a Wallet: Follow the wallet provider’s instructions to create a new


wallet. Securely store your recovery seed phrase.

Fund Your Wallet: Acquire XLM by purchasing from an exchange (e.g.,


Binance, Coinbase) and transferring it to your wallet.
Other Major Blockchain Platforms
2. Ripple
Ripple is a real-time gross settlement system (RTGS),
currency exchange, and remittance network. Unlike
typical blockchain networks, Ripple aims to enable
secure, instant, and nearly free global financial
transactions of any size with no chargebacks.
Key Features:
XRP: The native cryptocurrency of the Ripple
network, used as a bridge currency in cross-border
transactions.
RippleNet: A network of institutional
payment-providers such as banks and money services
businesses that use solutions developed by Ripple.
Ripple
Consensus Ledger: Ripple uses a consensus ledger and a set of validators to
confirm transactions, rather than traditional mining.

Ripple Protocol Consensus Algorithm (RPCA): This consensus algorithm


ensures that transactions are validated through a voting process among a
distributed set of validators.

Use Cases:
• Cross-border payments
• Currency exchange
• Reducing liquidity costs for banks and payment providers
Other Major Blockchain Platforms
3. Hyperledger Fabric
Hyperledger Fabric is a blockchain framework
implementation intended for developing applications
or solutions with a modular architecture. It is part of
the larger Hyperledger project hosted by The Linux
Foundation.
Key Features:
Permissioned Network: Unlike public blockchains,
Hyperledger Fabric is permissioned, meaning that all
participants are known to each other.
Modular Architecture: Components such as consensus
and membership services are plug-and-play, allowing
for customization based on specific needs.
Hyperledger Fabric
Chaincode: Smart contracts in Hyperledger Fabric are called chaincode and
can be written in general-purpose programming languages like Java, Go, and
Node.js.
Channels: Fabric supports channels, which are private sub-networks for more
confidential transactions.
Endorsement Policies: These policies define which peers need to endorse a
transaction before it can be considered valid.
Use Cases:
• Supply chain management
• Trade finance
• Health care data sharing
• Asset management
Other Major Blockchain Platforms
4. Cardano
Cardano is a third-generation blockchain platform that
focuses on sustainability, scalability, and interoperability. It
is designed to provide a more balanced and sustainable
ecosystem for cryptocurrencies and smart contracts.
Key Features:
Ouroboros Proof-of-Stake (PoS): Cardano uses Ouroboros, a
highly secure PoS protocol, which is more energy-efficient
than traditional Proof-of-Work (PoW) mechanisms.
Layered Architecture: Cardano's architecture is divided into
the Cardano Settlement Layer (CSL) for transactions and the
Cardano Computation Layer (CCL) for smart contracts.
Cardano
Formal Verification: Cardano emphasizes formal verification to ensure that
smart contracts are mathematically proven to be correct.
Governance: Cardano includes mechanisms for future upgrades and changes
to be decided by the community.
Native Tokens: Besides ADA (the native cryptocurrency), Cardano supports
native tokens, allowing users to create their own tokens on the platform
without needing smart contracts.
Use Cases:
• Secure and scalable financial applications
• Decentralized applications (DApps)
• Identity management
• Voting systems
Interoperability
Interoperability refers to the ability of different blockchain networks to
communicate, share data, and interact with one another. This allows for the
transfer of assets and information across different blockchain platforms, which is
essential for creating a cohesive blockchain ecosystem.

Key Components:
• Cross-Chain Protocols: These are protocols designed to facilitate interaction
between different blockchain networks. Examples include Polkadot’s
interoperability framework and Cosmos’ Inter-Blockchain Communication (IBC)
protocol.

• Bridges: Blockchain bridges connect two or more blockchain networks, enabling


the transfer of tokens and data between them. For example, the
Ethereum-Bitcoin bridge allows assets to move between these two networks.
Interoperability
• Atomic Swaps: These are smart contracts that enable the exchange of
cryptocurrencies between different blockchains without needing a trusted third
party.
• Federated Interoperability: Some solutions use a federation of trusted nodes to
facilitate cross-chain transactions. These nodes are responsible for verifying and
relaying transactions between blockchains.

Advantages:
▪ Enhanced Functionality: Users can leverage the unique features of different
blockchains (e.g., Ethereum’s smart contracts and Bitcoin’s security) in a
complementary manner.
Interoperability
▪ Resource Efficiency: It allows blockchains to share resources and
capabilities, reducing redundancy and improving overall efficiency.
▪ Broader Ecosystem: Interoperability fosters collaboration between
different blockchain communities and projects, leading to a more robust
and versatile ecosystem.
Challenges:
Security Risks: Cross-chain interactions can introduce new attack vectors and
vulnerabilities.
Complexity: Implementing interoperability protocols can be technically
complex and challenging.
Standardization: Lack of standard protocols and frameworks for
interoperability can hinder seamless integration.
Cross-Chain Communication
Cross-chain communication refers to the mechanisms and protocols that enable
different blockchain networks to exchange information and interact. This is a critical
aspect of interoperability, focusing on the actual data and message transfers between
chains.

Key Components:

• Messaging Protocols: Protocols like Cosmos IBC and Polkadot’s XCMP


(Cross-Chain Message Passing) are designed to facilitate secure and efficient
message passing between blockchains.

• Relays: These are intermediary nodes or systems that facilitate communication


between different blockchains. They monitor transactions on one chain and relay
information to another.
Cross-Chain Communication
• Smart Contracts: Cross-chain smart contracts can execute transactions and
processes that involve multiple blockchains. They often rely on oracles to provide
the necessary data from other chains.
• Oracles: Oracles are services that provide external data to a blockchain. In
cross-chain communication, they can be used to verify and relay information
between blockchains.

Advantages:
▪ Data Sharing: Enables the sharing of information and data across different
blockchain platforms, enhancing transparency and utility.
▪ Inter-Chain Transactions: Facilitates transactions that involve multiple
blockchains, broadening the scope of blockchain applications.
Cross-Chain Communication
▪ Decentralized Finance (DeFi): Enhances DeFi applications by allowing assets and
data to move freely across different blockchain networks, increasing liquidity and
functionality.

Challenges:
Latency: Communication between blockchains can introduce delays and affect
transaction speed.
Complexity in Synchronization: Ensuring that different blockchains remain
synchronized can be challenging, especially when they have different consensus
mechanisms and protocols.
Security: As with interoperability, cross-chain communication can introduce
additional security risks, such as potential vulnerabilities in relays or oracles.
Class Work

1. What are the main differences between public, private, Consortium and hybrid
blockchains?

2. Describe the role of nodes in a blockchain network. briefly explain each type of
Node.

3. How does the Ethereum blockchain differ from Bitcoin?

4. Explain the concept of interoperability and crosschain communication in


blockchain.

5. Explain some major blockchain protocols other than Bitcoin and Ethereum?
END
www.paruluniversity.ac.in

You might also like