Challenges and Types of Blockchain Systems
Challenges and Types of Blockchain Systems
15. Explain the generic elements of a block chain with suitable diagram.
16. Compare and contrast the different types of blockchain. Also List out the Benefits
and limitations of block chain.
Benefits:
1. Decentralization
2. Transparency and trust
3. Immutability
4. High availability
5. Highly secure
6. Simplification of current paradigms
7. Faster dealings
8. Cost saving
Limitations:
1. Scalability
2. Adaptability
3. Regulation
4. Relatively immature technology
5. Privacy
Types:
1. Distributed ledgers
2. Distributed Ledger Technology (DLT)
3. Blockchains
4. Ledgers
Distributed ledgers
1. distributed ledger is a broad term describing shared databases.
2. all blockchains are fundamentally distributed ledgers, all distributed ledgers are not
necessarily a blockchain.
Public ledger
1. not owned by anyone.
2. They are open to the public, and anyone can participate as a node in the
decision-making process.
3. Users may or may not be rewarded for their participation.
4. All users maintain a copy of the ledger on their local nodes and use a distributed
consensus mechanism to decide the eventual state of the ledger.
5. Ex: Bitcoin and Ethereum
Permissioned Ledger
1. is a blockchain where participants of the network are already known and trusted.
2. do not need to use a distributed consensus mechanism;
3. instead, an agreement protocol is used to maintain a shared version of the truth
about the state of the records on the blockchain.
4. Ex: Bitcoin can become a permissioned ledger if an access control layer is
introduced on top of it that verifies the identity of a user and then allows access to
the blockchain.
Shared Ledger
1. all blockchains, fall into the category of a shared ledger.
Tokenized blockchains
1. These blockchains are standard blockchains that generate cryptocurrency as a
result of a consensus process via mining or initial distribution.
2. Bitcoin and Ethereum are prime examples of this type of blockchain.
Tokenless blockchains
1. they do not have the basic unit for the transfer of value.
2. they are still valuable in situations where there is no need to transfer value
between nodes and only the sharing of data among various trusted parties is
required.
3. This is similar to full private blockchains, the only difference being that use of
tokens is not required.
4. This can also be thought of as a shared distributed ledger used for storing data.
5. It does have its benefits when it comes to immutability, security, and consensus
driven updates but are not used for common blockchain application of value
transfer or cryptocurrency.
Private blockchain
1. they are open only to a consortium or group of individuals or organizations who
have decided to share the ledger among themselves.
2. Ex: HydraChain and Quorum.
Semiprivate blockchains
1. part of the blockchain is private and part of it is public.
2. this is still just a concept today, and no real world POCs have yet been
developed.
3. the private part is controlled by a group of individuals, while the public part is
open for participation by anyone.
4. semi-decentralized model, where it is controlled by a single entity but still allows
for multiple users to join the network by following appropriate procedures.
Sidechains
1. known as pegged sidechains.
2. is a concept whereby coins can be moved from one blockchain to another and
moved back again.
3. altcoins (alternative cryptocurrencies) whereby coins are burnt as a proof of an
adequate stake.
17. Differentiate between byzantine Fault Tolerance based consensus and Leader
Election based consensus algorithm.
Proof of Stake(PoS):
1. This algorithm works on the idea that a node or user has an adequate stake in
the system; that is, the user has invested enough in the system so that any
malicious attempt by that user would outweigh the benefits of performing such an
attack on the network.
2. This idea was first introduced by Peercoin, and it is going to be used in the
Ethereum blockchain version called Serenity.
3. Another important concept in PoS is coin age, which is a criterion derived from
the amount of time and number of coins that have not been spent.
4. In this model, the chances of proposing and signing the next block increase with
the coin age.
Proof of Deposit
1. In this case, nodes that wish to participate in the network have to make a security
deposit before they can mine and propose blocks.
2. This mechanism is used in the Tendermint blockchain.
Proof of Importance
1. This idea is significant and different from PoS.
2. PoI not only relies on how large a stake a user has in the system, but it also
monitors the usage and movement of tokens by the user in order to establish a
level of trust and importance.
3. It is used in the NEM coin blockchain.
Reputation-based mechanisms
1. a leader is elected by the reputation it has built over time on the network.
2. It is based on the votes of other members.
Proof of Activity
1. This scheme is a combination of PoS and PoW, which ensures that a stakeholder
is selected in a pseudorandom but uniform fashion.
2. This is a comparatively more energy-efficient mechanism as compared to PoW.
3. It utilizes a new concept called Follow the Satoshi.
4. In this scheme, PoW and PoS are combined together to achieve consensus and
good level of security.
5. This scheme is more energy efficient as PoW is used only in the first stage of the
mechanism, after the first stage it switches to PoS which consumes negligible
energy.
Proof of Capacity
1. This scheme uses hard disk space as a resource to mine the blocks.
2. This is different from PoW, where CPU resources are used.
3. In in PoC, hard disk space is utilized for mining and as such is also known as
hard drive mining.
4. This concept was first introduced in the Burstcoin cryptocurrency.
Proof of Storage
1. This scheme allows for the outsourcing of storage capacity.
2. This scheme is based on the concept that a particular piece of data is probably
stored by a node which serves as a means to participate in the consensus
mechanism.
3. Several variations of this scheme have been proposed, such as Proof of
Replication, Proof of Data Possession, Proof of Space, and Proof of Space-Time.
20. Illustrate the working model of the public-key cryptography signature scheme with
suitable diagram.
Also called asymmetric cryptography or asymmetric key cryptography.
Asymmetric cryptography refers to a type of cryptography where the key that is used to
encrypt the data is different from the key that is used to decrypt the data. This is also
known as public key cryptography.
21. Explain the working principle of RSA digital signature algorithm with suitable
diagram.
Digital signing (left) and verification process (right) (Example of RSA digital signatures)
Message Integrity: MACs ensure that the message has not been altered during
transmission. Any modification to the message will result in a mismatched MAC tag upon
verification.
Message Authentication: MACs verify that the message was sent by someone who
possesses the secret key, confirming the sender’s authenticity. Only those with the key
can generate a valid MAC, preventing forgery.
23. Consider the following conditions and write the security property associated with
it.
i. h(x) = y
ii. m != x & h(m) = h(x)
iii. h(x) != h(z)
1. This property can be explained by using the simple equation shown as follows:
i.h(x) = y
2. Here, h is the hash function, x is the input, and y is the hash.
3. The first security property requires that y cannot be reverse-computed to x.
4. x is considered a preimage of y, hence the name preimage resistance.
5. This is also called a one-way property.
1. The second preimage resistance property requires that given x and h(x),
2. it is almost impossible to find any other message m, where m != x and hash of m
= hash of x or h(m) = h(x).
3. This property is also known as weak collision resistance.
1. The collision resistance property requires that two different input messages
should not hash to the same output.
2. In other words, h(x) != h(z). This property is also known as strong collision
resistance.
25. Explain the working principle of SHA-256 algorithm with suitable illustrations. (one
round compression function)
Wallet software is used to store private or public keys and bitcoin address.
27. Illustrate the following scenario using protocol messages with suitable diagram.
Alice wants to establish a communication with bob. She needs to send a
transaction as a response to the getdata protocol message. Also she wants to
know the information about all of her peers.
Step 1: Alice sends a version message to Bob, indicating her intent to establish
communication. This message typically includes her protocol version, node ID,
timestamp, and other details about her node.
Step 7: Alice wants to know information about her peers, so she sends a
getaddr message to Bob, requesting addresses of her peers.
Step 8: Bob responds with an addr message, listing addresses of peers that
Alice can connect to.
Double spending in a cryptocurrency network like Bitcoin refers to the risk of a user (e.g.,
Alice) spending the same Bitcoin more than once. In a scenario where Alice wants to
pay Bob for goods using Bitcoin, double spending could occur if she tries to send the
same Bitcoin to another party (or even back to herself) while simultaneously paying Bob.
Race Attack:
Alice creates two transactions with the same input (unspent transaction output, or
UTXO).
She sends one transaction to Bob (to pay for goods) and sends a conflicting transaction
to a different recipient or back to herself.
If Bob accepts the transaction as valid without sufficient confirmations, there’s a risk that
Alice’s second transaction could be confirmed first, invalidating the transaction Bob
accepted.
Finney Attack:
Alice mines a block that includes a transaction paying herself with the same Bitcoin she
plans to send to Bob.
Before broadcasting this block, she sends a conflicting transaction to Bob for his goods.
If Bob delivers the goods before enough confirmations, Alice broadcasts her mined block
with her transaction, effectively canceling the transaction to Bob.
51% Attack:
If Alice controls more than 50% of the network’s mining power, she could attempt to
rewrite the blockchain to invalidate the transaction to Bob.
This would allow her to redirect the funds back to herself after Bob has already accepted
payment.
To prevent double spending, the Bitcoin protocol employs several key mechanisms.
Here’s how these mechanisms work to secure the transaction between Alice and Bob:
1. Use of Confirmations
Requirement: Bob should wait for multiple confirmations before considering the
transaction as final. In Bitcoin, six confirmations are generally considered secure.
Explanation: Each confirmation represents an additional block added after the block
containing Alice’s transaction. This makes it increasingly difficult and costly for Alice to
reverse the transaction, especially in a well-secured blockchain.
Illustration of Confirmations:
After six confirmations, it becomes extremely unlikely for the transaction to be reversed,
ensuring Bob’s payment is secure.
This process helps to prevent double spending, as only one transaction with the same
input can be confirmed in a block.
Requirement: Every block in the blockchain is timestamped and linked to the previous
block.
Each block includes the hash of the previous one, creating a chain of secure,
time-ordered records that is difficult to alter.
34. Write a Script to send 10BTC to the anonymous receiver using P2PKH and P2SH
in Bitcoin Network.
35. Calculate a Network Difficulty of a block chain network for the given scenario.
Previous network target of the block chain is 500 and time taken to add a new
block in the current block chain is 20 minutes.
36. Assume that a node is proposing a new transaction in the block chain network.
Maximum Size of the block chain is 500 bytes. Output value of the proposed
transaction is 1000 BTC. nLock time of the proposed transaction contains 15 bits.
Number of Signature operation required is 3 and the proposed transaction
receives 15 confirmations after the successful execution of PoW. Size of the
proposed block is 250 bytes. Verify whether the given transaction is valid or not.
Justify your answer.
To determine the validity of the proposed transaction, we’ll need to examine each
parameter and confirm whether it aligns with the rules typically applied in blockchain
systems. Here’s a breakdown of each factor:
38. Illustrate the process of node discovery protocol in bitcoin network with suitable
example.
39. Compare and contrast Full node and SPV nodes in Bitcoin network.
40. Assume that you are asked to establish a peer to peer connection among non
standard nodes in the bit coin network. Identify suitable protocol to do so and
justify your answer.
41. Identify the type of wallet used in the following scenarios and explain the steps to
be followed to make the payment.
Mr.X uses a wallet which stores randomly generated private keys for making
payments in the bitcoin network.
Mr.X uses a wallet in which keys are derived out of a seed value via hash
functions.
Mr.X uses a wallet which stores private keys in a tree structure derived from a
seed.
Mr.X uses a wallet in which master private key can also be derived from the hash
of passwords that are memorized
Mr.X uses a wallet which uses tamper-resistant device to store keys.
Mr.X uses a wallet which provides various methods to make payments, most
notably the ability to use smartphone cameras to scan QR codes quickly and
make payments.
42. Compare and contrast Hard Fork and Soft Fork in Bitcoin network.
Keys and Addresses: Ethereum uses asymmetric cryptography, specifically private and
public keys, to secure user identities and transactions. The private key is used to sign
transactions, while the public key generates an address, which is shared publicly as the
user’s identity on the network.
Accounts: Ethereum has two types of accounts – Externally Owned Accounts (EOAs),
controlled by private keys, and Contract Accounts, which are associated with smart
contracts. EOAs are controlled by users, while contract accounts run code and have no
private keys, making them accessible only through transactions.
Transactions and Messages: Transactions are operations that modify the blockchain
state, often involving the transfer of Ether or the execution of code on a smart contract.
Messages, often called internal transactions, are data sent between contracts as part of
transaction executions, enabling contract-to-contract interactions.
Ether (Cryptocurrency/Tokens): Ether (ETH) is the native cryptocurrency of the Ethereum
network and is primarily used to pay for computational work (gas fees) to execute
transactions or run smart contracts. Ethereum also supports ERC-20 tokens, which are
user-created tokens that can represent assets or currencies on the platform.
Ethereum Virtual Machine (EVM): The EVM is a decentralized runtime environment
where all Ethereum accounts and smart contracts live. It processes and executes smart
contract code using gas to measure computational steps. This ensures that all nodes in
the Ethereum network execute smart contracts consistently.
Smart Contracts: Smart contracts are self-executing code stored on the blockchain. They
run on the EVM and execute automatically when certain conditions are met, enabling
decentralized applications (DApps) by automating processes without intermediaries.
44. List out the steps involved in Ethereum state transition functions.
1. Confirm the transaction validity by checking the syntax, signature validity, and nonce.
2. The transaction fee is calculated, and the sending address is resolved using the
signature.
Furthermore, sender's account balance is checked and subtracted accordingly, and
nonce is incremented.
An error is returned if the account balance is not enough.
3. Provide enough Ether (gas price) to cover the cost of the transaction. This is charged
per byte incrementally proportional to the size of the transaction.
In this step, the actual transfer of value occurs.
The flow is from the sender's account to receiver's account.
The account is created automatically if the destination account specified in the
transaction does not exist yet.
Moreover, if the destination account is a contract, then the contract code is executed.
This also depends on the amount of gas available.
If enough gas is available, then the contract code will be executed fully; otherwise, it will
run up to the point where it runs out of gas.
4. In cases of transaction failure due to insufficient account balance or gas, all state
changes are rolled back except for fee payment, which is paid to the miners.
5. Finally, the remainder (if any) of the fee is sent back to the sender as change and fee
are paid to the miners accordingly. At this point, the function returns the resulting state
which is also stored on the blockchain.
45. Compare and Contrast the properties of Externally Owned Accounts and Contract
Accounts.
46. Whar are the different types of transactions in Ethereum Blockchain?
47. List out the essential parameters that are required when creating an account.
contract myContract
{
function checkValues(uint x, uint y)
{
}
}
contract myContract
{
function getValue() returns (uint z)
{
z=x+y;
}
}
A function can return multiple values. In the preceding example function, getValue only
returns one value, but a function can return up to 14 values of different data types.
56. Illustrate the issues in solidity language using suitable example. (Solidity
programs)
57. List out the various functionalities performed by iterator in Ethereum Virtual
Machine.
58. Describe the implementation of chain code in hyperledger fabric.
[Link] “Solo” and “Kafka” Ordereing Schemes.
[Link] the following sceenario. Mr.X wants to discover the list of peers participating
in his peer to peer network and transfer 100 ether to his immediate peer using
hyperledger fabric. Explain the different kind of message communication he is supposed
to use in order to complete the given scenario.
[Link] the various components of the fabric with reference architecture.
1. Consensus layer: These services are responsible for facilitating the agreement process
between the participants on the blockchain network.
2. The consensus is required to make sure that the order and state of transactions is
validated and agreed upon in the blockchain network.
3. Smart contract layer: These services are responsible for implementing business logic as
per the requirements of the users. Transaction are processed based on the logic defined
in the smart contracts that reside on the blockchain.
4. Communication layer: This layer is responsible for message transmission and exchange
between the nodes on the blockchain network.
5. Security and crypto layer: These services are responsible for providing a capability to
allow various cryptographic algorithms or modules to provide privacy, confidentiality and
non-repudiations services.
6. Data stores: This layer provides an ability to use different data stores for storing state of
the ledger. This means that data stores are also pluggable and allows usage of any
database backend.
7. Policy services: This set of services provide the ability to manage different policies
required for the blockchain network. This includes endorsement policy and consensus
policy.
8. APIs and SDKs: This layer allows clients and applications to interact with the blockchain.
An SDK is used to provide mechanisms to deploy and execute chaincode, query blocks
and monitor events on the blockchain.
[Link] and explain the Requirements and Design goals of hyper ledger fabric.