You are on page 1of 30

IAT1-QUESTION-BANK

Module-1
1. Define Blockchain. List down types of Blockchain and give features and examples
of each of them. Compare different types of Blockchains.
Blockchain is a mechanism for permanently recording cryptographically signed,
time-stamped transactions, sequentially linked in a chain. It is a type of Distributed
Ledger Technology (DLT) where multiple nodes in a network share the same database,
and it is decentralized, removing intermediaries by establishing trust through a consensus
model.
There are several types of blockchains based on their level of decentralization:
Public Blockchain:
Anyone can join the network and participate in the consensus process.
Transactions are transparent and can be viewed by anyone.
Immutable ledger ensures data integrity.
Examples: Bitcoin, Ethereum, etc.
Private Blockchain:
Permissioned access, where only selected entities can join the network.
More control over who can read, write, and validate transactions.
Increased privacy compared to public blockchains.
Examples: Hyperledger Fabric, Corda, etc.
Consortium Blockchain:
Shared control among a group of organizations.
Intermediate level of decentralization between public and private blockchains.
Suitable for industries where multiple parties collaborate but still want some level of
control.
Examples: R3 Corda, Quorum, etc.

Features of a Blockchain
● Immutable - the blockchain is a permanent and unalterable network. Once a
transaction is recorded on the blockchain, it cannot be modified or deleted.
● Distributed - All network participants have a copy of the ledger for complete
transparency.
● Decentralized - Blockchain technology is a decentralized system, which means
that there is no central authority controlling the network.
● Consensus - Consensus is a decision-making algorithm for the group of nodes
active on the network to reach an agreement quickly and faster and for the
smooth functioning of the system.
2. What is DLT? What are its key features? Discuss some examples of DLT.
Differentiate between DLT and Blockchain.
Distributed Ledger Technology (DLT) is a concept centered around an encoded and
distributed database where records regarding transactions are stored. It involves a
database spread across various computers, nodes, institutions, or countries, accessible by
multiple individuals globally. Here are its key features:
● Decentralized: DLT operates on a decentralized model where every node
maintains the ledger independently. Updates to the ledger occur autonomously at
each node, ensuring transparency and eliminating the need for a central
authority.
● Immutable: DLT utilizes cryptography to create a secure database where once
data is stored, it cannot be altered or changed. This feature ensures the integrity
and security of the data recorded on the ledger.
● Append-only: Distributed ledgers are append-only, meaning that new data can
only be added to the ledger and cannot be modified or deleted. This feature
ensures the traceability and auditability of transactions.
● Distributed: DLT does not rely on a central server or authority to manage the
database. Instead, the ledger is distributed among multiple nodes in the network,
enhancing transparency and resilience.
● Shared: The distributed ledger is shared among the nodes in the network, with
some nodes having a full copy of the ledger and others having only the
necessary information. This sharing ensures that the ledger is accessible and
functional across the network.
● Smart Contracts: DLT supports smart contracts, which are self-executing
contracts with predefined terms written into code. Smart contracts automate
transactions, making them secure and transparent.
● Fault Tolerance: Due to its decentralized nature, DLT is highly fault-tolerant. If
one node fails, the data remains available on other nodes, ensuring continuous
operation of the network.
● Transparency: DLT offers high transparency, as every participant in the network
can view the transactions recorded on the ledger. This transparency fosters trust
among participants.
● Examples of DLT include:
● Blockchain: A type of DLT where transactions are stored in a chain of blocks,
each containing a unique hash. Bitcoin and Ethereum are examples of
blockchain-based DLT.
● Directed Acyclic Graphs (DAG): DAG uses a different data structure to organize
data and achieve consensus. IOTA and Nano are examples of DAG-based DLT.
● Hashgraph: Hashgraph stores records in a directed acyclic graph and uses virtual
voting for consensus. Hedera Hashgraph is an example of Hashgraph-based
DLT.
● Holochain: Holochain operates on a peer-to-peer network where each node runs
on its own chain. It offers a highly decentralized form of DLT.

3. What is CAP (Brewer’s) theorem? How it is applicable to Blockchain? How


Blockchain deals with CAP theorem?
CAP Theorem, also known as Brewer’s Theorem, is a fundamental principle in
distributed systems that highlights the trade-offs between Consistency, Availability, and
Partition Tolerance. It states that in a distributed system, it is impossible to
simultaneously achieve all three of these properties in the presence of network partitions.
● Consistency (C): Every read receives the most recent write or an error. This
means that all nodes in the system have the same view of the data at the same
time. Consistency ensures that all nodes see the same data, regardless of which
node they interact with.
● Availability (A): Every request receives a response, without the guarantee that it
contains the most recent write. Availability ensures that the system remains
operational and responsive to user requests, even in the presence of failures or
network partitions.
● Partition Tolerance (P): The system continues to operate despite network
partitions or communication failures between nodes. Partition tolerance ensures
that the system can withstand network failures and maintain its functionality
even when some nodes are unreachable.
According to the CAP Theorem, in the event of a network partition (P), a distributed
system must choose between maintaining Consistency (C) or Availability (A). It is not
possible to guarantee both Consistency and Availability simultaneously when a network
partition occurs.

Application of CAP Theorem to Blockchain:


