0% found this document useful (0 votes)
41 views117 pages

Blockchain Complte Notes

Uploaded by

armyblinking43
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views117 pages

Blockchain Complte Notes

Uploaded by

armyblinking43
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 117

lOMoAR cPSD| 22516561

Block Chain

unit 1 - notes
lOMoAR cPSD| 22516561

UNIT 1

Overview of blockchain

The blockchain is a distributed database of records of all transactions or digital event that
have been executed and shared among participating parties. Each transaction verified by
the majority of participants of the system. It contains every single record of each transaction.
BitCoin is the most popular cryptocurrency an example of the blockchain. Blockchain
Technology Records Transaction in Digital Ledger which is distributed over the Network thus
making it incorruptible. Anything of value like Land Assets, Cars, etc. can be recorded on
Blockchain as a Transaction.
Blockchain is ideal for delivering that information because it provides immediate, shared and
completely transparent information stored on an immutable ledger that can be accessed only
by permissioned network members. A blockchain network can track orders, payments,
accounts, production and much more. And because members share a single view of the
truth, you can see all details of a transaction end to end, giving you greater confidence, as
well as new efficiencies and opportunities.

How does blockchain work?

One of the famous use of Blockchain is Bitcoin. Bitcoin is a cryptocurrency and is used to
exchange digital assets online. Bitcoin uses cryptographic proof instead of third-party trust for
two parties to execute transactions over the internet. Each transaction protects through digital
signature.

As each transaction occurs, it is recorded as a “block” of data


Those transactions show the movement of an asset that can be tangible (a product) or
intangible (intellectual). The data block can record the information of your choice: who, what,
when, where, how much and even the condition — such as the temperature of a food
shipment. Each block is connected to the ones before and after it. These blocks form a chain
of data as an asset moves from place to place or ownership changes hands. The blocks
confirm the exact time and sequence of transactions, and the blocks link securely together to
prevent any block from being altered or a block being inserted between two existing blocks.
Transactions are blocked together in an irreversible chain: a blockchain
lOMoAR cPSD| 22516561

Each additional block strengthens the verification of the previous block and hence the entire
blockchain. This renders the blockchain tamper-evident, delivering the key strength of
immutability. This removes the possibility of tampering by a malicious actor — and builds a
ledger of transactions you and other network members can trust.

Advantages of blockchain

Enhanced security :: Your data is sensitive and crucial, and blockchain can significantly
change how your critical information is viewed. By creating a record that can’t be altered and
is encrypted end-to-end, blockchain helps prevent fraud and unauthorized activity. Privacy
issues can also be addressed on blockchain by anonymizing personal data and using
permissions to prevent access. Information is stored across a network of computers rather
than a single server, making it difficult for hackers to view data.

Greater transparency :: Without blockchain, each organization has to keep a separate


database. Because blockchain uses a distributed ledger, transactions and data are recorded
identically in multiple locations. All network participants with permissioned access see the
same information at the same time, providing full transparency. All transactions are
immutability recorded, and are time- and date-stamped. This enables members to view the
entire history of a transaction and virtually eliminates any opportunity for fraud.

Instant traceability :: Blockchain creates an audit trail that documents the provenance of an
asset at every step on its journey. In industries where consumers are concerned about
environmental or human rights issues surrounding a product — or an industry troubled by
counterfeiting and fraud — this helps provide the proof. With blockchain, it is possible to
share data about provenance directly with customers. Traceability data can also expose
weaknesses in any supply chain — where goods might sit on a loading dock awaiting transit.

Increased efficiency and speed :: Traditional paper-heavy processes are time-consuming,


prone to human error, and often requires third-party mediation. By streamlining these
processes with blockchain, transactions can be completed faster and more efficiently.
Documentation can be stored on the blockchain along with transaction details, eliminating
the need to exchange paper. There’s no need to reconcile multiple ledgers, so clearing and
settlement can be much faster.

Automation :: Transactions can even be automated with “smart contracts,” which increase
your efficiency and speed the process even further. Once pre-specified conditions are met,
the next step in transaction or process is automatically triggered. Smart contracts reduce
human intervention as well as reliance on third parties to verify that terms of a contract have
been met. In insurance, for example, once a customer has provided all necessary
documentation to file a claim, the claim can automatically be settled and paid.

Disadvantages of blockchain
Scalability: It is one of the biggest drawbacks of blockchain technology as it cannot be
scaled due to the fixed size of the block for storing information. The block size is 1 MB due
to which it can hold only a couple of transactions on a single block.

Immaturity: Blockchain is only a couple-year-old technology so people do not have much


confidence in it, they are not ready to invest in it yet several applications of blockchain are
doing great in different industries but still it needs to win the confidence of even more people
to be recognized for its complete utilization.
lOMoAR cPSD| 22516561

Energy Consuming: For verifying any transaction a lot of energy is used so it becomes a
problem according to the survey it is considered that 0.3 percent of the world’s electricity had
been used by 2018 in the verification of transactions done using blockchain technology.

Time-Consuming: To add the next block in the chain miners need to compute nonce values
many times so this is a time-consuming process and needs to be speed up to be used for
industrial purposes.

Legal Formalities: In some countries, the use of blockchain technology applications is


banned like cryptocurrency due to some environmental issues they are not promoting to use
blockchain technology in the commercial sector.

Storage: Blockchain databases are stored on all the nodes of the network creates an issue
with the storage, increasing number of transactions will require more storage.

Regulations: Blockchain faces challenges with some financial institution. Other aspects of
technology will be required in order to adopt blockchain in wider aspect.

Public Ledger

A ledger (not to be confused with Ledger) is a record-keeping system: it tracks value as is


moves around, so the viewer can always see exactly what value resides where at a given
moment. Traditional finance systems like banks use ledgers to track all transactions
completed within a period. Blockchains are a form of digital ledgers that validate and store
all transactions within their network. For example, the Bitcoin blockchain records all
transactions involving bitcoins using blocks secured by cryptography.

A public ledger is an open-access network; anyone can join at any time. The public ledger is
fully decentralized, and no single entity controls the blockchain network. The Bitcoin and
Ethereum blockchains are both considered public ledgers. Public ledgers are also the most
secure blockchains; they maintain a pseudo-anonymous system for their users’ identities.
While all transactions are recorded publically, user identities remain private. .

Bitcoin

Satoshi Nakamoto introduced the bitcoin in the year 2008. Bitcoin is a


cryptocurrency(virtual currency), or a digital currency that uses rules of cryptography for
regulation and generation of units of currency. A Bitcoin fell under the scope of cryptocurrency
lOMoAR cPSD| 22516561

and became the first and most valuable among them. It is commonly called decentralized
digital currency.

A bitcoin is a type of digital assets which can be bought, sold, and transfer between the two
parties securely over the internet. Bitcoin can be used to store values much like fine gold,
silver, and some other type of investments. We can also use bitcoin to buy products and
services as well as make payments and exchange values electronically.

A bitcoin is different from other traditional currencies such as Dollar, Pound, and Euro, which
can also be used to buy things and exchange values electronically. There are no physical coins
for bitcoins or paper bills. When you send bitcoin to someone or used bitcoin to buy anything,
you don?t need to use a bank, a credit card, or any other third-party. Instead, you can simply
send bitcoin directly to another party over the internet with securely and almost instantly.

Bitcoin is more than a cryptocurrency used for payments or as an investment. There is an


entire ecosystem at work behind a cryptocurrency.
Bitcoin is a decentralized digital currency that operates without the need of financial system
or government authorities. It utilizes peer-to-peer transfers on a digital network that records
all cryptocurrency transactions. This network is powered by the blockchain, an open source
code that pairs (or chains) blocks of transaction histories to prevent manipulation.

Advantages and Disadvantages of Bitcoin

Advantages Disadvantages

Potential for high return No refund

Protection from payment fraud Unregulated & unbacked, cyber hacking

Immediate settlement, international Black market activity


transactions

Diversification, greater liquidity High volatility & potential fo large losses

Smart Contracts

A Smart Contract (or cryptocontract) is a computer program that directly and automatically
controls the transfer of digital assets between the parties under certain conditions.The
bitcoin network was the first to use some sort of smart contract by using them to transfer
value from one person to another. There are some common smart contract platforms like
Ethereum, Solana, Polkadot, Hyperledger fabric, etc.
Features of Smart Contract

1. Distributed: Everyone on the network is guaranteed to have a copy of all the


conditions of the smart contract and they cannot be changed by one of the
parties. A smart contract is replicated and distributed by all the nodes connected
to the network.
lOMoAR cPSD| 22516561

2. Deterministic: Smart contracts can only perform functions for which they are
designed only when the required conditions are met. The final outcome will not
vary, no matter who executes the smart contract.
3. Immutable: Once deployed smart contract cannot be changed, it can only be
removed as long as the functionality is implemented previously.
4. Autonomy: There is no third party involved. The contract is made by you and
shared between the parties. No intermediaries are involved which minimizes
bullying and grants full authority to the dealing parties. Also, the smart contract is
maintained and executed by all the nodes on the network, thus removing all the
controlling power from any one party’s hand.
5. Customizable: Smart contracts have the ability for modification or we can say
customization before being launched to do what the user wants it to do.
6. Transparent: Smart contracts are always stored on a public distributed ledger
called blockchain due to which the code is visible to everyone, whether or not
they are participants in the smart contract.
7. Trustless: These are not required by third parties to verify the integrity of the
process or to check whether the required conditions are met.
8. Self-verifying: These are self-verifying due to automated possibilities.
9. Self-enforcing: These are self-enforcing when the conditions and rules are met
at all stages.

Working of Smart Contract

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:
lOMoAR cPSD| 22516561

● 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.

● Identify Agreement: Multiple parties identify the cooperative opportunity and


desired outcomes and agreements could include business processes, asset
swaps, etc.
● Set conditions: Smart contracts could be initiated by parties themselves or when
certain conditions are met like financial market indices, events like GPS locations,
etc.
● Code business logic: A computer program is written that will be executed
automatically when the conditional parameters are met.
● Encryption and blockchain technology: Encryption provides secure
authentication and transfer of messages between parties relating to smart
contracts.
● Execution and processing: In blockchain iteration, whenever consensus is
reached between the parties regarding authentication and verification then the
code is executed and the outcomes are memorialized for compliance and
verification.
● Network updates: After smart contracts are executed, all the nodes on the
network update their ledger to reflect the new state. Once the record is posted
and verified on the blockchain network, it cannot be modified, it is in append
mode only.
lOMoAR cPSD| 22516561

Applications of Smart Contracts

1. Real Estate: Reduce money paid to the middleman and distribute between the
parties actually involved. For example, a smart contract to transfer ownership of
an apartment once a certain amount of resources have been transferred to the
seller’s account(or wallet).
2. Vehicle ownership: A smart contract can be deployed in a blockchain that keeps
track of vehicle maintenance and ownership. The smart contract can, for
example, enforce vehicle maintenance service every six months; failure of which
will lead to suspension of driving license.
3. Music Industry: The music industry could record the ownership of music in a
blockchain. A smart contract can be embedded in the blockchain and royalties
can be credited to the owner’s account when the song is used for commercial
purposes. It can also work in resolving ownership disputes.
4. Government elections: Once the votes are logged in the blockchain, it would be
very hard to decrypt the voter address and modify the vote leading to more
confidence against the ill practices.
5. Management: The blockchain application in management can streamline and
automate many decisions that are taken late or deferred. Every decision is
transparent and available to any party who has the authority(an application on the
private blockchain). For example, a smart contract can be deployed to trigger the
supply of raw materials when 10 tonnes of plastic bags are produced.
6. Healthcare: Automating healthcare payment processes using smart contracts
can prevent fraud. Every treatment is registered on the ledger and in the end, the
smart contract can calculate the sum of all the transactions. The patient can’t be
discharged from the hospital until the bill has been paid and can be coded in the
smart contract.

Smart contracts have several advantages including:

1. Lower error rate. Instead of trusting humans, smart contracts allow the trust to be
shifted to mathematics, which should reduce errors stemming from malicious or
negligent human management.
2. Automatic implementation of new data and secure storage of historical data.
lOMoAR cPSD| 22516561

3. The transparency and auditability of smart contracts also increase the personal
responsibility of the humans that manage the smart contract because each
transaction with the contract is recorded along with the account that initiated the
transaction.
4. By using a smart contract, the parties commit themselves to the rules of the
underlying code. In theory, this should reduce the potential for dispute and arbitration
costs, as both parties agree to the outcome programmed into the smart contract.

Disadvantages include:

1. Legality of smart contracts is questionable. Since this structure is digital, it can


circumvent state licensing requirements. State courts do not have to recognize the
rights of investors.

2. Smart contracts are not very flexible. Once a smart contract has been executed on a
public blockchain, the contract is vulnerable to hackers. Fixing errors and changing
contract terms can be impossible.

Block in Blockchain

Blocks are data structures within the blockchain database, where transaction data in a
cryptocurrency blockchain are permanently recorded. A block records some or all of the
most recent transactions not yet validated by the network. Once the data are validated, the
block is closed. Then, a new block is created for new transactions to be entered into and
validated.

A block is thus a permanent store of records that, once written, cannot be altered or
removed.

● A block is a place in a blockchain where information is stored and encrypted.


● Blocks are identified by long numbers that include encrypted transaction information
from previous blocks and new transaction information.
● Blocks and the information within them must be verified by a network before new
blocks can be created.
● Blocks and blockchains are not used solely by cryptocurrencies. They also have
many other uses.

Transactions
A transaction is a transfer of value on the blockchain. In very simple terms, a transaction is
when one person gives a designated amount of cryptocurrency they own to another person.
lOMoAR cPSD| 22516561

To perform transactions on the blockchain, you need a wallet, a program linked with the
blockchain to which only you have access, that keeps track of the crypto you own and allows
you to transact with it. Each wallet is protected by a special cryptographic method that uses
a unique pair of distinct but connected keys: a private and a public key.

A public key, also known as the address, is a series of letters and numbers that a user must
share in order to receive funds. In contrast, a private key must be kept secret, much like your
bank card pin number, as it authorizes the spending of any funds received by the associated
public key. With their wallet, a user (whoever has the private key) can authorize or sign
transactions and thereby transfer value to a new owner. The transaction is then broadcast to
the network to be included in the blockchain.

Steps of the Blockchain Transaction Process

A blockchain transaction has to undergo several steps before it becomes a part of the
blockchain, a critical aspect of the technology being the way it authorizes and confirms
transactions. The pointers below highlight the steps involved in a blockchain transaction:

1. Entry of a new transaction

2. Transmission of the transaction to a global network of peer-to-peer computers

3. Peer network of computers confirms the validity of the transaction

4. Confirmed legitimate transactions are clustered into blocks

5. The blocks are chained together to create a long history of all transactions

6. Completion of the transaction

Distributed Consesus

A procedure to reach a common agreement in a distributed or decentralized multi-agent


platform. It is important for the message passing system.It ensures reliability and fault
tolerance in distributed systems. In the presence of faulty individuals, it is Ensure correct
operations.

Public Blockchain

A public blockchain is one where anyone is free to join and participate in the core activities of
the blockchain network. Anyone can read, write, and audit the ongoing activities on a public
blockchain network, which helps achieve the self-governed, decentralized nature often
touted when blockchain is discussed.

Some features of public blockchain are :

● High Security –
It is secure Due to Mining (51% rule).
lOMoAR cPSD| 22516561

● Open Environment –
The public blockchain is open for all.

● Anonymous Nature –
In public blockchain every one is anonymous. There is no need to use your real
name, or real identity, therefore everything would stay hidden, and no one can
track you based on that.

● No Regulations –
Public blockchain doesn’t have any regulations that the nodes have to follow. So,
there is no limit to how one can use this platform for their betterment

● Full Transparency –
Public blockchain allow you to see the ledger anytime you want. There is no
scope for any corruption or any discrepancies and everyone has to maintain the
ledger and participate in consensus.

● True Decentralization –
In this type of blockchain, there isn’t a centralized entity. Thus, the responsibility
of maintaining the network is solely on the nodes. They are updating the ledger,
and it promotes fairness with help from a consensus algorithm .

● Full User Empowerment –


Typically, in any network user has to follow a lot of rules and regulations. In many
cases, the rules might not even be a fair one. But not in public blockchain
networks. Here, all of the users are empowered as there is no central authority to
look over their every move.

● Immutable –
When something is written to the blockchain, it can not be changed.
lOMoAR cPSD| 22516561

● Distributed –
The database is not centralized like in a client-server approach, and all nodes in
the blockchain participate in the transaction validation.

Merits:

● Complete trustable and transparent


● No intermediaries
● Secured

Demerits:

● Scalability issues
● Lack of transaction speed
● Consumes a lot of energy

Private Blockchain

Participants can join a private blockchain network only through an invitation where their
identity or other required information is authentic and verified. The validation is done by the
network operator(s) or by a clearly defined set protocol implemented by the network through
smart contracts or other automated approval methods.

Private blockchains control who is allowed to participate in the network. If the network is
capable of mining, its private nature could control which users can execute the consensus
protocol that decides the mining rights and rewards. Additionally, only select users might
maintain the shared ledger. The owner or operator has the right to override, edit, or delete
the necessary entries on the blockchain as required or as they see fit.

● Full Privacy –
It focus on privacy concerns.

● Private Blockchain are more centralized.

● High Efficiency and Faster Transactions –


When you distribute the nodes locally, but also have much less nodes to
participate in the ledger, the performance is faster.
lOMoAR cPSD| 22516561

● Better Scalability –
Being able to add nodes and services on demand can provide a great advantage
to the enterprise.
Merits:

● Higher transaction per second (TPS)


● Highly scalable

Demerits:

● Less secured compared to Public blockchains


● Less decentralized
● Achieving trust is difficult

Cryptocurrency

A cryptocurrency is a digital or virtual currency secured by cryptography, which makes it


nearly impossible to counterfeit or double-spend. Many cryptocurrencies are decentralized
networks based on blockchain technology—a distributed ledger enforced by a disparate
network of computers. A defining feature of cryptocurrencies is that they are generally not
issued by any central authority, rendering them theoretically immune to government
interference or manipulation. Cryptocurrencies are not regulated or controlled by any central
authority hence cryptocurrency works outside the banking system using different types of
coins.

1. Mining: Cryptocurrencies are generated through the process called Mining. In this
process, the miners are required to solve a mathematical puzzle over a specially equipped
computer system to be rewarded with bitcoins in exchange.
2. Buying, selling, and storing: Users can buy cryptocurrencies from central
exchanges, brokers, or individual currency owners and sell crypto to them. Cryptocurrencies
can be stored in wallets.
3. Investing: Cryptocurrencies can be transferred from one digital wallet to another.
Cryptocurrencies can be used for the following purposes:
● Buying goods and services.
● Trade-in them.
● Exchange them for cash.

How To Store Cryptocurrency

Once the cryptocurrency is purchased, it needs to be stored safely to protect it from hackers.
The usual place to store cryptocurrency is crypto wallets which can be physical devices or
online software. Not all exchanges or brokers provide crypto wallet services. The
cryptocurrencies can be stored in these four places:
1. Custodial Wallet: In this approach, a third party such as a crypto exchange
stores the cryptocurrency either through cold storage or hot storage, or a
lOMoAR cPSD| 22516561

