BlockChain Technologies (20CS32015)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

PART A

10x2=20

a. A blockchain is “a distributed database that maintains a


continuously growing list of ordered records, called blocks.” These
blocks “are linked using cryptography. Each block contains a
cryptographic hash of the previous block, a timestamp, and
transaction data.

b.

c.
Smart contracts are code written into a blockchain that executes the
terms of an agreement or contract from outside the chain. It
automates the actions that would otherwise be completed by the
parties in the agreement, which removes the need for both parties to
trust each other.

d. Double-spending is the risk that a cryptocurrency can be used twice


or more. Transaction information within a blockchain can be altered if
specific conditions are met. The conditions allow modified blocks to
enter the blockchain; if this happens, the person that initiated the
alteration can reclaim spent coins.
e. Components:
 Hyperledger fabric is an enterprise-level permission blockchain network. It is
made up of various unique organizations or members that interact with each
other to serve a specific purpose. For example, these organizations can be a
bank, financial institution, or a supply chain network. Each organization is
identified and they have a fabric certificate authority. These organizations
are called members.
 Each member of the fabric can set up one or more authorized peers to
participate in the network using the fabric certificate authority. All of these
peers must be authorized properly.
 There is a client-side application connected to the network written with the
software development kit (SDK) of any particular programming language.
Workflow:
For each and every transaction in the fabric, the following steps are followed-
1. Creation of the proposal: Imagine a deal between a smartphone
manufacturer company and a smartphone dealership. The transaction
begins when a member organization proposes or invokes a transaction
request with the help of the client application or portal. Then the client
application sends the proposal to peers in each organization for
endorsement.
2. Endorsement of the transaction: After the proposal reaches the endorser
peers (peers in each organization for endorsement of a proposal) the peer
checks the fabric certificate authority of the requesting member and other
details that are needed to authenticate the transaction. Then it executes the
chain code (a piece of code that is written in one of the supported languages
such as Go or Java) and returns a response. This response indicates the
approval or rejection of the following transaction. The response is carried out
to the client.
3. Submission to ordering service: After receiving the endorsement output,
the approved transactions are sent to the ordering service by the client-side
application. The peer responsible for the ordering service includes the
transaction into a specific block and sends it to the peer nodes of different
members of the network.
4. Updating the ledger: After receiving this block the peer nodes of such
organizations update their local ledger with this block. Hence the new
transactions are now committed.

f.
A consensus mechanism is any method used to achieve agreement,
trust, and security across a decentralized computer network. In the
context of blockchains and cryptocurrencies.
Blockchain Consensus Algorithms Popular in the Market
 Proof of Work (PoW) ...
 Proof of Stake (PoS) ...
 Proof of Authority. ...
 Byzantine Fault Tolerance (BFT) ...
 Direct Acyclic Graph (DAG) ...
 Proof of Capacity (PoC) ...
 Proof of Burn (PoB) ...
 Proof of Identity (PoI)

g.

PART- B
2
a. Types of Blockchain 5 Marks
The basic application of the blockchain is to perform transactions in a secure
network. That’s why people use blockchain and ledger technology in different
scenarios. One can set up multichain to prevent unauthorized access to sensitive
data. It is not available to the public, and can only be available to authorized
entities in the organization. It depends on the organization which type it requires to
choose for their work.
By using blockchain we can track orders and payments from end to end.
Advantage using blockchain :
It provides greater trust among users.
It provides greater security among data.
Reduce the cost of production.
Improve Speed.
Invocation and tokenization.
It provides immutable records.
Smart contracts

Disadvantages using blockchain :

Data modification is not possible.


It requires large storage for a large database.
The owner cannot access the private key again if they forget or lose it.
There are 4 types of blockchain:

Public Blockchain.
Private Blockchain.
Hybrid Blockchain.
Consortium Blockchain.
Types of Blockchain

1. Public Blockchain

These blockchains are completely open to following the idea of decentralization.


They don’t have any restrictions, anyone having a computer and internet can
participate in the network.

As the name is public this blockchain is open to the public, which means it is not
owned by anyone.
Anyone having internet and a computer with good hardware can participate in this
public blockchain.
All the computer in the network hold the copy of other nodes or block present in

the network
In this public blockchain, we can also perform verification of transactions or
records
Advantages:

Trustable: There are algorithms to detect no fraud. Participants need not worry
about the other nodes in the network
Secure: This blockchain is large in size as it is open to the public. In a large size,
there is greater distribution of records
Anonymous Nature: It is a secure platform to make your transaction properly at the
same time, you are not required to reveal your name and identity in order to
participate.
Decentralized: There is no single platform that maintains the network, instead
every user has a copy of the ledger.
Disadvantages:

Processing: The rate of the transaction process is very slow, due to its large size.
Verification of each node is a very time-consuming process.
Energy Consumption: Proof of work is high energy-consuming. It requires good
computer hardware to participate in the network
Acceptance: No central authority is there so governments are facing the issue to
implement the technology faster.
Use Cases: Public Blockchain is secured with proof of work or proof of stake they
can be used to displace traditional financial systems. The more advanced side of
this blockchain is the smart contract that enabled this blockchain to support
decentralization. Examples of public blockchain are Bitcoin, Ethereum.

2. Private Blockchain

These blockchains are not as decentralized as the public blockchain only selected
nodes can participate in the process, making it more secure than the others.

These are not as open as a public blockchain.


They are open to some authorized users only.
These blockchains are operated in a closed network.
In this few people are allowed to participate in a network within a
company/organization.
Advantages:

Speed: The rate of the transaction is high, due to its small size. Verification of each
node is less time-consuming.
Scalability: We can modify the scalability. The size of the network can be decided
manually.
Privacy: It has increased the level of privacy for confidentiality reasons as the
businesses required.
Balanced: It is more balanced as only some user has the access to the transaction
which improves the performance of the network.
Disadvantages:

Security- The number of nodes in this type is limited so chances of manipulation


are there. These blockchains are more vulnerable.
Centralized- Trust building is one of the main disadvantages due to its central
nature. Organizations can use this for malpractices.

Count- Since there are few nodes if nodes go offline the entire system of
blockchain can be endangered.
Use Cases: With proper security and maintenance, this blockchain is a great asset
to secure information without exposing it to the public eye. Therefore companies
use them for internal auditing, voting, and asset management. An example of
private blockchains is Hyperledger, Corda.

3. Hybrid Blockchain
It is the mixed content of the private and public blockchain, where some part is
controlled by some organization and other makes are made visible as a public
blockchain.

It is a combination of both public and private blockchain.


Permission-based and permissionless systems are used.
User access information via smart contracts
Even a primary entity owns a hybrid blockchain it cannot alter the transaction
Advantages:

Ecosystem: Most advantageous thing about this blockchain is its hybrid nature. It
cannot be hacked as 51% of users don’t have access to the network
Cost: Transactions are cheap as only a few nodes verify the transaction. All the
nodes don’t carry the verification hence less computational cost.
Architecture: It is highly customizable and still maintains integrity, security, and
transparency.
Operations: It can choose the participants in the blockchain and decide which
transaction can be made public.

Disadvantages:

Efficiency: Not everyone is in the position to implement a hybrid Blockchain. The


organization also faces some difficulty in terms of efficiency in maintenance.
Transparency: There is a possibility that someone can hide information from the
user. If someone wants to get access through a hybrid blockchain it depends on the
organization whether they will give or not.
Ecosystem: Due to its closed ecosystem this blockchain lacks the incentives for
network participation.
Use Case: It provides a greater solution to the health care industry, government,
real estate, and financial companies. It provides a remedy where data is to be
accessed publicly but needs to be shielded privately. Examples of Hybrid
Blockchain are Ripple network and XRP token.

4. Consortium Blockchain
It is a creative approach that solves the needs of the organization. This blockchain
validates the transaction and also initiates or receives transactions.

Also known as Federated Blockchain.


This is an innovative method to solve the organization’s needs.
Some part is public and some part is private.
In this type, more than one organization manages the blockchain.
Advantages:

Speed: A limited number of users make verification fast. The high speed makes
this more usable for organizations.

Authority: Multiple organizations can take part and make it decentralized at every
level. Decentralized authority, makes it more secure.
Privacy: The information of the checked blocks is unknown to the public view. but
any member belonging to the blockchain can access it.
Flexible: There is much divergence in the flexibility of the blockchain. Since it is
not a very large decision can be taken faster.
Disadvantages:

Approval: All the members approve the protocol making it less flexible. Since one
or more organizations are involved there can be differences in the vision of
interest.
Transparency: It can be hacked if the organization becomes corrupt. Organizations
may hide information from the users.
Vulnerability: If few nodes are getting compromised there is a greater chance of
vulnerability in this blockchain
Use Cases: It has high potential in businesses, banks, and other payment
processors. Food tracking of the organizations frequently collaborates with their
sectors making it a federated solution ideal for their use. Examples of consortium
Blockchain are Tendermint and Multichain.