● CA (Consistency and Availability): In a CA system, both Consistency and
Availability are prioritized, but Partition Tolerance is not guaranteed. This means
that the system ensures that all nodes have consistent and up-to-date data while
also remaining available to respond to user requests. However, in the event of a
network partition or failure, the system may sacrifice either Consistency or
Availability to maintain operation. For example, if a network partition occurs,
the system may choose to prioritize Availability by allowing nodes to continue
operating independently, even if they have slightly outdated data. CA systems
are suitable for applications where immediate consistency and high availability
are critical, such as financial systems or real-time data processing platforms.
● PA (Partition Tolerance and Availability): In a PA system, Partition Tolerance
and Availability are prioritized, but Consistency is not guaranteed. This means
that the system remains operational and responsive to user requests even in the
presence of network partitions or failures. However, because Partition Tolerance
is prioritized, the system may sacrifice Consistency by allowing nodes to diverge
in their views of the data during network partitions. This divergence may lead to
inconsistencies in the system, which are eventually resolved once the network
partition is resolved. PA systems are suitable for applications where continuous
operation and responsiveness are essential, even if it means temporarily
sacrificing Consistency. Examples include distributed messaging systems or
content delivery networks.
● CP (Consistency and Partition Tolerance): In a CP system, both Consistency and
Partition Tolerance are prioritized, but Availability is not guaranteed. This means
that the system ensures that all nodes have consistent views of the data and can
withstand network partitions without compromising data integrity. However,
because Availability is not guaranteed, the system may become unavailable or
unresponsive during network partitions or failures. This ensures that the system
maintains strong consistency even in the face of network disruptions. CP
systems are suitable for applications where data integrity and consistency are
paramount, such as database systems or critical infrastructure networks.

4. What Is the Byzantine Generals Problem? How it is applicable to Blockchain? How


does blockchain solve the Byzantine Generals problem? Explain with neat example.
The Byzantine Generals Problem is a classic problem in distributed computing and game
theory that illustrates the challenges of achieving consensus among a group of entities
that may not all be trustworthy or reliable. In this scenario, a group of Byzantine generals
surrounds a city and must collectively decide whether to attack or retreat. Each general
can only communicate with the others via messengers, and some of the generals may be
traitors who send conflicting messages in an attempt to sabotage the group's
decision-making process. The goal is to ensure that loyal generals can reach a consensus
on a common plan of action despite the potential presence of traitorous generals and the
risk of message failures or alterations.
In the context of blockchain technology, the Byzantine Generals Problem is highly
relevant because blockchain networks are decentralized systems that rely on achieving
consensus among a network of nodes to validate transactions and maintain the integrity of
the ledger. Here's how the Byzantine Generals Problem applies to blockchain and how
blockchain solves it:

Applicability to Blockchain: In a blockchain network, each node maintains a copy of the


entire ledger and participates in the process of validating transactions and adding them to
the blockchain. Nodes must agree on the order and validity of transactions to ensure
consistency and integrity across the network. However, some nodes may be malicious or
faulty, attempting to disrupt the consensus process by broadcasting invalid transactions or
attempting to double-spend coins. The Byzantine Generals Problem arises because
achieving consensus among nodes in a decentralized network is challenging when some
nodes may behave dishonestly or fail to follow the protocol.
Blockchain's Solution: Blockchain solves the Byzantine Generals Problem through the
use of consensus mechanisms, decentralization, cryptographic techniques, and economic
incentives. Here's how blockchain addresses the challenges posed by the Byzantine
Generals Problem:
● Consensus Mechanisms: Blockchain networks use consensus mechanisms, such as
Proof of Work (PoW), Proof of Stake (PoS), or Practical Byzantine Fault Tolerance
(PBFT), to achieve agreement among nodes on the validity of transactions and the state of
the ledger. These mechanisms ensure that honest nodes can collectively reach consensus
even in the presence of malicious actors or faulty nodes.
● Decentralization: Blockchain networks are decentralized, meaning there is no
central authority or single point of control. Instead, decision-making and
consensus are distributed among all participating nodes. Decentralization helps
mitigate the risk of collusion or manipulation by a single entity and enhances the
network's resilience to attacks or failures.
● Cryptographic Techniques: Blockchain networks use cryptographic techniques,
such as digital signatures and hash functions, to secure transactions and prevent
tampering or forgery. Digital signatures ensure that transactions are authentic
and cannot be altered without detection, while hash functions create a unique
fingerprint for each block, linking them together in a chain that is resistant to
tampering.
● Economic Incentives: Blockchain networks incentivize honest behavior and
disincentivize malicious behavior through mechanisms such as mining rewards,
transaction fees, and network penalties. Miners or validators are rewarded for
contributing computational resources to secure the network and validate
transactions while attempting to disrupt the network or validate fraudulent
transactions that would result in financial losses for the attacker.
Example: Suppose a decentralized cryptocurrency like Bitcoin is facing the Byzantine
Generals Problem. In Bitcoin, miners compete to validate transactions and add new
blocks to the blockchain. Miners use computational power to solve complex
mathematical puzzles and compete to be the first to find a valid block. Once a miner finds
a valid block, they broadcast it to the network for verification. Other nodes in the network
independently validate the block's transactions and confirm its validity before accepting it
and adding it to their copy of the blockchain. Through the consensus mechanism of Proof
of Work, Bitcoin ensures that the majority of honest nodes agree on the state of the ledger
and the validity of transactions, despite the potential presence of malicious actors or
faulty nodes.

5. What are the properties of cryptographic hash function? Which hash functions are
used in Blockchain? Explain each one of them with example and neat diagram.
Cryptographic hash functions have several properties that make them suitable for various
applications, including blockchain. Here are the common properties of cryptographic
hash functions:
● Deterministic: For the same input, the hash function always produces the same
output.
● Fast Computation: Hash functions should be computationally efficient to
calculate.
● Pre-image Resistance: Given a hash value, it should be computationally
infeasible to determine the input that produced that hash.
● Second Pre-image Resistance: Given an input and its hash value, it should be
computationally infeasible to find another input that produces the same hash.
● Collision Resistance: It should be computationally infeasible to find two
different inputs that produce the same hash value.
● Fixed Output Size: The output size of the hash function should be fixed,
regardless of the size of the input.
● Avalanche Effect: A small change in the input should result in a significant
change in the output.

