UNIT -1
Blockchain is a distributed database technology that is used to record and store
data in a secure and transparent manner. It is a decentralized ledger system that
allows multiple parties to access and maintain the same data without the need for a
central authority or intermediary.
In a blockchain network, each transaction is verified and validated by a network of
computers or nodes, and once a block of transactions is validated, it is added to the
existing chain of blocks in a permanent and tamper-proof manner. This makes it
very difficult for anyone to alter the data or manipulate the system without being
detected.
Blockchain technology has many potential applications, including in the areas of
finance, supply chain management, healthcare, and voting systems. Its ability to
securely and transparently record and store data has the potential to revolutionize
many industries and create new opportunities for innovation and efficiency.
Key Characteristics: Open: Anyone can access blockchain. Distributed or
Decentralised: Not under the control of any single authority. Efficient: Fast and
Scalable. Verifiable: Everyone can check the validity of information because
each node maintains a copy of the transactions. Permanent: Once a transaction is
done, it is persistent and can’t be altered.
Public leader:
A public ledger is a record of transactions that is accessible and viewable by
anyone on a blockchain network. In a blockchain network, transactions are verified
and validated by a network of nodes or computers, and once a block of transactions
is validated, it is added to the existing chain of blocks in a permanent and tamper-
proof manner.
This creates a transparent and public record of all transactions that have occurred
on the network, which can be viewed and audited by anyone. The public nature of
the ledger ensures that there is no need for a central authority or intermediary to
oversee the transaction process, as the network is self-governing and transparent.
The security and transparency of the blockchain technology is based on
cryptographic algorithms and protocols that ensure the integrity and authenticity of
the data.
Each block in the chain contains a unique hash code that is derived from the
previous block's hash, along with a timestamp and the transaction data. This
creates a chain of blocks that is resistant to tampering, as any alteration to a single
block will affect the entire chain and be immediately detected.
Bitcoin
Bitcoin is a digital currency that operates on a decentralized, peer-to-peer network
based on blockchain technology. It was created in 2009 by an anonymous person
or group of people using the pseudonym "Satoshi Nakamoto."
Bitcoin transactions are verified and recorded on the blockchain, which is a
distributed ledger that records every transaction in the network. Unlike traditional
currencies, which are issued by central banks, bitcoins are created through a
process called mining. This involves solving complex mathematical algorithms to
validate and verify transactions on the network, and miners are rewarded with
newly minted bitcoins for their efforts.
Bitcoin transactions are conducted anonymously, and ownership of bitcoins is
determined by the possession of private keys, which are used to sign and authorize
transactions. The Bitcoin network is open to anyone with an internet connection,
and transactions are verified and validated by a network of nodes or computers,
without the need for a central authority or intermediary.
The value of Bitcoin is determined by supply and demand, and it is subject to
fluctuations in the market like any other currency or asset. Bitcoin has gained
popularity due to its potential as a decentralized and anonymous currency, and it
has been adopted by various merchants and businesses as a payment method.
However, it is important to note that Bitcoin is still a relatively new and volatile
asset, and its value can be subject to extreme fluctuations. Additionally, its use has
been associated with illicit activities and money laundering due to its anonymous
nature, which has led to regulatory scrutiny and potential limitations on its use in
certain jurisdictions.
Smart contract:
Smart contracts are self-executing contracts that operate on blockchain technology.
They are essentially computer programs that can automatically execute the terms
of a contract when certain conditions are met. Smart contracts are written in code
and are stored on a blockchain network, which makes them tamper-proof and
transparent.
Smart contracts eliminate the need for intermediaries and can automate the
execution of complex transactions, making them faster, more efficient, and more
secure. They can be used to execute various types of transactions, such as the
transfer of assets, payment of funds, or the exchange of information, among others.
Smart contracts work by encoding the terms of a contract into code, which is stored
on a blockchain network. The code is programmed to execute the terms of the
contract automatically when certain conditions are met, such as the receipt of
payment or the completion of a task. Once the conditions are met, the smart
contract is executed automatically, and the results are recorded on the blockchain
for all parties to see.
Smart contracts have many potential applications, including in the areas of finance,
supply chain management, and real estate. They can increase transparency, reduce
costs, and eliminate the need for intermediaries, making them a promising
technology for a wide range of industries.
Block in Blockchain:
A block is a unit of data that contains a collection of transactions that have been
verified and confirmed on a blockchain network. Each block in a blockchain
contains a header, a list of transactions, and a cryptographic hash of the previous
block's header.
The header of a block contains important information, such as a timestamp, a
unique identifier called a nonce, and the cryptographic hash of the previous block's
header. The nonce is a random number that is generated by the miner to help solve
the complex mathematical algorithm required to validate the transactions and add
the block to the blockchain.
Once the transactions in a block have been validated, the block is added to the
blockchain, which creates a permanent and tamper-proof record of all transactions
that have occurred on the network. The cryptographic hash of each block is used to
link it to the previous block in the chain, which creates a chain of blocks that is
resistant to tampering and fraud.
The addition of each new block to the chain requires a significant amount of
computational power and energy, which is provided by the network of nodes or
computers that participate in the blockchain network. This ensures the security and
integrity of the blockchain and makes it a reliable and trustworthy platform for
conducting transactions and storing data.
Transactions:
Transactions in a blockchain refer to the transfer of digital assets or information
from one party to another on the blockchain network. A transaction contains
information about the sender, the receiver, the amount or value being transferred,
and any additional data or instructions.
When a transaction is initiated, it is broadcast to the entire blockchain network for
verification and validation. Each node or computer in the network validates the
transaction by checking that the sender has sufficient funds to make the transfer
and that the transaction conforms to the rules of the blockchain protocol.
Once the transaction is validated, it is confirmed and added to a block, which is
then added to the blockchain. The confirmation process can take anywhere from a
few seconds to several minutes, depending on the specific blockchain network and
its consensus algorithm.
Once a transaction is confirmed and added to the blockchain, it becomes a
permanent and immutable record that can be viewed and audited by anyone on the
network. This creates a transparent and tamper-proof ledger of all transactions that
have occurred on the blockchain network.
The use of blockchain technology for transactions offers many benefits, including
increased security, transparency, and efficiency. It eliminates the need for
intermediaries and can reduce the risk of fraud, errors, and delays.
Consensus
Consensus in a blockchain network refers to the process by which all the nodes or
participants in the network agree on the validity of transactions and the addition of
new blocks to the blockchain.
Consensus is critical to the functioning of a blockchain network because it ensures
that all transactions are validated and recorded in a way that is secure, transparent,
and tamper-proof. Without consensus, there would be no way to ensure that all
participants in the network have a consistent and accurate view of the blockchain
ledger.
There are several consensus algorithms that can be used in a blockchain network,
including Proof of Work (PoW), Proof of Stake (PoS), and Delegated Proof of
Stake (DPoS), among others. These algorithms differ in their approach to
achieving consensus, but they all require some form of validation and agreement
among the network participants.
In a Proof of Work algorithm, for example, miners compete to solve a complex
mathematical puzzle to validate transactions and add new blocks to the blockchain.
The first miner to solve the puzzle is rewarded with new cryptocurrency units, and
the block is added to the blockchain. In a Proof of Stake algorithm, on the other
hand, validators are selected based on the amount of cryptocurrency they hold, and
they are responsible for verifying transactions and adding new blocks to the
blockchain.
Consensus is an essential component of blockchain technology, and it enables the
creation of decentralized, trustless networks that can be used for a wide range of
applications. By ensuring that all transactions are validated and recorded in a
transparent and secure manner, consensus enables blockchain networks to operate
as a reliable and trustworthy platform for conducting transactions and storing data.
Cryptocurrency is a digital or virtual currency that uses cryptography for security
and operates on a decentralized network called a blockchain. A blockchain is a
distributed ledger that records all transactions in a secure and transparent manner.
In the case of cryptocurrency, every transaction is recorded as a block on the
blockchain, which is verified by a network of nodes. The nodes use complex
algorithms to validate and verify the transactions, which are then added to the
blockchain in a permanent and immutable way.
The blockchain allows for the creation of a decentralized, trustless system where
transactions can be conducted without the need for intermediaries such as banks or
financial institutions. This makes cryptocurrency a revolutionary concept, as it
challenges the traditional financial system and provides an alternative means of
conducting transactions.
The value of cryptocurrencies such as Bitcoin, Ethereum, and others is determined
by market demand and supply, similar to traditional currencies. Cryptocurrencies
can be bought and sold on cryptocurrency exchanges, and their value can fluctuate
based on market conditions.
The technology that underpins cryptocurrency, namely blockchain, has a wide
range of potential applications beyond just currency. Blockchain technology can be
used to build decentralized systems for a variety of purposes, such as supply chain
management, voting systems, and more.
Overall, understanding cryptocurrency requires a basic understanding of
blockchain technology and the way transactions are verified and recorded on the
blockchain. By providing a secure, transparent, and decentralized system for
transactions, cryptocurrency and blockchain have the potential to disrupt
traditional financial systems and revolutionize the way we conduct transactions.
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.
A permissioned blockchain is a type of blockchain where access to the network
and participation in the consensus process is restricted to a specific group of
participants. This is in contrast to a public blockchain, where anyone can access the
network and participate in the consensus process.
In a permissioned blockchain, participants are usually known to each other, and
access to the network is restricted through permissions and controls. This allows
for a more controlled and secure environment, where transactions can be
conducted without the need for intermediaries or third-party verification.
Permissioned blockchains are commonly used by organizations and businesses to
conduct transactions securely and transparently within a closed network. This can
be particularly useful for industries such as finance, healthcare, and government,
where data privacy and security are critical.
One of the key benefits of a permissioned blockchain is the ability to customize the
network to meet the specific needs of the organization or industry. This can include
customizing the consensus algorithm, network governance, and security measures.
Overall, permissioned blockchains offer a more controlled and secure environment
for conducting transactions, making them a suitable choice for enterprises or
organizations that require a higher degree of security and privacy.
Security is one of the key features of blockchain technology, and it is what
makes it a reliable and trustworthy system for conducting transactions. Here are
some of the main security aspects of blockchain:
Decentralization: Blockchain is a decentralized system, which means that it is not
controlled by any single entity. Instead, transactions are verified and recorded by a
network of nodes, making it difficult for any one entity to control the network or
manipulate transactions.
Consensus: In order for a transaction to be added to the blockchain, it must be
validated by the network of nodes. This consensus process ensures that all
transactions are verified and recorded in a transparent and secure manner.
Cryptography: Blockchain uses cryptography to secure transactions and protect
them from unauthorized access. Each transaction is encrypted and linked to the
previous transaction, creating an unchangeable and tamper-proof record.
Immutable ledger: Once a transaction is added to the blockchain, it cannot be
altered or deleted. This creates an immutable ledger that is transparent and secure,
making it difficult for anyone to manipulate the data.
Public key infrastructure: Blockchain uses a public key infrastructure (PKI) to
manage identities and secure transactions. Each participant in the network has a
public and private key, which is used to encrypt and decrypt transactions.
Smart contracts: Smart contracts are self-executing contracts that are stored on the
blockchain. They are programmed to automatically execute when certain
conditions are met, ensuring that transactions are conducted in a secure and
transparent manner.
Overall, blockchain technology provides a secure and transparent system for
conducting transactions, making it a suitable choice for a wide range of industries
and applications. By using cryptography, decentralization, and consensus
algorithms, blockchain ensures that transactions are secure, transparent, and
tamper-proof.
A cryptographic hash function is a mathematical algorithm that takes in input
data and produces a fixed-size output known as a hash or message digest. The
output is a unique digital fingerprint of the input data, which is virtually impossible
to reverse engineer back to the original data.
Cryptographic hash functions are designed to be computationally difficult to invert,
meaning that it is practically impossible to derive the original input data from the
hash. This property makes hash functions useful for a variety of security
applications, including data integrity checking, digital signatures, and password
storage.
Some of the key properties of a cryptographic hash function include:
1. Deterministic: Given the same input data, a hash function will always produce
the same output.
2. One-way: It is computationally infeasible to determine the original input data
from the hash output.
3. Collision-resistant: It is computationally infeasible to find two different input
data that produce the same hash output.
4. Fixed-size output: A hash function produces a fixed-size output, regardless of
the input data size.
Cryptographic hash functions are widely used in blockchain technology, where
they are used to secure transactions, link blocks in the chain, and ensure data
integrity. The most commonly used hash functions include SHA-256, SHA-3, and
BLAKE2.
Sure, here is a more detailed explanation of cryptographic hash functions:
The output of a hash function is sometimes referred to as a digital fingerprint, as it
uniquely identifies the input data. The output is a string of characters that is
typically represented in hexadecimal or base64 format. The length of the hash
output is fixed, regardless of the size of the input data.
One of the key properties of a cryptographic hash function is that it is
deterministic, meaning that given the same input data, the hash function will
always produce the same output. This property makes hash functions useful for a
variety of security applications, including data integrity checking, digital
signatures, and password storage.
Another important property of cryptographic hash functions is that they are one-
way functions. This means that it is computationally infeasible to determine the
original input data from the hash output. This property is essential for ensuring the
integrity and security of the data being hashed, as it makes it virtually impossible
to reverse-engineer the original data from the hash.
A good cryptographic hash function is also collision-resistant, meaning that it is
computationally infeasible to find two different input data that produce the same
hash output. This property is essential for ensuring the uniqueness of the hash
output, as it makes it extremely difficult for an attacker to create a fraudulent or
malicious input data that produces the same hash as the original data.
Cryptographic hash functions are widely used in blockchain technology, where
they are used to secure transactions, link blocks in the chain, and ensure data
integrity. The most commonly used hash functions in blockchain technology
include SHA-256, SHA-3, and BLAKE2.
Overall, cryptographic hash functions provide a critical layer of security for a wide
range of applications, from securing passwords to ensuring the integrity of
blockchain transactions. Their properties of determinism, one-wayness, and
collision resistance make them an essential tool for modern cybersecurity.
In a blockchain, each block contains a hash of the previous block's header, which
includes a hash of the previous block's data along with other information. This
creates a chain of blocks that are linked together by hash pointers, forming a
tamper-evident record of all the transactions that have occurred on the blockchain.
The use of hash pointers in blockchain technology is essential for maintaining the
integrity of the data stored on the blockchain. Because each block's header contains
a hash of the previous block's header, any tampering with the data in one block will
result in a change in its hash value, which will invalidate the hash pointer of the
next block. This makes it virtually impossible to alter any previous transactions on
the blockchain without being detected.
Hash pointers also allow for efficient verification of the entire blockchain. Because
each block contains a hash of the previous block's header, it is possible to verify
the entire chain by simply checking the hash values of each block's header. If any
of the hash values are invalid, it indicates that the data has been tampered with and
the blockchain is no longer valid.
Overall, hash pointers are a critical component of blockchain technology,
providing a secure and tamper-evident way to link blocks together in the chain and
ensure the integrity of the data being stored.
Merkle Tree
https://www.geeksforgeeks.org/blockchain-merkle-trees/
A Merkle tree, also known as a hash tree, is a data structure that allows large
datasets to be efficiently verified for integrity. It works by recursively hashing
smaller subsets of data together, forming a tree-like structure where the top-level
hash value represents the entire dataset.
In a Merkle tree, each leaf node contains a hash of a single data element, such as a
transaction in a blockchain. The intermediate nodes then contain a hash of the
hashes of their child nodes, recursively building up to the top-level hash of the
entire dataset.
Merkle trees are commonly used in blockchain technology to enable efficient
verification of the integrity of large sets of transactions. By using a Merkle tree, it
is possible to verify the authenticity of a transaction without having to download
the entire blockchain. The top-level hash of the Merkle tree can be compared
against a trusted source, such as a hash stored in the blockchain header, to ensure
the authenticity of the entire dataset.
Merkle trees provide several benefits for blockchain technology, including
reducing the amount of data that needs to be transmitted and stored, improving the
efficiency of data verification, and enhancing the security of the blockchain
network.
A digital signature is a mathematical scheme used to verify the authenticity and
integrity of digital messages or documents. It is essentially a digital equivalent of a
handwritten signature or a seal, but with additional cryptographic security features.
To create a digital signature, a sender first applies a mathematical algorithm to the
message or document to generate a unique message digest, or hash value. This
hash value is then encrypted using the sender's private key, resulting in the digital
signature. The recipient can then verify the authenticity and integrity of the
message or document by using the sender's public key to decrypt the signature and
compare the resulting hash value to a newly generated hash value of the original
message or document.
Digital signatures are widely used in electronic transactions and communications
to provide a secure and tamper-evident way to authenticate the identity of the
sender, ensure the integrity of the message or document, and protect against
unauthorized modifications or forgeries. They are a key component of many
security protocols, such as Secure Sockets Layer (SSL), Transport Layer Security
(TLS), and Pretty Good Privacy (PGP).
In blockchain technology, digital signatures are used to authenticate and secure
transactions between participants. Each transaction in a blockchain is digitally
signed by the sender using their private key to create a unique signature that can be
verified by anyone using the sender's public key.
When a transaction is broadcast to the blockchain network, it is propagated to all
nodes, which verify the digital signature using the sender's public key. If the
signature is valid, the transaction is added to the blockchain and considered
confirmed. Otherwise, it is rejected as invalid.
Digital signatures play a critical role in ensuring the security and integrity of
blockchain transactions. They provide a way to authenticate the identity of the
sender, ensure that the transaction has not been tampered with, and protect against
unauthorized modifications or forgeries. Additionally, because digital signatures
are cryptographically secure and impossible to duplicate or forge, they provide a
high level of assurance that transactions are valid and trustworthy.
Public Key Cryptography, also known as asymmetric cryptography, is a
cryptographic system that uses a pair of keys, a public key and a private key, to
securely communicate over an insecure communication channel.
In this system, the public key is available to anyone who wishes to send a message
to the owner of the public key. The private key, on the other hand, is kept secret by
the owner and used to decrypt messages that are encrypted with the public key.
This system allows for secure communication without the need for both parties to
share a secret key.
Public key cryptography is widely used in various applications, including secure
communication, digital signatures, and key exchange protocols. In the context of
blockchain technology, public key cryptography is used to verify the authenticity
and integrity of transactions and blocks, secure communication between nodes, and
enable the creation and management of digital wallets.
The security of public key cryptography relies on the computational complexity of
certain mathematical problems, such as factoring large numbers or computing
discrete logarithms, which are believed to be difficult for classical computers to
solve efficiently. As a result, public key cryptography is considered to be a highly
secure and reliable method for secure communication and data protection.
A cryptocurrency is a digital currency that is secured by cryptography and
operates on a decentralized network. The most famous cryptocurrency is Bitcoin,
but there are many others like Ethereum and Litecoin.
Unlike traditional currencies that are controlled by governments or banks,
cryptocurrencies are not controlled by any central authority. They use a
decentralized system called the blockchain to record and verify transactions
without the need for intermediaries.
Cryptocurrencies can be traded on specialized exchanges and used to purchase
goods and services or exchanged for traditional currencies. Their value is
determined by supply and demand and can be highly volatile.
Overall, cryptocurrencies are seen as a potentially disruptive technology that could
change the way we think about money and finance.
UNIT II
Architecture and Conceptualization of Block Chain, Crypto Currencies
Block in a Block chain-find Transactions-Distributed Consensus-Proof of work, Stake,
Space-Attacks on POW-Ethereum-Pos/POW Hybrids-Crypto currency to block chain 2.0,
Model of Blockchain- Algorand.
2.1 BLOCK IN A BLOCK CHAIN
Definition of Blockchain
A block chain is an open, distributed ledger that can record transactions between two
parties efficiently and in a verifiable and permanent way without the need for a central
authority.
Key Characteristics to be remembered:
Open: Anyone can access blockchain.
Distributed or Decentralised: Not under the control of any single authority.
Efficient: Fast and Scalable.
Verifiable: Everyone can check the validity of information because each node maintains
a copy of the transactions.
Permanent: Once a transaction is done, it is persistent and can’t be altered.
Contents of a Block
Blockchain starts with a block called genesis block. Each block stores the following
information in it:
Index: Position of the block in blockchain. Index of genesis block is 0.
Time stamp: The time when that particular block was created.
Hash: Numeric value that uniquely identifies data just like our fingerprints.
Previous hash: Hash value of the previous block. For genesis block, this value is 0.
Data: Data stored on the node. For example, transactions.
Nonce: It is a number used to find a valid hash. To generate this number, the processing power
is used.
Fig.2.1 Genesis block
Mechanism of Blockchain
Fig 2.2 Blocks connected in backward direction
Blockchain works like a public ledger.
Any small change in the data value can affect the hash value. Hence, affecting
the whole block chain.
Every peer in a Blockchain network maintains a local copy of the Blockchain.
All the replicas need to be updated with the last mined block.
All the replicas need to be consistent — the copies of the Blockchain at
different peers need to be exactly similar.
Structure of a Block (Reference: Bitcoin)
The blockchain is a chain of data blocks. Each block can be thought of as a page in a
ledger. The individual blocks are composed of several components.
Roughly these can be differentiated into
the head of the block (block header) and
Block header
The head of the block is divided into six components:
1. the version number of the software
2. the hash of the previous block
3. the root hash of the Merkle tree
4. the time in seconds since 1970–01–01 T00: 00 UTC
5. the goal of the current difficulty
6. the nonce
The version number of the software: The software version number does not matter in
most cases. However, a miner with a particular version number can signal which protocol
decisions he supports.
The hash of the previous block :The hash of the previous block is, so to speak, the chain
of blockchains. Because the hash of the previous block is contained in the hash of the new
block, the blocks of the blockchain all build on each other. Without this component, there
would be no connection and chronology between each block.
The root hash of the Merkle tree :All transactions contained in a block can be
aggregated in a hash. This is the root hash of the Merkle tree.
The time in seconds since 1970–01–01 T00: 00 UTC: A timestamp in the block itself.
The time is given in seconds since 1.1.1970.
The goal of the current difficulty :The goal indicates how small the new hash must be to
claim validity. In other words, every hash has a size in bits. The lower the goal in bits is,
the harder it is to find a matching hash. A hash with many zeros at the beginning is smaller
than a hash without zeros. Find out more about the difficulty of the proof of work.
The Nonce:The nonce is the variable incremented by the proof of work. In this way, the
miner guesses a valid hash, a hash that is smaller than the target.
The six components form the block header. The block header plays a fundamental role
in Bitcoin because it connects all blocks together. You can imagine it like the cockpit of a
truck. Here are the important papers with which the truck comes through the controls of the
network.
Block Body
The block body is conceivable as the loading space of a truck. It contains all
transactions that are confirmed with the block.
When a miner constructs a block, it validates the transactions. That is, he checks that
the sender actually has enough money to spend. He can easily read this information from the
blockchain. The miner looks in the past blocks to see if the sender has even gotten ten Bitcoins
if he wants to send ten Bitcoins. The transactions in a block are not just in a list, but in a so-
called Merkle Tree.
Merkle Tree
The Merkle Tree takes its name from the mathematician Ralph Merkle. The discovery
was that much information can be represented in a single hash. For this, the data itself is first
hashed. Then the hashes are hashed again and merged. Finally, the Merkle Tree is merged into
a single hash. This last hash is also called the root hash, the root of the tree. It represents all the
information of its “leaves” (individual transactions) and “branches” (hashes of the leaves) in a
relatively short string.
Creating the root hash is quick and easy, as long as all branches and leaves are known.
We remember the function of a hash function: it works clearly and quickly in one direction
and is impossible to break down in the other direction. If the root hash is known, but the
transactions are unknown, it is impossible to guess the transactions.
A root hash alone is therefore not enough, and the rest of the block must be saved.
Thus, the miner can validate the root hash at any time by hashing the information contained in
the block again. As long as the hash function is the same, the miners always get the same hash
for a given input of data. This is very handy because they can only check if they are on the
same level as the hash.
Mining: The search for a special hash
In this context, it is easier to understand the mining of the proof of work. When mining,
the block header of the block is incrementally changed to get a special hash. The header
consists of five constants and one variable. The constants are the version number of the
software, the hash of the previous block, the root hash of the Merkle tree, the timestamp, and
the target size of the searched hash in bytes.
The variable is the nonce. A nonce is a number raised by one. Then the miner hashes
the data and checks if the data results in a hash that is below the searched target value. If the
hash value is greater than the target, the miner repeats the process; So it increases the nonce by
one, hashes and checks again. It repeats this until it finds a hash below the target, or it gets
another block from another networker whose hash is below the target. Then takes this new
block and uses it as the basis for the next block (using the new hash as the “hash of the
previous block”).
Mining is a hyper-repetitive process whose goal is to find a special hash. Once the hash
is found, the game starts again. The probability of finding a special hash depends on the
difficulty. On average Bitcoin finds a new block every ten minutes. The difficulty keeps
adapting, so this average stays the same.
The special feature of this process is that the special hash can only be found by
guessing. This rate costs computing power and therefore energy. A look at the special hash is
enough to see that it is special because it begins with zeros.
Here is an example of such a hash from the Bitcoin blockchain:
000000000000000000094bfa4edb1245c347e42452e4418e9fe5a1d24e335b16
Hashes: The matryoshka of the blockchain
A block can be simplified as a matryoshka image. The smallest doll is the unhashed
transaction. The next envelope is the hashed form of this transaction. Thereafter, two hashed
transactions are hashed together. So the hashes are merged more and more. In the end, there is
2.2 DISTRIBUTED CONSENSUS
Consensus is the process by which peers agree to the addition of next block in the block
chain. Distributed Consensus ensures that different nodes in the network see the same data at
nearly the same point of time. Hence in case of any failure, the system can still provide a
service as the data is decentralised. To maintain anonymity in this large network,
the permission less protocol is used where you don’t need to record your identity while
participating in the consensus.
Consensus Algorithms
We know that Blockchain is a distributed decentralized network that provides
immutability, privacy, security, and transparency. There is no central authority present to
validate and verify the transactions, yet every transaction in the Blockchain is considered to
be completely secured and verified. This is possible only because of the presence of
the consensus protocol which is a core part of any Blockchain network.
A consensus algorithm is a procedure through which all the peers of the Blockchain
network reach a common agreement about the present state of the distributed ledger. In this
way, consensus algorithms achieve reliability in the Blockchain network and establish trust
between unknown peers in a distributed computing environment. Essentially, the consensus
protocol makes sure that every new block that is added to the Blockchain is the one and
only version of the truth that is agreed upon by all the nodes in the Blockchain. The
Blockchain consensus protocol consists of some specific objectives such as coming to an
agreement, collaboration, co-operation, equal rights to every node, and mandatory
participation of each node in the consensus process. Thus, a consensus algorithm aims at
finding a common agreement that is a win for the entire network.
Now, we will discuss various consensus algorithms and how they work.
2.2.1 Proof of Work (PoW):
The idea for Proof of Work(PoW) was first published in 1993 by Cynthia Dwork and
Moni Naor and was later applied by Satoshi Nakamoto in the Bitcoin paper in 2008. Proof
of Work consensus is the mechanism of choice for the majority of cryptocurrencies
currently in circulation. The term “proof of work” was first used by Markus
Principle: A solution that is difficult to find but is easy to verify.
The purpose of a consensus mechanism is to bring all the nodes in agreement, that is,
trust one another, in an environment where the nodes don’t trust each other.
All the transactions in the new block are then validated and the new block is then
added to the blockchain. Note that, the block will get added to the chain which has the
longest block height(see blockchain forks to understand how multiple chains can exist at a
point of time). Miners(special computers on the network) perform computation work in
solving a complex mathematical problem to add the block to the network, hence named,
Proof-of-Work. With time, the mathematical problem becomes more complex.
Working of POW(Proof of Work)
“The Proof of Work consensus algorithm involves solving a computational
challenging puzzle in order to create new blocks in the Bitcoin blockchain. Colloquially,
the process is known as ‘mining’, and the nodes in the network that engage in mining are
known as ‘miners’. The incentive for mining transactions lies in economic payoffs, where
competing miners are rewarded with 12.5 bitcoins(at the time of writing this article; this
reward will get reduced by half its current value with time) and a small transaction fee.”
The process of verifying the transactions in the block to be added, organizing these
transactions in a 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. At the time of writing this article, mining a block in the bitcoin network
gives the winning miner 12.5 bitcoins. The amount of bitcoins won halves every four years
or so(thats how the bitcoin network is designed). So, the next deduction in the amount of
bitcoin is due at around 2020-21(with the current rate and growth).
With more miners comes the inevitability of the time it takes to mine the new block
is necessary for a steady and diminishing flow of new coins until the maximum number of
21 million is reached (expected some time with the current rate in around 2140)), the
Bitcoin network regularly changes the difficulty level of mining a new block.
Fig 2.3 Proof of Work
The fact that Block GFG1 is connected to Block GFG2 through its hash number is
important. The significance lies in the fact that this ‘hash number’ connects new block to
the last block in the valid blockchain. If, on the other hand, the Block GFG1 Hash number
on Block GFG2 had a different hash number than Block GFG1 they would not match up,
and Block GFG2 would not be verified.
First block in the blockchain is called the Genesis Block and has no Prev Block Hash value.
Changing a block (which can only be done by making a new block containing the
same predecessor) requires regenerating all successors and redoing the work they contain
(amounting to calculating the entire chain of ‘hard mathematical problems’) which is
practically impossible. This protects the blockchain from tampering.
Bitcoin’s Proof-of-Work system:
Bitcoin uses the Hashcash Proof of Work system as the mining basis. The ‘hard
mathematical problem’ can be written in an abstract way like below :
Given data A, find a number x such as that the hash of x appended to A results is a
number less than B.
The miners bundle up a group of transactions into a block and try to mine. To mine
it, a hard mathematical problem has to be solved. This problem is called the proof of work
problem which has to be solved to show that the miner has done some work in finding out
problem needs to be a lower number than the hash of the block for it to be accepted, known
as the ‘target hash’.A target hash is a number that the header of a hashed block must be
equal to or less than for a new block, along with the reward, to be awarded to a miner. The
lower a target is, the more difficult it is to generate a block.
A miner continues testing different unique values (known as nonce(s)) until a
suitable one is produced. The miner who manages to solve the problem gets the bitcoin
reward and adds the block into the blockchain by broadcasting that the block has been
mined. The target hash adjusts once every 2016 blocks or approximately once every 2
weeks. All the miners immediately stop work on the said block and start mining the next
block.
Common cryptographic protocols used in Proof of Work systems: The most widely
used proof-of-work consensus is based on SHA-256 and was introduced as a part of
Bitcoin. Others include Scrypt, SHA-3, scrypt-jane, scrypt-n, etc.
Features of Proof of Work system:
There are mainly two features that have contributed to the wide popularity of this consensus
protocol and they are:
It is hard to find a solution for the mathematical problem
It is easy to verify the correctness of that solution
Main issues with the Proof-of-Work consensus:
\The Proof-of-Work consensus mechanism has some issues which are as follows:
The 51% risk: If a controlling entity owns 51% or more than 51% of nodes in the
network, the entity can corrupt the blockchain by gaining the majority of the network.
Time consuming: Miners have to check over many nonce values to find the right
solution to the puzzle that must be solved to mine the block, which is a time consuming
process.
Resource consumption: Miners consume high amounts of computing power in order to
find the solution to the hard mathematical puzzle. It leads to a waste of precious
resources(money, energy, space, hardware). It is expected that the 0.3% of the world’s
electricity will be spent to verify transactions by the end of 2018.
Transaction confirmation takes about 10–60 minutes. So, it is not an instantaneous
transaction; because it takes some time to mine the transaction and add it to the
blockchain thus committing the transaction.
Cryptocurrencies using PoW:
Litecoin
Ethereum
Monero coin
Dogecoin
2.2.2 Proof of Stake (PoS):
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.
Need of Proof-of-Stake:
Before proof of stake, the most popular way to achieve distributed consensus was
through Proof-of-Work (implemented in Bitcoin). But Proof-of-Work is quite
energy(electrical energy in mining a bitcoin) intensive. So, a proof-of-work based
consensus mechanism increases an entity’s chances of mining a new block if it has more
computation resources. Apart from the upper two points, there are other weaknesses of a
PoW based consensus mechanism which we will discuss later on. In such a scenario, a
Proof-of-Stake based mechanism holds merit.
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
Coin-age based selection: The algorithm tracks the time every validator candidate
node stays a validator. The older the node becomes, the higher the chances of it
becoming the new validator.
Random Block selection: The validator is chosen with a combination of ‘lowest hash
value’ and ‘highest stake’. The node having the best weighted-combination of these
becomes the new validator.
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.
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.
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.
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.
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.
Blockchains using Proof-of-Stake:
Ethereum(Casper update)
Peercoin
Nxt
Variants of Proof-of-Stake:
Regular Proof-of-Stake
Delegated Proof-of-Stake
Leased Proof-of-Stake
Masternode Proof-of-Stake
2.2.3 Proof of Space/ proof of capacity
Proof of space is a type of consensus algorithm achieved by demonstrating one's
legitimate interest in a service (such as sending an email) by allocating a non-trivial amount
of memory or disk space to solve a challenge presented by the service provider.
Proofs of space are very similar to proofs of work (PoW), except that instead of
computation, storage is used to earn cryptocurrency. Proof-of-space is different from
memory-hard functions in that the bottleneck is not in the number of memory access events,
but in the amount of memory required. the release of Bitcoin, alternatives to its PoW mining
mechanism were researched and PoS was studied in the context of cryptocurrencies. Proofs
of space are seen as a fairer and greener alternative by blockchain enthusiasts due to the
general-purpose nature of storage and the lower energy cost required by storage, but have
been criticized for increasing demand for storage. Several theoretical and practical
implementations of PoS have been released and discussed, such as SpaceMint, Burstcoin, and
Chia.
A proof-of-space is a piece of data that a prover sends to a verifier to prove that the
prover has reserved a certain amount of space. For practicality, the verification process needs
to be efficient, namely, consume a small amount of space and time. For security, it should be
hard for the prover to pass the verification if it does not actually reserve the claimed amount
of space. One way of implementing PoS is by using hard-to-pebble graphs.The verifier asks
the prover to build a labeling of a hard-to-pebble graph. The prover commits to the labeling.
The verifier then asks the prover to open several random locations in the commitment.
2.3 Types of Attacks on PoW (Proof of Work) based systems
As we know, the idea of Proof of Work was by Cynthia Dwork and Moni Naor. This
permissionless consensus uses double SHA 256 which makes it secure from hackers. With
proof of work, miners compete with each other to complete the transaction and get the
bounty. Even it has many advantages like solving the double-spending problem and very
difficult to tamper it, but it is not impossible to tamper if the hacker has high computational
power.
There are two major attacks by which PoW based systems can crash.They are :
1. Sybil Attacks
2. Denial of Service(DOS) Attacks
These are explained as following below with their solutions.
Sybil Attacks :
In Sybil attacks, the attacker attempts to fill the network with the clients under its
control. When this thing happens the attacker can actually control or get a monopoly over the
network and these clients can do different kinds of actions based on the instruction from the
attacker. They can refuse to relay the valid blocks or they can only relay the blocks which are
generated by the attackers and those blocks can lead to double-spending.
In Simple language, The attacker can include multiple nodes in the network who can
collectively compromise the Proof of Work mechanism.
Solution –
To prevent Sybil attacks we have to diversify the connections i.e allowing outbound
the attacker generates multiple false miners the attacker will generate them within the same
clustered network or subnet.
Denial of Service (DOS) Attacks :
In this attack, the attacker sends a lot of data to a particular node so that node will not
able to process normal Bitcoin transactions. As a result, the metabolism of the mining
procedure will get delayed which wastes the power for computation and in that meantime, the
attacker can also send new nodes to the network resulting in a monopoly which is nothing but
a Sybil attack.
Solution –
To prevent DOS attacks there are several rules bitcoin have which are:
No forwarding of orphaned blocks.
No forwarding of double-spend transactions.
No forwarding of same block or transactions
Disconnect a peer that sends too many messages
Restrict the block size to 1 MB (1mb according to Satoshi Nakamoto)
Limit the size of the bitcoin script up to 10000 bytes.
1.4 Ethereum
Ethereum is a blockchain platform with its own cryptocurrency, called Ether (ETH) or
Ethereum, and its own programming language, called Solidity.
As a blockchain network, Ethereum is a decentralized public ledger for verifying and
recording transactions. The network's users can create, publish, monetize, and use
applications on the platform, and use its Ether cryptocurrency as payment. Insiders call the
decentralized applications on the network "dapps."
. The Enterprise Ethereum Alliance (EEA) has some big-name founding members too,
including Microsoft, Intel, and JPMorgan Chase, according to The Motley Fool. “The
adoption of Ethereum by the corporate world,” says CNBC, “means it could eventually be
bigger than its early stage rival.” That means it’s time to get to know the Ethereum platform,
including its features and applications, and what makes Ethereum different from Bitcoin.
Our “Ethereum Explained” Ethereum tutorial video lays it all out for you, and here
Ethereum
Ethereum is a blockchain-based computing platform that enables developers to build
and deploy decentralized applications—meaning not run by a centralized authority. You can
create a decentralized application for which the participants of that particular application are
the decision-making authority.
Ethereum Features
Ether: This is Ethereum’s cryptocurrency.
Smart contracts: Ethereum allows the development and deployment of these.
Ethereum Virtual Machine: Ethereum provides the underlying technology—the
architecture and the software—that understands smart contracts and allows you to
interact with it.
Decentralized applications (Dapps): Ethereum allows you to create consolidated
applications, called decentralized applications. A decentralized application is
called a Dapp (also spelled DAPP, App, or DApp) for short.
Decentralized autonomous organizations (DAOs): Ethereum allows you to create
these for democratic decision-making.
These are the essential features of Ethereum and before going deep into the Ethereum
tutorial, let’s discuss each of these features in more detail.
Ether
Ether (ETH) is Ethereum’s cryptocurrency. It is the fuel that runs the network. It is
used to pay for the computational resources and the transaction fees for any transaction
executed on the Ethereum network. Like Bitcoins, ether is a peer-to-peer currency. Apart
from being used to pay for transactions, ether is also used to buy gas, which is used to pay for
the computation of any transaction made on the Ethereum network.
Also, if you want to deploy a contract on Ethereum, you will need gas, and you would
transaction in Ethereum. Ether can be utilized for building decentralized applications,
building smart contracts, and making regular peer-to-peer payments.
Smart Contracts
Smart contracts are revolutionizing the way how traditional contracts worked, which is
why you need to know about them in this Ethereum tutorial. A smart contract is a simple
computer program that facilitates the exchange of any valuable asset between two parties. It
could be money, shares, property, or any other digital asset that you want to exchange.
Anyone on the Ethereum network can create these contracts. The contract consists primarily
of the terms and conditions mutually agreed on between the parties (peers).
The primary feature of a smart contract is that once it is executed, it cannot be altered,
and any transaction done on top of a smart contract is registered permanently—it is
immutable. So even if you modify the smart contract in the future, the transactions correlated
with the original contract will not get altered; you cannot edit them.
The verification process for the smart contracts is carried out by anonymous parties of
the network without the need for a centralized authority, and that’s what makes any smart
contract execution on Ethereum a decentralized execution.
The transfer of any asset or currency is done in a transparent and trustworthy manner,
and the identities of the two entities are secure on the Ethereum network. Once the
transaction is successfully done, the accounts of the sender and receiver are updated
accordingly, and in this way, it generates trust between the parties.
a) Smart Contracts Vs. Traditional Contract Systems
In conventional contract systems, you sign an agreement, then you trust and hire a
third party for its execution. The problem is that in this type of process, data tampering is
possible. With smart contracts, the agreement is coded in a program. A centralized authority
does not verify the result; it is confirmed by the participants on the Ethereum blockchain-
based network. Once a contract is executed, the transaction is registered and cannot be altered
or tampered, so it removes the risk of any data manipulation or alteration.
Let’s take an example in which someone named Zack has given a contract of $500 to
someone named Elsa for developing his company’s website. The developers code the
agreement of the smart contract using Ethereum’s programming language. The smart contract
has all the conditions (requirements) for building the website. Once the code is written, it is
uploaded and deployed on the Ethereum Virtual Machine (EVM).
EVM is a runtime compiler to execute a smart contract. Once the code is deployed on
the EVM, every participant on the network has a copy of the contract. When Elsa submits the
work on Ethereum for evaluation, each node on the Ethereum network will evaluate and
confirm whether the result given by Elsa has been done as per the coding requirements, and
once the result is approved and verified, the contract worth $500 will be self-executed, and
the payment will be paid to Elsa in ether. Zack’s account will be automatically debited, and
Elsa will be credited with $500 in ether.
Fig 2.4 Smart contract
Ethereum Virtual Machine
EVM, as mentioned above in this Ethereum tutorial, is designed to operate as a
runtime environment for compiling and deploying Ethereum-based smart contracts. EVM is
the engine that understands the language of smart contracts, which are written in the Solidity
language for Ethereum. EVM is operated in a sandbox environment—basically, you can
deploy your stand-alone environment, which can act as a testing and development
environment, and you can test your smart contract (use it) “n” number of times, verify it, and
Any programming language in the smart contract is compiled into the bytecode, which
the EVM understands. This bytecode can be read and executed using the EVM. One of the
most popular languages for writing a smart contract in Solidity. Once you write your smart
contract in Solidity, that contract gets converted into the bytecode and gets deployed on the
EVM. And thereby EVM guarantees security from cyberattacks.
a)Working of EVM
Suppose person A wants to pay person B 10 ethers. The transaction will be sent to the
EVM using a smart contract for a fund transfer from A to B. To validate the transaction; the
Ethereum network will perform the proof-of-work consensus algorithm.
The miner nodes on Ethereum will validate this transaction—whether the identity of A
exists or not, and if A has the requested amount to transfer. Once the transaction is
confirmed, the ether will be debited from A’s wallet and will be credited to B’s wallet, and
during this process, the miners will charge a fee to validate this transaction and will earn a
reward.All the nodes on the Ethereum network execute smart contracts using their respective
EVMs.
b) Proof of Work
Every node in the Ethereum network has:
The entire history of all the transactions—the entire chain
The history of the smart contract, which is the address at which the smart contract
is deployed, along with the transactions associated with the smart contract
The handle to the current state of the smart contract
The goal of the miners on the Ethereum network is to validate the blocks. For each
block of a transaction, miners use their computational power and resources to get the
appropriate hash value by varying the nonce. The miners will vary the nonce and pass it
through a hashing algorithm—in Ethereum, it is the Ethash algorithm.
This produces a hash value that should be less than the predefined target as per the
proof-of-work consensus. If the hash value generated is less than the target value, then the
block is considered to be verified, and the miner gets rewarded.
When the proof of work is solved, the result is broadcast and shared with all the other
nodes to update their ledger. If other nodes accept the hashed block as valid, then the block
gets added to the Ethereum main blockchain, and as a result, the miner receives a reward,
which as of today stands at three ethers. Plus the miner gets the transaction fees that have
been generated for verifying the block. All the transactions that are aggregated in the block—
the cumulative transaction fees associated with all the transactions are also given as a reward
to the miner.
c) Proof of Stake
In Ethereum, a process called proof of stake is also under development. It is an
alternative to proof of work and is meant to be a solution to minimize the use of expensive
resources spent on mining using proof of work. In proof of stake, the miner—who is the
validator—can validate the transactions based on the number of crypto coins he or she holds
before actually starting the mining. So based on the accumulation of crypto coins the miner
has beforehand, he or she has a higher probability of mining the block. However, proof of
stake is not widely used as of now compared to proof of work.
d) Gas
Just like we need fuel to run a car, we need gas to run applications on the Ethereum
network. To perform any transaction within the Ethereum network, a user has to make a
payment—shell out ethers—to get a transaction done, and the intermediary monetary value is
called gas. On the Ethereum network, gas is a unit that measures the computational power
required to run a smart contract or a transaction. So if you have to do a transaction that
updates the blockchain, you would have to shell outgas, and that gas costs ethers.
In Ethereum, the transaction fees are calculated using a formula (see screenshot
below). For every transaction, there is gas and its correlated gas price. The amount of gas
required to execute a transaction multiplied by the gas price equals the transaction fees. “Gas
limit” refers to the amount of gas used for the computation and the amount of ether a user is
required to pay for the gas.
Fig 2.5 Gas value
Below is a screenshot from the Ethereum network showing the transaction cost. You
can see for this particular transaction, the gas limit was 21,000, the gas used by the
transaction was 21,000, and the gas price was 21 Gwei, which is the lowest denomination of
ether. So 21 Gwei * 21,000 gave the actual transaction fees: 0.000441 ethers, or about 21
cents as of today. As mentioned, the transaction fee goes to the miner, who has validated the
transaction.
Fig 2.6 Transaction fees in ethereum
To understand the gas limit and the gas price, let’s consider an example using a car.
Suppose your vehicle has a mileage of 10 kilometers per liter and the amount of petrol is $1
per liter. Then driving a car for 50 kilometers would cost you five liters of petrol, which is
worth $5. Similarly, to perform an operation or to run code on Ethereum, you need to obtain a
certain amount of gas, like petrol, and the gas has a per-unit price, called gas price.
If the user provides less than the amount of gas to run a particular operation, then the
process will fail, and the user will be given the message “out of gas.” And Gwei, as noted
above, is the lowest denomination of ether used for measuring a unit of a gas price.
e) Ethereum Mining Vs. Bitcoin Mining
The hashing algorithm is the primary difference between Ethereum mining and Bitcoin
mining.
Bitcoin uses SHA-256, and Ethereum uses Ethash. The average time taken on Bitcoin
for mining a block is 10 minutes, whereas on Ethereum it is 12 to 15 seconds. As of today,
the mining reward for Bitcoin is 12.5 bitcoins; for Ethereum it’s three ethers plus the
transaction fee—the cumulative transaction fees of all the transactions of a block. As of April
10, 2019, the value of 1 bitcoin is $5249.03, whereas one ether is $180.89.
f) Ethereum Mining VS Bitcoin Mining
Table 1 comparison of Bitcoin and Ethereum
Bitcoin Ethereum
Hashing Algorithm SHA-256 Ethash
Time is taken to An average of 10 An average of 12-15
mine a block minutes seconds
Reward 12.5 BTC 3 ETH
USD - 04/10/2019 1 Bitcoin = 5249.03 1 Ether = 180.89
Below is a screenshot of an Ethereum reward that has been given to the miner of the
block. As you can see, the reward is three ethers plus the total accumulated transaction fees of
all the underlying transactions in this block, which are 0.0666 ethers.
Fig 2.7 Reward calculation in ethereum
Decentralized Applications (Dapps)
Let’s compare decentralized applications with traditional applications. When you log
in to Twitter, for example, a web application gets displayed that is rendered using HTML.
The page will call an API to access your data (your information), which is centrally hosted.
It’s a simple process: your front end executes the backend API, and the API goes and fetches
your data from a centralized database.
Fig 2.8 Dapps
If we transform this application into a decentralized application when you log in, the
same web application gets rendered, but it calls a smart contract-based API to fetch the
interface, and the smart contract will bring the data from the blockchain network, which is its
backend.
That blockchain network is not a centralized database; it’s a decentralized network in
which the participants of the network (the miners) validate (verify) all the transactions that
are happening using the smart contract on the blockchain network. So any transaction or
action happening on a Twitter-type application that has now been transformed will be a
decentralized transaction.
A Dapp consists of a backing code that runs on a distributed peer-to-peer network. It is
a software designed to work in the Ethereum network without being controlled by a
centralized system, as mentioned, and that is the primary difference: it provides direct
interaction between the end-users and the decentralized application providers.
An application qualifies as a Dapp when it is open-source (its code is on Github), and
it uses a public blockchain-based token to run its applications. A token acts as fuel for the
decentralized application to run. Dapp allows the backend code and data to be decentralized,
and that is the primary architecture of any Dapp.
Decentralized Autonomous Organizations (DAOs)
A DAO is a digital organization that operates without hierarchical management; it
works in a decentralized and democratic fashion. So basically a DAO is an organization in
which the decision-making is not in the hands of a centralized authority but preferably in the
hands of certain designated authorities or a group or designated people as a part of an
authority. It exists on a blockchain network, where it is governed by the protocols embedded
in a smart contract, and thereby, DAOs rely on smart contracts for decision-making—or, we
can say, decentralized voting systems—within the organization. So before any organizational
decision can be made, it has to go through the voting system, which runs on a decentralized
application.
Here’s how it works. People add funds through the DAO because the DAO requires
funding in order to execute and make decisions. Based on that, each member is given a token
that represents that person’s percentage of shares in the DAO. Those tokens are used to vote
in the DAO, and the proposal status is decided based on the maximum votes. Every decision
within the organization has to go through this voting process.
Real-World Applications of Ethereum
Voting Systems
As we’ve seen with DAO, voting systems are adopting Ethereum. The results of polls
are publicly available, ensuring a transparent and fair democratic process by eliminating
voting malpractices.
Banking Systems
Ethereum is getting adopted widely in banking systems because with Ethereum’s
decentralized system; it is challenging for hackers to gain unauthorized access. It also allows
payments on an Ethereum-based network, so banks are also using Ethereum as a channel to
make remittances and payments.
Shipping
Deploying Ethereum in shipping helps with the tracking of cargo and prevents goods
from being misplaced or counterfeited. Ethereum provides the provenance and tracking
framework for any asset required in a typical supply chain.
Agreements
With Ethereum smart contracts, agreements can be maintained and executed without any
alteration. So in an industry that has fragmented participants, is subject to disputes, and
requires digital contracts to be present, Ethereum can be used as a technology for developing
smart contracts and for digitally recording the agreements and the transactions based on them.
2.3 POS/POW HYBRID
Understanding POW
In the blockchain network, there are various ways to validate transactions in a
decentralized manner, one is Proof of Work (PoW), and the other is Proof of Stake(PoS).
Now, as we have understood the concept of consensus mechanism, let’s start discussing with
Proof-of-Work (PoW) consensus.
The central principle behind this consensus is to solve complex mathematical
problems and make the largest number of guesses as quickly as possible. Such requires a lot
of computational power, and by using a more efficient mining machine to run calculations, a
miner is able to maximize profitability in terms of crypto rewards. In this type of consensus
mechanism, miners compete to be the first one to find a hash regarding a particular block,
guesses. When a miner finds the right solution, they advertise it to the whole network,
receiving a reward in cryptocurrency, provided by the protocol. Bitcoin is a classic example
that achieves consensus using Proof-of-Work.
The Concept of PoS
Proof-of-Stake is a consensus algorithm that deals with the main drawbacks of PoW.
In this mechanism, every block gets validated before the network adds another block to the
blockchain ledger. Unlike PoW, where miners have to solve complex puzzles, in PoS, miners
can join the mining process using their coins to stake. It allows users to mine for rewards
using very minimal hardware and software resources. Here, the mining capacity of a
particular miner depends on how many coins they already have; thus, the more coins one has,
the better chances are, which indicates only the richest can have control of the consensus.
Moreover, a person with enough money to invest can purchase an insane amount of coins,
thereby reducing the decentralization of the system.
The Hybrid of PoW and PoS
Hybrid PoW/PoS consensus mechanisms utilize elements of both PoW and PoS
models when determining transaction validation rights, and for doing so, hybrid aims to
mitigate the weaknesses of each consensus mechanism.
Decred is the most notable project to utilize both the consensus mechanisms (PoW &
PoS) in recognizable forms and merge them together to produce a hybrid consensus
mechanism. It is a governance-focused cryptocurrency that utilizes neither solely the 1 CPU
= 1 vote of PoW nor the ‘1 token = 1 vote’ of a PoS consensus. Instead, it opts for a hybrid
approach where transactions on the Decred network are validated through a hybrid of both
the consensus mechanisms.
A hybrid consensus starts with having PoW miners to create new blocks containing
transactions to be added to the blockchain. Once these blocks are created, PoS miners decide
whether to confirm them or not. PoS miners purchase votes by staking a portion of their
tokens. However, instead of examining the total vote count, the hybrid PoW/PoS mechanism
randomly chooses 5 ‘votes’ to determine the efficacy of the newly created block; if 3 of the 5
chosen votes are affirmative, the block is added to the blockchain. In exchange for these
services, PoW miners receive 60% of the block reward, PoS miners receive 30%, and the
It is clear that consensus algorithms make the nature of the blockchain networks
versatile. But it is not a single consensus algorithm that can claim it to be perfect. There are
various other consensus mechanisms such as Proof of Activity, Proof-of-Burn, Proof-of-
Weight, amongst others.
Similar to Decred, as already discussed, Hcash is a decentralized, open-source, cross-
platform cryptocurrency that works under the hybrid Pow + PoS consensus mechanism. It
ensures that all PoW-generated blocks must be verified by PoS miners in order to join the
blockchain. Having both miners and stakeholders participating in block production, hybrid
eliminates the possibility of hash power monopoly to a great extent and ensures the security
of the network.
2.5 Cryptocurrency to blockchain 2.0
Blockchain technology has to be one of the biggest innovations of the 21stcentury
given the ripple effect it is having on various sectors, from financial to manufacturing as well
as education. Unknown to many, is that the history of Blockchain dates back to the early
1990s.
Fig 2.9 Evolution of block chain
History of Blockchain Technology
It is important to know about the history of Blockchain for Blockchain enthusiasts and
Blockchain evolution, here we bring a detailed guide to the history of blockchain technology
with its detailed evolution.
1991-2008: Early Years of Blockchain Technology
How did blockchain emerge? Stuart Haber and W. Scott Stornetta envisioned what
many people have come to know as blockchain, in 1991. Their first work involved working
on a cryptographically secured chain of blocks whereby no one could tamper with
timestamps of documents.
In 1992, they upgraded their system to incorporate Merkle trees that enhanced
efficiency thereby enabling the collection of more documents on a single block. However, it
is in 2008 that Blockchain History starts to gain relevance, thanks to the work one person or
group by the name Satoshi Nakamoto.
Satoshi Nakamoto is accredited as the brains behind blockchain technology. Very little
is known about Nakamoto as people believe he could be a person or a group of people that
worked on Bitcoin, the first application of the digital ledger technology. Nakamoto
conceptualized the first blockchain in 2008 from where the technology has evolved and found
its way into many applications beyond cryptocurrencies. Satoshi Nakamoto released the first
whitepaper about the technology in 2009. In the whitepaper, he provided details of how the
technology was well equipped to enhance digital trust given the decentralization aspect that
meant nobody would ever be in control of anything.
Ever since Satoshi Nakamoto exited the scene and handed over Bitcoin development to
other core developers, the digital ledger technology has evolved resulting in new applications
that make up the blockchain History.
Blockchain Structure
In simple terms, Blockchain is a peer-to-peer distributed ledger that is secure and used
to record transactions across many computers. The ledger’s contents can only be updated by
adding another block linked to the previous block. It can also be envisioned as a peer-to-peer
network running on top of the internet.
In layman or businesses term, blockchain is a platform where people are allowed to
The created database is shared among network participants in a transparent manner,
whereby everyone can access its contents. Management of the database is done autonomously
using peer-to-peer networks and a time stamping server. Each block in a blockchain is
arranged in such a way that it references the content of the previous block.
The blocks that form a blockchain hold batches of transactions approved by
participants in a network. Each block comes with a cryptographic hash of a previous block in
the chain.
Evolution of Blockchain: Phase 1- Transactions
2008-2013: Blockchain 1.0: Bitcoin Emergence
Most people believe that Bitcoin and Blockchain are one and the same thing. However,
that is not the case, as one is the underlying technology that powers most applications of
which one of them is cryptocurrencies.
Bitcoin came into being in 2008 as the first application of Blockchain technology.
Satoshi Nakamoto in his whitepaper detailed it as an electronic peer-to-peer system.
Nakamoto formed the genesis block, from which other blocks were mined, interconnected
resulting in one of the largest chains of blocks carrying different pieces of information and
transactions.
Ever since Bitcoin, an application of blockchain, hit the airwaves, a number of
applications have cropped all of which seek to leverage the principles and capabilities of the
digital ledger technology. Consequently, blockchain history contains a long list of
applications that have come into being with the evolution of the technology.
Evolution of Blockchain: Phase 2- Contracts
2013-2015: Blockchain 2.0: Ethereum Development
In a world where innovation is the order of the day, Vitalik Buterin is among a
growing list of developers who felt Bitcoin had not yet reached there, when it came to
leveraging the full capabilities of blockchain technology, as one of the first contributors to the
Bitcoin codebase.
Concerned by Bitcoin’s limitations, Buterin started working on what he felt would be a
network. Ethereum was born out as a new public blockchain in 2013 with added
functionalities compared to Bitcoin, a development that has turned out to be a pivotal
moment in Blockchain history.
Buterin differentiated Ethereum from Bitcoin Blockchain by enabling a function that
allows people to record other assets such as slogans as well as contracts. The new feature
expanded Ethereum functionalities from being a cryptocurrency to being a platform for
developing decentralized applications as well.
Officially launched in 2015, Ethereum blockchain has evolved to become one of the
biggest applications of blockchain technology given its ability to support smart contracts used
to perform various functions. Ethereum blockchain platform has also succeeded in gathering
an active developer community that has seen it establish a true ecosystem.
Ethereum blockchain processes the most number of daily transactions thanks to its
ability to support smart contracts and decentralized applications. Its market cap has also
increased significantly in the cryptocurrency space.
Evolution of Blockchain: Phase 3- Applications
2018: Blockchain 3.0: the Future
Blockchain History and evolution does not stop with Ethereum and Bitcoin. In recent
years, a number of projects have cropped up all leveraging blockchain technology
capabilities. New projects have sought to address some of the deficiencies of Bitcoin and
Ethereum in addition to coming up with new features leveraging blockchain capabilities.
Some of the new blockchain applications include NEO, billed as the first open-source,
decentralized, and blockchain platform launched in China. Even though the country has
banned cryptocurrencies, it remains active when it comes to blockchain innovations. NEO
casts itself as the Chinese Ethereum having already received the backing of Alibaba CEO
Jack Ma as it plots to have the same impact as Baidu in the country.
In the race to accelerate the development of the Internet of Things, some developers,
so it fit, to leverage blockchain technology and in the process came up with IOTA. The
cryptocurrency platform is optimized for the Internet of things ecosystem as it strives to
provide zero transaction fees as well as unique verification processes. It also addresses some
In addition to IOTA and NEO, other second-generation blockchain platforms are also
having a ripple effect in the sector. Monero Zcash and Dash blockchains came into being as a
way of addressing some of the security and scalability issues associated with the early
blockchain applications. Dubbed as privacy Altcoins, the three blockchain platform seek to
provide high levels of privacy and security when it comes to transactions.
The blockchain history discussed above involves public blockchain networks, whereby
anyone can access the contents of a network. However, with the evolution of technology, a
number of companies have started adopting the technology internally as a way of enhancing
operational efficiency.
Large enterprises are investing big in hiring professionals as they seek to gain a head
start on the use of technology. Companies like Microsoft and Microsoft appear to have taken
the lead when it comes to exploring blockchain technology applications resulting in what has
come to be known as private, hybrid, and federated blockchains.
2015: Hyperledger
In 2015, the Linux Foundation unveiled an Umbrella project of open-source
blockchain. They went on to call it Hyperledger, which until to date acts as collaborative
development of distributed ledgers. Under the leadership of Brian Behlendorf, Hyperledger
seeks to advance cross-industry collaboration for the development of blockchain and
distributed ledgers. Hyperledger focuses on encouraging the use of blockchain technology to
improve the performance and reliability of current systems to support global business
transactions.
2017: EOS.IO
EOS brainchild of private company block.one came into being in 2017, on the
publishing of a white paper detailing a new blockchain protocol powered by an EOS as the
native cryptocurrency. Unlike other blockchain protocols, EOS tries to emulate attributes of
real computers including CPU and GPU.
For that reason, EOS.IO doubles up as a smart contract platform as well as a
decentralized operating system. Its main purpose is to encourage the deployment
of decentralized applications through an autonomous decentralized corporation.
Table 2 Blockchain Evolution Timeline
Timeline Blockchain Bitcoin Ethereum
1991- Stuart Haber and Scott
2008 Stornetta Work on The First
Blockchain
2009 Satoshi Nakamoto
Releases Bitcoin
White Paper
2010 The First Bitcoin
Purchase 10,000BTC
take place
2013 Bitcoin Marketplace Vitalik Buterin
Surpasses $1 Billion Releases Ethereum
White Paper
2014 Ethereum Blockchain
Is Funded By
Crowdsale
2014 Blockchain Technology R3
is Formed and forms a
Consortium of Over 40
Legacy financial for
implementing Blockchain
Technology
2014
2015 Ethereum Second
Blockchain Is
Unveiled
2015 Linux Foundation Unveils
Hyperledger To Enhance
Blockchain development
2017 EOS.IO is Unveiled by
block.one as a new
blockchain protocol for the
deployment of decentralized
applications
2015- Blockchain Technology
Timeline Blockchain Bitcoin Ethereum
Depicted by increased
number of cryptocurrencies
as well as Companies
leveraging the Technology
To enhance Efficiency
2020: Blockchain History & The Future
The future of Blockchain technology looks bright, in part, because of the way
governments and enterprises are investing big as they seek to spur innovations and
applications. It is becoming increasingly clear that one day there will be a public blockchain
that anyone can use.
Advocates expect the technology to help in the automation of most tasks handled by
professionals in all sectors. The technology is already finding great use in supply
management as well as in the cloud computing business. The technology should also find its
way into basic items such as search engines on the internet in the future.
As the technology evolves, Gartner Trend Insights expects at least one business built
on blockchain to come into being valued at more than $10 billion by 2022. Due to
the Blockchain Digital Transformation, the research firm expects the business value to grow
to over $176 billion by 2025 and exceed the $3.1 trillion by 2030. The evolution of
Blockchain Technology in recent years has increased the demand for Blockchain
professionals. the companies are also implementing Blockchain to get benefits of the
Blockchain applications.
2.6 Model of Blockchain- Algorand
Algorand is a block chain-based cryptocurrency platform that aims to be secure,
scalable, and decentralized The Algorand platform supports smart contract functionality, and
its consensus algorithm is based on proof-of-stake principles and a Byzantine
Agreement protocol.Algorand's native cryptocurrency is called Algo.
In the Algorand network, the consensus algorithm is permissionless, and all users who
hold an Algo balance can participate. The consensus algorithm works in rounds, with each
round made up of two phases. The first phase is the block proposal phase, during which
blocks are proposed as the new block; the second phase is the block finalization phase, during
which a vote on the proposed blocks is taken.
The first phase (the block proposal phase) uses proof of stake principles. During this
phase, a committee of users in the system is selected randomly, though in a manner that is
weighted, to propose the new block. The selection of the committee is done via a process
called “cryptographic sortition.” In cryptographic sortition, there is not a central authority that
designates who the members of the committee are and then communicates that information
across the network; rather, each user determines whether they are on the committee or not by
locally executing a Verifiable Random Function (VRF). If the VRF indicates that the user is
chosen, the VRF returns a cryptographic proof that can be used to verify that the user is on
the committee.
Only a given user knows whether they are on the committee, unless/until they send a
message to other users indicating that they are. The likelihood that a given user will be on the
committee is influenced by the “stake” (i.e., the number of Algo tokens) held by that user, in
proportion to the size of the user's stake. After determining that they are on the block
selection committee, a user builds a proposed block and disseminates it to the network for
review/analysis during the second phase. The user includes the cryptographic proof from the
VRF in their proposed block, which demonstrates that the user was in fact an eligible
committee member.
In the second phase (the block finalization phase), a Byzantine Agreement protocol
(called “BA⋆”) is used to vote on the proposed blocks. In this second phase, cryptographic
sortition as described above is again used to determine a committee; this second-phase voting
committee will be different from the committee from the first phase, though it is possible that
there could be overlap in membership between the two committees. When users have
determined that they are in this second-phase voting committee, they analyze the proposed
blocks they have received (this will include verifying that they were in fact proposed by users
from the first-phase committee) and vote on whether any of the blocks should be adopted or
not. If the voting committee achieves consensus on a new block, then the new block is
disseminated across the network as the new block.
The Algorand consensus algorithm possess the characteristic of “player
replaceability”; i.e., as noted above, membership in the different committees (in both the
protects users against targeted attacks, as an attacker will not know in advance which users
are going to be in a committee.
Algorand is resilient against arbitrary partitions, also known as asynchronous safety.
Two different blocks cannot reach consensus in the same round, i.e. it is mathematically
guaranteed that Algorand will not fork.The asynchronous safety has also been formally
verified by Runtime Verification Inc. and compared to their previous verification models, the
model also accounts for timing issues and adversary actions, e.g., when the adversary has
control over message delivery.
Smart contracts
Algorand supports two types of smart contracts: stateless smart contracts and stateful
smart contracts. Stateless smart contracts are intended for the purpose of authorizing
transactions; stateful smart contracts store data persistently and can be used for broader
purposes.
Algorand smart contracts can be written in a programming language called Transaction
Execution Approval Language (TEAL). TEAL is a bytecode-based stack language, with
a programming interface for Python that is called PyTeal. While some smart contract
programming models are Turing-complete (for example, Solidity is Turing-complete), the
Algorand smart contracts model is not Turing-complete. The Algorand smart contracts model
does support transaction atomicity. In some other blockchain systems, smart contracts are
used to define user-defined assets; for example, in Ethereum, smart contracts implement the
ERC20 and ERC721 interfaces to define new assets. In Algorand, in contrast, user-defined
assets are supported natively, and Algorand smart contracts are able to manipulate user-
defined assets (for example, by transferring ownership of given amounts of them) using built-
in transaction types.
Understanding Block chain for Enterprises
Understanding Block chain for Enterprises: Permissioned Block chain: Permissioned model
and use cases, Design issues for Permissioned block chains, Execute contracts, State
machine replication, Overview of Consensus models for permissioned block chain-
Distributed Consensus in closed environment, Paxos, RAFT Consensus, Byzantine general
problem,Byzantine fault tolerant system, Lamport-Shostak-Pease BFT Algorithm, BFT
overAsynchronous systems.
Permissioned vs permissionless
Blockchain technology has the potential to revolutionize how businesses operate, especially
when it comes to collaborating with other companies. Here's a breakdown of blockchain for
enterprises:
What is Enterprise Blockchain?
Traditional blockchains, like the one that underlies Bitcoin, are permissionless, meaning
anyone can join and participate. Enterprise blockchains, on the other hand, are permissioned,
meaning only authorized participants can access the network. This allows companies to
control who sees the data and ensures regulatory compliance.
Benefits of Blockchain for Enterprises
● Enhanced Trust and Transparency: With a shared ledger, all participants have
access to the same information, reducing the need for intermediaries and improving
trust between businesses.
● Increased Efficiency: By automating workflows and streamlining processes,
blockchain can significantly reduce operational costs and expedite transaction times.
● Improved Traceability: Blockchain provides a tamper-proof record of transactions,
making it easier to track goods and materials throughout a supply chain.
● Enhanced Security: The distributed nature of blockchain makes it highly resistant to
hacking and fraud.
Use Cases for Enterprise Blockchain
Several industries are exploring the potential of blockchain:
● Supply Chain Management: Track the movement of goods from origin to
destination, ensuring authenticity and provenance.
● Trade Finance: Streamline trade finance processes by automating document
verification and payments.
● Digital Rights Management: Securely manage and track ownership of digital assets
like intellectual property.
● Regulatory Compliance: Meet complex compliance requirements by providing a
secure and auditable record of transactions.
Challenges of Enterprise Blockchain
● Integration with Existing Systems: Integrating blockchain with existing enterprise
systems can be complex and expensive.
● Standardization: The lack of standardization across different blockchain platforms
can create interoperability challenges.
● Scalability: Scaling blockchain solutions to meet the needs of large enterprises can be
difficult.
Permissioned Block chain
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 Blockchain can be either private or consortium blockchains.
● A private blockchain is a permissioned blockchain where access to the network is
restricted to a single organisation.
● A consortium blockchain is a permissioned blockchain where access to the network is
restricted to a group of organisations.
You might consider the addition of permissioned users as an extra blockchain security
system. Administrators maintain an access control layer to allow certain actions to be
performed only by certain identifiable participants. Records are kept within the blockchain of
who is involved in the transactions. This makes permissioned blockchains different from
public blockchains.
● 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 realise their
benefits.
Characteristics of Permissioned Blockchains
1. Controlled Access:
○ Access to a permissioned blockchain is restricted to a predefined list of
participants. This list is managed by a central authority or a consortium of
entities.
○ Participants typically need to go through an identification and verification
○ This access control ensures that only trusted entities can join the network,
enhancing security and trust.
2. Identity Management:
○ Participants' identities are known and authenticated using a Public Key
Infrastructure (PKI).
○ Each participant is issued a digital certificate by a trusted Certificate Authority
(CA), which is used to sign transactions and ensure authenticity.
○ This mechanism prevents anonymity and enhances accountability within the
network.
3. Governance:
○ Permissioned blockchains have well-defined governance structures to manage
the network.
○ Governance can be centralized (managed by a single entity) or decentralized
(managed by a consortium).
○ It includes rules for adding or removing participants, managing updates to the
protocol, and resolving disputes.
4. Customizable Consensus:
○ Consensus mechanisms in permissioned blockchains are often tailored to the
specific needs of the network.
○ Common consensus algorithms include Practical Byzantine Fault Tolerance
(PBFT), Raft, and Federated Consensus.
○ These algorithms focus on speed and efficiency, as the trust model assumes
that participants are semi-trusted.
5. Privacy and Confidentiality:
○ Permissioned blockchains offer enhanced privacy features compared to public
blockchains.
○ Transactions can be encrypted and shared only with relevant parties.
○ Data access can be restricted based on roles and permissions, ensuring that
sensitive information remains confidential.
6. Scalability:
○ With a limited number of nodes and more efficient consensus mechanisms,
permissioned blockchains can achieve higher transaction throughput.
○ The controlled environment allows for optimizations that are not possible in
open, public networks.
Advantages of Permissioned Blockchains
● Faster Transactions: Optimized consensus mechanisms.
● Regulatory Compliance: Easier to meet industry standards.
● Enhanced Security: Reduced risk of unauthorized access.
● Data Privacy: Controlled access to sensitive information.
● Clear Governance: Defined structures for decision-making.
● Potential Centralization: May reduce decentralization benefits.
● Limited Transparency: Less open than public blockchains.
● Scalability Issues: Verification of participants can limit scalability.
● Single Point of Failure: Reliance on central authority or consortium.
● Complex Setup: Requires significant resources to implement and maintain.
● Regulation and censorship
Being a permissioned network these blockchains fall under the purview of regulators.
This means that permissioned blockchains can be regulated or censored and a
transaction can be restricted from being executed.
● Vulnerable to attacks
The consensus protocol in a permissioned blockchain has fewer validators which
makes the network more prone to malicious attacks.
Use Cases for Permissioned Blockchains
1. Supply Chain Management
○ Provenance Tracking: Track origin and journey of goods.
○ Transparency: Real-time visibility into the supply chain.
○ Compliance: Ensure products meet industry standards.
2. Financial Services
○ Clearing and Settlement: Streamline securities transactions.
○ Cross-Border Payments: Facilitate fast, low-cost international payments.
○ Trade Finance: Automate processes, reduce paperwork, and prevent fraud.
3. Healthcare
○ Patient Records: Secure sharing and management of patient data.
○ Drug Traceability: Track production and distribution of pharmaceuticals.
○ Clinical Trials: Ensure transparency and integrity of trial data.
4. Government
○ Voting Systems: Secure, transparent electronic voting.
○ Land Registries: Maintain accurate, immutable records of land ownership.
○ Identity Management: Create secure digital identities for citizens.
5. Consortiums and Industry Groups
○ Collaborative Networks: Enable secure data sharing among organizations.
○ Standardization: Develop and enforce industry standards.
○ Resource Sharing: Pool resources for joint research and development.
6. Insurance
○ Claims Processing: Automate and secure claims management.
○ Fraud Detection: Enhance the detection of fraudulent activities.
○ Policy Management: Efficiently manage and update insurance policies.
7. Real Estate
○ Property Transactions: Simplify and secure property sale and transfer
processes.
8. Energy Sector
○ Grid Management: Enhance the management and distribution of energy.
○ Renewable Energy Credits: Track and trade renewable energy certificates.
○ Energy Trading: Facilitate secure and efficient energy trading.
9. Retail
○ Loyalty Programs: Securely manage and track loyalty points and rewards.
○ Supply Chain: Ensure product authenticity and traceability.
○ Customer Data: Secure management of customer data and preferences.
10. Education
○ Credential Verification: Securely issue and verify educational credentials.
○ Student Records: Efficiently manage and share student records.
○ Research Data: Ensure integrity and security of academic research data.
Design issues for Permissioned blockchains
There are several design issues that need to be considered when implementing a permissioned
blockchain -
1. Access Control -
a. determining who has access to the network, and ability to validate
transactions, managing the access control process.
b. Define roles and permissions for network participants.
c. Implement authentication and authorization mechanisms.
d. Develop processes for access management and revocation.
2. Consensus mechanism - determining the consensus mechanism to be used. Choosing
the right consensus mechanism can be a trade-off between security and performance.
Ensure fault tolerance and resistance to malicious activities.
3. Scalability -
a. Another design issue is scalability, as permissioned blockchains may have a
smaller number of participants as compared to public blockchains.
b. Optimize network architecture for varying numbers of participants.
c. Implement strategies to manage and optimize transaction processing rates,
such as sharding or off-chain solutions.
d. Ensure that the system can scale without excessive resource consumption,
balancing computational load among participants.
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 unauthorised parties.
a. Use encryption and zero-knowledge proofs for data confidentiality.
b. Implement transaction anonymity features as needed.
c. Ensure access control mechanisms protect sensitive information.
5. Regulatory Compliance -
a. Permissioned blockchains are often used in regulated industries, such as
finance and healthcare, and need to comply with existing regulations.
c. Implement features that allow compliance with data retention policies,
including the ability to delete data when required by law.
6. Integration - Permissioned blockchains often need to be integrated with existing
systems, such as enterprise resource planning (ERP) systems.
a. Develop APIs and middleware for seamless integration with existing systems.
b. Maintain data consistency and compatibility with enterprise software.
c. Plan migration strategies for transitioning from legacy systems to the
blockchain.
State machine Replication (SMR)
State Machine Replication (SMR) is a technique used in distributed systems to achieve fault
tolerance and ensure consistency of replicated services. Here’s an overview of how SMR
works:
Key Concepts:
1. Replicated State Machine:
○ SMR involves replicating a state machine across multiple nodes in a
distributed system.
○ The state machine consists of a set of states and a set of transition functions
(commands or operations) that can change the state.
2. Consensus Protocol:
○ SMR relies on a consensus protocol (such as Paxos or Raft) to ensure that all
replicas of the state machine receive the same sequence of commands in the
same order.
○ This ensures that all replicas transition through the same sequence of states,
maintaining consistency.
3. Execution of Commands:
○ Clients submit commands or requests to any replica in the system.
○ The chosen consensus protocol ensures that these commands are ordered and
replicated across all replicas.
○ Each replica independently applies the commands in the same order to its local
state machine.
4. Fault Tolerance:
○ SMR provides fault tolerance by replicating the state machine across multiple
nodes.
○ If a node fails, the system can continue to operate correctly as long as a
sufficient number of replicas remain operational and can form a majority to
reach consensus.
Process Flow:
● Command Submission: A client sends a command (e.g., read, write, update) to any
replica.
● Command Ordering: The receiving replica proposes the command to the consensus
protocol.
● Consensus: The replicas coordinate via the consensus protocol to agree on the order
of commands.
● Execution: Each replica applies the agreed-upon commands to its local state machine
in the same order.
● Response: Once executed, the replicas respond to the client, indicating the outcome
of the command execution.
Advantages:
● Fault Tolerance: SMR ensures that even if some replicas fail, the system can
continue to function correctly.
● Consistency: All replicas maintain the same state due to the replicated state machine
model.
● Durability: Commands are persisted and applied in a durable manner, ensuring that
data is not lost.
Challenges:
● Performance Overhead: Coordinating between replicas can introduce latency and
overhead.
● Complexity: Implementing and maintaining SMR systems can be complex due to the
need for consensus protocols and synchronization mechanisms.
Use Cases:
● Database Systems: Replicating databases to ensure high availability and consistency.
● Distributed File Systems: Ensuring that files are replicated and consistent across
multiple nodes.
● Blockchain: Blockchain networks use a form of SMR to achieve consensus on the
order and validity of transactions.
Overview of Consensus models for permissioned block chain-
Distributed Consensus in closed environment
Definition: It involves multiple nodes agreeing on a single value or decision despite potential
failures or network partitions.
Consensus Protocols: Paxos, Raft, and Zookeeper are common protocols ensuring
agreement among nodes.
Process:
● Agreement: Nodes communicate through the consensus protocol to agree on a single
value.
● Commitment: Once consensus is reached, the agreed-upon value or decision is
committed and becomes the state of the system.
Challenges: Handling node failures, network partitions, and maintaining system
performance.
Use Cases: Essential for databases, distributed storage, and blockchain networks to ensure
consistency and reliability.
Paxos
HISTORY
Paxos is a type of protocols for solving the problem of consensus in distributed networks.
First submitted in 1989, the Paxos protocol is named after a fictional legislative consensus
system on the island of Paxos in Greece.
According to Paxos’ inventor, Leslie Lamport, the parliament had to function “even though
legislators continually wandered in and out of the parliamentary Chamber.”
Thus, Paxos is a metaphor for achieving agreement in unpredictable conditions.
What is the PAXOS Consensus Algorithm?
The PAXOS Consensus Algorithm is a powerful device used in distributed structures to
ensure all of the network’s machines (nodes) agree on a single fee, even if confronted with
network issues or node failures.
1. Paxos is designed to be fault-tolerant and can handle network partitions and failures.
2. There are several variations of the Paxos algorithm that have been proposed,
including Multi-Paxos, Fast Paxos, etc.
3. Complexity: PAXOS is known for its intricate message exchanges and handling of
failure scenarios.
4. Comparison: While powerful, its complexity has led to the development of simpler
alternatives like Raft, which aims to achieve similar consensus results with easier
implementation.
Objectives of the PAXOS Algorithm
PAXOS focuses on achieving three core objectives in a distributed system, but its design also
indirectly contributes to a few other important aspects. Here’s a breakdown of PAXOS’
objectives:
Core Objectives
1. Agreement: This is the essential goal of PAXOS. It ensures that each node in the
machine eventually converges at an equal price for a particular facts item. This
prevents inconsistencies and guarantees all contributors have identical updated
information.
2. Liveness: PAXOS guarantees progress. As long as the network remains mostly
functional and a sufficient number of nodes are operational, a decision will eventually
be made. This prevents the system from getting stuck due to temporary network issues
or unresponsive nodes.
3. Safety: PAXOS prioritizes choosing a valid value. It ensures that the agreed-upon
value must have originated as a proposal from one of the nodes. This eliminates the
possibility of the system adopting a random or invalid value, safeguarding data
integrity.
Secondary Objectives (Achieved Indirectly)
1. Fault Tolerance: By ensuring agreement and liveness, PAXOS inherently contributes
to fault tolerance. The system can continue to operate even if some nodes fail, as long
as a majority remains functional. This allows the system to be resilient to hardware or
software failures.
2. Data Consistency: Since all nodes agree on a single value, PAXOS promotes data
consistency across the distributed system. This is crucial for maintaining reliable and
accurate information throughout the network.
3. Scalability: PAXOS can theoretically function in systems with a varying number of
nodes. While managing a large number of nodes can add complexity, PAXOS itself
doesn’t inherently limit scalability.
4. Partial Ordering: PAXOS can be extended to establish a partial order on the
operations it executes. This means that operations are agreed upon in a specific
sequence, which can be beneficial for applications that require ordered execution of
tasks.
Assumptions of PAXOS
For PAXOS to function effectively, it makes certain assumptions about the underlying
network and participating nodes:
Network Assumptions
Asynchronous Network: PAXOS operates below the belief that the network is asynchronous.
In this approach messages among nodes can be delivered in any order, or maybe not at all.
There’s no assurance of well-timed shipping or receipt of messages. This displays the reality
of distributed systems where network delays, packet loss, and reordering are common
Node Assumptions
Unreliable Processors: Nodes participating in PAXOS are considered unreliable and may
crash or become unresponsive due to hardware or software failures.
Stable Storage: Each node has access to stable storage, which retains data even if the node
crashes or restarts. This storage is crucial for PAXOS to maintain necessary information for
the consensus process and to recover correctly after failures.
No Byzantine Failures: PAXOS assumes the absence of Byzantine failures, where nodes can
behave arbitrarily, including sending misleading or inconsistent messages. PAXOS cannot
handle such failures as they undermine the trust needed for consensus.
Tolerance of Node Failures: Despite node failures, PAXOS is designed to tolerate a certain
level of these failures without compromising its ability to achieve consensus.
In essence, PAXOS operates in an environment where the network is unpredictable and nodes
are fallible, but not malicious. It provides a mechanism for these imperfect components to
collaboratively reach an agreement on a single value.
Phases of PAXOS:
Phase 1: Prepare Phase
● A proposer (node) initiates the process by sending a "prepare" message with a
proposal number (unique and increasing) to a majority of acceptors.
● Each acceptor responds with a "promise" message:
○ It promises not to accept any proposal with a lower number than the received
proposal number.
○ If it has already accepted a proposal, it includes the proposal's number and
value that it has accepted.
Phase 2: Accept Phase
● If a proposer receives responses (promises) from a majority of acceptors in Phase 1, it
can proceed to the accept phase.
● The proposer sends an "accept" message with the proposed value to a majority of
acceptors.
● Acceptors, upon receiving an accept message, accept the proposal if they have not
promised to accept a proposal with a higher number.
Achieving Consensus:
● Consensus is achieved when a proposer receives acknowledgments (acceptances)
from a majority of acceptors for the same proposal number.
● Once a value is accepted by a majority, it is considered chosen.
● Learners eventually learn the chosen value from the acceptors.
Handling Failures:
● PAXOS assumes that nodes may fail or be unresponsive but does not handle
Byzantine failures (arbitrary behavior).
Recovery:
● Nodes use stable storage to remember their state and the proposals they have
promised or accepted.
● After a failure or network partition, nodes can recover and resume the protocol from
where they left off using their stable storage.
PROBLEMS -
Complexity: PAXOS is complex to understand and implement due to its multi-phase
protocol and handling of failure scenarios.
Performance Overhead: The protocol involves multiple message exchanges between nodes,
which can introduce latency and overhead.
Understanding and Debugging: Debugging PAXOS implementations can be challenging
due to the intricate message exchanges and failure recovery mechanisms.
Liveness Issues: In certain scenarios, PAXOS may face challenges in achieving progress
(liveness) if nodes continually fail or are slow to respond.
Configuration and Tuning: Properly configuring PAXOS for different network conditions
and tuning its parameters can be non-trivial and require expertise.
RAFT Consensus
1. RAFT is a consensus algorithm that was developed as an alternative to Paxos.
2. Raft is a leader-based consensus algorithm and it's more understandable than Paxos.
3. In blockchain, Raft can be used as a consensus algorithm to ensure that all nodes in
the network agree on the state of the blockchain.
4. Raft is designed to be fault-tolerant and can handle network partitions and failures,
making it a suitable option for permissioned blockchains.
The RAFT consensus algorithm is a protocol designed to manage a replicated log in a
distributed system. It aims to ensure that multiple servers agree on the same sequence of state
for its simplicity and understandability compared to other consensus algorithms like Paxos.
Here’s an overview of how RAFT works:
Key Components of RAFT
1. Nodes/Roles:
○ Leader – Only the server elected as leader can interact with the client. All
other servers sync up themselves with the leader. At any point of time, there
can be at most one leader(possibly 0, which we shall explain later)
○ Follower – Follower servers sync up their copy of data with that of the
leader’s after every regular time intervals. When the leader server goes
down(due to any reason), one of the followers can contest an election and
become the leader.
○ Candidate – At the time of contesting an election to choose the leader server,
the servers can ask other servers for votes. Hence, they are called candidates
when they have requested votes. Initially, all servers are in the Candidate state.
2. Terms:
○ RAFT divides time into terms, with each term beginning with an election.
Terms are sequentially numbered and used to maintain order and consistency.
RAFT Phases
1. Leader Election:
○ When a follower node does not receive communication from a leader for a
certain period (election timeout), it transitions to a candidate state and initiates
an election.
○ The candidate increments its term, votes for itself, and requests votes from
other nodes.
○ If the candidate receives a majority of votes, it becomes the leader. If no
candidate wins a majority, a new election term begins, and the process repeats.
○ The leader receives commands from clients and appends them to its log.
○ It then sends AppendEntries messages (log entries) to all followers.
○ Followers append these entries to their logs and acknowledge receipt.
○ Once a log entry is replicated on a majority of followers, it is considered
committed, and the leader applies it to its state machine.
○ The leader then notifies followers of the committed entries in subsequent
AppendEntries messages.
3. Safety:
○ RAFT ensures that the leader’s log is always consistent with the majority of
followers.
○ Each log entry has a term number, and the leader can only commit an entry
from its current term if it is stored on a majority of followers.
Additional Concepts
● Log Matching Property: If two logs contain an entry with the same index and term,
then the logs are identical up to that entry.
● Leader Completeness Property: If a log entry is committed in a given term, then it
will be present in the logs of the leaders of all higher-numbered terms.
● Cluster Membership Changes: RAFT allows for dynamic changes to the set of
nodes in the cluster. It uses a two-phase process to ensure consistency during the
membership change.
Advantages of RAFT
● Understandability: RAFT is designed to be easier to understand and implement
compared to other consensus algorithms.
● Strong Leader: RAFT simplifies the consensus process by electing a single leader
who is responsible for managing the replicated log.
● Fault Tolerance: RAFT can tolerate the failure of a minority of nodes and still make
progress.
Example Workflow
1. Normal Operation:
○ A leader is elected.
○ Clients send commands to the leader.
○ The leader appends commands to its log and replicates them to followers.
○ Followers acknowledge the replication.
○ Once a command is replicated on a majority, the leader commits the command
and applies it to its state machine.
○ The leader notifies followers of the committed commands.
2. Leader Failure:
○ One or more followers become candidates and initiate an election.
○ A new leader is elected, and the process continues.
Byzantine general problem
1. 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.
It is basically a game theory problem that provides a description of the extent to which
decentralized parties experience difficulties in reaching consensus without any trusted central
parties.
● The Byzantine army is divided into many battalions in this classic problem called the
Byzantine General’s problem, with each division led by a general.
● The generals connect via messenger in order to agree to a joint plan of action in which
all battalions coordinate and attack from all sides in order to achieve success.
● It is probable that traitors will try to sabotage their plan by intercepting or changing
the messages.
● As a result, the purpose of this challenge is for all of the faithful commanders to reach
an agreement without the imposters tampering with their plans.
2. In blockchain, the Byzantine Generals Problem is relevant because it addresses the
issue of how to reach agreement on the state of the blockchain when some of the
nodes in the network may be faulty or behaving maliciously.
3. This can include issues such as double spending, where a malicious node tries to
spend the same cryptocurrency twice.
4. 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.
Requirements for a Solution:
1. Agreement: All loyal generals must agree on the same plan of action.
2. Validity: If all loyal generals propose the same action, that action must be chosen.
3. Fault Tolerance: The system must be able to handle a certain number of traitorous
generals.
Byzantine fault tolerance(BFT) System
1. A Byzantine Fault Tolerant (BFT) system is a distributed system that can tolerate the
presence of faulty or malicious nodes, also called Byzantine nodes.
2. A BFT system is important in blockchain because it ensures that the network can
continue to function correctly even if some of the nodes are behaving maliciously or
are faulty.
3. This can include issues such as double spending, where a malicious node tries to
4. There are several different approaches to achieving BFT in a distributed system. One
common approach is to use a consensus algorithm, such as PBFT or Raft, that uses a
combination of message passing and voting.
5. Nodes in a BFT system communicate through message passing, exchanging
information to reach consensus on the system's state. This communication ensures
that all non-faulty nodes agree on the same value or decision.
6. To achieve consensus, BFT systems often employ a voting mechanism where nodes
vote on proposed values or actions. The system requires a certain number of votes
(usually a majority) to agree on a decision, ensuring that the influence of faulty nodes
is minimised.
7. BFT systems typically use replication, where each node maintains a copy of the state
machine, ensuring redundancy and reliability.
Byzantine Fault Tolerance (BFT) is a property of a distributed computing system that enables
it to function correctly and reach consensus despite the presence of faulty or malicious
components. These faults are termed "Byzantine" due to their arbitrary and potentially
malicious nature, which can include sending conflicting or misleading information to
different parts of the system.
Definition of Byzantine Fault Tolerance (BFT)
Byzantine Fault Tolerance (BFT): A distributed system is said to exhibit Byzantine fault
tolerance if it can continue to operate correctly and reach consensus even when some of its
components (nodes) fail or behave maliciously. The system should be able to:
1. Achieve Agreement: Ensure that all non-faulty (honest) nodes agree on the same
value or course of action.
2. Maintain Validity: Ensure that if all honest nodes propose the same value, then the
agreed-upon value must be that proposed value.
3. Ensure Fault Tolerance: Handle a specific number of faulty nodes, often represented
as fff, and still reach consensus among the remaining nnn nodes.
Key Characteristics of BFT Systems
1. Redundancy: BFT systems use redundant components to ensure that even if some
nodes fail, there are enough honest nodes to reach consensus.
2. Consensus Protocols: These systems employ sophisticated consensus algorithms to
ensure agreement among nodes. Examples include Practical Byzantine Fault
Tolerance (PBFT) and algorithms used in blockchain technologies like proof-of-work
(PoW) and proof-of-stake (PoS).
3. Message Authentication: To counteract faulty or malicious messages, BFT systems
often use cryptographic techniques to authenticate messages between nodes.
4. Fault Tolerance Limits: A BFT system can typically tolerate up to fff faulty nodes
out of a total of nnn nodes, provided that n≥3f+1n. This ensures that the system can
handle up to n−1/3 faulty nodes.
Examples and Applications
1. Blockchain Technology: Cryptocurrencies like Bitcoin and Ethereum use BFT
principles to achieve consensus across a decentralized network of nodes. The
consensus algorithms ensure that even if some nodes act maliciously, the blockchain
remains secure and accurate.
2. Distributed Databases: Systems like Google Spanner and Apache Cassandra use
BFT to maintain data consistency and availability despite node failures.
3. Cloud Computing: Cloud services ensure reliability and fault tolerance by deploying
BFT mechanisms to handle server failures and ensure seamless service delivery.
4. Aerospace and Avionics: Systems in spacecraft and aircraft use BFT to ensure that
critical operations can continue even in the presence of hardware or software faults.
Lamport-Shostak-Pease BFT Algorithm
1. The Lamport-Shostak-Pease (LSP) algorithm is a Byzantine Fault Tolerance (BFT)
algorithm that was first proposed by Leslie Lamport, Robert Shostak, and Marshall
Pease in 1982.
2. It is a simple and efficient algorithm that can be used to achieve BFT in a distributed
system, such as a blockchain network.
3. In the LSP algorithm, nodes in the network are divided into two groups: generals and
lieutenants.
4. Generals are responsible for proposing values, and lieutenants are responsible for
voting on proposed values.
Algorithm Steps
● Commander Sends Order:
○ The commander starts by sending its order (e.g., "attack" or "retreat")
to all the lieutenants.
● Lieutenants Relay Messages:
○ Each lieutenant, upon receiving the commander's order, sends that
same order to all the other lieutenants. This step is crucial for ensuring
that all lieutenants have the opportunity to hear from each other, not
just from the commander.
● Collecting Orders:
○ Each lieutenant collects the orders it receives from the other
lieutenants. This means each lieutenant will end up with a list of orders
from everyone else, including the original order from the commander.
○ Each lieutenant looks at all the orders it received and decides what the
majority of those orders say. For example, if most of the orders say
"attack," then the lieutenant decides to "attack." If most say "retreat,"
then the lieutenant decides to "retreat."
5. In blockchain, LSP algorithm can be used as a consensus algorithm to ensure that all
nodes in the network agree on the state of the blockchain.
6. LSP is designed to be fault-tolerant and can handle network partitions and failures,
making it a suitable option for permissioned blockchains.
BFT over Asynchronous systems
1. A Byzantine Fault Tolerance (BFT) system is typically designed to work in a
synchronous network, where all nodes have a consistent view of time and can
communicate with each other in a timely manner.
2. When BFT is applied to asynchronous systems, there is a risk of the algorithm being
stuck in an infinite loop, or that it may not be able to reach the agreement on the state
of the blockchain.
3. Byzantine Fault Tolerance (BFT) in asynchronous systems presents additional
challenges compared to synchronous systems due to the lack of guaranteed message
delivery times. In asynchronous systems, messages can experience arbitrary delays,
and there is no global clock to coordinate actions among nodes. Despite these
challenges, achieving BFT in asynchronous systems is crucial for ensuring reliability
and security in many real-world applications, such as blockchain technologies and
distributed databases.
Key Challenges
1. No Bound on Message Delivery Time: In asynchronous systems, messages can be
delayed indefinitely, which makes it difficult to distinguish between a slow node and a
faulty one.
2. Lack of Global Clock: Without a synchronized clock, coordinating actions and
detecting faults becomes more complex.
3. Arbitrary Message Order: Messages can arrive out of order, which can complicate
the process of reaching consensus.
BFT in Asynchronous Systems
To address these challenges, specific algorithms and protocols have been developed. Two
of the most notable ones are:
1. Practical Byzantine Fault Tolerance (PBFT)
2. Asynchronous Byzantine Agreement (ABA)
PBFT
Practical Byzantine Fault Tolerance (PBFT) is a consensus algorithm designed to provide
Byzantine fault tolerance in asynchronous systems, making it particularly suitable for
real-world applications such as distributed databases, blockchain technologies, and other
distributed systems requiring high reliability and security. PBFT was introduced by Miguel
Castro and Barbara Liskov in 1999, and it aims to be efficient and practical for use in real
systems.
Key Concepts of PBFT
1. Fault Tolerance:
○ PBFT can tolerate up to fff faulty nodes out of a total of 3f+13f + 13f+1
nodes. This means that for the system to be fault-tolerant against 1 faulty
node, at least 4 nodes are required.
2. Asynchronous System:
○ PBFT operates in asynchronous environments where there are no guarantees
on message delivery times. It ensures consensus without relying on timing
assumptions.
3. Three-Phase Protocol:
○ PBFT operates through a sequence of three phases: pre-prepare, prepare, and
commit. These phases ensure that all non-faulty nodes reach consensus on the
proposed value.
PBFT Protocol Steps
1. Pre-prepare Phase:
○ The primary (leader) node proposes a value (or request) to be agreed upon. It
sends a pre-prepare message containing the proposed value to all replicas
(nodes).
2. Prepare Phase:
○ Upon receiving a pre-prepare message, each replica verifies the validity of the
proposal. If valid, the replica sends a prepare message to all other replicas.
Each replica waits to receive prepare messages from at least 2f2f2f different
replicas, including its own prepare message.
3. Commit Phase:
○ After collecting at least 2f+12f + 12f+1 prepare messages (which includes the
replica's own message), the replica sends a commit message to all other
replicas. Each replica waits to receive commit messages from at least 2f+12f +
12f+1 different replicas, including its own commit message.
4. Reply Phase:
○ Once a replica collects at least 2f+12f + 12f+1 commit messages, it considers
the proposed value to be committed. The replica then executes the request and
View Change
1. Primary Failure:
○ If the primary node is faulty or fails to send a valid pre-prepare message, the
replicas initiate a view change process to elect a new primary node. The view
change process ensures that the system can continue to make progress despite
the failure of the primary.
2. View Change Process:
○ Each replica sends a view change message to all other replicas. The new
primary is selected based on the view change messages, and the system
transitions to the new view with the new primary proposing the next value.
Efficiency and Practicality
1. Optimized for Performance:
○ PBFT is designed to be practical for real-world systems by minimizing the
number of communication rounds and ensuring that the protocol can handle a
high throughput of requests.
2. Low Latency:
○ The three-phase commit process ensures low latency for reaching consensus,
making PBFT suitable for systems requiring quick response times.
Applications of PBFT
1. Blockchain:
○ PBFT is used in some blockchain platforms to achieve consensus without the
need for energy-intensive proof-of-work mechanisms. Examples include
Hyperledger Fabric.
2. Distributed Databases:
○ PBFT ensures data consistency and reliability in distributed databases by
providing a robust mechanism for agreement among distributed nodes.
3. Financial Systems:
○ PBFT is employed in financial systems where security and fault tolerance are
critical to ensure the integrity of transactions and data.
Asynchronous Byzantine Agreement (ABA)
Asynchronous Byzantine Agreement (ABA) is a fundamental concept in distributed
computing that focuses on achieving consensus among nodes in an asynchronous network
where message delivery times are unpredictable and nodes may behave maliciously
(Byzantine faults). Unlike synchronous systems, where there are known bounds on message
delivery times, asynchronous systems do not provide such guarantees, making consensus
more challenging.
Key Characteristics of ABA
1. Asynchronous Communication:
○ Nodes in the network communicate without any assumptions about message
delivery times. Messages can be delayed indefinitely, arrive out of order, or be
lost.
2. Byzantine Faults:
○ Some nodes may behave arbitrarily or maliciously, sending incorrect or
misleading messages to other nodes. The algorithm must ensure that honest
nodes can still reach agreement despite these faults.
3. Consensus Requirement:
○ All non-faulty nodes must agree on the same value, and if all non-faulty nodes
propose the same value, that value must be the agreed-upon result.
Proposal Phase:
● Each node proposes a value and sends it to all other nodes.
Exchange Phase:
● Nodes exchange the received proposals and record the values they receive from
others.
Random Decision:
● If nodes do not observe a majority of identical proposals, they use a random
mechanism to make a decision (e.g., flipping a coin). This random decision helps
break ties and move the protocol forward.
Commit Phase:
● Nodes exchange their final decisions. If a node observes that a sufficient number of
other nodes have committed to the same value, it commits to that value as well.
Permissioned Blockchain Permissionless Blockchain
Access is restricted to selected participants
Open access for anyone who wants to participate
who have been granted permission by the
in the network without requiring any prior approval.
network owner or consortium.
The anonymity of participants is maintained as
Participants have identified identities and their
they do not require identification before
actions are traceable.
participating in the network.
Transactions are validated through a Validation of transactions occurs through a
consensus mechanism involving pre-selected decentralized consensus mechanism such as
nodes or entities. Proof of Work (PoW) or Proof of Stake (PoS).
Scalability can be achieved through Decentralization ensures scalability but may result
centralization or selective participation. in slower transaction processing times.
Changes to the protocol require consent from Frequent updates and changes to the protocol due
all involved parties, ensuring stability and to the absence of a central authority could impact
security. stability and security.
Suitable for enterprise use cases where Ideal for public applications such as
privacy, control, and regulatory compliance are cryptocurrencies, digital assets, and decentralized
critical factors. finance platforms.
BLOCKCHAIN NOTES (CH-4)
Enterprise application in Blockchain – Unit 3 mein hai
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
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.
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 macro-
economic 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.
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
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
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, drawn-
out 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.
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
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
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
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
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),
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
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
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
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
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 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
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.
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
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
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 post-
pandemic world.
Benefits of blockchain enabled trade
1. Lower risk and operational costs: Quickly process credits and
positions and transaction histories, and monitor transactions from
start to finish.
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
Most of the trade finance activities involve a substantial amount of
physical paperwork being shuffled back and forth between the importer,
exporter, 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
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
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.
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:
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 medium-
sized 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.
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.
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.
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 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-of-
birth, 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
Identity theft
People share their personal information online via different unknown
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
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
Now, let’s understand how could Blockchain Identity Management
work
Currently, people need the right way to manage their identity than paper-
based 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 self-
certification 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.
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 self-
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.
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.
• 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 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, 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
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 self-
regulated business logic in smart contracts, leaving a non-
repudiable 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 blockchain-
based application. Let’s understand how to start with blockchain app
development and what steps are required to develop an app successfully.
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
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.
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.
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
be a final application and can be launched.
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?
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.
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
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.
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 key-
value 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, damage-
resistant 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.
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
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
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 enterprise-
grade 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
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.
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 Attribute-
Based Access Control (ABAC) policies. Roughly speaking, an attribute-
based 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
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
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.
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.
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.
• 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
addition to doing anything else we want them to do by using either
one of the following languages: JavaScript, TypeScript, Java or Go
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.
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 testing and deployment environment.
• Deploy directly to Mist or MetaMask.
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
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
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.
• 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?
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.