combination of the two. This is the most simplest and convenient method for the
users as it requires less work on the user part.
2. Cold Wallet: These are also known as Hardware wallets. It is an offline wallet in
which hardware connects to the computer and stores the cryptocurrency. The
device connects to the internet at the time of sending and receiving
cryptocurrency but other than that the cryptos are safely stored offline.
3. Hot Wallet: These are the applications that store cryptocurrencies online. These
are available as desktop or mobile apps.
4. Paper Wallet: This is also known as a physical wallet. It is a printout of the public
and private keys available as a string of characters or scannable QR codes. To
send crypto scan the public and private keys and crypto will be received using the
public keys.

What Can You Do With Cryptocurrency

Here are some of the examples:


● Shopping: Some luxury retailers like Rolex and Patek Philippe accept
cryptocurrency as a form of payment.
● Insurance: Some insurance companies like Premier Shield insurance accept
Bitcoin for premium payments.
● Gift: Cryptocurrency can be a great gift for persons who want to learn and invest
in new technology.
● Travel: As crypto is not tied to a specific country, thus traveling with crypto can
save a lot on money exchange fees.

Advantages of Cryptocurrencies

The following are some of the advantages of cryptocurrencies:


1. Private and Secure: Blockchain technology ensures user anonymity and at the
same time the use of cryptography in blockchain makes the network secure for
working with cryptocurrencies.
2. Decentralized, Immutable, and Transparent: The entire blockchain network
works on the principle of shared ownership where there is no single regulating
authority and the data is available to all the permissioned members on the
network and is tamper-proof.
lOMoAR cPSD| 22516561

3. Inflation Hedge: Cryptocurrencies are a good means of investing in times of


inflation as they are limited in supply and there is a cap on mining any type of
cryptocurrency.
4. Faster Settlement: Payments for most cryptocurrencies settle in seconds or
minutes. Wire transfers at banks can cost more and often take three to five
business days to settle.

5. Easy Transactions: Crypto transactions can be done more easily, in a private


manner in comparison to bank transactions. using a simple smartphone and a
cryptocurrency wallet, anyone can send or receive a variety of cryptocurrencies.

Disadvantages of Cryptocurrencies

The following are some of the drawbacks of cryptocurrencies:


1. Cybersecurity issues: Cryptocurrencies will be subject to cyber security
breaches and may fall into the hands of hackers. Mitigating this will require
continuous maintenance of security infrastructure.
2. Price Volatility: Cryptocurrencies are highly volatile in terms of price as they
have no underlying value and there is a supply-demand-like equation that is used
to determine the price of cryptocurrencies.
3. Scalability: Scalability is one of the major concerns with cryptocurrencies. Digital
coins and tokens adoption is increasing rapidly but owing to the sluggish nature
of the blockchain makes cryptocurrencies prone to transaction delays.
Cryptocurrencies cannot compete with the number of transactions that payment
giants like VISA, and Mastercard processes in a day.
4. Less awareness: Cryptocurrency is still a new concept for the people and the
long-term sustainability of cryptocurrencies remains to be seen.

Features of cryptocurrencies:

Decentralization: Cryptocurrencies are decentralized, meaning they operate on a peer-


topeer network and are not controlled by a central authority or government.
Security: Cryptocurrencies use cryptographic techniques to ensure the security and integrity
of transactions and to protect against fraud and hacking.
Transparency: Most cryptocurrencies operate on a public ledger called a blockchain, which
allows anyone to see all transactions that have occurred on the network.
Anonymity: While most cryptocurrencies are not completely anonymous, they do offer a
high degree of privacy and can allow users to transact without revealing their identity.
lOMoAR cPSD| 22516561

Limited Supply: Cryptocurrencies are designed with a limited supply to maintain their value
and prevent inflation.
Global Accessibility: Cryptocurrencies can be accessed and used from anywhere in the
world, as long as there is an internet connection.
Low Transaction Fees: Compared to traditional banking and financial institutions,
cryptocurrencies generally have lower transaction fees, making them an attractive option for
international transactions.
Programmability: Some cryptocurrencies allow for programmable transactions, meaning
that they can be programmed to execute automatically based on certain conditions.

However, there are also some potential drawbacks to cryptocurrencies, including:

Volatility: Cryptocurrencies can be highly volatile, with prices fluctuating rapidly and
unpredictably.
Lack of Regulation: Cryptocurrencies are not yet fully regulated by governments, which can
lead to uncertainty and potential risk for users.
Limited Acceptance: While the number of merchants accepting cryptocurrencies is
growing, they are still not widely accepted as a form of payment.
Hacking and Fraud: Cryptocurrencies are vulnerable to hacking and fraud, and there have
been numerous high-profile incidents of theft and scams in the cryptocurrency world.
Overall, cryptocurrencies offer a range of features that make them a unique and innovative
form of digital currency. However, they also come with potential risks and challenges that
users must be aware of before investing in or using them.

Permissioned Blockchain

A permissioned blockchain is a distributed ledger that is not publicly accessible. It can only
be accessed by users with permissions. The users can only perform specific actions granted
to them by the ledger administrators and are required to identify themselves through
certificates or other digital means.
● Permissioned blockchains provide an additional level of security over typical
blockchain systems like Bitcoin, as they require an access control layer.
● These blockchains are favored by entities who require security, identity, and role
definition within the blockchain.
● Permissioned blockchains are becoming more common as businesses realize their
benefits.

Overview of security aspects of Blockchain

Security is managed in order to protect some vital information so that hackers or other
unauthorized users do not get access to it. With the increasing dependency on Blockchain
networks, Blockchain security has become a prime concern. Blockchain security is a risk
management technique that aims to secure transactions and hence the whole blockchain
lOMoAR cPSD| 22516561

network. It is usually implemented with the help of cybersecurity, authorized services, and
ethical users.
Blockchain is an immutable ledger with no involvement of third-party organization. It also
uses cryptography to hide some details. So hackers find it almost impossible to tamper with
the blocks. But there are some loopholes that allow the malicious users to perform malicious
activities as blockchain networks are not immune to cyberattacks and fraud. Blockchain
attacks are cyber attacks that can be done by outside malicious users as well as the users
involved in the network.

Hackers and fraudsters threaten blockchains in four primary ways: phishing, routing, Sybil
and 51% attacks.
Phishing attacks : Phishing is a scamming attempt to attain a user's credentials. Fraudsters
send wallet key owners emails designed to look as though they're coming from a legitimate
source. The emails ask users for their credentials using fake hyperlinks. Having access to a
user's credentials and other sensitive information can result in losses for the user and the
blockchain network.
Routing attacks : Blockchains rely on real-time, large data transfers. Hackers can intercept
data as it's transferring to internet service providers. In a routing attack, blockchain
participants typically can't see the threat, so everything looks normal. However, behind the
scenes, fraudsters have extracted confidential data or currencies.
Sybil attacks : In a Sybil attack, hackers create and use many false network identities to
flood the network and crash the system. Sybil refers to a famous book character diagnosed
with a multiple identity disorder.
51% attacks : Mining requires a vast amount of computing power, especially for large-scale
public blockchains. But if a miner, or a group of miners, could rally enough resources, they
could attain more than 50% of a blockchain network's mining power. Having more than 50%
of the power means having control over the ledger and the ability to manipulate it. Note:
Private blockchains are not vulnerable to 51% attacks.

Basic crypto primitives

In Blockchains, there are no third parties or Governments involved. It is fully decentralized


and various transactions happen in these networks. So security is of utmost importance in
Blockchain. Cryptographic primitives are used for building cryptographic protocols for a
strong secured network. They are the low-level algorithms that are used to build algorithms.
They are the basic building blocks of the cryptosystem. The programmers develop new
cryptographic algorithms with the help of cryptographic primitives.

Cryptographic primitives are the basic building blocks for the development of security
protocols. Hence they are an integral part of the blockchain because of the following
reasons:
● Security: To secure a transaction in the network or confidential information, strong
cryptography is required. So cryptographic primitives are used to develop high-
level algorithms.
lOMoAR cPSD| 22516561

● Encryption and Decryption: The Cryptographic primitives are used to develop


encryption and decryption algorithms. Encryption algorithms encrypt the data and
decryption algorithms decrypt the data as and when required.
● Validation: The validation of data is done with the help of digital signatures. These
digital signatures are public key primitives which the receivers use to validate the
message.
● Specific: Cryptographic primitives are very specific in nature. It means one
cryptographic primitive can perform only one function. For example, The encryption
algorithms developed using crypto primitives are only responsible for encrypting
the text. It is not responsible for hashing or decryption.

Below are some of the common cryptographic primitives:


● One way Hash Functions: It is a mathematical function used to encrypt variable
length data to fixed binary data. It is a one-way function. It means that once the
input has been converted to a binary sequence, there is no scope for reverting
back. It is also known as fingerprint or compression function. It is to be noted that
a slight change in input can also change the hash function. This is known as the
avalanche effect. A popular hash function is SHA-256.
● Symmetric Key cryptography: This is also known as Symmetric Encryption.
Suppose a message is encrypted using a key. The message is now converted to
ciphertext which is readable but has no meaning. The same key is used to decrypt
the message. A key is a variable used to encrypt or decrypt a text. It is basically
used to ‘lock’ or ‘unlock’ data. In this cryptography, the key is shared between two
users. The sharing of keys is a problem. However, this technique is faster than
public-key cryptography. Examples are Advanced Encryption Standard (AES) and
the Data Encryption Standard (DES)
● Asymmetric key cryptography: It is also known as public key cryptography. Since
there is a problem with sharing keys in symmetric encryption, this method is used.
Here one key is public and another key is private. The public key is used to encrypt
or ‘lock’ data. The private key is only accessible to the receiver. The receiver uses
a private key to ‘unlock’ the data. For example, Suppose Bob encrypts the data
using the public key. The public key is available to everyone but this key works in
one way. The receiver has the private key which works in one way and is used to
decrypt the message. Examples of public key algorithms are DSA and RSA
lOMoAR cPSD| 22516561

● Randomized Algorithms: These algorithms produce random ciphertexts for


encryption. The ciphertext is an encrypted text. It is very secure as random texts
are produced for encryption. It is impossible for hackers to find various
combinations of texts. It employs randomness as a logical part. It uses random
inputs and gives correct output. For Example, Monte Carlo
● Mix Network: It is a routing algorithm that uses public key cryptography to
encrypt data. The proxy servers take messages, encrypt them and shuffle them so
that communication cannot be traced. It basically breaks the flow of messages
between the sender and the target.
● Retrieval of Private information: It is a protocol that allows the user to retrieve
information from the database. Other users don’t get to know about it. The user can
anonymously retrieve data without taking permission.
● Initialization Vector: It is a number that is used along with a key for encryption. It
is used to prevent the duplicate generation of ciphertext.

Cryptographic hash function

A cryptographic hash function is a mathematical function used in cryptography. Typical hash


functions take inputs of variable lengths to return outputs of a fixed length.

A cryptographic hash function combines the message-passing capabilities of hash functions


with security properties.

● Hash functions are mathematical functions that transform or "map" a given set of
data into a bit string of fixed size, also known as the "hash value."
● Hash functions are used in cryptography and have variable levels of complexity and
difficulty.
● Hash functions are used for cryptocurrency, password security, and message
security.
Hash functions are commonly used data structures in computing systems for tasks, such as
checking the integrity of messages and authenticating information. While they are
considered cryptographically "weak" because they can be solved in polynomial time, they
are not easily decipherable. Cryptographic hash functions add security features to typical
hash functions, making it more difficult to detect the contents of a message or information
about recipients and senders. In particular, cryptographic hash functions exhibit these three
properties:

● They are “collision-free.” This means that no two input hashes should map to the
same output hash.
● They can be hidden. It should be difficult to guess the input value for a hash function
from its output.
lOMoAR cPSD| 22516561

● They should be puzzle-friendly. It should be difficult to select an input that provides a


pre-defined output. Thus, the input should be selected from a distribution that's as
wide as possible.

Properties of hash function

A hash function is a mathematical function that takes an input string of any length and converts
it to a fixed-length output string. The fixed-length output is known as the hash value. To be
cryptographically secure and useful, a hash function should have the following properties:
● Collision resistant: Give two messages m1 and m2, it is difficult to find a hash
value such that hash(k, m1) = hash(k, m2) where k is the key value.
● Preimage resistance: Given a hash value h, it is difficult to find a message m
such that h = hash(k, m).
● Second preimage resistance: Given a message m1, it is difficult to find another
message m2 such that hash(k, m1) = hash(k, m2).
● Large output space: The only way to find a hash collision is via a brute force
search, which requires checking as many inputs as the hash function has
possible outputs.
● Deterministic: A hash function must be deterministic, which means that for any
given input a hash function must always give the same result.
● Avalanche Effect: This means for a small change in the input, the output will
change significantly.
● Puzzle Friendliness: This means even if one gets to know the first 200 bytes,
one cannot guess or determine the next 56 bytes.
● Fixed-length Mapping: For any input of fixed length, the hash function will
always generate the output of the same length.

What is Hash Pointer?

A regular pointer stores the memory address of data. With this pointer, the data can be
accessed easily. On the other hand, a hash pointer is a pointer to where data is stored and
with the pointer, the cryptographic hash of the data is also stored. So a hash pointer points
to the data and also allows us to verify the data. A hash pointer can be used to build all kinds
of data structures such as blockchain and Merkle tree.
lOMoAR cPSD| 22516561

Merkel tree

A hash tree, also known as a Merkle tree, is a tree in which each leaf node is labeled with

the cryptographic hash of a data block, and each non-leaf node is labeled with the

cryptographic hash of its child nodes' labels. The majority of hash tree implementations are

binary (each node has two child nodes), but they can also have many more child nodes.

Merkle Tree Structure

Structure of Merkle tree

1. A blockchain can potentially have thousands of blocks with thousands of transactions


in each block. Therefore, memory space and computing power are two main challenges.
2. It would be optimal to use as little data as possible for verifying transactions, which
can reduce CPU processing and provide better security, and this is exactly what Merkle
trees offer.
3. In a Merkle tree, transactions are grouped into pairs. The hash is computed for each
pair and this is stored in the parent node. Now the parent nodes are grouped into pairs and
their hash is stored one level up in the tree. This continues till the root of the tree. The
different types of nodes in a Merkle tree are:
lOMoAR cPSD| 22516561

● 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.

4. Bitcoin uses the SHA-256 hash function to hash transaction data continuously till the
Merkle root is obtained.
5. 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.

How Do Merkle Trees Work?

● A Merkle tree is constructed from the leaf nodes level all the way up to the Merkle
root level by grouping nodes in pairs and calculating the hash of each pair of
nodes in that particular level. This hash value is propagated to the next level. This
is a bottom-to-up type of construction where the hash values are flowing from
down to up direction.
● Hence, by comparing the Merkle tree structure to a regular binary tree data
structure, one can observe that Merkle trees are actually inverted down.

Binary tree direction vs Merkle tree direction


lOMoAR cPSD| 22516561

Example: Consider a block having 4 transactions- T1, T2, T3, T4. These four
transactions have to be stored in the Merkle tree and this is done by the following
stepsStep 1: The hash of each transaction is computed.
H1 = Hash(T1).

Step 2: The hashes computed are stored in leaf nodes of the Merkle tree.
Step 3: Now non-leaf nodes will be formed. In order to form these nodes, leaf nodes will be
paired together from left to right, and the hash of these pairs will be calculated. Firstly hash
of H1 and H2 will be computed to form H12. Similarly, H34 is computed. Values H12 and
H34 are parent nodes of H1, H2, and H3, H4 respectively. These are non-leaf nodes.
H12 = Hash(H1 + H2)

H34 = Hash(H3 + H4)

Step 4: Finally H1234 is computed by pairing H12 and H34. H1234 is the only hash
remaining. This means we have reached the root node and therefore H1234 is the Merkle
root.
H1234 = Hash(H12 + H34)

Digital Signatures

A digital signature is used for the same purpose as handwritten signature, but it is far more
secure. In blockchain when users submit transactions (or data), they must prove to every
node in the system that they are authorized to carryout that transaction. Every node in the
network then verifies the submitted transaction and also confirms that the transaction is in its
lOMoAR cPSD| 22516561

original form. This is carried out using digital signatures. Digital signature, therefore, serves
following purposes:

● The message has been created by a known sender. This is also known as
authentication.

● The sender cannot deny having sent the message. This is known as non-repudiation.

● The messages has not been altered during transmission. This is integrity.

Public Key Cryptography & Digital Signatures

Digital signatures in blockchain use public key cryptography which is also known as
asymmetric cryptography. The scheme uses two keys known as public key and private key
to encrypt and decrypt the data. Private key is known only to the user, whereas public key
can be shared with everyone. Private key is used to encrypt a message; whereas the public
key is used for decryption.

The other type of cryptography is symmetric cryptography (which is not used in blockchain).
It uses a single key. Using a common single key creates a problem of securely transferring
the key between the sender and the receiver. It is also called secret key cryptography. It
should be noted that both of the above encryption types are two-way functions. On the other
hand hash function is a one-way function only. Hash function does not have any key and it is
not possible to decrypt the data i.e. reverse the hashing.

Public key cryptography

Most of the time blockchain uses public-key cryptography, also known as asymmetric-key
cryptography. Public key cryptography uses both public key and private key in order to encrypt
and decrypt data. The public key can be distributed commonly but the private key can not be
shared with anyone. It is commonly used for two users or two servers in a secure way.
lOMoAR cPSD| 22516561

Public Key: Public keys are designed to be public. They can be freely given to everyone or
posted on the internet. By using the public key, one can encrypt the plain text message into
the cipher text. It is also used to verify the sender authentication. In simple words, one can
say that a public key is used for closing the lock.
Private Key: The private key is totally opposite of the public key. The private key is always
kept secret and never shared. Using this key we decrypt cipher text messages into plain text.
In simple words, one can say that the public is used for opening the lock.

Benefits of Public-key Cryptography

● Authentication: It ensures to the receiver that the data received has been sent
by the only verified sender.
● Data integrity: It ensures that the information and program are changed only in a
specific and authorized manner.
● Data confidentiality: It ensures that private message is not made available to an
unauthorized user. It is referred to as privacy or secrecy.
● Non-repudiation: It is an assurance that the original creator of the data cannot
deny the transmission of the said data to a third party.

Limitation of Public-Key Cryptography

● One can encrypt and decrypt the fixed size of messages or data. If there is an
attempt to encrypt or decrypt a large size of the message then the algorithm
demands high computational power.
● The main disadvantage of this algorithm is that if the receiver losses its private
key then data/message will be lost forever.
● If someone has access private key then all data will be in the wrong hand.
● There are many secret-key which is faster than public-key cryptography.
lOMoAR cPSD| 22516561

UNIT 2 - notes
lOMoAR cPSD| 22516561

UNIT 2

Creation of coins