SHA-256 (Secure Hash Algorithm 256)


SHA-256 is a cryptographic hash function that produces a fixed-size 256-bit (32-byte)
hash value. It is widely used in blockchain technology, including Bitcoin and Ethereum,
for securing data integrity and generating digital signatures.
Features:
Message Length: SHA-256 can process messages up to 2^64 bits in length, making it
suitable for handling large amounts of data.
Digest Length: The hash digest produced by SHA-256 is 256 bits in length. This
fixed-length output ensures consistency and uniformity across different inputs.
Irreversible: SHA-256 is designed to be irreversible, meaning it is computationally
infeasible to reconstruct the original input data from its hash value. This property ensures
data integrity and prevents tampering.
Example:
Suppose we have a simple message, "Hello, world!". Using SHA-256, we can calculate
its hash value:
Input: "Hello, world!"
SHA-256
Hash: "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
RIPEMD (RACE Integrity Primitives Evaluation Message Digest)
RIPEMD-160: This hash function generates a 160-bit hash value. It's commonly utilized
in blockchain for address generation and transaction validation. For example, Bitcoin uses
RIPEMD-160 in combination with SHA-256 to produce Bitcoin addresses.
RIPEMD-256/320: These variants offer longer hash lengths (256 or 320 bits) and
increased resistance against collisions compared to RIPEMD-160. While less common in
blockchain applications, they provide additional security for specific use cases.
Message-Digest Algorithm (MD)
MD5: Historically widely used, MD5 is now considered insecure due to vulnerabilities
and collision attacks. It's not suitable for blockchain applications where data integrity and
security are paramount.
MD6: MD6 is an improved version designed to address the weaknesses of earlier MD
algorithms. However, it's not prevalent in blockchain due to the dominance of more
secure hash functions like SHA.
BLAKE2 and BLAKE3
BLAKE2: This hash function is designed as a replacement for MD5 and SHA-1, offering
better security and performance. BLAKE2 is suitable for various blockchain applications,
including hashing data blocks efficiently.
BLAKE3: An enhanced version of BLAKE2, BLAKE3 provides faster hashing and
additional features such as parallelism and key derivation functions. It's well-suited for
high-performance blockchain systems.
Whirlpool
Whirlpool: Known for its strong security properties, Whirlpool is a cryptographic hash
function suitable for data integrity verification. While not as commonly used in
blockchain as SHA algorithms, it can still serve as an additional layer of security in
certain applications.

6. What do you understand by Consensus mechanism in Blockchain? Which


consensus mechanisms are commonly used in different types of blockchains? Explain
POW and POS consensus mechanisms and differentiate them.
Consensus mechanisms are the fundamental protocols or algorithms that ensure all nodes
in a decentralized network agree on the validity of transactions and maintain the integrity
of the blockchain ledger. These mechanisms play a crucial role in achieving agreement,
trust, and security across a distributed network where nodes may not trust each other.
Commonly Used Consensus Mechanisms:
Proof of Work (PoW):
PoW is a leader-based consensus mechanism where participating nodes, known as
miners, compete to solve complex mathematical puzzles. The solution, known as Proof of
Work, is then verified by other nodes in the network.
PoW relies on computational power and requires significant energy consumption for
mining operations.
Example: Bitcoin utilizes PoW, where miners compete to find a nonce value that, when
hashed with the block's data, produces a hash value below a specified target.
Proof of Stake (PoS):
In PoS, validators are selected to create new blocks based on the amount of
cryptocurrency they hold and are willing to "stake" or lock up as collateral. Validators are
chosen to propose and validate new blocks based on their stake.
PoS is more energy-efficient compared to PoW as it does not rely on intensive
computational power. Validators are chosen based on their stake, not their computational
power.
Example: Ethereum plans to transition from PoW to PoS with Ethereum 2.0, where
validators are chosen to propose and validate new blocks based on their stake in the
network.

7. With neat diagram illustrate the structure of Block (Header and Body) in the
Blockchain. Write short note on Genesis block and Merkle tree.
In a blockchain, each block consists of two main components: the block header and the
block body. Let's discuss each of these components in detail:
Block Header:
The block header contains metadata about the block and is essential for maintaining
the integrity and security of the blockchain. It typically includes the following fields:
● Version: This field specifies the version of the blockchain protocol being used
for the block.
● Previous Block Hash: This field contains the cryptographic hash of the previous
block's header, linking the current block to its predecessor. This linkage ensures
the chronological order and immutability of the blockchain.
● Merkle Root: The Merkle root is the hash of all the transactions included in the
block. It is derived from the Merkle tree, which provides a concise and efficient
way to summarize and verify the integrity of the transactions.
● Timestamp: This field records the time when the block was created or mined. It
helps establish the chronological order of blocks in the blockchain.
● Difficulty Target: The difficulty target determines the level of difficulty required
to mine a new block. It adjusts dynamically based on the network's hashing
power to maintain a consistent block creation rate.
● Nonce: The nonce is a 32-bit number that miners incrementally adjust during the
mining process to find a valid hash for the block. It is crucial for proof-of-work
consensus mechanisms.
Block Body:
The block body contains the actual data stored within the block. This data typically
consists of transactions, smart contracts, or other relevant information depending on
the blockchain's use case.
For example, in a cryptocurrency blockchain like Bitcoin, the block body contains a
list of transactions. Each transaction represents the transfer of cryptocurrency from one
address to another.
In other blockchain applications, such as Ethereum, the block body may include smart
contract code and state changes resulting from contract execution.
Genesis Block:
The Genesis block is the very first block in a blockchain. It serves as the foundation
upon which all subsequent blocks are built.
Unlike regular blocks, the Genesis block does not have a previous block hash because
it has no predecessor.
The creation of the Genesis block marks the birth of the blockchain network and
typically includes special metadata or messages to commemorate its significance.
For example, in the Bitcoin blockchain, the Genesis block includes a message
referencing a newspaper headline from January 3, 2009, indicating the block's creation
date.
Merkle Tree:
A Merkle tree is a data structure used to efficiently summarize and verify the integrity
of large sets of data, such as transactions in a block.
It is constructed by recursively hashing pairs of data (transactions) until a single root
hash, known as the Merkle root, is obtained.
The Merkle root is stored in the block header and serves as a compact representation
of all the transactions in the block.
By verifying the Merkle root, nodes in the blockchain network can quickly confirm the
validity of transactions without having to process each transaction individually.
The Merkle tree enhances the security and efficiency of blockchain networks by
facilitating fast and secure verification of block contents.

