unit 2.pptx
unit 2.pptx
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
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
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.
▪ 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
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.
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
Choose Hardware:
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
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.
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:
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.
5. Explain some major blockchain protocols other than Bitcoin and Ethereum?
END
www.paruluniversity.ac.in