The units of cryptocurrency are created through a process called mining. Mining is the process
of validating cryptocurrency transactions and creating new units of cryptocurrency. The mining
process uses powerful computer hardware and software to solve complex mathematical
problems that generate coins.
Cryptocurrencies use blockchain technology. Therefore, whenever a cryptocurrency
transaction occurs, cryptocurrency miners (who also act as nodes on the blockchain network
where these types of cryptocurrency transactions take place) try to decrypt the block
containing the transaction information. The block not only verifies the transaction but also
provides information about who sent how much cryptocurrency to whom, when and on what
date. Once a block is decrypted and accepted as authentic by the majority of nodes in the
blockchain network, the block is added to the blockchain. The verification process is very
resource-intensive in terms of the required computing power. As a result, individual
cryptocurrency miners often find the process too expensive, So because of this miners join
mining pools to share computing power.
Cryptocurrencies are broadly divided into two groups – coins and tokens. A coin is a
cryptocurrency application that runs on its own blockchain, where all transactions take place.
Tokens, on the other hand, work on existing blockchain infrastructure and are typically used
for physical objects like smart contracts. digital services, etc.
The coin creation process is not that challenging. You can simply copy Bitcoin’s code, add a
new variable, or even change its value, and that’s it – you have your blockchain and your
coin. However, you must understand the code and know how to modify it, which requires
extensive programming knowledge.

Payments and double spending

Blockchain payment systems are used to facilitate, process, and verify transactions made on
a blockchain or distributed ledger system. These tools may be designed for individuals,
businesses, or financial institutions, and will have a few differing features depending on the
use case. Across all uses, blockchain payment solutions allow customers to quickly and
securely make transactions on a blockchain.

Companies choose to use blockchain payment solutions for a number of reasons. Some
tools enable the creation of smart contracts, or protocols used to facilitate, verify, and
enforce transactions. These contracts are well documented and provide a higher level of
traceability. These forms of payment are also quicker than traditional tools since they do not
require a financial institution and transactions can be completed across country borders with
ease.

Some of the less complex and customizable blockchain payment products offer a product
similar to payment gateways. The only difference here is the documentation and traceability
lOMoAR cPSD| 22516561

provided by the blockchain and the simplified international payment process. These tools
can also get confused with cryptocurrency exchanges, but those tools are not used for
trading anything except cryptocurrencies such as bitcoin or ethereum.

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.Double-spending occurs when someone alters a
blockchain network and inserts a special one that allows them to reacquire a cryptocurrency.
Double-spending can happen, but it is more likely that a cryptocurrency is stolen from a
wallet that wasn't adequately protected and secured. Many variations of attacks could be
used for double-spending —51% is one of the most commonly cited attacks, while the
unconfirmed transaction attack is most commonly seen.

Types Of Double Spending Attacks

There are different types of Double Spending attacks:

● Finney Attack: Finney Attack is a type of Double spending Attack. In this, a


merchant accepts an unauthorized transaction. The original block is eclipsed by
the hacker using an eclipse attack. The transaction is performed on an
unauthorized one. After that, the real block shows up and again the transaction is
done automatically for the real block. Thus the merchant loses money two times.
● Race attack: is an attack in which there is a ‘race’ between two transactions. The
attacker sends the same money using different machines to two different
merchants. The merchants send their goods but transactions get invalid.
● 51% Attack: This type of attack is prevalent in small blockchains. Hackers usually
take over 51% of the mining power of blockchain and therefore can do anything of
their own will.

To tackle these double-spending issues, some security measures are taken. They are:

● Validation: Validation of transactions by a maximum number of nodes in the


network. Once a block is created, it is added to a list of pending transactions. Users
send validation for the block. If the verifications are done then only the block is
added to the blockchain.
lOMoAR cPSD| 22516561

● Timestamp: The confirmed transactions are timestamped, therefore they are


irreversible. If a transaction is involved with a bitcoin it is verified and done. But in
the future, if other transactions are made with the same bitcoin, the transactions
will be canceled.

● Block Confirmations: Merchants get block confirmations so that they are assured
that there was no case of double spending. In bitcoin, a minimum of 6 confirmations
are done.
● Saving copies: A copy of each transaction is kept at each node so in case of
network failure the whole network does not go down.

Bitcoin Scripts

Bitcoin Script is the language Bitcoin uses to do everything it can do, from sending funds
from a wallet to allowing the creation of multi-user accounts. All these functionality contained
in a simple extensible and powerful tool that we will know next.

When we talk about bitcoinscript, We are talking about a simple programming language used
in Bitcoin for the processing of transactions that is read from left to right. This is based on a
series of linear structures, known as stack, which contain existing data in order LIFO (Last
In - Firt Out). Each instruction in this language is executed one after the other consecutively.

This language is not Full Turing because its functionality is limited and cannot loops. So it is
not capable of solving any type of problem such as turing machines. However, this limitation
is intentional as this prevents infinite or endless looping and error execution. Where
malicious parts of the program can be free to create complicated operations to consume the
rate of hash and slow down the Bitcoin system through infinite loops.

A programming language is necessary because it allows us to write programs and that


computers execute our wishes. In BitcoinIn order to communicate our wishes, the opcodes
(OP CODES), which serve various functions. Like memory manipulation, math, loops,
function calls, among many others. Therefore, Bitcoin Script is essentially a set of
programmed instructions that are recorded with every transaction made. These instructions
describe how users can access and make use of the bitcoins available on the network.

What are peer-to-peer (P2P) networks?


lOMoAR cPSD| 22516561

Peer-to-Peer (P2P) technology is based on the decentralization concept, which lets network
participants conduct transactions without needing any middle-man, intermediaries or central
server. Peer-to-peer technology is how Bitcoin (BTC) operates; no administrator is required
to maintain track of user transactions on the network. Instead, the peers in the network
cooperate to handle deals and manage the BTC.

Peers refer to the nodes or computers that perform the same tasks and have the same
power within a blockchain network. Blockchain is a P2P network that acts as a decentralized
ledger for one or more digital assets, which refers to a decentralized peer-to-peer system
where each computer keeps a complete copy of the ledger and verifies its authenticity with
other nodes to guarantee the data is accurate. In contrast, transactions at a bank are kept
secret and are only overseen by the bank.

The security of the underlying consensus algorithms and the privacy of transactions are all
closely tied to its implementation, making the P2P network a crucial component of
blockchains. However, no common P2P protocol for blockchains has been suggested.
Instead, different cryptocurrencies have developed and adapted their own peer-to-peer
protocols.

How does a P2P Network Work?


A peer-to-peer (P2P) network is a type of computer network in which each participant (or
"peer") can act as both a client and a server, allowing them to share resources and information
directly with one another without the need for a central server. P2P networks are decentralized,
meaning that there is no central authority or organization that controls the network or its
resources. In a P2P network, each peer has equal status and can connect to any other peer
on the network. Peers can share a variety of resources, including files, data, and computing
power, with one another.

There are several different types of P2P networks, including structured and unstructured
networks. Structured P2P networks have a specific structure or organization, such as a
directory or index, that helps to facilitate communication and resource sharing between peers.
Unstructured P2P networks, on the other hand, do not have a specific structure and rely on
peers to search for and locate resources on the network.

Here's how a P2P network works −


lOMoAR cPSD| 22516561

Peers connect to the network − To join a P2P network, each peer must install
software that allows them to connect to the network and share resources with other
peers.
Peers share resources − Once connected to the network, each peer can share their
resources, such as files or computing power, with other peers.
Peers search for and locate resources − If a peer is looking for a specific resource,
they can search the network for it using the P2P software. Once the resource is
found, the peer can download it directly from the peer that is sharing it.

Resources are shared directly between peers − In a P2P network, resources are
shared directly between peers rather than being passed through a central server. This
makes P2P networks more efficient and reduces the risk of bottlenecks or delays.

Transactions in bitcoin network

A transaction is a transfer of Bitcoin value on the blockchain. In very simple terms, a


transaction is when participant A gives a designated amount of Bitcoin they own to
participant B. Transactions are created through mobile, desktop or hardware wallets.

For Bitcoin users, sending a transaction is as simple as entering an amount and an address
in their wallet and pressing send. They don’t have to worry about the technicalities of how it
works. Many users are curious how it works in practice though.

Bitcoin makes use of public-key cryptography to ensure the integrity of transactions created
on the network. In order to transfer bitcoin, each participant has pairs of public keys and
private keys that control pieces of bitcoin they own. A public key is a series of letters and
numbers that a user must share in order to receive funds. In contrast, a private key must be
kept secret as it authorizes the spending of any funds received by the associated public key.
Using the private key associated with their bitcoin, a user can sign transactions and thereby
transfer the value to a new owner. The transaction is then broadcast to the network to be
included in the blockchain.

Bitcoin mining

Bitcoin mining is the process by which new bitcoins are entered into circulation. It is also the
way the network confirms new transactions and is a critical component of the blockchain
ledger's maintenance and development. "Mining" is performed using sophisticated hardware
lOMoAR cPSD| 22516561

that solves an extremely complex computational math problem. The first computer to find the
solution to the problem receives the next block of bitcoins and the process begins again.

The encrypted data needs decryption to prove validity. Decrypting the data encoded in
blocks is not an easy task and demands computational hardware and software alongside
human efforts. One single code decryption will take an enormous amount of time and energy
both for the computer and the human. combination of the computational speed and human
intelligence will result in the decrypted data, which, when linked with the adjacent blocks,
verifies the transaction. The bitcoin blocks link together by codes named hash-codes. These
hash codes meet specific requirements in the encrypted data’s solution.

The miners need to solve the complex problem to find the perfect solution hash that matches
and fits. The solution to the hidden code encryption is known as the ‘Proof-of-work.’ As the
name suggests, it is a proof of the abundance of resources, time, and energy that is spent by
the miner. This proof-of-work is challenging to produce and may sometimes prove to be of
lower profitability.

Types of Mining

The process of mining can get really complex and a regular desktop or PC cannot cut it. Hence,
it requires a unique set of hardware and software that works well for the user. It helps to have
a custom set specific to mining certain blocks.

The mining process undertaking can be divided into three categories:

1. Individual Mining

When mining is done by an individual, user registration as a miner is necessary. As soon as a


transaction takes place, a mathematical problem is given to all the single users in the
blockchain network to solve. The first one to solve it gets rewarded.

Once the solution is found, all the other miners in the blockchain network will validate the
decrypted value and then add it to the blockchain. Thus, verifying the transaction.

2. Pool Mining
lOMoAR cPSD| 22516561

In pool mining, a group of users works together to approve the transaction. Sometimes, the
complexity of the data encrypted in the blocks makes it difficult for a user to decrypt the
encoded data alone. So, a group of miners works as a team to solve it. After the validation of
the result, the reward is then split between all users.

3. Cloud Mining

Cloud mining eliminates the need for computer hardware and software. It’s a hassle-free
method to extract blocks. With cloud mining, handling all the machinery, order timings, or
selling profits is no longer a constant worry.

While it is hassle-free, it has its own set of disadvantages. The operational functionality is
limited with the limitations on bitcoin hashing in blockchain. The operational expenses increase
as the reward profits are low. Software upgrades are restricted and so is the verification
process.

Block propagation

The P2P network for Bitcoin is composed of miner nodes that connect to one another at
random. These nodes disseminate transactions and blocks throughout the network until all
have received the information. Hops are required for a transaction to spread a message
throughout the network. The network dispersion increases by a factor of 2n with each
iteration as a set of two nodes are delivered the message. After twelve to fifteen hops, the
message is distributed over the whole network, with the diffusion growing exponentially as
the number of hops rises.

The throughput of a blockchain is determined by the number of transactions it can support


per second and is expressed as –

Where, TransactionsBlock is the factor of the current block capacity of the Bitcoin and
average transaction size.
lOMoAR cPSD| 22516561

With an average transaction size of about 540 bytes and the current Bitcoin block capacity of
1MB for a block interval of ten minutes, the network now handles about 1,950 transactions
each block, or about three transactions every second (TPS).

Either the transactions per block or the blocks per second can be increased to boost
throughput. It has already taken a lot of effort to use both on-chain and off-chain techniques
to increase the number of transactions per block. Teams have experimented with expanding
the block size by ten times in an effort to multiply the capacity by a factor of ten. A higher
block size typically maintains the hop count at twelve to fifteen for the whole network, but
necessitates delivering a bigger block (one block of 10MB) through the Bitcoin connection.

Although the transaction/block size grows in this case, it also raises the issue of network
throttling, which exponentially lengthens propagation times and raises the stakes in the
argument over Bitcoin splits. One such attempt is the hard fork of Bitcoin into Bitcoin Cash.

On the other hand, blocks/second is another important component to take into account for
network scaling, although it has so far frequently been overlooked owing to a variety of
throttling considerations. The absence of features like pipelining, latency optimization,
redundancy, congestion, message losses, and others prevent the Bitcoin network stack from
achieving the per-node link capacity, making the existing gossip mechanism that determines
journey time on the network plane inefficient.

Block relay

Compact block relay is a protocol that allows two nodes with roughly similar sets of
unconfirmed transactions to minimize both the bandwidth and the latency required to transfer
a block that confirms many of those same transactions.

By default, most full nodes are configured to receive relayed unconfirmed transactions,
which the nodes store in their mempools and further relay to their other peers. Ultimately
those transactions reach miners, who attempt to include them in a block. When that new
block is itself relayed back to nodes, it typically consists almost entirely of transactions that
the nodes already have in their mempools.
lOMoAR cPSD| 22516561

Consensus is bitcoin network

A consensus mechanism is a program used in blockchain systems to achieve distributed


agreement about the ledger's state. Generally, it is implemented in a network with many
processes and users. Cryptocurrencies, blockchains, and distributed ledgers benefit from
their use because the consensus mechanism replaces much slower human verifiers and
auditing.

For instance, the Bitcoin blockchain uses a mechanism called Proof-of-Work (PoW), which
requires computational power to solve an encrypted puzzle, called the hash. After the hash
is solved by one miner (or a group working together), Bitcoin's PoW requires that every node
on the network verifies the data that has been changed by checking:

● The data structure


● The block header hash
● The block timestamp
● The block size
● The first transaction

It then completes a long transaction verification checklist. This verification takes much less
time than the process of solving the hash, which is called mining, and is orders of magnitude
less time-consuming than human verification.

● 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, proof-of-work (PoW) and proof-
ofstake (PoS) are two of the most prevalent consensus mechanisms.
● Consensus mechanisms play an essential part of securing information by encrypting
it and using automated group verification.

Proof of Work (PoW)

Proof of work (PoW) describes a consensus mechanism that requires a significant amount of
computing effort from a network of devices. The term “proof of work” was first used by
Markus Jakobsson and Ari Juels in a publication in 1999. Proof of work (PoW) is a
decentralized consensus mechanism that requires network members to expend effort in
lOMoAR cPSD| 22516561

solving an encrypted hexadecimal number. Proof of work is also called mining, in reference
to receiving a reward for work done. Proof of work allows for secure peer-to-peer transaction
processing without needing a trusted third party. Proof of work at scale requires vast
amounts of energy, which only increases as more miners join the network. The PoW
consensus algorithm involves verifying a transaction through the mining process. This
section focuses on discussing the mining process and resource consumption during the
mining process.

Mining:

The Proof of Work consensus algorithm involves solving a computationally challenging


puzzle in order to create new blocks in the Bitcoin blockchain. The process is known as
‘mining’, and the nodes in the network that engages in mining are known as ‘miners’.

● The incentive for mining transactions lies in economic payoffs, where competing
miners are rewarded with 6.25 bitcoins and a small transaction fee.
● This reward will get reduced by half its current value with time.

Energy and Time consumption in Mining:

The process of verifying the transactions in the block to be added, organizing these
transactions in chronological order in the block, and announcing the newly mined block to
the entire network does not take much energy and time.

● The energy-consuming part is solving the ‘hard mathematical problem’ to link the
new block to the last block in the valid blockchain.
● When a miner finally finds the right solution, the node broadcasts it to the whole
network at the same time, receiving a cryptocurrency prize (the reward) provided
by the PoW protocol.

Hash cash

The development of HashCash comes from the hand of Adam Back in 1997. Back is a
renowned crypto expert and computer hacker. He development the proof of work system.
This as a countermeasure against spam in emails and also in blogs (spam is spam). Back
devised this technology based on a job called; "Assessment through processing or
lOMoAR cPSD| 22516561

combating spam". A document presented in 1992 by computer experts Cynthia dwork y


Moni naor.

The objective of HashCash is to require computer work for it to be verified. Once said work is
verified, the user is allowed to use the resource. Use in email is based on adding an
encrypted header to the email. This header has the information generated by the user using
the HashCash system. This is a kind of seal that ensures that the mail has passed the proof
of work. This seal is an identifier that shows that the sender has used the processor for a
small amount of time. Well, it is the only way to generate a genuine stamp for each email
you want to send.

It is based on the idea that if a certain user has used their processor to generate this stamp, it
is unlikely that they are a spammer. Receivers with a very low almost negligible computational
cost can verify this. In this way we can guarantee that it is not spam.

Decrypting the seal and ensuring it is not spam requires brute computing force. Or what is
the same, we need the processor to find the answer by trial and error. Basically, the
processor will test combinations according to certain criteria until it finds the correct answer.
This would demonstrate that it is not spam.

Spammers base their business model on sending hundreds, thousands, and even millions of
emails quickly. All this with a low cost of resources per message. For example; If a 5-second
job is requested before sending an email, the cost of sending thousands of emails would be
unbearable by the spammer. For its part, the receiver can quickly verify if there is a
verification work prior to receiving the mail. With this, you can quickly filter and classify legal
emails from spam attempts.

Consensus in Open System.

Problems in open system:

● Message passing requires a closed environment. Everyone need to

know the identity of others. Since in Bitcoin anyone can join the network

anytime, this clearly is not possible in an open environment.

● Shared memory is not suitable for Internet grade computing. Where will we keep

the shared memory?


lOMoAR cPSD| 22516561

Consensus in Bitcoin:

All the nodes in this network need to agree on the correctness of a

transaction. Some nodes can also initiate malicious transactions.

Whenever the multiple miners mine new blocks simultaneously, the objective of consensus is

to decide which block is to be added next.

Here the miners don’t know each other. If we broadcast the transactions (flooding), then the

impossibility result might occur because we don’t have a global clock. So, it is not feasible to

wait for infinite time. Every miner solves a challenge independently. The miner who

completes the challenge first will add the block mined by him to blockchain. This is his Proof

of Work(PoW).
lOMoAR cPSD| 22516561

Now the miner sends the solution to all the other miners and this block is included in the

blockchain. In case any transactions are not logged in the block, they will be included in the

next round.

Monopoly Problem.

During bitcoin’s early days, anyone could “mine” it using their home computer. But as the

price of digital currency climbed towards $100 in 2013 (it’s now over $4,000), professional

mining groups with specialised computer chips emerged. Today, these groups, or pools —

nearly all based in China — have become concentrated and now dominate the production of

new bitcoins.

Why monopoly problem existed?

● Miners are getting less rewards over the time. So, they are discouraged to join

as a miner.

● The difficulty of puzzle is increasing which is not possible to be solved by normal

hardware.

● Solution of Monopoly Problem:

Proof of Stake(PoS) emerged as a solution to this problem. Let’s study about it in detail.

Proof of Stake(PoS):