Module-2
1. What is Bitcoin? Explain double spending problem and how it is handled in
Bitcoin.
Bitcoin (BTC) is a virtual currency that works like a real-world currency. It's a
cryptocurrency, which means it's designed to be a form of payment outside the
control of any one person, group, or entity. It was invented in 2008 by an
anonymous person or group of people using the pseudonym Satoshi Nakamoto
and was released as open-source software in 2009. Bitcoin is not regulated by a
third party like banks, the government, or a company.
Double spending problem
The double spending problem refers to the risk associated with spending the
same digital currency more than once. In a traditional monetary system, this
issue doesn't arise because physical currency cannot be duplicated. However, in
digital transactions, since currency exists as data, there's a risk that a malicious
actor could spend the same digital currency multiple times, leading to fraudulent
transactions and undermining the integrity of the payment system.
In Bitcoin and other blockchain-based cryptocurrencies, the double spending
problem is addressed through a decentralized consensus mechanism and
cryptographic techniques. Here's how Bitcoin handles the double spending
problem:
● Decentralized Ledger: Bitcoin operates on a decentralized ledger called the
blockchain. This ledger is maintained by a network of nodes (computers)
spread across the globe. Each node maintains a copy of the entire
blockchain, which contains a record of all transactions ever executed on
the network.
● Transaction Verification: When a user initiates a Bitcoin transaction, it is
broadcast to the network of nodes. These nodes validate the transaction to
ensure that the sender has sufficient funds and that the transaction adheres
to the network's rules (e.g., no double spending).
● Consensus Mechanism: Bitcoin uses a consensus mechanism called Proof
of Work (PoW) to agree on the state of the blockchain. Miners, who are
specialized nodes, compete to solve complex mathematical puzzles to
validate and add new blocks of transactions to the blockchain. This
process requires significant computational power and ensures that no
single entity can control the network.
● Confirmation: After a transaction is included in a block by a miner and
added to the blockchain, it receives a certain number of confirmations.
Each confirmation represents a subsequent block added to the blockchain
after the block containing the transaction. The more confirmations a
transaction has, the more secure and irreversible it becomes.

2. Explain Bitcoin Mining process. List down types of mining.


Bitcoin mining is the process by which new bitcoins are created and transactions
are validated and added to the blockchain ledger. It involves using specialized
computer hardware to solve complex mathematical puzzles, a process known as
proof of work (PoW). Miners compete to find a solution to these puzzles, and
the first miner to solve it earns the right to add a new block of transactions to the
blockchain. Here's a breakdown of the Bitcoin mining process:
● Transaction Validation: Transactions made on the Bitcoin network are
collected into blocks. Miners gather these unconfirmed transactions from
the network and validate their authenticity.
● Block Formation: Once a miner has collected a set of transactions, they
package them into a block. Each block contains a list of transactions, a
reference to the previous block (creating a chain of blocks, or blockchain),
and a nonce (a random number used in the mining process).
● Proof of Work: The miner's next task is to find a nonce that, when
combined with the block's data, produces a hash value that meets certain
criteria. This process requires significant computational power and is
known as proof of work. Miners repeatedly hash the block's data with
different nonce values until they find a hash that meets the difficulty target
set by the Bitcoin network.
● Finding the Solution: The difficulty target is adjusted regularly to ensure
that new blocks are added to the blockchain approximately every 10
minutes. Miners compete to find a valid hash value that is below the
current difficulty target. The first miner to find such a hash broadcasts
their solution to the network.
● Verification and Consensus: Once a miner announces a solution, other
nodes in the network verify the validity of the solution and the transactions
contained in the block. If the majority of nodes agree that the block is
valid, it is added to the blockchain, and the miner receives a reward in the
form of newly minted bitcoins and transaction fees.
● Reward Distribution: The miner who successfully mines a block receives
the block reward, which consists of a fixed amount of newly minted
bitcoins (currently 6.25 bitcoins per block) and any transaction fees
associated with the transactions in the block. This serves as an incentive
for miners to participate in the network and secure the blockchain.
Types of Bitcoin Mining:
● Solo Mining: In solo mining, an individual miner operates independently
and attempts to mine blocks on their own. They compete with other miners
to find solutions to the proof-of-work puzzles without joining a mining
pool. Solo mining can be profitable for miners with significant
computational resources, but it requires patience and luck to find blocks.
● Pool Mining: Pool mining involves multiple miners combining their
computational power to increase their chances of successfully mining
blocks and earning rewards. Miners contribute their hashing power to a
mining pool, and when a block is successfully mined, the rewards are
distributed among pool participants based on their contribution. Pool
mining offers a more consistent income stream compared to solo mining
but involves sharing the rewards with other miners.
● Cloud Mining: Cloud mining allows individuals to rent computing power
from remote data centers to mine bitcoins. Instead of investing in
expensive hardware and managing mining operations, users can purchase
mining contracts from cloud mining providers. Cloud mining can be
convenient for users who lack technical expertise or access to affordable
electricity but may involve higher fees and lower profitability compared to
traditional mining methods.