b. 5 Marks
Merkle tree: A Merkle tree is a binary tree formed by hash pointers, and
named after its creator, Ralph Merkle.
The different types of nodes in a Merkle tree are:
 Root node: The root of the Merkle tree is known as the Merkle root and this
Merkle root is stored in the header of the block.
 Leaf node: The leaf nodes contain the hash values of transaction data. Each
transaction in the block has its data hashed and then this hash value (also
known as transaction ID) is stored in leaf nodes.
 Non-leaf node: The non-leaf nodes contain the hash value of their respective
children. These are also called intermediate nodes because they contain the
intermediate hash values and the hash process continues till the root of the
tree.
 Further, a Merkle tree is binary in nature. This means that the number of
leaf nodes needs to be even for the Merkle tree to be constructed properly.
In case there is an odd number of leaf nodes, the tree duplicates the last
hash and makes the number of leaf nodes even.
Why Merkle Trees are Important For Blockchain?
 In a centralized network, data can be accessed from one single copy. This
means that nodes do not have to take the responsibility of storing their own
copies of data and data can be retrieved quickly.
 However, the situation is not so simple in a distributed system.
 Let us consider a scenario where blockchain does not have Merkle trees. In
this case, every node in the network will have to keep a record of every single
transaction that has occurred because there is no central copy of the
information.
 This means that a huge amount of information will have to be stored on every
node and every node will have its own copy of the ledger. If a node wants to
validate a past transaction, requests will have to be sent to all nodes,
requesting their copy of the ledger. Then the user will have to compare its own
copy with the copies obtained from several nodes.
 Any mismatch could compromise the security of the blockchain. Further on,
such verification requests will require huge amounts of data to be sent over the
network, and the computer performing this verification will need a lot of
processing power for comparing different versions of ledgers.
 Without the Merkle tree, the data itself has to be transferred all over the
network for verification.
 Merkle trees allow comparison and verification of transactions with viable
computational power and bandwidth. Only a small amount of information
needs to be sent, hence compensating for the huge volumes of ledger data that
had to be exchanged previously.
Merkle trees use a one-way hash function extensively and this hashing separates
the proof of data from data itself
3
A
5 Marks

What is Blockchain Architecture?

Blockchain is a technology where multiple parties involved in communication can


perform different transactions without third-party intervention. Verification and
validation of these transactions are carried out by special kinds of nodes.
Benefits of Blockchain:
 It is safer than any other technology.
 To avoid possible legal issues, a trusted third party has to supervise the
transactions and validate the transactions.
 There’s no one central point of attack.
 Data cannot be changed or manipulated, it’s immutable.

1. Header: It is used to identify the particular block in the entire blockchain.


It handles all blocks in the blockchain. A block header is hashed
periodically by miners by changing the nonce value as part of normal
mining activity; also Three sets of block metadata are contained in the
block header.
2. Previous Block Address/ Hash: It is used to connect the i+1th block to the
ith block using the hash. In short, it is a reference to the hash of the
previous (parent) block in the chain.
3. Timestamp: It is a system verify the data into the block and assigns a time
or date of creation for digital documents. The timestamp is a string of
characters that uniquely identifies the document or event and indicates
when it was created.
4. Nonce: A nonce number which uses only once. It is a central part of the
proof of work in the block. It is compared to the live target if it is smaller
or equal to the current target. People who mine, test, and eliminate many
Nonce per second until they find that Valuable Nonce is valid.
5. Merkel Root: It is a type of data structure frame of different blocks of
data. A Merkle Tree stores all the transactions in a block by producing a
digital fingerprint of the entire transaction. It allows the users to verify
whether a transaction can be included in a block or not.

Key Characteristics of Blockchain Architecture

 Decentralization: In centralized transaction systems, each transaction needs


to be validated in the central trusted agency (e.g., the central bank),
naturally resulting in cost and the performance jam at the central servers.
In contrast to the centralized mode, a third party is not needed in the
blockchain. Consensus algorithms in blockchain are used to maintain data
stability in a decentralized network.
 Persistency: Transactions can be validated quickly and invalid transactions
would not be admitted by persons or miners who mining the crypto. It is
not possible to delete or roll back transactions once they are included in
the blockchain network. Invalid transactions do not carry forward further.
 Anonymity: Each user can interact with the blockchain with a generated