A person can mine or validate block transactions according to how many coins he or she

holds. This means that the more Bitcoin or altcoin owned by a miner, the more mining power

he or she has.
lOMoAR cPSD| 22516561

The first cryptocurrency to adopt the PoS method was Peercoin.In Peercoin, the coinage is

used as a variation of stake. Coinage is calculated by multiplying number of coins by the

number of days the coins have been held.

● If an attacker wants to attack, he/she should have more number of bitcoins.

● If the attacker holds majority of bitcoins, then the majority affect will be on

attacker only.

Proof of Stake (PoS) is a type of algorithm which aims to achieve distributed consensus in a
Blockchain. This way to achieve consensus was first suggested by Quantum Mechanic here
and later Sunny King and his peer wrote a paper on it. This led to Proof-of-Stake (PoS)
based Peercoin.

A stake is value/money we bet on a certain outcome. The process is called staking.


A more particular meaning of stake will be defined later on.

What is Proof-of-Stake:

As understandable from the name, nodes on a network stake an amount of cryptocurrency to


become candidates to validate the new block and earn the fee from it. Then, an algorithm
chooses from the pool of candidates the node which will validate the new block. This
selection algorithm combines the quantity of stake (amount of cryptocurrency) with other
factors (like coin-age based selection, randomization process) to make the selection fair to
everyone on the network.

A typical PoS based mechanism workflow:

1. Nodes make transactions. The PoS algorithm puts all these transactions in a
pool.
2. All the nodes contending to become validator for the next block raise a stake.
This stake is combined with other factors like ‘coin-age’ or ‘randomized block
selection’ to select the validator.
3. The validator verifies all the transactions and publishes the block. His stake still
remains locked and the forging reward is also not granted yet. This is so that the
nodes on the network can ‘OK’ the new block.
lOMoAR cPSD| 22516561

4. If the block is ‘OK’-ed, the validator gets the stake back and the reward too. If the
algorithm is using a coin-age based mechanism to select validators, the validator
for the current block’s has its coin-age reset to 0. This puts him in a low-priority
for the next validator election.
5. If the block is not verified by other nodes on the network, the validator loses its
stake and is marked as ‘bad’ by the algorithm. The process again starts from step
1 to forge the new block.

Features:

● Fixed coins in existence:


There is only a finite number of coins that always circulate in the network. There
is no existence of bringing new coins into existence(as in by mining in case of
bitcoin and other PoW based systems). Note that the network starts with a finite
number of coins or ‘initially starts with PoW, then shifts to PoS’ in some cases.
This initiation with PoW is meant to bring coins/cryptocurrency in the network.
● Transaction fee as reward to minters/forgers:
Every transaction is charged some amount of fee. This is accumulated and given
to the entity who forges the new block. Note that if the forged block is found
fraudulent, the transaction fee is not rewarded. Moreover, the stake of the
validator is also lost(which is also known as slashing).
● Impracticality of the 51% attack:
To conduct a 51% attack, the attacker will have to own 51% of the total
cryptocurrency in the network which is quite expensive. This deems doing the
attack too tedious, expensive and not so profitable. There will occur problems
when amassing such a share of total cryptocurrency as there might not be so
much currency to buy, also that buying more and more coins/value will become
more expensive. Also validating wrong transactions will cause the validator to
lose its stake, thereby being reward-negative.

Advantages of PoS:

● Energy-efficient:
As all the nodes are not competing against each other to attach a new block to
the blockchain, energy is saved. Also, no problem has to be solved( as in case of
Proof-of-Work system) thus saving the energy.
lOMoAR cPSD| 22516561

● Decentralization:
In blockchains like Bitcoin(Proof of Work system to achieve distributed
consensus), an extra incentive of exponential rewards are in place to join a
mining pool leading to a more centralized nature of blockchain. In the case of a
Proof-of-Stake based system(like Peercoin), rewards are proportional(linear) to
the amount of stake. So, it provides absolutely no extra edge to join a mining
pool; thus promoting decentralization.
● Security:
A person attempting to attack a network will have to own 51% of the stakes(pretty
expensive). This leads to a secure network.

Weakness of a PoS mechanism:

● Large stake validators:


If a group of validator candidates combine and own a significant share of total
cryptocurrency, they will have more chances of becoming validators. Increased
chances lead to increased selections, which lead to more and more forging
reward earning, which lead to owning a huge currency share. This can cause the
network to become centralized over time.
● New technology:
PoS is still relatively new. Research is ongoing to find flaws, fix them and making
it viable for a live network with actual currency transactions.
● The ‘Nothing at Stake’ problem:
This problem describes the little to no disadvantage to the nodes in case they
support multiple blockchains in the event of a blockchain split(blockchain forking).
In the worst-case scenario, every fork will lead to multiple blockchains and
validators will work and the nodes in the network will never achieve consensus.

Proof of Burn

Proof of burn (POB) is an alternative consensus algorithm that tries to address the high
energy consumption issue of a POW system. POB is often called a POW system without
energy waste. It operates on the principle of allowing miners to “burn” virtual currency
tokens. They are then granted the right to write blocks in proportion to the coins burnt.
lOMoAR cPSD| 22516561

Iain Stewart, the inventor of the POB algorithm, uses an analogy to describe the algorithm:
burnt coins are like mining rigs. In this analogy, a miner burns their coins to buy a virtual
mining rig that gives them the power to mine blocks. The more coins burned by the miner,
the bigger their virtual mining "rig" will be.

To burn the coins, miners send them to a verifiably un-spendable address. This process
does not consume many resources (other than the burned coins) and ensures that the
network remains active and agile. Depending upon the implementation, miners are allowed
to burn the native currency or the currency of an alternate chain, such as Bitcoin. In
exchange, they receive a reward in the native currency token of the blockchain.

You can send out transactions to the network that will burn your own cryptocurrency coins.

Other participants can mine/burn on top of your block, and you can also take the
transactions of other participants to add them to your block. Essentially, all of this burning
activity keeps the network agile, and participants are rewarded for their activities (both
burning their own coins and burning other people’s coins).

To prevent the possibility of unfair advantages for early adopters, the POB system has
implemented a mechanism that promotes the periodic burning of cryptocurrency coins to
maintain mining power. The power of burnt coins “decays” or reduces partially each time a
new block is mined. This promotes regular activity by the miners, instead of a one-time, early
investment. To maintain a competitive edge, miners may also need to periodically invest in
better equipment as technology advances.

What Is Proof of Elapsed Time (PoET)?


Proof of elapsed time (PoET) is a blockchain network consensus mechanism that prevents
high resource utilization and energy consumption; it keeps the process more efficient by
following a fair lottery system.

The algorithm uses a randomly generated elapsed time to decide mining rights and block
winners on a blockchain network. By running a trusted code within a secure environment,
the PoET algorithm also enhances transparency by ensuring lottery results are verifiable by
external participants. Based on the principle of a fair lottery system where every node is
lOMoAR cPSD| 22516561

equally likely to be chosen, the PoET mechanism spreads the chances of winning across the
largest possible number of network participants.

Under PoET, each participating node in the network must wait for a randomly chosen period;
the first to complete the designated waiting time wins the new block. Each node in the
blockchain network generates a random wait time and sleeps for that specified duration. The
one to wake up first—that is, the one with the shortest wait time—wakes up and commits a
new block to the blockchain, broadcasting the necessary information to the whole peer
network. The same process then repeats for the discovery of the next block.

Life of bitcoin miner

Within the bitcoin networks, there are a group of people known as Miners. In miners, there
was a process and confirm transactions. Anybody can apply for a minor, and you could run
the client yourself. However, these minors use very powerful computers that are specifically
designed to mine bitcoin transaction. They do this by actually solving math problems and
resolving cryptographic issues because every transaction needs to be cryptographically
encoded and secured. These mathematical problems ensure that nobody is tampering with
that data. Additionally, for this task, the minors are paid in bitcoins, which is the key component
in bitcoin. In Bitcoin, you cannot create money as like you create regular fiat currencies such
as Dollar, Euro, and Yuan. The bitcoin is created by rewarding these minors for their work in
solving the mathematical and cryptographical problems What is Mining difficulty?

Every blockchain has a mining process by which miners can generate fresh coins. An
algorithm regulates how difficult it is for the miners to mine a certain block. This difficulty is
known as mining difficulty. For mining a block, a miner must solve complex mathematical
problems by finding a valid hash. As the process progresses, the network adjusts the rate so
miners can find valid hashes. Each blockchain has its algorithm to regulate this adjustment.
The algorithm increases or decreases the mining difficulty based on the rate at which miners
can mine a block.

In recent times, the number of miners has increased manifold. Thus automatically, the
mining difficulty of blockchains has also increased. Let’s take an example for you to
understand better. Bitcoin is a cryptocurrency that has become very popular. As a result, the
number of miners on that blockchain has also increased.
lOMoAR cPSD| 22516561

The more the number of miners, the more computing power is used in the peer-to-peer
network. And as a result, greater is the competition for the limited block rewards. Thus to
adjust the rate at which miners can find blocks, the network raises its hash power. This
maintains the time a miner or a mining pool can successfully mine a block. The more the
hash power, the more difficult it will be to find valid hashes for a block. Currently, it takes
about 10 minutes to mine a Bitcoin block. After every 2,016 blocks are mined, Bitcoin
adjusts its mining difficulty. The difficulty will increase based on the number of miners and
their combined hash power.

What Is a Mining Pool?


A mining pool is a joint group of cryptocurrency miners who combine their computational
resources over a network to strengthen the probability of finding a block or otherwise
successfully mining for cryptocurrency.

● Cryptocurrency mining pools are groups of miners who share their computational
resources.
● Mining pools utilize these combined resources to strengthen the probability of finding
a block or otherwise successfully mining for cryptocurrency.
● If the mining pool is successful and receives a reward, that reward is divided among
participants in the pool.
How a Mining Pool Works
Individually, participants in a mining pool contribute their processing power toward the effort
of finding a block. If the pool is successful in these efforts, they receive a reward, typically in
the form of the associated cryptocurrency.

Rewards are usually divided between the individuals who contributed, according to the
proportion of each individual's processing power or work relative to the whole group. In some
cases, individual miners must show proof of work in order to receive their rewards.

Rewards are usually split among the miners based on the agreed terms and on their
respective contributions to the mining activity.

Anyone who wants to make a profit through cryptocurrency mining has the choice to either
go solo with their own dedicated devices or to join a mining pool where multiple miners and
their devices combine to enhance their hashing output. For example, attaching six mining
lOMoAR cPSD| 22516561

devices that each offers 335 megahashes per second (MH/s) can generate a cumulative 2
gigahashes of mining power, thereby leading to faster processing of the hash function.
lOMoAR cPSD| 22516561

lOMoAR cPSD| 22516561

Blockchain Unit – 03

 Permissioned model of Blockchain


A permissioned blockchain is a controlled and private network where access to participate and
view the data is restricted to authorized entities. They are employed by organizations and groups
that require enhanced control, privacy, and security over their blockchain activities.

The governance for this blockchain is managed by a consortium of trusted participants who
collectively determine network rules, consensus mechanisms, and overall management. These
entities rigorously control access, using methods like digital certificates or cryptographic keys to
ensure that only the approved users can engage with the network.

These blockchains often employ efficient mechanisms like practical Byzantine fault tolerance
(PBFT), delegated proof of stake (DPoS), or Raft consensus. Thus, it enables faster transaction
validation and reduced energy consumption.

Additionally, these blockchains efficiently safeguard privacy and confidentiality, a crucial


requirement for industries where sensitive information must be kept confidential. Moreover, these
blockchains support smart contracts, which reduces the need for intermediaries and optimizes
operational efficiency.

Characteristics
The characteristics of permissioned blockchain are:
1. Access Control: These blockchains have strict access control. Only authorized users are allowed
to join the network. Access can be controlled through digital certificates, cryptographic keys, or
other authentication methods. Thus, it ensures that the network is limited to known and
trusted participants.
2. Network Governance: They are typically governed by a group of trusted entities. These users
collectively decide on network rules, consensus mechanisms, and governance. Hence, these
blockchains have a more centralized governance structure.
3. Consensus Mechanisms: Such blockchains use consensus mechanisms to validate transactions
and maintain the ledger’s integrity. They often employ more efficient consensus mechanisms.
lOMoAR cPSD| 22516561

As a result, these mechanisms enable faster transaction validation and lower energy
consumption.
4. Privacy and Confidentiality: Enhanced privacy and confidentiality are significant characteristics
of permissioned blockchain. Users have greater control over who can access their data and
transactions. Thus, it is crucial for industries where sensitive information must be kept
confidential.
5. Smart Contracts: Many such blockchains support smart contracts, self-executing code that
automates processes and agreements when predefined conditions are met. Smart contracts
can streamline complex business processes, reduce the need for intermediaries, and enhance
operational efficiency.
 Uses cases
Some permissioned blockchain use cases include:
1. Banks and financial institutions use these blockchains to facilitate faster and cost-effective
cross-border payments and settlements. They streamline trade and finance processes, reducing
fraud and improving transparency in international trade transactions.
2. Companies in the food, pharmaceutical, and luxury goods industries use these blockchains to
track the origin and journey of products, ensuring authenticity and compliance with
regulations. They help manage inventory levels, automate reorder processes, and enhance
supply chain visibility.
3. Healthcare providers use such blockchains to securely and efficiently manage patient records,
ensuring data privacy and integrity. Moreover, the pharmaceutical industry employs them to
trace the production and distribution of medications, reducing the risk of counterfeit drugs.
4. One of the crucial permissioned blockchain use cases is to develop secure and transparent
electronic voting systems, reducing the potential for fraud. Additionally, Governments can use
these blockchains for identity verification, enhancing security in passport issuance and border
control areas.
5. They help artists and creaators protect their intellectual property rights by transparently
recording ownership and usage rights. Furthermore, legal firms and businesses use these
blockchains to automate contract execution and ensure compliance.
6. Educational institutions utilize these blockchains to verify and share academic credentials
securely. It aids in reducing fraud in the hiring process.

 Design issues for permissioned blockchain


There are several design issues that need to be considered when implementing a permissioned
blockchain -
lOMoAR cPSD| 22516561

1. Access Control - determining who has access to the network, and ability to validate
transactions, managing the access control process.
2. Consensus mechanism - determining the consensus mechanism to be used. choosing the right
consensus mechanism can be a trade-off between security and performance.
3. Scalability - Another design issue is scalability, as permissioned blockchains may have a smaller
number of participants as compared to public blockchains.
4. Privacy - the privacy of the participants and their transactions needs to be considered. This
includes designing the network in such a way that it does not reveal sensitive information
about the participants or their transactions to unauthorized parties.
5. Regulatory Compliance - Permissioned blockchains are often used in regulated industries, such
as finance and healthcare, and need to comply with existing regulations. It includes designing
the network to meet data protection and privacy laws.
6. Integration - Permissioned blockchains often need to be integrated with existing systems, such
as enterprise resource planning (ERP) systems.

 Execute contracts
 State machine replication
SMR is a technique used in distributed systems to ensure that all replicas of a service/application
have the same state.
In the blockchain, SMR is used to ensure that all nodes in the network have the same copy of the
blockchain ledger.
There are several algorithms that are used for state machine replication in blockchain, such as
Practical Byzantine Fault Tolerance (PBFT) and RAFT.
SMR is a key aspect of blockchain technology, that ensures the consistency and fault-tolerance of
the network.
It works in conjunction with the consensus algorithm to keep all the nodes in the network in
agreement about the state of the blockchain.

 Consensus model for permissioned blockchain


Consensus is the process by which all the nodes in a blockchain network agree on the state of the
blockchain.
Consensus models commonly used in permissioned blockchains:
1. Practical Byzantine Fault Tolerance (PBFT): PBFT Consensus algorithm uses a combination of
message passing and voting to ensure that all nodes have the same view of the state of the
blockchain.
lOMoAR cPSD| 22516561

2. RAFT: RAFT Consensus algorithm is designed to be fault-tolerant and can handle network
partitions and failures.

3. Proof of Authority (PoA): PoA Consensus algorithm uses a group of authorized nodes, called
validators, to validate transactions and create new blocks.

4. Proof of Stake (PoS): PoS Consensus algorithm uses a group of validators, called validators, to
validate transactions and create new blocks. Validators are chosen based on their stake in the
network.

5. PLaTFoRM (Parallel Ledger Technology For Optimized Replication and Machine Learning):
PLATFORM Consensus algorithm uses parallel replication to provide a fast and secure way to
add blocks to the blockchain, and machine learning to improve the performance and scalability
of the network.

 Distributed consensus in closed environment


The main features of consensus algorithms in distributed systems include:

1. Agreement: Consensus algorithms aim to achieve agreement among a group of nodes


regarding a single value or a sequence of operations. All nodes in the system should eventually
agree on the same decision.

2. Fault Tolerance: Consensus algorithms are designed to handle node failures, communication
delays, and network partitions. They ensure that the system can continue to make progress
even in the presence of failures.

3. Safety: Consensus algorithms ensure safety by guaranteeing that only one value or decision is
agreed upon. Conflicting decisions are prevented to maintain data consistency.

4. Liveness: Liveness ensures that the system can make progress and continue to agree on new
values or decisions even in the absence of failures.

5. Two-Phase Approach: Most consensus algorithms follow a two-phase approach, where


proposals are first prepared and then accepted. This reduces the likelihood of conflicts and
ensures safety.
lOMoAR cPSD| 22516561

6. Leader-Based or Leaderless: Some consensus algorithms use a leader-based approach, where a


designated leader coordinates the consensus process, while others are leaderless, where nodes
work collaboratively to achieve consensus.

7. Message Exchange: Nodes communicate with each other by exchanging messages to propose
values, vote, and inform each other about their states.

 Paxos
Paxos is a family of protocols for solving the problem of consensus in distributed networks. The
Paxos algorithm provides a mechanism that enables distributed systems to continue working in a
predictable way in the event of network partitioning or server failures.
Paxos is an algorithm that enables a distributed set of computers (for example, a cluster of
distributed database nodes) to achieve consensus over an asynchronous network. To achieve
agreement, one or more of the computers proposes a value to Paxos. Consensus is achieved when
a majority of the computers running Paxos agrees on one of the proposed values.

In general terms, Paxos selects a single value from one or more of the values that are proposed,
and then broadcasts that value to all of the cooperating computers. Once the Paxos algorithm has
run, all of the computers (or database nodes)) agree upon the proposed value, and the cluster
clocks forward.

Paxos defines several different roles which must cooperate to achieve consensus; they interact to
collectively agree on a proposed value. The three roles are:
- Proposers, who receive requests (values) from clients and try to convince acceptors to accept
the value they propose.
- Acceptors, who accept certain proposed values from proposers and let proposers know
whether a different value was accepted. A response from an acceptor represents a vote for a
particular proposal.
- Learners, who announce the outcome to all participating nodes.
The Paxos algorithm operates in a series of phases, ensuring that a group of nodes reach a
consensus on a single value. The consensus process is divided into three main phases: Prepare
Phase, Promise Phase, and Accept Phase. These phases involve message exchanges between
proposers and acceptors to reach an agreement on a value or sequence of values.