3. Illustrate generation of private key, public key (using ECC) and Address of
Bitcoin (Using hash and Base58 encoding).
Generation of Private Key:
A private key is a randomly generated 256-bit number.
Example of a private key:
5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF
Generation of Public Key (Using ECC):
The public key is derived from the private key using Elliptic Curve
Cryptography.
Bitcoin uses the secp256k1 elliptic curve.
The public key is a point on the elliptic curve calculated by multiplying a
predetermined generator point (G) by the private key (k).
Example of a public key (uncompressed format):
0431c1e9f0e124b3e4f2c4c4b5f3c49d204d774f147bb9db3e6e5f7b3f2062c3b15a
173b23db20084a2f8c6ef87b6f78ef85aafef204199f3a5ef0b1d0794bcb5
Derivation of Bitcoin Address:
A Bitcoin address is derived from the public key through a series of
cryptographic operations.
The public key is first hashed using the SHA-256 algorithm.
The resulting hash is then hashed again using the RIPEMD-160 algorithm.
The RIPEMD-160 hash is then prefixed with a version byte (usually 0x00 for
mainnet) to identify the network and create a checksum.
The checksum is calculated by taking the first four bytes of the double SHA-256
hash of the prefixed hash.
The checksum is appended to the prefixed hash, forming the payload.
The payload is encoded using Base58Check encoding to create the Bitcoin
address.
Example of a Bitcoin address: 1J7mdg5rbQyUHENYdx39WVWK7fsLpEoXZy

4. What is wallet? What are types of wallets. What are wallet technologies?
Explain with neat diagram the concept of HD deterministic wallet
(specification-BIP0032).
A cryptocurrency wallet is a software or hardware tool used to securely store,
manage, and interact with digital assets such as Bitcoin and other
cryptocurrencies. It's called a wallet because, like a physical wallet, it allows
users to send, receive, and manage their funds. However, instead of holding
physical currency, a cryptocurrency wallet stores the private keys necessary to
access and control the user's digital assets on the blockchain.

Types of Wallets:
Hot Wallets:
● Software Wallets: Software wallets include applications for desktops and
mobile devices. These wallets are installed on a desktop or laptop
computer and can access your cryptocurrency, make transactions, display
your balance, and much more. Some software wallets also include
additional functionality, such as exchange integration if you're using a
wallet designed by a cryptocurrency exchange.
● Online Wallets: Also known as web wallets, they run on cloud servers and
can be accessed from anywhere via a web browser.
Cold Wallets:
● Hardware Wallets: Physical devices that generate and store keys offline,
providing enhanced security against online threats.
● Paper Wallets: Physical printouts or handwritten records of keys, typically
in the form of QR codes, offering offline storage but vulnerable to physical
damage or loss.
Wallet Technologies:
● Nondeterministic Wallets: Each key is independently generated from a
random number, known as a JBOK (Just a Bunch Of Keys) wallet.
Cumbersome to manage and require frequent backups to prevent loss of
funds.
● Deterministic Wallets: Keys are derived from a single master key, known
as the seed, making it possible to recreate the entire wallet from the seed.
Two types: hierarchical deterministic (HD) wallets and non-hierarchical
deterministic wallets.
Hierarchical Deterministic (HD) wallets
Hierarchical Deterministic (HD) wallets, as defined by the BIP-32 standard,
offer a sophisticated approach to cryptocurrency wallet management. They
organize keys in a tree structure, where a parent key can derive a sequence of
children keys, and each child key can further derive its own set of keys,
extending to an infinite depth. HD wallets are created from a single root seed,
typically generated from a mnemonic phrase. Every key in the HD wallet is
deterministically derived from this root seed, enabling the recreation of the
entire wallet from the seed in any compatible HD wallet. This feature facilitates
easy backup, restoration, export, and import of HD wallets by simply
transferring the mnemonic phrase. HD wallets provide numerous advantages,
including organizational structuring, enhanced privacy, and improved security
through hierarchical key derivation. Additionally, HD wallets allow the creation
of a sequence of public keys without access to corresponding private keys,
enabling their use in insecure environments or for specific purposes like
receiving payments. The child key derivation process in HD wallets utilizes a
one-way hash function, combining a parent key, a chain code, and an index
number to generate child keys, ensuring that knowledge of a child key does not
compromise its siblings' security. Overall, HD wallets offer a powerful and
flexible solution for managing cryptocurrency funds, catering to both individual
and organizational needs.
5. With the help of diagram explain bitcoin UTXO model for transaction and
transaction lifecycle.

The Bitcoin Unspent Transaction Output (UTXO) model governs how