address, which does not disclose the real identity
of the miner. Note that blockchain cannot guarantee perfect privacy
preservation due to the permanent thing.
 Auditability: Blockchain stores data of users based on the Unspent
Transaction Output (UTXO) model. Every transaction has to refer to some
previous unspent transactions. Once the current transaction is recorded
into the blockchain, the position of those referred unspent transactions
switches from unspent to spent. Due to this process, the transactions can
be easily tracked and not harmed between transactions.
 Transparency: The transparency of blockchain is like cryptocurrency, in
bitcoin for tracking every transaction is done by the address. And for
security, it hides the person’s identity between and after the transaction.
All the transactions are made by the owner of the block associated with
the address, this process is transparent and there is no loss for anyone who
is involved in this transaction.
 Cryptography: The blockchain concept is fully based on security and for
that, all the blocks on the blockchain network want to be secure. And for
security, it implements cryptography and secures the data using the cipher
text and ciphers.
3
B 5 Marks

A digital signature is a mathematical scheme for presenting the authenticity of


digital messages or documents. A valid digital signature gives a recipient reason to
believe that the message was created by a claimed sender (authentication), that the
sender cannot deny having sent the message (non-repudiation), and that the
message was not altered in transit (integrity).

Digital signatures are often used to implement electronic signatures, a broader term
that refers to any electronic data that carries the intent of a signature, but not all
electronic signatures use digital signatures. Digital signatures employ asymmetric
cryptography. Asymmetric cryptography, also known as public key cryptography
(PKI), uses public and private keys to encrypt and decrypt data. The keys are
simply large numbers that have been paired together but are not identical
(asymmetric). One key in the pair can be shared with everyone; it is called
the public key. The other key in the pair is kept secret; it is called the private key.
Either of the keys can be used to encrypt a message; the opposite key from the one
used to encrypt the message is used for decryption.In many instances they provide a
layer of validation and security to messages sent through a non-secure channel.
Digital signatures are equivalent to traditional handwritten signatures in many
respects, but properly implemented digital signatures are more difficult to forge
than the handwritten type.
Digital signing in blockchain technology aims to authenticate transactions. That
means checking if the sender is authorized to make the transactions. The user has
to prove to the network that he’s authorized to spend his balance. The balance is
also verified by checking the transactions made to the account.

Each node in the network verifies the submitted transaction and then makes an
informed decision asking the whole network to add it. And that’s how the use of
digital signing network participants can authorize the transaction and account.
5
A
Marks 5

How Do Smart Contracts Work?

A smart contract is just a digital contract with the security coding of the
blockchain.
 It has details and permissions written in code that require an exact sequence
of events to take place to trigger the agreement of the terms mentioned in
the smart contract. 
 It can also include the time constraints that can introduce deadlines in the
contract. 
 Every smart contract has its address in the blockchain. The contract can be
interacted with by using its address presuming the contract has been
broadcasted on the network. 
The idea behind smart contracts is pretty simple. They are executed on a basis
of simple logic, IF-THEN for example: 

 IF you send object A, THEN the sum (of money, in cryptocurrency) will be


transferred to you.
 IF you transfer a certain amount of digital assets (cryptocurrency, for
example, ether, bitcoin), THEN the A object will be transferred to you.
 IF I finish the work, THEN the digital assets mentioned in the contract will be
transferred to me.

Advantages of Smart Contracts

1. Recordkeeping: All contract transactions are stored in chronological order


in the blockchain and can be accessed along with the complete audit trail.
However, the parties involved can be secured cryptographically for full
privacy.
2. Autonomy: There are direct dealings between parties. Smart contracts
remove the need for intermediaries and allow for transparent, direct
relationships with customers.
3. Reduce fraud: Fraudulent activity detection and reduction. Smart contracts
are stored in the blockchain. Forcefully modifying the blockchain is very
difficult as it’s computation-intensive. Also, a violation of the smart contract
can be detected by the nodes in the network and such a violation attempt is
marked invalid and not stored in the blockchain.
4. Fault-tolerance: Since no single person or entity is in control of the digital
assets, one-party domination and situation of one part backing out do not
happen as the platform is decentralized and so even if one node detaches
itself from the network, the contract remains intact.
5. Enhanced trust: Business agreements are automatically executed and
enforced. Plus, these agreements are immutable and therefore unbreakable
and undeniable.
6. Cost-efficiency: The application of smart contracts eliminates the need for
intermediaries(brokers, lawyers, notaries, witnesses, etc.) leading to reduced
costs. Also eliminates paperwork leading to paper saving and money-saving.

You might also like