1. Prepare Phase:
A proposer initiates the consensus process by sending a prepare message with a proposal
number to the acceptors.
lOMoAR cPSD| 22516561

The proposal number is a unique identifier for the current proposal and helps prevent conflicts
between competing proposals.
Upon receiving the prepare message, each acceptor checks if the proposal number is greater
than any previous proposal number it has seen.
If the proposal number is greater, the acceptor replies with a promise not to accept any
proposals with lower numbers and includes information about the highest-numbered proposal
it has accepted (if any).

2. Promise Phase:
After receiving prepare messages, acceptors respond with promise messages to the proposer.
The promise message includes the acceptor’s acceptance status and the highest-numbered
proposal it has accepted (if any).
If an acceptor has not accepted any proposals before, it
responds with a promise but without any accepted value.
If an acceptor has accepted a proposal before, it includes the
proposal number and value in its promise.

3. Accept Phase:
If a proposer receives promises from a majority of acceptors
(a quorum), it moves on to the accept phase.
In the accept phase, the proposer sends an accept message
to the acceptors with the same proposal number and the
value it wants to be accepted.
Acceptors check if the proposal number is not lower than any previous proposal number they
have seen.
If the proposal number is valid, the acceptor accepts the proposal and informs the proposer.

4. Learn Phase:
The Learn Phase ensures that the decision is reliably communicated to all nodes in the system,
including learners and proposers, so that the distributed system achieves agreement on the
chosen value. This phase completes the consensus process and ensures that all correct nodes
eventually have the same agreed-upon value, maintaining data consistency across the
distributed system.
Paxos ensures two critical properties: safety (only one value is agreed upon) and liveness (the
algorithm makes progress even in the presence of failures and message delays).
lOMoAR cPSD| 22516561

 RAFT Consensus
Raft is designed to be more understandable than Paxos and operates based on a strong leader
model. It is divided into three main components: Leader Election, Log Replication, and Safety.
1. Leader Election:
In Raft, nodes use randomized timeouts to elect a leader. Each node has a timeout period, and
when it times out, it becomes a candidate and starts a leader election process.
The candidate sends a “request for votes” to other nodes. If a node has not voted for any other
candidate in the current term and it has not already become a leader, it votes for the
candidate.
If a candidate receives votes from a quorum of nodes (majority), it becomes the leader.

2. Log Replication:
The leader receives client requests and appends them to its log, forming log entries.
The leader then sends the log entries to followers (other nodes) to replicate the data.
Once a log entry is replicated to a quorum of nodes, the leader commits the entry and notifies
followers to apply the log entry to their state machines.

3. Safety:
Raft ensures safety by always having the most up-to-date log
on the leader. If a follower discovers a more recent log from
another node, it reverts to the follower state and follows the new leader.
Raft prioritizes understandability over complexity, making it easier to implement and reason about.
It retains Paxos’s fundamental concepts while providing a more structured and intuitive approach
to distributed consensus.
 Byzantine general problem
The Byzantine Generals Problem is a classic problem in distributed computing that addresses the
issue of how to reach agreement in a distributed system when some of the nodes may be faulty or
behaving maliciously.

The Byzantine Generals Problem is a fundamental issue in distributed computing and game theory
that illustrates the challenges decentralized parties face in reaching consensus without trusted
central authorities. Understanding this problem helps to grasp the significance of blockchain
technology in ensuring secure, fault-tolerant systems.

The Byzantine Generals Problem is a metaphor for the difficulties of achieving consensus in a
distributed system where some components may fail or act maliciously. The problem is framed as
follows:
lOMoAR cPSD| 22516561

1. Scenario: An army is led by several generals, each commanding a portion of the army. The
generals need to agree on a common plan of action, such as whether to attack or retreat. The
success of their strategy relies on all generals coordinating their actions.

2. Communication: The generals can only communicate via messengers. However, some generals
might be traitors who intend to undermine the coordination by sending false messages or
altering communications.

3. Goal: The objective is for the loyal generals to reach a consensus on their plan despite the
presence of traitors. Specifically, they need to ensure:
Agreement: All loyal generals agree on the same plan.
Validity: If all loyal generals propose the same plan, that plan should be adopted.

Several consensus algorithms have been developed to address the Byzantine Generals Problem in
blockchain, such as the Practical Byzantine Fault Tolerance (PBFT) and the Raft algorithm.

 Byzantine fault tolerant system


Byzantine Fault Tolerance is a property of a distributed system that allows it to function correctly
even if some of the nodes in the network are faulty or malicious. A Byzantine failure is a failure in
which a node in a distributed system provides incorrect or misleading information to other nodes.

In a Byzantine failure, it is not possible to distinguish between faulty nodes and nodes that are
providing correct information. BFT algorithms are designed to tolerate Byzantine failures by
ensuring that the system can reach consensus even if some nodes are providing incorrect
information.

BFT algorithms work by dividing nodes in the network into groups and requiring them to exchange
messages with each other. By exchanging messages, nodes can validate the information being
provided by other nodes and ensure that all nodes agree on the current state of the system. There
are several BFT algorithms that are commonly used in blockchain technology, including Practical
Byzantine Fault Tolerance (PBFT), Federated Byzantine Agreement (FBA), and others.

 Lamport-Shostak-Pease BFT Algorithm


The main idea behind this algorithm is: There is a commander and N lieutenants. The commander
initiates the process and sends an initial message to all the lieutenants in the closed network.
Later, each lieutenant forwards the value received from the commander to the other lieutenants
except the sender. So at the end of the rounds, all the lieutenants must be having N-1 values,
lOMoAR cPSD| 22516561

except the offline lieutenants. In the end, they will apply the majority voting principle and achieves
the consensus. This is one of the first algorithms for Byzantine Generals’ Problem.
1. Pulse-1 is the initial pulse where the commander sends the message to all the Lieutenants.
Broadcast (N, t=0), where N is the number of processes and t is the algorithm parameter,
denotes the individual rounds. The Commander decides his own value, and in this case, the
possible values are {retreat, attack}. In this example, N = 3 has three different lieutenants and is
trying to reach a consensus.
2. Each lieutenant receives the message from the commander and checks whether it is a pulse-1
message or not. If it is a pulse-1 message, and the sender is the commander, accept it;
otherwise, wait for a pulse-1 message. Suppose a pulse-1 message is received then broadcast
this message to all other processes in the network.
3. All the lieutenants broadcast their values to the other lieutenants except the senders. At the
end of the rounds, all the lieutenants must be having N-1 values, except the offline lieutenants.
In the end, they will apply the majority voting principle and achieves the consensus.

In this agreement Protocol, after N rounds, each process must be having the N values; this is
because the system is synchronous and having a reliable communication medium. Once they have,
N values can apply the majority voting principle and achieve the consensus. However, to achieve
consensus, the system should satisfy the below condition.
- The system must have a minimum of three lieutenants (N =3) and a commander. So, out of N
number of processes (lieutenants), maximum of F number of the processes can be faulty, and
F + 1 number of processes must be non-faulty such that N = 2*F + 1.
- The system should be fully connected, and the receivers always know the identity of the
senders.
- The system should be synchronous and having a reliable communication medium.

 BFT over Asynchronous systems


The asynchronous property of Asynchronous Byzantine Fault Tolerance overcomes a challenge of
fault tolerance, which is that of timing. Many forms of Byzantine fault tolerance assume there is a
maximum threshold of message latency when coming to a consensus. An Asynchronous Byzantine
Fault Tolerant (ABFT) network eliminates this assumption and allows for some messages to be lost
or indefinitely delayed.

An ABFT network allows for messages to be lost or indefinitely delayed and assumes only that at
some point an honest node’s messages will eventually get through. It is much more challenging for
an honest node to assess whether another node is not following the rules, if that node’s messages
lOMoAR cPSD| 22516561

can be indefinitely delayed, but this scenario much better reflects that network reliability in the
real world.

When BFT is applied to asynchronous systems, there is a risk of algorithm being stuck in an infinite
loop, or that it may not be able to reach the agreement on the state of the blockchain.

To address this, several modifications have been proposed to BFT algorithms such as :

1. First approach: use a hybrid BFT algorithm, which combines a synchronous BFT algorithm with
a gossip protocol.
2. Second approach: use a modified BFT algorithm, such as Asynchronous BFT (ABFT), which is
designed to work in asynchronous networks.
3. Third approach: use a probabilistic BFT algorithm, such as HoneyBadgerBFT, which uses a
combination of secret sharing and threshold signing to ensure that the network can reach
agreement.
lOMoAR cPSD| 22516561

Enterprise application in Blockchain –

Cross Border Payments in blockchain


Blockchain technology in cross-border payments can enable secure
transfers between an infinite number of bank ledgers. This allows one to
bypass banking intermediaries who serve as middlemen to help transfer
money from one bank to another. The transaction is secure, quicker, and
cheaper and has end-to-end visibility anywhere in the world.

The use of blockchain technology in cross-border payments is very


different from existing methods such as SWIFT. Even SWIFT’s new GPI
(global payments innovation) relies on the same unidirectional messaging,
which means that it is not connected to any underlying settlement process.
Such a system has its drawbacks, where individuals can manipulate the
banking system to commit fraud. A case in point was the Punjab National
Bank fraud case, where INR 14,356.84 crore was stolen because
perpetrators of the fraud made unauthorized transactions on the SWIFT
network, where payment messages sent were not linked to the system
that actually settled the transaction.

There are no such issues for payments processed on the blockchain. Any
transactions can be settled instantly. Using the bidirectional messaging
and settlement component employed in blockchain solutions, such as
Ripple’s, ensure that the transaction is validated on the blockchain before
the funds are transferred across the ledgers of transacting parties. If for
some reason the payment does not go through, both banks are
immediately notified and no funds are transferred.

The use of digital assets (sometimes called crypto-currencies) such as


XRP (an independent digital asset) can help financial institutions convert
lOMoAR cPSD| 22516561

funds into the desired currency instantly. Given that India has the largest
diaspora population in the world, this means that banks often deal with
currency pairs such as SAR/INR to USD/INR. Sourcing liquidity for
payments into and outside India can be onerous and costly, and the use
of XRP as a bridge asset for currency conversions takes just minutes and
is cheaper than what it would cost if one did a traditional fiat-to-fiat
exchange. Additionally, the ability to do this in real-time would also reduce
a financial institution’s exposure to forex volatility as well.

Blockchain - The cross-border payments for India

Blockchain can help India’s financial institutions develop world-class


payment platforms. Banks and payment providers are aware of the pain
points in facilitating cross-border transactions, and have made some
progress in addressing them. In India, blockchain technology has been
adopted by banks to help improve the payments experience for its
customers. For example, last year, YES BANK has signed a partnership
with Ripple to help facilitate inbound remittances from North America, the
Middle East and the United Kingdom.

Apart from facilitating greater efficiencies in existing payments


infrastructure, there is much to be said about what blockchain can do for
India and its people. Let us consider its benefits at a more human level.
For example, let’s say an Indian construction worker in Dubai urgently
needs to transfer funds back home for a medical emergency his family is
experiencing. If his bank used blockchain technology, the remittance
transfer could be completed within minutes, with fees that are significantly
lower than existing methods of transferring money. Had the conventional
means of cross-border payments been used, it would have taken 3-4
days, with the money going through multiple intermediaries and incurring
extra fees, before finally reaching the worker’s family.
lOMoAR cPSD| 22516561

Blockchain can also allow a bank’s customers to use their more efficient
cross-border payments service and reduce their dependency on hawala
brokers, where fees can also be quite high, while improving financial
inclusion amongst the Indian populace as well.

Such instances highlight the centrality of remittances to India’s economy,


where the World Bank has stated that India is the world’s largest recipient
of remittances worldwide (at about INR 4.6 trillion a year). From a
macroeconomic perspective, inbound remittances are often used by
families for household purchases and investments. The rise in
consumption levels will in return create a ripple effect, driving growth in
other industries as well. Therefore, the importance of cross-border
payments cannot be understated in India, and it is imperative that financial
institutions look closely on leveraging blockchain technology for the
broader purpose of socio-economic development.

Although much of the current debate on blockchain revolves on its


‘disruptive’ element and focuses on how it seeks to challenge the status
quo, innovative cross-border payment solutions built on blockchain
technology are not here to replace financial institutions, nor do they seek
to circumvent financial regulations. Blockchain technology can enable
banks to improve and future-proof their cross-border payments services.

Going back to Mr Modi’s address to world leaders and global CEOs at the
World Economic Forum, he said: “This technology-driven world has
influenced every aspect of our lives ... Technology has the ability to bend,
break and link...” With blockchain technology, we bend and break the
existing system, and link the world more seamlessly through cheaper,
faster and better cross-border transactions of funds. Blockchain can have
a transformative impact on how cross-border payments are conducted,
augmenting and reshaping entire financial infrastructures of countries.
lOMoAR cPSD| 22516561

The financial ecosystem needs to be looking at implementing thoughtful


regulations that can encourage innovative solutions for cross-border
payments. At the same time, any implementation of blockchain technology
should be done responsibly, with a careful amount of deliberation over the
security, risk and stability of cross-border payments solutions. This is the
right way on how financial institutions and policy makers can reap
maximum benefits with blockchain.

Blockchain and KYC (Know Your Customer)


KYC is a process by which banks obtain information about the identity and
address of the purchasers. It’s a regulator governed process of performing
due diligence for verifying the identity of clients. This process helps to
make sure that banks’ services aren’t misused. The banks are responsible
for completing the KYC procedure while opening accounts. Banks also
are required to periodically update their customers’ KYC details. KYC may
be a manual, time-consuming, and redundant across institutions. Sharing
KYC information on Blockchain would enable financial institutions to
deliver better compliance outcomes, increase efficiency, and improve
customer experience.

KYC processes are the backbones of a financial institution’s anti-money


laundering efforts. Find out how businesses are revolutionising the long,
tiresome process. Know Your Customer or KYC processes are the
backbones of a financial institution’s anti-money laundering efforts.
According to current estimates, the amount of KYC spending rose to up
to $1.2 Billion in 2020 on a global level.

With a whopping amount as this being spent on making KYC processes


better, it is easy to assume that the process would be unhackable and
lOMoAR cPSD| 22516561

issues-free. But inspite of the importance of the process, KYC continues


to operate inefficiently. Clenched by labor-intensive and time-consuming
tasks, the high scope of effort duplication, and the risk of error, it is
estimated that 80% of KYC efforts go on gathering information and
processing while only 20% of efforts are assessing and monitoring
focused.

Key Problem Areas and Solution Benefits


1. Redundancy: Most large files use similar data and processes to
verify an equivalent client. The solution benefit is to eliminate
the redundancy documentations that got to be verified only once
before the approval information is shared.
2. Inefficiency: Manual and time-consuming process to collect and
verify documentary evidence. The solution benefit is to extend
automation where documents and approvals are digitized and
may be verified without manual intervention.
3. Lack of specificity: Requirements for due-diligence are often
fuzzy, creating uncertainty on compliance to avoid legal
sanctions. The solution benefit is to standardize process i.e.
standardized, automated KYC processes sanctioned by the
regulators.

The Idea Behind Blockchain and KYC


Each company has to verify your identity somehow, and it’s particularly
important for financial institutions. From this ‘know your customer,’ or KYC
protocols was the rise to assist companies to ensure they know who
they’re doing business with. Typically, this involves an extended, drawnout
lOMoAR cPSD| 22516561

practice where certain documents are shown, and a few kinds of


background checks or verification takes place.

KYC Blockchain Implementation

In the traditional KYC system, each bank will conduct its identity check i.e.
each user is checked individually by an individual organization or
government structure. Hence, there is a waste of time for checking each
identity from scratch.

The blockchain architecture and the DLT allow us to collect information


from various service providers into one cryptographically secure and
unchanging database that does not need a third party to verify the
authenticity of the knowledge. It makes it possible to form a system where
the user will only need to undergo the KYC procedure once to verify
his/her identity.

The process is as follows:

1. For KYC procedure a user submits documents to one of the


banks where he wants to take a loan or use another service.
2. Individual participants are responsible for collecting personal
data(banks, government agencies, companies, or users
themselves) and stored in a decentralized network.
3. The bank checks and confirms the passage of KYC if everything
is normal.
4. The bank is responsible for entering the data about the user into
the blockchain platform, to which other banks, organizations and
state structures have access. All parties can control and regulate
the KYC process. The system will monitor changes and updating
of the user data, and if someone breaks the rules, it will become
known to all parties.
lOMoAR cPSD| 22516561

5. When a user wants to use the services of another bank, this


second bank accesses the system and thus confirms the user’s
identity.
6. The access to user data will be based solely on its consent. The
user must log in with cryptocurrency transactions i.e. use the
private key to initiate the information exchange operation.

Benefits of Blockchain implementation

Distributed data collection

The introduction of blockchain in KYC brings data on a decentralized


network which can be accessed by parties after permission has been
given to them. Moreover, the system offers efficient data security since the
data can only be accessed after permission has been given by the users,
thus eliminating instances of unauthorized access.

Better operational efficiency

The abilities like an unhackable digital process and sharing user


information on a permissioned network can massively lower the effort and
time needed in the early stages of KYC. This, in turn, expedites the
customer onboarding time and lowers the regulatory and compliance
expenses.

Validation of information accuracy

KYC Blockchain systems enable transparency and immutability that, in


turn, allows financial institutions to validate the trustworthiness of data
present in the DLT platform. The decentralized KYC process acts as a
lOMoAR cPSD| 22516561

streamlined way for gaining secure and swift access to up-to-date user
data.

Real-time updated user data

Every time a KYC transaction is performed at a financial institution, the


information is shared within a distributed ledger. This Blockchain
technology KYC systems enable other participating institutions to access
real-time updated information with a guarantee that every time there’s a
new addition in the documents or there are any modifications, they’ll be
notified.

Is Blockchain Development Solutions the Answer to KYC Issues?


Gathering information and processing it takes up a great amount of cost,
time, and effort in the KYC process leaving very few resources available
for monitoring and assessing user behavior for anomalies. By offering
speedy access to up-to-date data, blockchain technology in KYC can
lower the time needed for the laborious tasks, which, in turn, can be
employed to find solutions to more complex KYC challenges. However,
blockchain cannot solve all the issues faced by KYC. After the data is
acquired, financial institutions still have to validate the information. For
this, AI and cognitive processing-like technologies have to be employed
for greater efficiencies. In its present state, blockchain when used in
combination with other technologies can showcase high potential to help
institutions lower the cost and time linked with the KYC process.
Blockchain in Agriculture and Food Security

With global-scale food systems such as seafood, nearly 40 per cent of


which is traded globally, data transparency and traceability through
lOMoAR cPSD| 22516561

technologies like blockchain are important for socially and environmentally


conscious decision making and to facilitate trust among stakeholders.

Global food supply chains proved brittle during the COVID-19 pandemic,
leading for calls to boost the resilience of global food supply chains
through improved efficiency in production, distribution and consumption of
nutritious food. How could technologies like blockchain that provide data
to producers, distributors and consumers be part of the solution? Big data
applications may present opportunities to address inefficiencies from farm
to table and improve global food security.
Blockchain, a linked decentralized database that stores auditable data
throughout entire supply chains, may change the game for food producers
across the globe.