transactions are processed and managed within the Bitcoin blockchain. In this
model, transactions consist of inputs and outputs. Inputs reference previous
transaction outputs and specify the funds being spent, while outputs contain
instructions for sending bitcoins. When a transaction is initiated, the sum of the
input values (less any transaction fee) is allocated to the outputs, with any
remaining funds returned as change to the sender. Bitcoin full nodes maintain a
record of all UTXOs, which represent spendable outputs available for further
transactions. A user's bitcoin balance is the total value of all UTXOs their wallet
can spend. Each UTXO consists of an amount of bitcoin and a locking script that
specifies the conditions required to spend the output. When a user initiates a
transaction, their wallet selects appropriate UTXOs as inputs to cover the desired
amount to be sent, ensuring that the sum of inputs meets or exceeds the amount
to be sent plus any transaction fee. The transaction is then broadcast to the
network, where it is validated and added to the blockchain, updating the UTXO
set accordingly.
Example: Consider Tom, who has 5 BTC in his wallet, represented by multiple
Unspent Transaction Outputs (UTXOs) from previous transactions: 2 BTC, 1
BTC, 1.5 BTC, and 0.5 BTC. Now, suppose Tom wants to send 2 BTC to Alice.
In this Bitcoin transaction, the input would be the total sum of 5 BTC from
Tom's UTXOs. The output would include 2 BTC sent to Alice and 3 BTC
returned to Tom as change. To accomplish this, the transaction would create a
new UTXO of 3 BTC, which would be associated with Tom's address. This
process ensures that the sum of inputs (5 BTC) equals the sum of outputs (2
BTC to Alice + 3 BTC change), maintaining the balance.

6. What are different types of transaction scripts? Explain pay-to-Public-Key-hash,


Multi-signature Addresses and Pay-to-Script Hash (P2SH). Differentiate
between P2PKH and P2SH.
Different types of transaction scripts in Bitcoin include Pay-to-Public-Key Hash
(P2PKH), Multi-signature Addresses, and Pay-to-Script Hash (P2SH).
● Pay-to-Public-Key Hash (P2PKH): This script involves locking funds to a
recipient's hashed public key. The output script (locking script) contains
the recipient's hashed public key, while the input script (unlocking script)
must provide a digital signature and the original public key corresponding
to the hashed one. If the signature matches the original public key and the
hash, the transaction is considered valid. P2PKH offers a straightforward
way to secure transactions and is commonly used in Bitcoin wallets.
● Multi-signature Addresses: Multi-signature addresses enhance security by
requiring authorization from multiple parties to spend funds. These
addresses involve multiple public keys, and a predefined number of
signatures (out of the total) is needed to validate a transaction. The locking
script specifies the required number of signatures and the associated public
keys, while the unlocking script must provide the required number of valid
signatures. Multi-signature addresses are useful for applications that
require heightened security, such as joint accounts and corporate funds.
● Pay-to-Script Hash (P2SH): P2SH allows funds to be sent to a script hash
instead of a specific public key or public key hash. This enables complex
spending conditions to be encoded within a script, enhancing flexibility
and security. In P2SH, the output script (locking script) includes the
hashed script instead of a public key hash, while the input script
(unlocking script) must provide the original script along with any required
signatures or data. If the conditions specified in the hashed script are met,
the funds can be spent. P2SH is commonly used for implementing
advanced spending conditions, including multi-signature wallets and smart
contracts, without revealing the details of the script until spending occurs.

7. With neat diagram explain the structure of Block in Bitcoin Blockchain


The structure of a block in the Bitcoin blockchain comprises two main
components: the block header and the list of transactions.
Block Header:
● The block header is a 80-byte structure containing metadata about the
block.
● It includes the following information:
● Previous Block Hash: A reference to the hash of the previous block in the
blockchain, linking it to the chain.
● Merkle Root: The root hash of the Merkle tree, which summarizes all
transactions in the block.
● Timestamp: The Unix timestamp indicating when the block was mined.
● Nonce: A random number used in the mining process to find a valid block
hash.
● Difficulty Target: The target difficulty level for mining this block.
List of Transactions:
● After the block header comes a list of transactions.
● This list contains all the transactions included in the block, such as
transfers of Bitcoin between addresses.
● Each transaction includes inputs and outputs, representing the movement
of Bitcoin from one address to another.
● Transactions are grouped together in the block and ordered by the miner
who successfully mined the block.

