BLOCKCHAIN
BLOCKCHAIN
ANSWERS
1. Define blockchain and explain
its importance in modern
technology.
Definition: Blockchain is a distributed ledger technology
where data is stored in blocks that are linked using
cryptographic hashes. It operates on a decentralized
network, ensuring transparency, security, and immutability.
Importance:
• Enhances security by preventing unauthorized alterations.
• Promotes transparency as all participants have access to the
same data.
• Eliminates intermediaries, reducing costs and increasing
efficiency.
• Provides trust in digital transactions, essential for industries like
finance, healthcare, and supply chain.
2. List and describe any two types of
blockchain.
Public Blockchain:
2.Open to everyone and does not require permission to
participate.
3.Examples: Bitcoin, Ethereum.
4.Provides high transparency but may face scalability issues.
Private Blockchain:
5.Access is restricted to specific individuals or organizations.
6.Used for enterprise solutions, such as supply chain
tracking.
7.Offers better control and privacy but is less decentralized.
3. What are private keys and public keys in
blockchain wallets? Why are they important?
Private Key: A secret key used to sign transactions
and prove ownership of blockchain assets.
Public Key: A derived key from the private key used to
generate wallet addresses and verify signatures.
Importance:
• Private keys ensure the security and authenticity of
transactions.
• Public keys enable others to interact with the wallet without
exposing sensitive information.
4. Explain the term "smart
contract" and provide one
example of its use.
Definition: A smart contract is a self-executing program
stored on the blockchain that automatically enforces the
terms of an agreement when predefined conditions are
met.
Example:
• In insurance, a smart contract can automatically process
claims when evidence of an event (e.g., flight delay) is
verified.
5. What is Proof of Work (PoW)?
How does it ensure the security
of a blockchain?
• Definition: PoW is a consensus mechanism where
miners solve complex mathematical problems to
validate transactions and add blocks to the blockchain.
• Security:
• The computational effort makes attacks costly and resource-
intensive.
• Blocks cannot be altered without re-mining, ensuring
immutability.
6. Identify and describe any two
vulnerabilities or attacks in blockchain
systems.
51% Attack:
Occurs when a single entity gains control of more than 50% of
the network’s hashing power.
Can lead to double-spending and block reorganization.
Smart Contract Exploits:
Vulnerabilities in poorly written smart contracts can be
exploited to drain funds or cause unintended behavior.
Example: The DAO hack on Ethereum.
7. Describe the key steps
involved in a blockchain
transaction.
• Transaction Creation: A user creates a transaction using a
private key.
• Broadcasting: The transaction is broadcast to the network.
• Validation: Nodes verify the transaction’s validity (e.g.,
checking digital signatures).
• Block Formation: Valid transactions are grouped into a block.
• Consensus: The block is validated through a consensus
mechanism like PoW or PoS.
• Addition to the Blockchain: The block is added to the
blockchain, making the transaction permanent.
8. List the layers of the blockchain technology
stack and explain the role of the Consensus
Layer.
Layers:
1. Application Layer: Interfaces for users (e.g., wallets, dApps).
2. Execution Layer: Processes transactions and smart contracts.
3. Consensus Layer: Ensures agreement among nodes on the
blockchain state.
4. Network Layer: Manages communication between nodes.
5. Data Layer: Stores blockchain data.
Consensus Layer Role: Maintains trust and consistency
across the network by validating transactions and
ensuring the blockchain remains tamper-proof.
SECTION B
Compare Proof of Stake (PoS) and Proof of Work (PoW).
Highlight one advantage and one disadvantage of each
consensus mechanism.
Components:
2.Blockchain Network: Core infrastructure.
3.Smart Contracts: Business logic.
4.APIs: Facilitate interaction between front-end and blockchain.
5.Front-End Interface: User-facing application.
Connections:
2.Front-end communicates with smart contracts through APIs.
3.Smart contracts interact with the blockchain network.
Process:
2.Define requirements.
3.Choose a blockchain platform.
4.Develop smart contracts.
5.Integrate front-end and back-end.
6.Test and deploy.
3. Discuss any two types of blockchain attacks. Explain
how they work and suggest ways to mitigate them.
Sybil Attack:
• Attackers create multiple fake identities to gain control of the network.
• Mitigation: Use strong consensus mechanisms like PoW or PoS.
Replay Attack:
• Transactions from one blockchain are maliciously repeated on another.
• Mitigation: Implement unique transaction identifiers and expiration
mechanisms.
4. Define Solidity and explain the key steps to
set up a Solidity development environment.
contract SimpleStorage {
uint public storedNumber;