With global-scale food systems such as seafood, nearly 40 per cent of


which is traded globally, data transparency and traceability through
technologies like blockchain are important for socially and environmentally
conscious decision making and to facilitate trust among stakeholders.

Blockchain agriculture means the use of blockchain in the agricultural


sector to improve the operating process and get profitable results. The
use of blockchain in the agricultural sector ranges from having a
sustainable business and reduction of waste, to informed consumer
purchasing decisions, to having smooth future transactions with fraud
elimination. There is a new term that has surfaced in the marketplace,
Smart Agriculture. Smart agriculture includes the utilization of natural
resources and the decrease of environmental impact through the
execution of ICTs (information and communication technologies),
lOMoAR cPSD| 22516561

blockchain, and other modern technologies for gathering and analyzing


data.

How it impacts in food security?

• Gathering information: Blockchain technologies can be used to


consolidate information on the quality of the seed, track how crops
grow and record the journey once it leaves the farm. In Canada, for
example, Grain Discovery - an online blockchain marketplace - is an
example of data being leveraged by those involved in the food
system to grow and market globally competitive crops.
The data could enhance transparency in supply chains by providing
immutable records from production to consumption. Such data have
the potential to facilitate information transfer throughout every step
of the supply chain. And if blockchains are implemented with proper
validation, it can prevent illegal and unethical production and
distribution that undermines sustainability and community food
security.

This transparency also means consumers could make informed


decisions to protect vulnerable producers and the environment.
Access to product data may allow consumers to reward producers
who employ good practices, such as rural smallholder farmers and
fishermen who are among the most food-insecure groups.

• Tracking pathways: Currently, there is little evidence supporting


the claim that blockchain and big data technologies are contributing
to global food security. Even though the average farm is projected
to generate 4.1 million data points by 2050, up from 190,000 data
lOMoAR cPSD| 22516561

points in 2014, increases in global food security have not been


impressive.
Part of the challenge is how blockchains have been implemented
until now. The corporate control of blockchains and big data
platforms could even undermine food security. For example, IBM
and Walmart have teamed up to track produce from farm to fork.
Producers and processors along the supply chain are required to
input information into IBM’s blockchain for the process to be entirely
transparent to consumers.
Traditional blockchains are decentralized and democratized in order
to ensure trust between users. Corporate control of supply chain
information could also leave out small-scale farmers that lack the
required size, scale and technological know-how to participate. This
division between large and small food producers can contribute to
global food insecurity, and many researchers believe that small, as
well as large farms, are required to feed the world’s growing
population.

• Data and Food futures: Before blockchain and other data


technologies can help address food security, a number of
challenges need to be addressed.

The implementation of blockchains must be be decentralized to


include small farmers and rural people. This will enable sustainable
and equitable food systems and allow consumers to make informed
decisions.

However, as blockchains place additional responsibility on the end


users, challenges such as limited digital literacy among the world’s
lOMoAR cPSD| 22516561

poor and infrastructure constraints may undermine true


decentralization.

Also, they must be integrated into broader food security promotion


strategies to make them sensitive to social and environmental
values critical to tackling food insecurity among diverse groups.

The untapped potential of harnessing big data through a transparent


and decentralized food distribution system may support sustainable
food production and provide accountability for food production.

This is crucial for efficient food systems and food security in the
future. But it is important that these innovations are deployed
equitably so that all stakeholders along the value chain may benefit.

• Food Inventory Management: Truth be told, many food


organizations aren’t prepared to utilize cutting edge technology to
deal with their inventories. This is actually leading to wastage of the
produce and the resources. Also the losses are borne by farmers.
Thus, this is a huge burden for the farmers, as they don’t have the
required tools to manage the issue. The use of blockchain
technology here can change that situation for great. Blockchain in
inventory management can help farmers by monitoring the storage
climate and inform you when produce will expire. In this way, you
can take legitimate measures.

Blockchain in Mortgage Industry


The mortgage industry is a relatively slow-paced industry when it comes
to its various stages and processes. There’s a lot of friction between each
stage that makes it cumbersome to issue a loan. However, with the advent
lOMoAR cPSD| 22516561

of blockchain technology, the industry has been revolutionized to quite an


extent.

Blockchain technology is rapidly penetrating several industries such as


finance, fashion, pharmaceuticals, and more. It can do so because of its
efficient functioning structure that makes processes simpler, faster, and
more reliable. Blockchain technology is acting as the fundamental
framework upon which businesses are building their processes. The
mortgage industry, being one of the slower sectors, has immense scope
for improvement. Blockchain can cause this improvement by paving the
way for a digital mortgage.

The US mortgage system is primed for rapid process and technology


change, driven by shifting demographics, rising consumer expectations,
technological innovations, increased regulatory expectations, and
outdated legacy infrastructure. Collectively, these factors require
homebuyers, governments, and real estate and mortgage-related
companies to reimagine US housing finance and homeownership. In
response to these trends, digital mortgage, and housing finance solutions
are forming across the US at unprecedented speed and scale.

Role Of Blockchain In The Mortgage Industry

Conventional Mortgage Process

In a conventional scenario, there are several steps involved while getting


a mortgage. First and foremost, one has first to be eligible to apply. They
then have to fill an application which will later be verified. Once all this
has taken place, and it all goes right, a loan would be approved and
sanctioned. This is a long process that easily takes about a month to
two. During this, several actors are involved at various stages, which
lOMoAR cPSD| 22516561

gives room for many inefficiencies and risks. There’s a lot of time taken,
there’s a risk of improper documentation, and since it is all manually
done, there’s a lot of room for human error. These challenges can be
solved using blockchain.

Mortgage Process Using Blockchain

One will first fill an application which will become a block. The application
will be verified by not one person/authority but several nodes. After the
verification, this said application will be added to the chain. The person
will then need to sign and accept this loan, following which funds would
be transferred to them from the entity supplying it. So, a process that takes
at least 30 days will finish in a matter of days and is made entirely digital.
Thus using blockchain tech as the base framework, mortgage software,
and consumer lending software can be developed.

Benefits Of A Digital Mortgage

1. Better record keeping: Each step of the process is stored as a


record, and these records are on a decentralized ledger. This means
there’s no one central hub that manages it all. Thus, there’s proper
proof of all the actions that is quite difficult to tamper with. So, it
becomes easier to verify all actors such as the loan borrower, the
seller, and entities that approve the loans.
2. Cost efficiency: It becomes relatively economical for one to get a
mortgage compared to the conventional process, where they’d have

to pay a third party to streamline the process. Here, they can do it


all on their own, without any intervention from an outsider.
3. Instant Settlements: Usually, transferring funds takes time. With
this, the person will get their funds right away without having to wait.
lOMoAR cPSD| 22516561

4. Smart Contracts: A smart contract is a set of rules that are


automatically set in motion when an event occurs. It can be applied
in the verification and approval process such that the rules are
initially fed along with criteria. If the application follows these rules
and meets the criteria, it is approved, else it’s not. This way, the
complete verification process can be executed automatically instead
of manually carried out by multiple actors.

Blockchain enabled Trade


The trade finance industry has emerged as a key focus area for realizing
the efficiencies of blockchain technology. Blockchain has the potential to
disrupt the trade landscape by making it easier to reduce disputes and
fraud to provide delivery and payment certainty, enable transparency of
trade asset movement, and facilitate the flow of trade receivables. The
result: increased collaboration, automation and oversight in trade
transactions. Trade finance by banks and other financial institutions is a
vital function in international commerce, as it provides delivery and
payment assurance to buyers and sellers, and it helps close the trade
cycle funding gap for these parties. The growth and sustenance of the $16
trillion international trade market depends on the easy availability and
robustness of financing mechanisms. For this reason, trade finance is
often described as the fuel for global commerce.
Blockchain enables data to be recorded in a secure digital format by
providing real-time information on transactions between different parties,
be they corporations, supplier networks, investment pools, or an
international supply chain. It provides all parties with a record that is
lOMoAR cPSD| 22516561

secure, encrypted, transparent, easy to access, and impossible to tamper


with. Although blockchain emerged within the financial system with the
launch of cryptocurrency Bitcoin, today it is used in a wide range of
activities, including ones that are directly or indirectly related to foreign
trade. The long value chain tied to international trade includes vast,
complex areas like logistics, transportation, customs administration,
financing, and administrative procedures between firms, all of which could
be streamlined by adopting this technology.

Blockchain optimizes processes, makes goods traceable, guarantees the


security of payments and financing, facilitates the verification of digital
quality and origin certifications, enables real-time sharing of information
on the different stages of trade, and helps improve how related public and
private services operate, among other benefits. Blockchain provides
solutions for trade operations by simplifying cross-border trade,
contributing to competitive improvements, and reducing transaction costs.
Although blockchain has been used within foreign trade for several years,
its significance has increased since the start of the COVID-19 health crisis
and it is expected to play an even more prominent role in the
postpandemic world.

Benefits of blockchain enabled trade

1. Lower risk and operational costs: Quickly process credits and


guarantees electronically, gain deep insights into client financial
positions and transaction histories, and monitor transactions from
start to finish.
lOMoAR cPSD| 22516561

2. Find new opportunities and markets: Discover revenue


opportunities through a new class of transparent, risk-mitigated and
standardized trade finance and trade credit insurance solutions.
3. Establish leadership in a new era of trade: Foster greater trust
and transparency in cross-border trading. Enjoy first-mover
advantages by convening new trade networks and creating new
trading hubs.
4. Leadership in trade facilitation: We’re reinventing complex trade
processes to help start, accelerate and innovate blockchain
networks — including the successful production development of
we.trade, now comprised of 15 banks across Europe.
5. Trusted business expertise: IBM knows trade and trade
processes, complex systems integration, regulated industries, and
— with 500+ client engagements to date — how to unlock
blockchain value. We provide the entire stack to run your business.

Blockchain in Trade Finance


Trade finance serves as the lifeblood of international trade in goods and
services by enabling transactions between buyers and sellers worldwide.
Trade finance provides the credit, payment guarantee, and insurance
needed to facilitate the transaction on terms that would satisfy all parties.
One of the difficulties involved with trade finance is the large volume of
paper documents that make up much of the information flow between
trading parties.
Most of the trade finance activities involve a substantial amount of physical
paperwork being shuffled back and forth between the importer, exporter,
lOMoAR cPSD| 22516561

importer’s bank, exporter’s bank, shipping company, receiving company,


local shippers, insurers, and others. This reliance on documents usually
has drawbacks, including the cost and time required to prepare, transmit,
and check these documents. Paper documents may also be open to errors
and even forgery.

Furthermore, the COVID-19 outbreak has impacted different trade finance


steps, including deal origination and distribution, negotiable instruments,
document transmission, authorized signatures, and shipping. Nowadays,
several banks and financial institutions worldwide are trying to quickly
scale their digital initiatives to move toward a world where digitalization is
central to every interaction. Banks are looking to utilize technology to
streamline trade by creating digital ecosystems that reduce costs and
increase trade finance efficiency by replacing paper with digital data flows.
The International Chamber of Commerce (ICC) survey conducted in April
2020 indicated that banks are focusing on the rapid adoption of
blockchain, the digitization of documentation, and automated processing
and handling software in response to the COVID-19 pandemic.

How trade finance works?

Trade finance could be understood by the following example. Let's


assume that there is a company named MHW in India and this company
wants to import a certain number of goods from a supplier company that
is located in the United States. Let's name this supplier company as SSI.
Now to import the goods the company MHW needs to pay for the goods,
but it wants to make sure that the goods should arrive as ordered and thus
is hesitating in processing the payment. Now on the same hand, the
lOMoAR cPSD| 22516561

exporter is also hesitant to ship the goods, without being certain that the
payment will arrive for the goods they supply.

Now at this step, the banks get involved to solve the issues faced by the
importer and exporter company. The importer's bank issues a letter of
credit to the exporter via the exporter's bank and promises to pay the
required amount once the exporter bank provides the valid documents
proving the ordered goods have been loaded to the ship or any other
means of transport. Thus the involved banks ensure that the trust is being
built between the importer and exporter parties by holding the money for
each party.

Benefits of Blockchain in Trade Finance

The key benefits of blockchain technology in trade finance is that it can


reduce processing time, eliminate the use of paper, and save money while
ensuring transparency, security, and trust. Removing intermediaries from
the process removes the risk of manipulation by the participants in the
process.

Here are some major points demonstrating the advantages of blockchain


in trade finance:

• Efficiency: Blockchain technology makes the trade finance process


more efficient by completing the transactions directly between the
relevant parties with no intermediary and with digitized information.
With blockchain, the parties can operate smart contracts that trigger
commercial actions automatically. This allows to dramatically
lOMoAR cPSD| 22516561

streamline trade finance processes, thereby cutting costs and


increasing the transaction speed.

• Traceability: With blockchain technology, the importers and


exporters can track goods and assets and where they are currently
residing. Also, related asset information can be received from the
previous and pass on to the new owner for possible action. This
allows new financing opportunities and can improve the perfection
of an interest in the trading of goods. This is considered one of the
main benefits of blockchain in trade finance.

• Transparency: Blockchain, being a distributed ledger technology


can record multiple details of the transactions against commercial
agreements and can distribute the data to improve further trust. This
allows reducing the risk of tampering the records and offers more
options for financing trade.

• Auditability: Utilising Blockchain each trade finance transaction


can be recorded sequentially and indefinitely. This provides a lasting
audit trail for the life of the traded asset as well as better verification
of assets authenticity with a reduction of compliance costs.

• Security: Each transaction within the trade network is verified using


independently verified cryptography. The encryption and
cryptographically protected keys securely transmit data between
different financial institutions and thus privatize the data.
lOMoAR cPSD| 22516561

Blockchain in supply chain finance technology


Supply chain finance and blockchain technology is revolutionizing
businesses around the world. As businesses expand, they build new
domestic and global ties to strengthen their procurement process and find
more affordable yet better solutions. While this bodes well for buyers’
balance sheets, it can trigger working capital concerns. Valuable capital
may get locked into supply chains, forcing businesses to scramble for
solutions.

Supply chain finance is a creative way out that can help buyers as well as
their suppliers. Using a supply chain finance provider, buyers can pay their
suppliers early and lengthen their payment terms. Besides assisting
buyers in optimizing their working capital, supply chain finance also
provides an affordable way for suppliers to get cash.

However, despite these features, supply chain finance does not solve
everything. For instance, it is usually reserved for the top suppliers. Small
and medium-sized enterprises are left out, which is unfair as they could
benefit significantly from early payments.

Fortunately, the relevant stakeholders are aware of these problems and


have looked at different tools to improve supply chain finance. Many
proposals have been presented, but none look better (at least right now)
than using blockchain to enhance supply chain finance.

How can blockchain improve supply chain finance?

The intersection of supply chain finance and blockchain technology has


remarkable benefits for the relevant stakeholders. Some of these include:
lOMoAR cPSD| 22516561

It increases authenticity in the supply chain

Supply chain finance is a massive web involving many stakeholders. From


buyers to suppliers and intermediaries, there are many interested parties,
and the exchange of information is not always transparent. Each
stakeholder may prioritize their needs over others, triggering delays in the
supply chain.

Blockchain can solve this problem. Copies of the same digital ledger,
which keeps the records in the network, are distributed among the
stakeholders, who have access to the same information. The immutability
of blockchain prevents confusion and ensures transparency and
authenticity in the network. It can enhance supply chain management and
smoothen the supply chain.

Brings inclusivity to the ecosystem

The existing supply chain finance ecosystem has shortfalls, especially


regarding financial inclusion. Supply chain financiers usually offer to fund
buyers’ top 10 to 50 suppliers, leaving behind many small and
mediumsized enterprises. This is unfair, as smaller suppliers can benefit
more from early payments through buyer-led supply chain finance than
larger counterparts.

Blockchain technology has the potential to address this issue and make
supply chain finance available to everyone. The nature of the blockchain
network can allow supply chain finance providers to fund invoices sent by
all the suppliers.Every transaction and information exchange is recorded
on the ledger, so finance providers do not have any reason to limit
financing to only the top suppliers.
lOMoAR cPSD| 22516561

Redefines financiers in the supply chain

Financial institutions are generally the financers in buyer-led supply chain


finance. They are the ones that make the invoice payments to the
suppliers. Buyers pay them back through a repayment plan consisting of
the borrowed sum along with a small fee and interest.

While financial institutions will remain relevant in buyer-led supply chain


finance, blockchain could open up the system to other stakeholders in the
ecosystem. Corporate foundations and individual investors could also
participate in supply chain finance and earn returns on their investment.
Platforms like CredSCF are already using blockchain to allow different
financiers to leverage supply chain finance to earn returns.

Enhances the functioning of the supply chain

Information exchange is always an issue when there are many parties


involved. Supply chain finance has suffered from the same ailment.
Information inaccuracy is, in fact, one of the significant reasons why
supply chain finance has struggled to solve the age-old issues in the
supply chain.

However, using blockchain technology in supply chain finance might be


the answer. The digital, immutable ledger can keep track of information
exchange, asset transfer, product quality, and timelines to smoothen the
supply chain. It can reduce lags in the system, saving money and time for
all the stakeholders.
lOMoAR cPSD| 22516561

Blockchain in identity management

Also known as “identity and access management”, or IAM, identity


management comprises all the processes and technologies within an
organisation that are used to identify, authenticate and authorize someone
to access services or systems in that said organisation or other associated
ones.

Examples of this would range from customers and/or employees


accessing software or hardware inside a company/enterprise – and the
level of access, privileges and restrictions each user has while doing so –
or, in a governmental setting, the issuing and verification of birth
certificates, national id cards, passports or driver’s licenses (that allow a
user/citizen to not only prove his identity but also access services from the
government and other organisations).

The problem with current Identity Management Systems

Identity has a problem. If it’s paper-based, such as birth certificates sitting


idly in a basement of a town hall, it’s subject to loss, theft of fraud. A digital
identity reduces the level of bureaucracy and increases the speed of
processes within organisations by allowing for a greater interoperability
between departments and other institutions. But if this digital identity is
stored on a centralised server, it becomes a target for hackers. Since 2017
alone, more than 600 million personal details – such as addresses or
credit card numbers – have been hacked, leaked or breached from
organisations. Most of the current identity management systems are weak
and outdated.
lOMoAR cPSD| 22516561

Identities need to be portable and verifiable everywhere, any time, and


digitization can enable that. But being digital is not enough. Identities also
need to be private and secure.

Several industries suffer the problems of current identity management


systems:

• Government: The lack of interoperability between departments and


government levels takes a toll in the form of excess bureaucracy.
Which, in turn, increases processes’ times and costs.

• Healthcare: half of the world’s population does not have access to


quality healthcare. The lack of interoperability between actors in the
healthcare space (Hospitals, clinics, insurance companies, doctors,
pharmacies, etc) leads to inefficient healthcare and delayed care
and frustration for patients.

• Education: It is estimated that two hundred thousand fake


academic certificates are sold each year in the USA alone. The
difficulty in verifying the authenticity of these credentials leads to
hiring of unqualified professionals, brand damage to the universities
and the hiring companies.