Module-5
1. What is Cryptocurrency? What are their characteristics? List down various types
of Cryptocurrencies and compare Bitcoin and Ethereum
Cryptocurrency is a type of digital or virtual currency that uses cryptography for
security and operates on decentralized networks based on blockchain technology.
Here are its characteristics:
● Decentralization: Cryptocurrencies are typically decentralized, meaning
they are not controlled by any single entity or government. Instead, they
rely on distributed ledger technology, such as blockchain, to record
transactions and manage the network.
● Cryptography: Cryptocurrencies use cryptographic techniques to secure
transactions and control the creation of new units. This ensures the
integrity and security of the network, as well as the anonymity of users.
● Digital Nature: Cryptocurrencies exist purely in digital form and do not
have a physical counterpart like traditional currencies. They are stored in
digital wallets and can be transferred electronically between users.
● Limited Supply: Many cryptocurrencies have a predetermined maximum
supply, which is coded into their protocol. This ensures scarcity and can
contribute to their value over time.
● Irreversible Transactions: Once a transaction is confirmed on the
blockchain, it cannot be reversed or altered. This immutability ensures the
integrity of the transaction history.
● Global Accessibility: Cryptocurrencies can be accessed and used by
anyone with an internet connection, regardless of geographic location or
socioeconomic status.
Types of cryptocurrencies
Bitcoin-derived cryptocurrencies: These are cryptocurrencies that are either directly
forked from Bitcoin's codebase or are built using similar principles. They often share
many characteristics with Bitcoin, such as proof-of-work consensus mechanisms and a
focus on decentralization and digital currency use cases.
Examples of Bitcoin-derived cryptocurrencies include:
● Bitcoin Cash (BCH): Forked from Bitcoin in 2017 to increase the block size
limit, allowing for more transactions per block and faster transaction speeds.
● Bitcoin SV (BSV): Another fork of Bitcoin, created to maintain the original
vision of Bitcoin as outlined in the Satoshi Nakamoto whitepaper. It aims to
scale Bitcoin for global adoption by increasing the block size and restoring
certain protocol features.
● Litecoin (LTC): While not a direct fork of Bitcoin, Litecoin shares many
similarities with Bitcoin and is often considered a "silver" to Bitcoin's "gold." It
was created by Charlie Lee in 2011 and offers faster transaction confirmations
and a different hashing algorithm (Scrypt) compared to Bitcoin.
Native blockchain cryptocurrencies: These are cryptocurrencies that operate on their
own blockchain networks and are not directly derived from Bitcoin's codebase. They
often have unique features, consensus mechanisms, and use cases beyond serving as
digital currencies.
Examples of native blockchain cryptocurrencies include:
● Ethereum (ETH): A decentralized platform that enables the creation and
execution of smart contracts and decentralized applications (DApps). Ether
(ETH) is the native cryptocurrency of the Ethereum platform, used to pay for
transaction fees and computational services.
● Ripple (XRP): Developed by Ripple Labs, XRP is designed to facilitate fast and
low-cost cross-border payments. It aims to provide solutions for banks and
financial institutions to improve the efficiency of international money transfers.
● Cardano (ADA): A blockchain platform focused on scalability, sustainability,
and interoperability. Cardano aims to provide a secure and scalable infrastructure
for the development of decentralized applications and smart contracts.
● Polkadot (DOT): A multi-chain blockchain platform that enables interoperability
between different blockchains. It aims to create a decentralized and interoperable
ecosystem where different blockchain networks can communicate and share
information.
2. What do you understand by Crypto-Tokens in Blockchain? How they work?
What are the different types of Crypto-Tokens? Give suitable examples.
Crypto-tokens in blockchain are digital assets that are created, traded, and stored
on a blockchain platform. These tokens can represent various assets, such as
commodities, loyalty points, or even other cryptocurrencies, and are often used
for specific purposes within a blockchain ecosystem. Here's an overview of how
crypto-tokens work and the different types:
How Crypto-Tokens Work:
● The token is given a numerical value to represent a monetary digital asset.
● Crypto tokens are programmable, permissionless, trustless, and
transparent.
● The token can be programmed to represent any tradable asset or utility that
resides on the blockchain and allows the holder to use it for investment or
economic purposes.
● The person owning the token essentially holds a key that lets them create a
new entry on the public blockchain ledger.
Types of Crypto-Tokens:
● Governance Tokens: These tokens enable holders to participate in the
governance of a blockchain network by voting on protocol upgrades,
parameter changes, or other governance decisions. Examples include
MakerDAO's MKR token and Compound's COMP token.
● Utility Tokens: Utility tokens are used to access or pay for services,
products, or features within a blockchain platform or decentralized
application (DApp). Examples include Basic Attention Token (BAT),
which is used within the Brave browser for advertising and content
rewards.
● Security Tokens: Security tokens represent ownership or investment in
real-world assets, such as equity shares, bonds, or real estate. They often
offer holders certain rights, such as voting or dividends. Security tokens
are subject to regulatory compliance and securities laws. Examples include
tokenized stocks and real estate.
● Non-Fungible Tokens (NFTs): NFTs are unique tokens that represent
ownership or proof of authenticity of a specific digital or physical asset.
Each NFT has unique properties and cannot be exchanged on a one-to-one
basis like fungible tokens. NFTs are commonly used for digital art,
collectibles, gaming items, and more. Examples include CryptoKitties,
NBA Top Shot moments, and digital artworks by Beeple.
Examples:
Ethereum-based Tokens: Many tokens are created and operate on the Ethereum
blockchain using ERC-20, ERC-721, or ERC-1155 standards. Examples include
DAI stablecoin (ERC-20), CryptoKitties (ERC-721), and Decentraland's MANA
token (ERC-20).

3. Illustrate working of ERC-20 and ERC-721 standard and compare them.