• Banking: the need for login details such as passwords decreases


the security of banking for users.

• Businesses in general: the current need to store clients’ and


employees’ personal data is a source of liability for companies. A
personal data breach may result in huge fines due to GDPR
infringement – such as the British Airways case – or simply due to
lOMoAR cPSD| 22516561

customer trust loss and consequential damage to the organisation’s


brand.

How Blockchain brings privacy and security to Identity


Management

Through the infrastructure of a blockchain, the verifying parties do not


need to check the validity of the actual data in the provided proof but can
rather use the blockchain to check the validity of the attestation and
attesting party (such as the government) from which they can determine
whether to validate the proof.

For example, when an identity owner presents a proof of their date-


ofbirth, rather than actually checking the truth of the date of birth itself, the
verifying party will validate the government’s signature who issued and
attested to this credential to then decide whether he trusts the
government’s assessment about the accuracy of the data.

What are the challenges that exist in the traditional identity


management system?
The present identity management system faces the following four major
challenges:
1. Identity theft

2. Combination of usernames and passwords

3. KYC onboarding

4. Lack of control
lOMoAR cPSD| 22516561

Identity theft
People share their personal information online via different unknown
sources or services that can put their identification documents into the
wrong hands. Also, as online applications maintain centralized servers for
storing data, it becomes easier for hackers to hack the servers and steal
sensitive information. According to the Breach Level Index, 4,861,553
records are stolen every day, accounting for:
• 202,565 records every hour

• 3,376 records every minute

• 56 records every second

The breach statistics indicate how quickly a hacker can steal personal or
other confidential information.

A combination of usernames and passwords


While signing up on multiple online platforms, users have to create a
unique username and password every time. It becomes difficult for an
individual to remember a combination of usernames and passwords for
accessing different services. Maintaining different authentication profiles
is quite a challenging task.

KYC Onboarding
The current authentication process involves three stakeholders, including:
• verifying companies/KYC companies

• users

• third parties that need to check the identity of the user


lOMoAR cPSD| 22516561

The overall system is expensive for all these stakeholders. Since KYC
companies have to serve requests of different entities such as banks,
healthcare providers, immigration officials, etc., they require more
resources to process their needs quickly. Therefore, KYC companies have
to charge a higher amount for verification, which is passed to individuals
as hidden processing fees. Moreover, third-party companies have to wait
for a long time to onboard the customers.
A global survey of “Know Your Customer” challenges found that global
annual spending on KYC is estimated as the US $48million.

Lack of Control
It is currently impossible for users to have control over personally
identifiable information (PII). They do not know:
• how many times PII has been shared without their consent

• where all their personal information has been stored

As a result, the existing identity management process requires an


innovative change. Using blockchain for identity management can allow
individuals to have ownership of their identity by creating a global ID to
serve multiple purposes.
Blockchain offers a potential solution to the above challenges by allowing
users a sense of security that no third party can share their PII without
their consent. By using blockchain:
• a platform can be designed to protect individuals’ identities from
breaches and thefts

• people can be free to create self-sovereign and encrypted digital


identities • the need for making multiple usernames and passwords
can be removed
lOMoAR cPSD| 22516561

Now, let’s understand how could Blockchain Identity Management


work
Currently, people need the right way to manage their identity than
paperbased documents. The app for Blockchain Identity management will
help people to verify and authenticate their identity in real-time.

Step 1: Installation of Mobile App


An individual will first have to download the mobile app from the play store
or app store to establish his/her identity.
After downloading the app in mobile phones, a user will create a profile on
the app.
Once the profile is created, the user will get the unique ID number, which
will help organizations access the user’s identification documents.

Step 2: Uploading the documents


After the user gets ID number, they need to upload the government-issued
IDs on the app that will be saved in the IPFS with hashed addresses stored
in the blockchain.
The app will extract the personal information from these IDs to do
selfcertification of his/her details.
The user will own their data. It helps users decide the information to be
shared with organizations. Without the user’s consent, no data can be
shared with any identity seekers.
lOMoAR cPSD| 22516561

Step 3: Smart contracts generating trust score of the person


Suppose there is a score that determines the trustworthiness of a person.
Smart contracts containing the business logic can generate a trust score
for a user from the information provided by them while creating a
selfsovereign identity.
Step 4: Third-party companies requesting access
Every time any company will have to access specific details of a person
for authentication purposes, a notification will be sent to the individuals
owning the identity.
Once the user allows the companies to access their details, third parties
can use the identifiable information for authenticating a person. Also,
individuals will be able to trace the purpose for which their PII has been
used.
Blockchain does not store the user’s data or information. Instead, the
transactions made between identity holders and companies will only be
recorded on the blockchain.

For example, if an immigration authority verifies the person’s identity via


an app, then that transaction will be added on the blockchain and visible
to all the connected nodes.
Let’s discuss the example in more depth.
Suppose a person named Alex needs to authenticate himself to apply for
study abroad programs. Thus, the education center can validate his
identity quickly because of the blockchain-enabled identity management
app.
Alex will provide the unique ID number to the center, enabling them to
submit the request for accessing information. After he validates the
request, the education hub can check his documents, and the transaction
will be recorded on the blockchain.
lOMoAR cPSD| 22516561
lOMoAR cPSD| 22516561

Blockchain Ch4
lOMoAR cPSD| 22516561

BLOCKCHAIN NOTES (CH-5)

Blockchain Application Development


A blockchain is a decentralized digital ledger that saves transactions on
thousands of computers around the globe. These are registered in a way
that inhibits their subsequent modification. Blockchain technology
increases the security and speeds up the exchange of information in a
way that is cost-effective and more transparent. It also dispenses with third
parties whose main role was to provide a trust and certification element in
transactions (such as notaries and banks).

The high importance of blockchain has attracted the attention of


organizations in different sectors, with banking sector being the most
active at this stage. Blockchain has resulted in the development of
thousands of new job positions and new startups ranging from mobile
payment solutions to health care applications.

Whether you need a prototype or a production-ready platform, our


engineering team’s deep experience in cryptocurrency, data science, and
serverless computing can help you leverage the benefits of blockchain.
We will evaluate potential blockchains for your project, including
Ethereum, Hyperledger, EOS, NEO, Tezos, and Qtum, and choose the
best fit, like when to use private permissioned blockchains such as
Quorum.

Our Engineering Capabilities Include:

• Blockchain deployment and development with web3, solidity,


cakeshop and truffle.
• Smart contracts and custom dapp frameworks like OpenZeppelin.
lOMoAR cPSD| 22516561

• Application and data science engineering using Python.

• Enterprise native mobile apps with Swift and Objective-C.

• Web platforms using Phoneix / Elixir and serverless architecture.

Blockchain Software Development Platforms

While there are more than 25 platforms for building blockchain solutions,
the top blockchain platforms that are commonly
considered for blockchain/DLT development are:-
1. Ethereum: It is an open-source and public platform (and operating
system) taken into consideration for blockchain dApp development
and ICOs with smart-contract functionality. Unlike bitcoin, it is
flexible and adaptable – making it the first choice for every
blockchain app development company for building a blockchain app.
2. EOS: The aim of EOS platform is to offer smart contract capability,
decentralized application hosting, and decentralized storage of the
enterprise solutions which solves the scalability issues found in
Blockchains such as Ethereum and Bitcoin, along with eliminating
all the fees incurred by the users.
3. Multichain: It is a platform that empowers blockchain app builders
to create and deploy private blockchain solutions to be used within
or between multiple organizations.
4. Liquid Apps: The name behind DAPP Network recently launched
DSP 2.0 to make the platform a lot more flexible and powerful. They
are capable of supporting a range of dApps creation.
5. Hyperledger: It is an open-source platform used to create advanced
blockchain software development solutions. For example, building
lOMoAR cPSD| 22516561

blockchain solutions based on IoT, creating blockchain apps for


supply chain management, etc.
6. IOTA: It is an open-source DLT based solution used for providing
faster and secure payment services between connected IoT
devices. This platform uses directed acyclic graph (DAG)
technology and offers unique characteristics, like free transactions
no matter what the size of the transaction is, faster confirmation
times, handling of unlimited transactions at a time, etc. which makes
it the ideal platform for building payment systems.
7. Quorum: It is an open-source DLT and smart contract platform
based on Ethereum.

Blockchain is also widely integrated in P2P payment applications for safe


cashless transactions.

Factors to Consider for Blockchain App Development

1. Nature of Platform: While some blockchain platforms are


cryptocurrency based, others are relying on smart contracts or using
more than one crypto token. Determining which type is apt for you
will make the Blockchain applications development process easier.
2. Smart Contracts: The second thing you need to pay attention to is
to determine if you need a smart contract or not. A Smart contract,
as you might know, is a self-executing protocol that processes,
validates or enforces any trigger-based action stored on the
blockchain system.
3. Consensus Protocol: Different blockchain development platforms
work upon different consensus protocol, including Proof of Work,
lOMoAR cPSD| 22516561

Proof of Stake, Proof of Elapsed time, Proof of Burn, etc. So,


identifying the right platform on the basis of consensus protocol is
also favorable situation.
4. Cryptocurrency: The next thing that you need to consider when
answering How to develop a Blockchain app is whether you need
the use of cryptocurrencies in your mobile application or not also
plays a pivotal role in finding the right platform.
5. Public/Private Network: Ask yourself what kind of network you
want – one where all are free to make changes or the one where
authorized users only can participate. Based on the decision,
choose the platform and start creating your own blockchain
application.
6. Adoption Rate And Functionality: It is vital to look into the
Adoption rate and Community Support level for a current blockchain.
Adoption rate means the degree of implementation that a specific
blockchain innovation has gotten. Picking a technology that has
been exceptionally embraced and adopted is a smart choice than
picking one with a poor adoption level.
7. Scalability: Those hoping to build blockchain platforms off of
existing innovation should take a gander at the transaction capability
and decide whether their requirements will be met. When taking
consideration into blockchain scalability three central points are
thought of: speed, security, and decentralization. This is known as
the Scalability Trilema and points to the fact that any developer can
hope to get, at best, two out of three characteristics.

Languages to Consider for Blockchain Development


There are various programming languages that can be considered while
blockchain application development. You can either begin with traditional
lOMoAR cPSD| 22516561

programming languages like C++, Python, Go, and Java, or turn towards
the advanced blockchain-specific languages like Simplicity and Solidity.

1. Simplicity: Simplicity is used for smart contracts blockchain


development. The language is easy, employs static analysis, and
can be seen as an improvement of the basic cryptocurrency
languages like Ethereum Virtual Machine (EVM) and Bitcoin Script.

2. Solidity: Solidity is a statically-typed blockchain development


language used particularly for building smart contracts that run on
the EVM. With this language, you can easily implement
selfregulated business logic in smart contracts, leaving a
nonrepudiable and authoritative record of transactions.

Blockchain Development Process


The blockchain development process consists of the following six stages:
1. Identify the Goal

2. Choose the right Blockchain Platform

3. Brainstorming and Blockchain Ideation

4. Proof of Concept

5. Visual and Technical Designs 6. Development

Let’s discuss these stages in detail.

In this section, we have explained the process of building a


blockchainbased application. Let’s understand how to start with
blockchain app development and what steps are required to develop an
app successfully.
lOMoAR cPSD| 22516561

1. Identify problems you want to solve with blockchain


First of all, it is essential to develop a problem statement and understand
all of the issues you want to solve with a proposed solution. Ensure that
the blockchain solution will benefit your business abilities. Analyze
whether you need to migrate your current solution to the blockchain, or
you require a new application to be developed from scratch.
For example, suppose you are a healthcare provider who wants to develop
a blockchain-based health record exchange app. In that case, you should
know various use cases of the applications and what benefits they will
offer to users.
Once you decide that you need a blockchain solution for your business
operations, the next step is to select the right blockchain platform and
blockchain development tools for your project.

2. Choose the right blockchain platform


As mentioned above in the article, building a blockchain from scratch
requires thorough research and takes months to years to develop
successfully. Therefore, you should build a blockchain app on top of a
blockchain platform that meets your business requirements. You should
identify the right blockchain platform for your application based on the
factors like consensus mechanism and problems you want to solve. For
example, you can build an Ethereum-based application to develop a
decentralized public application with smart contracts. When the
blockchain platform is identified, you must do a brainstorm and understand
the exact business needs.
3. Brainstorming and blockchain ideation
Once you identify the platform for developing a blockchain application, you
should focus on drafting business requirements and brainstorming ideas.
lOMoAR cPSD| 22516561

Find what technology components should be added to the blockchain


ecosystem as off-chain or on-chain entities. Create a product roadmap
that will help you build an application within a decided deadline. You
should develop a blockchain model and conceptual workflow for the
blockchain application.
Also, decide if the application needs to be developed on a permissioned
or permissionless blockchain network. It would help if you also decided on
front-end programming languages, servers, and external databases at this
stage.

4. Doing a Proof-of-Concept
A proof of concept is done to represent the practical applicability of a
blockchain project. It can be either a design prototype or a theoretical
build-up. In Theoretical Build-up, each project requires theoretical cases
so that users could understand the applicability and viability of the product.
Proposals can be created to explain the project’s parameters. After
creating a theoretical build-up and receiving feedback, a prototype is
designed, which includes:
• sketches

• mockups

• tested product

• designs

•information architecture
When the client approves the PoC, the next step is to prepare technical
and visual designs for the application.
lOMoAR cPSD| 22516561

5. Visual and Technical Designs


Since you have planned an entire application at this stage, start creating
UIs for each software component. Designs APIs that will be integrated with
user interfaces to run an application at the back-end. Visual designs are
created to give a look and feel to the application, whereas technical
designs represent the application’s technology architecture.
Once the admin consoles and user interfaces are designed, the
application gets ready for development.
6. Development
Development is the significant phase of the blockchain development
process, where you should be ready to build the blockchain app. In this
specific stage, you either have to develop or integrate APIs for particular
use cases of the application. The application is built under multiple
versions.
Firstly, an application that does not undergo formal testing is a pre-alpha
version of the app.
Once the client approves it, the application moves to the next stage, i.e.,
alpha, where the developers test the software with white-box techniques.
But, the software might not comprise all the features at this stage. After
the alpha version is released, the app is prepared for the beta version.
During Beta Phase, the software application has the complete feature set
but with some unknown bugs. Developers share the beta version with a
particular group of people outside the organization to test its
functionality.
Once the beta version is approved and tested, the application moves to
the Release Candidate version, an advanced beta version that is ready to
be a final application and can be launched.
lOMoAR cPSD| 22516561

After thorough testing, the application moves to the production phase and
gets ready for delivery.
Before an app goes live, you should deploy it on the test network to
carefully test its functionalities.
Administrators can also manage which versions of the app need to be
deployed to various resources with provisioning when deploying an
application.
Once an application is provisioned, it must be hosted on the main chain.
If your blockchain app is a hybrid solution, i.e., it contains both off-chain
and on-chain business entities, you need to deploy it on the cloud server
and app store/play store. The application should be able to upgrade
according to any new business needs and prioritization.
For instance, if you need to upgrade the smart contract, you should be
able to deploy the new contracts without any difficulty later on. Developing
and deploying an app does not mean you are done. Instead, a software
application needs to be maintained post-development to ensure that it
works with all types of upgrades in the future.

How long blockchain development takes?


lOMoAR cPSD| 22516561

The duration of a blockchain project depends on the application’s


requirements. The project is initiated with PoC, which typically takes 2-3
weeks. Once the PoC is done, it takes 4-5 weeks to develop a minimum
viable product with bare minimum features. Launching an application on
the main net takes around 2-3 months based on the requirements of a
client.

Hyperledger Fabric

What is Hyperledger fabric?


The Linux Foundation (the same corporation behind the Linux Operating
System) launched the Hyperledger blockchain initiative in December
2015. This project was established as a core for both the collaborative
production of fully accessible blockchain technology and distributed
ledgers.
Hyperledger Fabric is a modular blockchain framework that acts as a
foundation for developing blockchain-based products, solutions, and
applications using plug-and-play components that are aimed for use within
private enterprises.

Hyperledger Fabric is an open source, permissioned blockchain


framework, started in 2015 by The Linux Foundation. It is a modular,
general-purpose framework that offers unique identity management and
access control features, which make it suitable for a variety of industry
applications such as track-and-trace of supply chains, trade finance,
loyalty and rewards, as well as clearing and settlement of financial assets.
lOMoAR cPSD| 22516561

Because Hyperledger Fabric is private and requires permission to access,


businesses can segregate information (like prices), plus transactions can
be sped up because the number of nodes on the network is reduced.

What is the need for Hyperledger in Blockchain?


Hyperledger was founded to advance the discovery as well as the
adoption of cross-industry blockchain systems. It is backed by major
corporations such as IBM and many others across a wide range of sectors,
including finance, IoT, banking, industry, etc.

One thing to keep in mind is that Hyperledger was designed to assist and
stimulate the advancement of blockchain technology, not any particular
cryptocurrency.

Blockchains can transform online transactions by fostering faith,


openness, and trustworthiness, as per the Hyperledger webpage. It was
created solely to fulfill that ability. Around 100 companies, comprising
industry titans like Nokia, IBM, and Samsung, are part of the Hyperledger
blockchain, which meets every month to supervise the development of
prospective blockchain frameworks. This Hyperledger neither has any nor
will have its coin. It is a vital thing to keep in mind about Hyperledger.

This directly addresses Hyperledger’s purpose: developing robust


industrial applications using blockchain technology while remaining apart
from the digital currency creation process.

How Hyperledger Fabric Works


Traditional blockchain networks can’t support private transactions and
confidential contracts that are of utmost importance for businesses.
lOMoAR cPSD| 22516561

Hyperledger Fabric was designed in response to this as a modular,


scalable and secure foundation for offering industrial blockchain solutions.
Hyperledger Fabric is the open-source engine for blockchain and takes
care of the most important features for evaluating and using blockchain
for business use cases.

Within private industrial networks, the verifiable identity of a participant is


a primary requirement. Hyperledger Fabric supports memberships based
on permission; all network participants must have known identities. Many
business sectors, such as healthcare and finance, are bound by data
protection regulations that mandate maintaining data about the various
participants and their respective access to various data points. Fabric
supports such permission-based membership.

Example of Hyperledger Fabric


Suppose there's a manufacturer that wants to ship chocolates to a specific
retailer or market of retailers (i.e., all US retailers) at a specific price but
does not want to reveal that price in other markets (i.e., Chinese retailers).

Since the movement of the product may involve other parties, like
customs, a shipping company, and a financing bank, the private price may
be revealed to all involved parties if a basic version of blockchain
technology is used to support this transaction.

Hyperledger Fabric addresses this issue by keeping private transactions


private on the network; only participants who need to know are aware of
the necessary details. Data partitioning on the blockchain allows specific
data points to be accessible only to the parties who need to know.
lOMoAR cPSD| 22516561

The Architecture of Hyperledger Fabric System


In this part of the article, we will learn about the design of the Hyperledger
Fabric System.

Assets-
Assets can vary from the physical (property investment and equipment) to
the immaterial (software and trade secrets). By using the chain code
transaction process, Hyperledger Fabric allows users to alter assets. In
the Hyperledger Fabric system, assets are portrayed as a series of
keyvalue pairs, with state changes registered as exchanges on a ledger
path.
Binary and JSON representations are available for assets.

Chaincode-
Chaincode is the commercial concept software that defines one or multiple
assets and the transaction methods for managing the purchase (s). The
criteria for accessing or changing key-value pairs or any other dynamic
database entries are enforced by Chaincode. Chaincode operations are
started with a transaction idea and run against the ledger’s existing state
information. The implementation of Chaincode generates a collection of
key-value writes that can be sent to the system and implemented to the
ledgers of all users.

Ledger-
All value changes in the fabric are recorded in a sequential,
damageresistant ledger. Chaincode abstractions (‘transactions’) supplied
by interacting parties cause state shifts. Every transaction generates a
collection of asset key-value pairs that have been created, updated, or
deleted in the ledger.
lOMoAR cPSD| 22516561

A blockchain is used to store permanent, sequential records in blocks, and


a database file is used to keep track of the present fabric state. Each
channel has only one ledger, which performs an error handling check is
conducted before adding a block to guarantee that the conditions of assets
that were fetched have not altered since chain code processing time.

Security-
Hyperledger Fabric is the foundation of a transactional system in which all
members are acknowledged. Cryptographic licenses are related to
businesses, networking equipment, and application developers or client
apps via Public Key Infrastructure. As an outcome, data access
management on the system and channel stages can be regulated and
managed. In this way, it makes it secure.

Consensus-
Consensus has gradually been associated with a specific method within a
particular target in distributed ledger architecture. On the other hand,
consensus entails more than just responding on transaction execution,
and this distinction is underscored in Hyperledger Fabric by its central
position in the whole transaction pipeline, from request and approval to
ordering, verification, and pledge. In a word, the consensus is the total
authentication of the accuracy of a group of transactions that make up a
block.

Confidentiality-
Hyperledger Fabric uses an unchangeable ledger and a chain code that
may edit and alter the present state of objects. A ledger can operate within
lOMoAR cPSD| 22516561

the range of a channel — it could be broadcast throughout the existing


system or privately run to include precisely a limited number of users.

After all these situations, these parties will make a different channel,
isolating and segregating their transactions and the database. A chain
code can only be deployed on peers, which needs the information to the
asset states to execute reads and updates to overcome situations that
seek to fill the space between complete transparency and confidentiality.

When companies on a network want to maintain their transaction


information secret, secret record keeping is being used to store it in a
personal library that is logically independent of the channel record and
available only to the allowed group of companies.

Benefits of Hyperledger Fabric


1. Open Source- Hyperledger Fabric platform is an open source
blockchain framework hosted by The Linux Foundation. It has an
active and growing community of developers.
2. Permissioned- Fabric networks are permissioned, meaning all
participating member’s identities are known and authenticated. This
benefit is particularly useful in industries including healthcare,
supply chain, banking, and insurance where data cannot be
exposed to unknown entities. For example, an insurance company
on a Hyperledger Fabric blockchain network can share customer’s
claim data with permissioned parties to maintain customer privacy.
3. Governance and Access Control- Fabric networks consist of
channels, which are a private “subnet” of communication between
two or more specific network members, members on the network
lOMoAR cPSD| 22516561

can transact in a private and confidential way. Each transaction on


the blockchain network is executed on a channel, where each party
must be authenticated and authorized to transact on that channel.
This provides an additional layer of access control and is especially
useful when members want to limit exposure of the data, for
example when competitors are on the same network.
4. Performance- Hyperledger Fabric is built to support
enterprisegrade use cases, and can support quick transaction
throughput from its consensus mechanism. Because Fabric is a
permissioned blockchain framework, it does not need to solve for
Byzantine Fault Tolerance which can cause slower performance
when validating transactions on the network.

Identity and Policy mein Identity management likh dena pichle notes
mein hai. And or baaki apne man se kuch bhi likh dena.

Membership and Access Control


Membership nhi mila agar aayega to pehle access control likhunga for
baad mein membership mein kuch bhi likh dunga.

What is Access Control?


Access control is a mechanism in computer security that regulates access
to the system resources. The current access control systems face many
problems, such as the presence of the third-party, inefficiency, and lack of
privacy. These problems can be addressed by blockchain, the technology
that received major attention in recent years and has many potentials. In
this study, we overview the problems of the current access control
systems, and then, we explain how blockchain can help to solve them. We
also present an overview of access control studies and proposed
lOMoAR cPSD| 22516561

platforms in the different domains. This paper presents the state of the art
and the challenges of blockchain-based access control systems.
Blockchain applications initially were limited to the cryptocurrencies and
financial transactions. Invention of smart contracts leads to development
of more divers applications, such as healthcare, IoT, supply chain. After
reviewing many research studies based on blockchain and smart
contracts, we noticed that the primary focus of many presented
applications is providing an efficient and secure access control
mechanism.
Access control is a required security part of almost all applications.
Blockchain specific characteristics such as immutability, durability,
auditability, and reliability lead to considering blockchain as a
supplementary solution for access control systems. Access control
systems are applied to regulate access to the system’s resources and it is
the fundamental part of computer security. Access control is usually
enforced against a set of authorization based on system policies.

Blockchain has desirable features that make it a trustable alternative


infrastructure for access control systems. The distributed nature of
blockchain solves the problem of single point of failure and other
centralized management problems. Also, by eliminating third parties, we
do not need to be concern about privacy leakage from their side. In
addition, we can access to a trustable and unmodifiable history log.
Consensus mechanisms are applied, so only valid transactions are
recorded on blockchain. Furthermore, by using smart contracts, we can
monitor and enforce access permissions under complex conditions. All of
these features have motivated researchers to consider blockchain as an
infrastructure for access control systems.
lOMoAR cPSD| 22516561

we propose to store the representation of the right to access a resource in


a blockchain, allowing the management of such right through blockchain
“transactions”
The main advantages of the proposed approach are:
– the right to access a resource can be easily transferred from a user
to another through a blockchain transaction created by the last right
owner, without the intervention of the resource owner;
– the right is initially defined by the resource owner through a
transaction, and all the other transactions representing the right transfers
are published on the blockchain. Hence, any user can inspect them at any
time in order to check who currently holds the rights to perform a given
action on a given resource. Consequently, a user who had its access
request denied, can check whether the entity in charge of verifying the
existence of the required right actually made the right decision.
A common way of expressing access control rights is through
AttributeBased Access Control (ABAC) policies. Roughly speaking, an
attributebased access control policy combines a set of rules expressing
conditions over a set of attributes paired to the subject, to the resource or
to the environment.

1. Blockchain-based access control from transactions to smart


contracts.
2. Data sharing access control 3. Access control for cloud federation
4. Access control across multiple organizations
5. Access control for shared blockchains 6.
Access control and self-Sovereign identities
Inhe khud se likh sakte hain.
lOMoAR cPSD| 22516561

CHANNELS IN BLOCKCHAIN
A Hyperledger Fabric channel is a private “subnet” of communication
between two or more specific network members, for the purpose of
conducting private and confidential transactions. A channel is defined by
members (organizations), anchor peers per member, the shared ledger,
chaincode application(s) and the ordering service node(s). Each
transaction on the network is executed on a channel, where each party
must be authenticated and authorized to transact on that channel. Each
peer that joins a channel, has its own identity given by a membership
services provider (MSP), which authenticates each peer to its channel
peers and services.
To create a new channel, the client SDK calls configuration system
chaincode and references properties such as anchor peers, and members
(organizations). This request creates a genesis block for the channel
ledger, which stores configuration information about the channel policies,
members and anchor peers. When adding a new member to an existing
channel, either this genesis block, or if applicable, a more recent
reconfiguration block, is shared with the new member.

The election of a leading peer for each member on a channel determines


which peer communicates with the ordering service on behalf of the
member. If no leader is identified, an algorithm can be used to identify the
leader. The consensus service orders transactions and delivers them, in
a block, to each leading peer, which then distributes the block to its
member peers, and across the channel, using the gossip protocol.

Although any one anchor peer can belong to multiple channels, and
therefore maintain multiple ledgers, no ledger data can pass from one
channel to another. This separation of ledgers, by channel, is defined and
lOMoAR cPSD| 22516561

implemented by configuration chaincode, the identity membership service


and the gossip data dissemination protocol. The dissemination of data,
which includes information on transactions, ledger state and channel
membership, is restricted to peers with verifiable membership on the
channel. This isolation of peers and ledger data, by channel, allows
network members that require private and confidential transactions to
coexist with business competitors and other restricted members, on the
same blockchain network.

Transaction Validation
Transaction validation is the process of determining if a transaction
conforms to specific rules to deem it as valid. Validators check if
transactions meet protocol requirements before adding the transactions to
the distributed ledger as part of the validating process.

This validation process is carried out by nodes who store full copies of the
blockchain. When nodes validate a transaction, it is added to the mempool
(short for memory pool). In a proof of work network, miners are
incentivized by transaction fees to confirm these transactions by including
them in a block in the blockchain, establishing a clear chronological record
of when the transaction occurred so that a later transaction cannot spend
the same coins as in the original.
A transaction is considered valid if the sender in the transaction has an
initial balance in their wallet equal to or greater than the amount being sent
in the transaction (including the transaction fee). Other rules can exist
depending on the specific protocol in question, but this rule is generally
applicable to all protocols.

Full transaction validation includes the following checks:


lOMoAR cPSD| 22516561

1. Transaction fields check including:

• Timestamp check: the transaction timestamp should be not more than


2 hours ago or 1.5 hours ahead from the current block timestamp.

• Transaction version check: all the features required to support this


version should be activated.

• Transaction type check: all the features required to support this type
should be activated.

• Check of token amounts: the values must be non-negative.

• Check of fields depending on the transaction type.


2. Sender's balance check.

The sender should have enough funds to pay the fee. If a sponsored
asset is used for the fee, the sponsor's balance is also checked.

Depending on the type of transaction, the sender should have


enough asset for transfer or for payments attached to the Invoke
Script transaction. Order senders in the Exchange transaction
should have enough funds to exchange.
3. The sender's signature verification for ordinary account (without
script), or account script execution if the sender is smart account, or
the verifier function execution if the sender is dApp. A similar check
is performed for orders in an Exchange transaction.
4. For the Invoke Script transaction:

4.1. Calculation of the result of dApp callable function.


4.2. dApp balance check: dApp account should have enough funds
for dApp script actions.
4.3. Check that the transaction fee is not less than the minimum fee
based on script actions.
lOMoAR cPSD| 22516561

5. Execution of asset scripts if the transaction uses smart assets,


including scripts of assets used in dApp script actions.
When receiving the transaction via the broadcast endpoint, or adding
transaction to a block, or receiving a block over the network, the node
performs full validation of the transaction. When receiving an Invoke Script
transaction over the network, the node performs calculations of the
callable function up to the threshold for saving unsuccessful transactions.

Validation Result
When the transaction is received via broadcast or over the network:
• If one of the checks failed, the transaction is discarded.
• If all the checks passed, the transaction is added to the UTX pool
that is the list of transactions waiting to be added to the block.

When adding the transaction to the block, the result of validation depends
on the transaction type.

For the Invoke Script transaction:


• If one of the checks 1–3 failed, the transaction is discarded.
• If checks 1–3 passed, and the calculation of the result (check 4.1)
failed with an error or throwing an exception before the complexity
of performed calculations exceeded the threshold for saving failed
transactions, the transaction is also discarded.
• If checks 1–3 passed but checks 4–5 failed and besides the result
of the callable function is calculated successfully or the complexity
exceeded the threshold, the transaction is saved on the blockchain
but marked as failed: "applicationStatus": "script_execution_failed".
The sender is charged the transaction fee. The transaction doesn't
entail any other changes to the state of the blockchain.
lOMoAR cPSD| 22516561

• If all checks passed, the transaction is saved on the blockchain as


successful: "applicationStatus": "succeeded" and the sender is
charged the fee.

For the Exchange transaction:


• If one of the checks 1–3 failed, the transaction is discarded.
• If checks 1–3 passed but check 5 failed, the transaction is saved on
the blockchain but marked as failed: "applicationStatus":
"script_execution_failed". The sender of the transaction (matcher) is
charged the transaction fee. The transaction doesn't entail any other
changes in balances, in particular, the order senders don't pay the
matcher fee.
• If all checks passed, the transaction is saved on the blockchain as
successful: "applicationStatus": "succeeded". The matcher is
charged the transaction fee as well as the order senders are
charged the matcher fee.

For the other transaction:


• If one of the checks failed, the transaction is discarded.

• If all checks passed, the transaction is saved on the blockchain as


successful and the sender is charged the fee.

Smart Contracts in Hyperledger Fabric


Developing Blockchain applications really means developing smart
contracts, or as they are also called: chain code. Smart contracts can
be compared to stored procedures in the database world and mostly
deal with getting and setting parameters on business objects, in
addition to doing anything else we want them to do by using either
one of the following languages: JavaScript, TypeScript, Java or Go
lOMoAR cPSD| 22516561

Developing Smart Contracts for Hyperledger Fabric is best done in


the open source Visual Studio Code environment.

Smart Contracts in Ethereum


Smart contracts samjha do. Then,

1. Create a Wallet at MetaMask


Install MetaMask in your Chrome browser and enable it. Once it is
installed, click on its icon on the top right of the browser page. Clicking on
it will open it in a new tab of the browser.

Click on Create Wallet and agree to the terms and conditions by clicking I
agree to proceed further. It will ask you to create a password.

After you create a password, it will send you a secret backup phrase that
can be used for backing up and restoring the account. Do not disclose it
or share it with someone, as this phrase can take away your Ethers.

Next, ensure that you are in the Main Ethereum Network. If you find a
checkmark next to “Main Ethereum Network, you are in the right place.

2. Select a Test Network


You might also find the following test networks in your MetaMask wallet:

• Robsten Test Network


• Kovan Test Network
• Rinkeby Test Network
• Goerli Test Network

• The above networks are for testing purposes only; note that the
Ethers of these networks have no real value.
lOMoAR cPSD| 22516561

3. Add Some Dummy Ethers in Your Wallet • In case you want to test the
smart contract, you must have some dummy Ethers in your MetaMask
wallet.

• For example, if you want to test a contract using the Robsten test
network, select it, and you will find 0 ETH as the initial balance in
your account.

• To add dummy Ethers, click on the Deposit and Get Ether button
under Test Faucet.

To proceed, you need to click request 1 ether from faucet and one ETH
will be added to your wallet. You can add as many Ethers as you want in
the test network.

4. Use Editor Remix to Write the Smart Contract in Solidity


We will use Remix Browser IDE to write our Solidity code. Remix is the
best option for writing smart contracts, as it comes with a handful of
features and offers comprehensive development experience.

It is usually used for writing smaller sized contracts. Remix’s features


include:

• Warnings like Gas cost, unsafe code, checks for overlapping


variable names, and whether functions can be constant or not.
• Syntax and error highlighting.
• Functions with injected Web3 objects.
• Static analysis.
• Integrated debugger.

• Integrated testing and deployment environment.


• Deploy directly to Mist or MetaMask.
lOMoAR cPSD| 22516561

5. Create a .sol Extension File


Open Remix Browser, and click on the plus icon on the top left side next
to the browser to create a .sol extension file.

6. Smart Contract Code to Create ECR20 Tokens


ERC20.sol is a standard template for ERC20 tokens.

7. Deploy Your Contract


Deploy the smart contract at the Ethereum test network by pressing the
deploy button at the right-hand side of the Remix window. Wait until the
transaction is complete.

After the transaction commits successfully, the address of the smart


contract would be visible at the right-hand side of the Remix window. At
first, all the ERC20 token will be stored in the wallet of the user who is
deploying the smart contract.

Ripple
It is an open-source protocol designed to allow transactions in a fast and
cheap manner. Ripple is not just a platform but a currency. This platform
has its own currency known as XRP but also allows people to create their
own currency via RippleNet. RippleNet is nothing but a network of
institutional payment-providers like banks and money services firms that
use solutions developed by Ripple to offer a frictionless experience to
send money globally. Although Bitcoin is one of the known
cryptocurrencies, Ripple is another one to take its place in the market.
Unlike traditional methods of transactions, this platform aims at making
lOMoAR cPSD| 22516561

the transaction process easier and quicker, especially for the cross-border
payments, thus creating a better ecosystem of growth and development.

Ripple is a technology that acts as both a cryptocurrency and a digital


payment network for financial transactions. It was first released in 2012
and was co-founded by Chris Larsen and Jed McCaleb. Ripple's main
process is a payment settlement asset exchange and remittance system,
similar to the SWIFT system for international money and security
transfers, which is used by banks and financial middlemen dealing across
currencies. The token used for the cryptocurrency is premined and utilizes
the ticker symbol XRP. Ripple is the name of the company and the
network, and XRP is the cryptocurrency token. The purpose of XRP is to
serve as an intermediate mechanism of exchange between two currencies
or networks—as a sort of temporary settlement layer denomination.

Features and It’s Working

To make international payment transfers easier and more convenient,


Ripple can be seen as the best solution. But before understanding how
this platform works, it is essential to learn what are the significant
challenges associated with cross-border payments.

• The international payment transfer is expensive as there is the


involvement of third parties.
• The traditional method of transfer is really slow as it takes
around days and even weeks.

Distinguishing Ripple and Bitcoin

Although Bitcoin and Ripple have some similarities, there are striking
differences between the two.
lOMoAR cPSD| 22516561

• Bitcoin is a blockchain technology while Ripple doesn’t use


blockchain but uses a distributed consensus ledger and crypto
tokens called XRP.
• Bitcoin can handle a maximum of 3-4 transactions per second
on-chain while Ripple has demonstrated over 1500 transactions
per second in its enclaves.
• Bitcoin is a digital currency intended as a means of payment
for goods and services while on the other hand Ripple is designed
for banks and payment networks, is a payment settling, currency
exchange and remittance system.

Corda
Corda is an open-source enterprise-based blockchain designed to offer
interoperability. It is a platform that is intended to record, manage, and
synchronize agreements and transfer anything valuable. It allows
enterprises to communicate and transact directly while maintaining
transparency and without worrying about privacy and to integrate
Blockchain across their operations immediately and efficiently. Moreover,
Corda offers timestamping services to order transactions temporally and
ignore disputes. It has a smart contract logic, which specifies constraints
that ensure state transitions are valid as outlined in the contract code.

What Makes Corda Blockchain Framework Different?


lOMoAR cPSD| 22516561

Privacy

Privacy is a critical focus for any distributed ledger technology system. It


is because your data is bound to be distributed across multiple nodes and
servers belonging to different business entities.

Identity

Identification of different parties in the DLT system over a permissioned


blockchain becomes a core criterion to build a closed network of the
system among known participants.

Consensus

Consensus is a technique through which organizations over a distributed


and decentralized network come on to an agreement over the transactions
happening between them.

Contracts

Smart contracts and program files embedding the business logic, rules
validation are part of any business being run among different organizations
over a blockchain-based distributed system.

No Block, But Chain

Corda’s functionality relies on the UTXO input/output model, which is very


similar to the transaction system used in traditional blockchains such as
Bitcoin.

You might also like