ERC-20 and ERC-721 are two prominent standards in the Ethereum ecosystem,
each serving distinct purposes and catering to different tokenization needs. The
ERC-20 standard, introduced in 2015, defines a set of rules and functions for
creating fungible tokens on the Ethereum blockchain. These tokens are
interchangeable, meaning each token is identical and can be traded or transferred
with any other token of the same type. The creation process of ERC-20 tokens
involves submitting proposals through Ethereum Improvement Proposals (EIPs),
which are then reviewed and approved by the Ethereum community. Once
implemented, ERC-20 tokens offer functionalities such as balance checking,
token transfer, and approval of token spending by third parties. However, they
may face network inefficiencies and slower transaction times during
high-congestion periods.
In contrast, the ERC-721 standard, introduced in 2018, is designed for creating
non-fungible tokens (NFTs) on the Ethereum blockchain. These tokens represent
unique assets, each with its own distinct value and properties. ERC-721 tokens
find applications in various industries such as gaming, digital art, collectibles,
and tokenized assets. Unlike ERC-20 tokens, ERC-721 tokens cannot be
exchanged on a one-to-one basis and are not interchangeable. The creation
process involves defining the unique characteristics and metadata of each token,
providing transparency and provenance tracking for digital assets. ERC-721
tokens emit events such as 'Transfer' and 'Approval' to facilitate real-time
tracking of token ownership changes. Overall, ERC-20 and ERC-721 standards
play crucial roles in tokenizing assets and facilitating transactions within the
Ethereum ecosystem, offering solutions for both fungible and non-fungible
tokenization needs.
4. What is NFT? What are the key features of NFT? Explain working of NFT with
suitable use-case. Compare Altcoin, Utility tokens and Security tokens.
NFT, or Non-Fungible Token, is a unique digital identifier stored on a
blockchain that represents a specific asset or piece of content. Unlike fungible
tokens such as cryptocurrencies, where each token is identical and
interchangeable, NFTs are indivisible and cannot be replicated or substituted.
They are cryptographic assets that contain metadata defining their unique
characteristics and value. NFTs can represent both tangible and intangible items,
including digital art, collectibles, virtual real estate, in-game assets, and more.
Key Features of NFT
● Uniqueness: Each NFT has distinct properties and values stored within its
metadata, making it easily distinguishable from other tokens.
● Immutability: NFTs cannot be forged or altered due to the cryptographic
nature of blockchain technology, ensuring authenticity and provenance
tracking for digital assets.
● Ownership Verification: NFTs enable easy verification of ownership and
facilitate secure transfer of tokens between owners, as each token is
directly linked to an Ethereum address.
Working of Non-Fungible Tokens (NFTs) can be explained through a
suitable use case, such as a digital art marketplace:
● Creation of NFTs: An artist creates a digital artwork, whether it's a
painting, illustration, or any form of digital art. To tokenize this artwork,
the artist uses a platform that supports NFT creation, often built on the
Ethereum blockchain. They upload the artwork along with relevant
metadata, including title, description, and any additional information that
adds value or context to the piece.
● Minting Process: The platform initiates the minting process, where the
artwork is transformed into a unique NFT. During this process, the
metadata associated with the artwork is stored on the blockchain, ensuring
its immutability and authenticity. A digital certificate of ownership is also
generated, linking the NFT to the artist's Ethereum address.
● Ownership Verification: Once minted, the NFT is available for purchase or
auction on the platform. Collectors and art enthusiasts can browse the
marketplace, view the available artworks, and verify ownership through
the blockchain. Each NFT has a distinct identifier and cryptographic
signature, making it easily distinguishable from other tokens.
● Transaction and Transferability: When a collector purchases an NFT, the
ownership of the digital artwork is transferred from the artist's address to
the buyer's address. This transfer is facilitated by the blockchain through a
secure and transparent transaction. The buyer now holds the digital
certificate of ownership, proving their exclusive rights to the artwork.
● Market Dynamics: The value of NFTs is determined by various factors,
including the rarity, uniqueness, and demand for the artwork. As collectors
buy, sell, and trade NFTs on the marketplace, the market dynamics evolve,
with certain artworks gaining popularity and increasing in value over time.
Artists may also receive royalties or commissions for secondary sales of
their NFTs, providing them with ongoing incentives and rewards for their
creations.
● Display and Interactivity: Once owned, collectors can display their NFTs
in virtual galleries, online platforms, or even in virtual reality
environments. Some NFTs may also come with additional interactive
features or unlockable content, enhancing the overall experience for the
owner and adding value to the artwork.
5. Explain concept and working of ICO and STO with neat diagram and
differentiate between them.
Concept of ICO (Initial Coin Offering):
ICO, or Initial Coin Offering, is a fundraising method used by cryptocurrency
startups to raise capital for their projects. In an ICO, the company issues digital
tokens (cryptocurrency) to investors in exchange for funding. These tokens
represent a stake in the project or access to its products or services.
Working of ICO:
● Project Planning: The company conceptualizes its project and determines
the need for fundraising through an ICO.
● Token Creation: The company creates digital tokens using blockchain
technology, usually based on existing protocols like Ethereum's ERC-20
standard. These tokens represent ownership, participation rights, or access
to the project's platform or services.
● Whitepaper Publication: The company publishes a whitepaper detailing its
project, including its objectives, technical details, tokenomics, team
members, and roadmap. This document serves as a guide for potential
investors.
● Token Sale: The company announces the ICO and sets a date for the token
sale. Investors can participate by purchasing the project's tokens using
cryptocurrencies like Bitcoin or Ethereum. The company may offer
bonuses or discounts to early investors.
● Token Distribution: After the ICO concludes, the company distributes the
purchased tokens to investors' wallets. These tokens can then be traded on
cryptocurrency exchanges or used within the project's ecosystem.
● Project Development: The company utilizes the funds raised from the ICO
to develop and launch its project according to the outlined roadmap.
● Community Building: Throughout the development process, the company
engages with its community of investors and supporters through social
media, forums, and other channels to provide updates and gather feedback.
Concept of STO (Security Token Offering):
STO, or Security Token Offering, is a fundraising mechanism similar to an ICO
but with one key difference: the tokens issued in an STO are classified as
securities and are subject to regulatory compliance.
Working of STO:
● Regulatory Compliance: The company seeking to conduct an STO must
comply with securities regulations in the jurisdictions where it plans to
offer its tokens. This may involve registering with regulatory authorities or
conducting the offering under exemptions provided by securities laws.
● Tokenization of Assets: The company tokenizes its assets, which could
include equity in the company, real estate, bonds, or other financial
instruments. These tokens represent ownership or rights to the underlying
assets.
● Legal Documentation: The company prepares legal documents, such as a
prospectus or offering memorandum, detailing the terms and conditions of
the offering, as well as the rights and obligations of token holders.
● Investor Accreditation: Depending on securities regulations, the company
may be required to ensure that investors meet certain criteria, such as
being accredited investors or meeting minimum investment thresholds.
● Token Sale: The company conducts the STO, offering its security tokens to
investors in exchange for funding. Investors purchase the tokens using fiat
currency or cryptocurrencies, and the proceeds are used to fund the project
or investment.
● Compliance Reporting: The company must adhere to ongoing reporting
and compliance requirements imposed by securities regulators, such as
disclosing financial information and providing regular updates to
investors.
● Secondary Market Trading: Once the security tokens are issued, investors
can trade them on secondary markets, subject to applicable securities laws
and exchange regulations.

You might also like