Block Chain Technology Full Notes
Block Chain Technology Full Notes
Enhanced security,
greater transparency,
instant traceability,
automation.
…
Blockchain technology has the following five core components that include but are not
limited to the following.
First, every blockchain has a tamper-resistant ledger, which is where the transactions
and other information that have occurred on the blockchain network are stored.
Second, this information stored on the ledger is approved, before posting on the
network itself, via some sort of consensus methodology that enables network members
to jointly confirm that data are presented correctly.
Fourth, the management of this entire process (i.e., the way in which data are
confirmed and added to the network itself) is generally managed by full nodes, playing
an important role in maintaining the integrity of the blockchain network.
Fifth, every blockchain is in some way defined by the peer-to-peer (P2P) nature of
transactions that underpin the entire blockchain ecosystem, which greatly reduces the
need for intermediaries and other third-party organizations.
Nodes form the structure of the blockchain network. Nodes on the network are tasked
with different responsibilities, such as a miner and a validator. Nodes are devices with
computational power and a node application installed. Different blockchains have
different node applications containing the data and the rules to act as nodes on the
respective blockchain.
Distributed ledger
The distributed ledger is also known as the database of the blockchain. Every node on
the network has a copy of the ledger to provide fault tolerance to the network. A ledger
is immutable and visible to everyone on the blockchain network. It is made up of
sequentially linked blocks containing assets. Blocks are linked together using the
previous block’s hash.
Code blocks: Blockchains like Ethereum use it to store code in the form of smart
contracts, which serves as the basis of the concept of Dapps.
Consensus algorithm
Virtual machine
Blockchains like Ethereum run virtual machines on their nodes. They are used to
execute code written in smart contracts. This is done to ensure that if the code being
executed on the nodes contains malware, it will not affect the node executing the code.
State Database
Public Ledgers
A ledger is a record-keeping system: it tracks value as is moves around, so the viewer can
always see exactly what value resides where at a given moment. Traditional finance
systems like banks use ledgers to track all transactions completed within a period.
A public ledger is
The Bitcoin and Ethereum blockchains are both considered public ledgers.
Public ledgers are also the most secure blockchains; they maintain a pseudo-anonymous
system for their users’ identities. While all transactions are recorded publically, user
identities remain private.
This means that while you can view any wallet address with its balance and transaction
records, you cannot gain access to the identity of the wallet owner.
Bit coin
Bitcoin emerged out of the 2008 global economic crisis when big banks were caught
misusing borrowers' money, manipulating the system, and charging exorbitant fees. To
address such issues, Bitcoin creators wanted to put the owners of bitcoins in-charge of the
transactions, eliminate the middleman, cut high interest rates and transaction fees, and
make transactions transparent. They created a distributed network system, where people
could control their funds in a transparent way.
Smart Contracts
A Smart Contract (or cryptocontract) is a computer program that directly and automatically
controls the transfer of digital assets between the parties under certain conditions.
The bitcoin network was the first to use some sort of smart contract by using them to
transfer value from one person to another.
The smart contract involved employs basic conditions like checking if the amount of value
to transfer is actually available in the sender account.
Later, the Ethereum platform emerged which was considered more powerful, precisely
because the developers/programmers could make custom contracts in a Turing-complete
It is to be noted that the contracts written in the case of the bitcoin network were written in a
Turing-incomplete language, restricting the potential of smart contracts implementation in
the bitcoin network.
if/then/when…
Distributed: A smart contract is replicated and distributed by all the nodes connected
to the network
Deterministic: Smart contracts can only perform functions for which they are designed
only when the required conditions are met.
Immutable: Once deployed smart contract cannot be changed, it can only be removed
as long as the functionality is implemented previously.
Customizable
Transparent
Self-enforcing: These are self-enforcing when the conditions and rules are met at all
stages.
Chain code
https://hyperledger-fabric.readthedocs.io/en/release-1.3/chaincode.html
Legal issues
The legal issue of smart contracts is another crucial aspect of smart contract
challenges. For example, the European General Data Protection Regulation (GDPR)
stipulates that citizens have a “right to be forgotten” which is inconsistent with the
immutable nature of blockchain-enabled smart contracts.
Immutability issue
dark side of the immutability concept in smart contracts lies mainly in the fact that in the
event of any errors made in the code, the immutability feature of a smart contract
prevents it from being rectified.
Scalability issue
Scalability is the primary concern for many blockchain networks. For instance, the
Ethereum blockchain can verify 14 transactions per second, which is slow as compared
with Visa that can handle up to 24,000 transactions per second.
The consensus mechanism plays the leading role to maintain security, scalability, and
decentralization in the blockchain networks at the same time. There are several
existing consensus algorithms, including Proof-of-Work (PoW), Proof-of-Stake (PoS),
etc. Although the PoW algorithm enables security in the blockchain, it wastes
resources. Thus, many organizations switch from the PoW algorithm to new consensus
mechanisms that promise lower fees for transactions as well as lower energy costs for
the block production process.
Structure of blocks
The structure of a block is different for every blockchain. However, a general structure of a
block is as follows:
Block's structure
Header
Body
Header
A block's header contains information about the block and the miner. It is further divided
into subparts which are as follows:
Previous block's hash—This is the hash of the previous block. It chains the blocks
together and makes the data in the previous blocks immutable. If data in the previous
blocks is changed, then the hash of that block will change causing the unchaining of
the blockchain.
Other block header fields—These fields can vary depending on the different
requirements of different blockchains.
Some of the common fields are as follows:
Nonce: This is an integer that a miner changes to change the hash of the block to
achieve the network's difficulty.
Merkel root hash: Hashes pair off transactions until only one hash remains, called
a root hash or a Merkel root hash.
Block height: The number of blocks mined between the genesis block and the
current block.
Body
It includes all the data stored in the block, such as transactions. Every blockchain has a
different format for storing transactions. An array of transactions is stored in the body of the
block.
Transactions
Blockchain technology is mostly about the transactions that we make digitally for ourselves.
Eventually, these transactions make their way to the various blocks that become part of the
This lifecycle follows the journey of a single transaction as it makes its way through each
stage in the process of joining the blockchain. Transaction in simple words is the process of
sending money by the sender and the receiver receiving it. The Blockchain transaction is
also quite similar, but it is made digitally.
Distributed Consensus
Features :
Step 1: Elect
Step 2: Vote
Step 3: Decide
In a public blockchain, no
one knows who each
In a private blockchain,
validator is and this
there is no chance of minor
increases the risk of
collision. Each validator is
Attacks potential collision or a 51%
known and they have the
attack (a group of miners
suitable credentials to be a
which control more than
part of the network.
50% of the network’s
computing power.).
Potential to disrupt current
business models through
Reduces transaction cost
disintermediation. There is
and data redundancies and
lower infrastructure cost. No
replace legacy systems,
need to maintain servers or
Effect simplifying documents
system admins radically.
handling and getting rid of
Hence reducing the cost of
semi manual compliance
creating and running
mechanisms.
decentralized application
(dApps).
Bitcoin, Ethereum, Monero,
R3 (Banks), EWF (Energy),
Examples Zcash, Dash, Litecoin,
B3i (Insurance), Corda.
Stellar, Steemit etc.
By creating its own native cryptocurrency, the blockchain network can reward validators for
their contribution by issuing block rewards and transaction fees payable on such
cryptocurrency.
If this was not the case, validator’s compensation would be limited to transaction fees paid
by users through two alternative mechanisms, each with burdensome implications:
In both alternatives, blockchain users would require accepting some features present on
the payment system or external blockchain, as well as losing noncompatible attributes. For
example, both options would constrain blockchain transactions speeds to the transaction
speed of the off-chain payment system or external blockchain. It would restrict the universe
of potential users and validators to those individuals and insti- tutions with access to the
selected payment system. For the case of pay- ments through traditional financial networks,
it would most likely require eliminating the blockchain’s anonymity and pseudonymity
attributes since validators would need to be identifiable to receive payments.
Cryptocurrency can be stored in several ways, but the most common is through a digital
wallet. A digital wallet can be software-based, web-based, or hardware-based.
Permissioned blockchains are blockchain networks that require access to be part of.
In these blockchain types, a control layer runs on top of the blockchain that governs
the actions performed by the allowed participants.
It allows information access to all designated nodes or members who can record, share,
and view encrypted transactional data on their blockchain.
Sybil attacks. Named for the book that deals with multiple personality disorder, Sybil
attacks flood the target network with an overwhelming amount of false identities,
crashing the system.
Phishing attacks. This classic hacker tactic works with blockchain as well. Phishing is
a scam wherein cyber-criminals send false but convincing-looking emails to wallet
owners, asking for their credentials.
Use of Cold Wallet: Cold Wallets do not connect to the Internet, therefore users can
secure their private keys. The wallet is not prone to cyberattacks.
Blockchain Penetration Testing: Those who create blockchain networks should get
penetration testing done by an ethical hacker to test the strength of the security
blockchain networks and find vulnerabilities if present.
Secure keys: Keys should be secured by the user. Strong cryptographic keys should
be used Users should not share the keys with other users.
Each user should be verified before allowing them to access the blockchain.
All transactions within the blocks are validated by business users and are agreed upon
by a consensus mechanism.
1. Hash Function
a. A hash function is a mathematical function that converts a numerical input value into
another compressed numerical value. The input to the hash function is of arbitrary
length but output is always of fixed length.
b. They are efficient and are well-known for one property: they are irreversible. It's a
one-way function that's only meant to work in one direction.
c. For example, SHA-256 is a hash function in which for any variable-bit length input, the
output is always going to be a 256-bit hash.
a. Fixed Length Output (Hash Value): Hash function coverts data of arbitrary length to a
fixed length. This process is often referred to as hashing the data.
Second Pre-Image Resistance: This property means given an input and its hash, it should
be hard to find a different input with the same hash.
Collision Resistance: This property means it should be hard to find two different inputs of
any length that result in the same hash. This property is also referred to as collision free
hash function.
A regular pointer stores the memory address of data. With this pointer, the data can be
accessed easily.
On the other hand, a hash pointer is a pointer to where data is stored and with the pointer,
the cryptographic hash of the data is also stored.
So a hash pointer points to the data and also allows us to verify the data.
A hash pointer can be used to build all kinds of data structures such as blockchain and
Merkle tree.
Blockchain Structure
The blockchain is a proficient combination of two hash-based data structures—
1. Linked list: This is the structure of the blockchain itself, which is a linked list of hash
pointers. A regular linked list consists of nodes. Each node has 2 parts- data and pointer.
The pointer points to the next node. In the blockchain, simply replace the regular pointer
with a hash pointer.
Merkle tree
Merkle trees, also known as Binary hash trees, are a prevalent sort of data structure in
computer science.
A Merkle tree is a binary tree formed by hash pointers, and named after its creator, Ralph
Merkle.
As mentioned earlier, each block is supposed to hold a certain number of transactions. Now
the question arises, how to store these transactions within a block? One approach can be
to form a hash pointer-based linked list of transactions and store this complete linked list in
a block. However, when we put this approach into perspective, it does not seem practical to
store a huge list of hundreds of transactions. What if there is a need to find whether a
particular transaction belongs to a block? Then we will have to traverse the blocks one by
one and within each block traverse the linked list of transactions.
This is a huge overhead and can reduce the efficiency of the blockchain. Now, this is where
the Merkle tree comes into the picture. Merkle tree is a per-block tree of all the transactions
that are included in the block. It allows us to have a hash/digest of all transactions and
provides proof of membership in a time-efficient manner.
So to recap, the blockchain is a hash-based linked list of blocks, where each block
consists of a header and transactions. The transactions are arranged in a tree-like
fashion, known as the Merkle tree.
It's a mathematical data structure made up of hashes of various data blocks that
summarize all the transactions in a block.
It also enables quick and secure content verification across big datasets and verifies the
consistency and content of the data.
A Merkle root is a simple mathematical method for confirming the facts on a Merkle
tree.
They play a very crucial role in the computation required to keep cryptocurrencies like
bitcoin and ether running.
A Merkle tree totals all transactions in a block and generates a digital fingerprint of the
entire set of operations, allowing the user to verify whether it includes a transaction in
the block.
Merkle trees are made by hashing pairs of nodes repeatedly until only one hash
remains; this hash is known as the Merkle Root or the Root Hash.
They're built from the bottom, using Transaction IDs, which are hashes of individual
transactions.
Validate the data's integrity: It can be used to validate the data's integrity effectively.
Takes little disk space: Compared to other data structures, the Merkle tree takes up
very little disk space.
Tiny information across networks: Merkle trees can be broken down into small
pieces of data for verification.
Efficient Verification: The data format is efficient, and verifying the data's integrity
takes only a few moments.
Proof of Membership
A very interesting feature of the Merkle tree is that it provides proof of membership.
Example: A miner wants to prove that a particular transaction belongs to a Merkle tree
Now the miner needs to present this transaction and all the nodes which lie on the path
between the transaction and the root. The rest of the tree can be ignored because the
hashes stored in the intermediate nodes are enough to verify the hashes all the way up
to the root.
If there are n nodes in the tree then only log(n) nodes need to be examined.
Hence even if there are a large number of nodes in the Merkle tree, proof of
membership can be computed in a relatively short time.
Encryption and decryption address problems of eavesdropping, but they do not address
tampering and impersonation. However, public-key cryptography does address the
problems of tampering and impersonation.
You can use your private key for encryption and your public key for decryption. Although
this is not desirable when you are encrypting sensitive data, it is an important part of
digitally signing any data. Rather than encrypting the data itself, you can create a one-way
hash of the data and then use your private key to encrypt the hash. The encrypted hash,
along with other information like the hashing algorithm, is known as a digital signature.
Below figure shows a simplified view of how you can use a digital signature to validate the
integrity of signed data.
Public key cryptography involves a pair of keys known as a public key and a private key (a
public key pair), which are associated with an entity that needs to authenticate its identity
electronically or to sign or encrypt data. Each public key is published and the corresponding
private key is kept secret. Data that is encrypted with the public key can be decrypted only
with the corresponding private key.
RSA public key pairs can be any size. Typical sizes today are 1024 and 2048 bits.
Encryption and decryption, which allow two communicating parties to disguise data that
they send to each other. The sender encrypts, or scrambles, the data before sending it.
The receiver decrypts, or unscrambles, the data after receiving it. While in transit, the
encrypted data is not understood by an intruder.
The sender of the data from claiming, at a later date, that the data was never sent
First, bitcoin is divisible similar to how fiat currency units are divisible into smaller units of
previously existing units. The division takes place digitally in the form of bitcoin and other
cryptocurrencies, but the divisibility still exists.
Second, any medium of exchange (money) must also be useful as a unit of account, which
bitcoin partially fulfills. Despite prior price volatility and continued lower levels of volatility,
bitcoin has a value in other forms of currency. In fact, after the 2017 price bubble, volatility
decreased substantially.
Third, any medium of exchange must be portable. That is, it must be able to be transferred
across borders and boundaries. As a digital medium of exchange, bitcoin is easily portable
and can be transferred across borders without fees.
divisible
convertible
portable
Creation of coins
Each time a cryptocurrency transaction takes place, a cryptocurrency miner, who also
serves as a node on the blockchain on which these transactions are taking place, tries to
decrypt the block containing the transaction information. For example, if Person Y wants to
send 0.1 Bitcoins to Person Z, then miners on the Bitcoin blockchain compete to be the first
to decrypt the block that contains the transaction information.
Decrypting the block not only authenticates the transaction, but also provides the
information about who sent how many Bitcoins to whom and at what time and date. Once
the block has been decrypted and has been accepted by most of the nodes on the
blockchain as being authentic, the block is added to the blockchain.
Now, the verification process is pretty resource intensive in terms of the computational
power required. As such, individual miners often find the process too expensive and so they
join pools to collectively use computing power.
So, the question is, if the mining process is so expensive, why do miners compete to
decrypt blocks? The answer to this lies in the rewards mechanisms. In return for their
services, the cryptocurrency miner is rewarded with a fraction of new units of the
cryptocurrency. In other words, the miners are paid in the cryptocurrency that they
By pooling their resources, miners increase their chances of success and spread out
the costs, but they also then get only a share of the rewards.
Coins vs Tokens
Cryptocurrencies are largely divided into two groups—coins and tokens. Coins and tokens
are distinct and different from each other, and each has potential advantages for different
types of businesses.
A coin is that application of cryptocurrencies that runs on its own blockchain, which is
where all the transactions take place. Some of the larger examples of coins are Bitcoin,
Etherium, Dogecoin, etc. These are the assets that people can invest in and exchange. If
somebody wants to create a new coin, they would have to create a new blockchain.
A token, on the other hand, functions on top of an existing blockchain infrastructure and are
often used like smart contracts, which can be used for physical objects as well as services,
physical and digital. One of the main reasons companies consider issuing a token is for a
security token offering, which various projects and start-ups use to raise funds.
Double spending
In a physical currency, the double-spending problem can never arise. But in digital cash-like
bitcoin, the double-spending problem can arise. Hence, bitcoin transactions have a
possibility of being copied and rebroadcasted. It opens up the possibility that the same BTC
could be spent twice by its owner.
Let us suppose you have 1 BTC and try to spend it twice. You made the 1 BTC
transaction to Alice. Again, you sign and send the same 1 BTC transaction to Bob. Both
transactions go into the pool of unconfirmed transactions where many unconfirmed
transactions are stored already. The unconfirmed transactions are transactions which
do not pick by anyone. Now, whichever transaction first got confirmations and was
verified by miners, will be valid. Another transaction which could not get enough
confirmations will be pulled out from the network. In this example, transaction T1 is
valid, and Alice will receive the bitcoin.
Bitcoin Script is the language Bitcoin uses to do everything it can do, from sending funds
from a wallet to allowing the creation of multi-user accounts. All these functionality
contained in a simple extensible and powerful tool that we will know next.
This is based on a series of linear structures, known as stack, which contain existing data
in order LIFO (Last In - Firt Out).
This language is not Full Turing because its functionality is limited and cannot loop
In the Bitcoin network, each Bitcoin Script is divided into two types of scripts, the scriptSig
& scriptPubKey.
First, the scriptSig is the unlock script, which requires a public key and a digital
signature.
The second, the scriptPubKey, is the blocking script, which contains a public key
hash, also called a Bitcoin address.
On the other hand, there are the OP_CODES (Operation Code) that in the operation are
the following:
Peer-to-peer (P2P) networks are a type of network architecture where each node or
participant has the same capabilities and functions as both client and server. In P2P
networks, all nodes are equal, and resources such as files, data, and computing power are
shared directly among the users without the need for a central server.
P2P is a technology that is based on a very simple principle, and that is the concept of
decentralization. The peer-to-peer architecture of blockchain allows all cryptocurrencies
to be transferred worldwide, without the need of any middle-man or intermediaries or
central server. With the distributed peer-to-peer network, anyone who wishes to
participate in the process of verifying and validating blocks can set up a Bitcoin node.
Validation of transactions
Each node contains a copy of the transaction records and participates in the process of
adding new blocks to the chain.
Based on the consensus mechanism used, the nodes compete by solving extremely
complex mathematical problems to validate transactions and add blocks to the chain.
The node which adds blocks to the chain is rewarded with the native cryptocurrency of
the blockchain.
Nodes are thus able to ensure only valid transactions are included in the ledger,
ensuring its integrity is maintained.
Pros
Because of P2P networking capability, even if one peer gets down, the other peers are
still present. Thus nobody can take down the blockchain.
When you are using cloud computing to store your data, you need to trust AWS and
Google drives, but with the blockchain, because it utilizes peer to peer network you
don’t need to trust any third parties which can modify your crucial data. These are non-
resistant to censorship by central authorities.
Cons
Bitcoin transaction means sending bitcoin from one person to the other in the secured
blockchain network. These are messages that are digitally signed using cryptography and
are verified by the miners that are present in the blockchain network. The miner is the
person who solves mathematical puzzles(also called proof of work) to validate the
transaction.
The transaction input is the bitcoin address from which the money was sent, and the
transaction output is the bitcoin address to which the money was sent. Generally, a bitcoin
transaction takes 10 to 20 minutes to confirm any transactions. if network congestion takes
place, then time might take even 60 minutes.
An input:
This is a record of the BTC address from which X initially received the bitcoin he
wants to send to Y.
An amount:
An output:
Transaction Fees
The transaction rate or speed is dependent on the amount the user pays for it. If a user
pays a small amount, the transaction rate will be slow, the transaction will take more
time to happen, vice versa is applicable here. Due to limited space, only a limited
number of transactions are possible at one point in time.
Bitcoin makes use of public-key cryptography to ensure the integrity of transactions created
on the network. In order to transfer bitcoin, each participant has pairs of public keys and
private keys that control pieces of bitcoin they own. A public key is a series of letters and
numbers that a user must share in order to receive funds. In contrast, a private key must be
kept secret as it authorizes the spending of any funds received by the associated public
key.
Bitcoin Mining is the process of verifying bitcoin transactions and storing them in a
blockchain(ledger).
Types of Mining
Block propagation
The lack of scalability is known to be the foremost obstacle standing in the way of mass
adoption of blockchain technology.
All existing blockchain projects look for solutions that could improve the performance of
their network.
After the invention of decentralized peer-to-peer network Bitcoin, researchers got interested
in what determines the limits of Bitcoin’s scaling.
Soon the core issue was determined and described in terms of block propagation time or
block propagation delay.
If some node has got the new valid block, it informs nodes connected to it about its new
possession.
Then the node transfers this block to those nodes which asked it to do that. Before the
block reaches each full-node in the network, it passes through 7 intermediary nodes.
It is important that every honest node verifies the block before relaying it to other peers.
It is important that even in the worst-case scenario, the propagation delay should be
reasonable so that miners will keep their nodes synchronized most of the time and will
always verify proposed blocks.
Whenever people talk about the scalability of the blockchain, they mention the transaction
throughput of the system.
Block relay
A Bitcoin Relay Network is a network that attempts to minimize the latency in the
transmission of blocks between miners.
The original Bitcoin Relay Network was created by core developer Matt Corallo in 2015 to
enable fast synchronization of blocks between miners with very low latency.
The network consisted of several specialized nodes hosted on the Amazon Web Services
infrastructure around the world and served to connect the majority of miners and mining
pools.
The original Bitcoin Relay Network was replaced in 2016 with the introduction of the Fast
Internet Bitcoin Relay Engine or FIBRE, also created by core developer Matt Corallo.
FIBRE is a UDP-based relay network that relays blocks within a network of nodes. FIBRE
implements compact block optimization to further reduce the amount of data transmitted
and the network latency.
Relay networks are not replacements for bitcoin's P2P network. Instead they are
overlay networks that provide additional connectivity between nodes with specialized
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.
Thus, a consensus algorithm aims at finding a common agreement that is a win for the
entire network.
Proof of Capacity
algorithm is used to confirm the transaction and creates a new block to the chain
In this algorithm, miners (a group of people) compete against each other to complete the
transaction on the network. The process of competing against each other is called mining.
As soon as miners successfully created a valid block, he gets rewarded. The most famous
application of Proof of Work(PoW) is Bitcoin
A new Block is created in every 10 Minutes. The more Miners there are, the harder the
puzzle is. Mining Difficulty is adjusted every 2 weeks
Mining Pool means one such Mining Unions - When Many Miners Mining by Making
Pool
Disadvantages of POW
Only one gets Reward, but a lot of Miners' Energy Wastage takes place while solving
the puzzle.
technology gained wide popularity thanks to its implementation in the Bitcoin and many
others cryptocurrencies
Once said work is verified, the user is allowed to use the resource.
Use in email is based on adding an encrypted header to the email. This header has the
information generated by the user using the HashCash system. This is a kind of seal that
ensures that the mail has passed the proof of work. This seal is an identifier that shows that
the sender has used the processor for a small amount of time.
It is based on the idea that if a certain user has used their processor to generate this
stamp, it is unlikely that they are a spammer. Receivers with a very low almost
negligible computational cost can verify this. In this way we can guarantee that it is not
spam.
Protection of connections
hashing functions create a unique signature for each block of stored data. Thanks
to this signature, the system is able to verify their authenticity
Bitcoin uses the Hashcash Proof of Work system as the mining basis.
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 the solution to the problem and hence the mined
block must be valid.
The answer to the 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.
Time-consuming
Resource consumption
Attacks on PoW
2 major attacks by which PoW based systems can crash
Sybil Attacks
In this attack, the attacker attempts to fill the network with the clients under its control
so that he can refuse to relay valid blocks and can perform double spending.
In Simple language, The attacker can include multiple nodes in the network who can
collectively compromise the Proof of Work mechanism.
Solution
Bitcoin makes these attacks more difficult by only making an outbound connection
to one IP address per /16 IP address
The attacker sends a lot of data in the network to make it busy so that the actual
transactions are not able to take place.
Solutions:
Monopoly problem
During bitcoin’s early days, anyone could “mine” it using their home computer. But as the
price of digital currency climbed towards $100 in 2013 (it’s now over $4,000), professional
mining groups with specialised computer chips emerged. Today, these groups, or pools —
nearly all based in China — have become concentrated and now dominate the production
of new bitcoins.
Miners are getting less rewards over the time. So, they are discouraged to join as a
miner.
Proof of Stake
A person can mine or validate block transactions according to how many coins he or she
holds. This means that the more Bitcoin or altcoin owned by a miner, the more mining
power he or she has.
The first cryptocurrency to adopt the PoS method was Peercoin. In Peercoin, the
coinage is used as a variation of stake. Coinage is calculated by multiplying number of
coins by the number of days the coins have been held.
If the attacker holds majority of bitcoins, then the majority affect will be on attacker only.
Proof of Burn
To burn the coins, miners send them to a verifiably un-spendable address. This process
does not consume many resources other than the burned coins.
PoB works by burning PoW mined cryptocurrencies. It is power efficient unlike PoW.
In this each participant in the blockchain network waits a random amount of time. The first
participant to finish waiting gets to be leader for the new block.
To verify that the proposer has really waited for the random amount of time, it relies on a
special CPU instruction set called Intel Software Guard Extensions (SGX). SGX allows
applications to run trusted code in a protected environment.
Responsibilities of a miner:
Validate transactions and construct a block.
Use hash power to vote on consensus and commit transactions with a newblock.
Listens for new blocks, then validate and re-broadcast a new block when it is proposed.
Mining Difficulty
Mining difficulty is a measure of the amount of difficulty in finding the hash below a given
target.
Bitcoin has a global block difficulty while mining pools have a pool-specific share difficulty.
In Bitcoin, the difficulty changes for every 2016 blocks. The desired rate is that it
should take two weeks to mine 2016 blocks provided one block is mined in 10 minutes.
If it takes less than two weeks to mine 2016 blocks, then the difficulty is increased. If it
takes more than two weeks to mine 2016 blocks, the difficulty is decreased.
The expected number of hashes we need to calculate to find a block with difficulty D is :
Mining Pool
When the resources are pooled by miners, they create a mining pool.
The processing power is shared by miners over a network to mine a new block.
The reward is split proportionally to the amount of work each miner has contributed.
Slush Pool is the oldest currently active mining pool. AntPool is the largest currently
active mining pool.
Although mining pool allows small miners to participate in the mining process, it also
discourages miners for running complete mining procedure.
This places restrictions on who is allowed to participate in the network, and only in certain
transactions.
Permissioned blockchain tends to be fast as they can choose their own consensus
method and do not need every node for validation purposes.
Member’s KYC is required to join the network with the admin’s approval.
Less anonymous.
Financial Services:
Trade Finance: Trade finance provides delivery and payment assurance to buyers and
sellers. The blockchain can be used by the legal entities to sign all approvals, keeping
all parties informed regarding the approval status, when goods are received and when
payment is transferred from the importer’s to the exporter’s bank.
Government:
Food Safety: Powered by IBM Blockchain, IBM Food Trust directly connects
participants through a permissioned, permanent, and shared record of food origin
details, processing data, shipping details, and more.
Health Care:
Blockchain holds the complete medical history for each patient, with multiple
granularities of control by the patient, doctors, regulators, hospitals, insurers, and so
on, providing a secure mechanism to record and maintain comprehensive medical
histories for every patient.
A compromised node may send inconsistent messages to others or accuse other nodes
compromised, and it should be removed as soon as it is identified and confirmed.
A BGP protocol allows the network to detect the behaviour of malicious nodes, and all
working nodes can reach a consensus if the number of compromised node is less
than one-third of the total number of nodes, or
n >= 3f +1
where n is the number of nodes and f is the number of compromised nodes
PBFT has three phases, and each node maintains its own view of the network.
The protocol is initiated by a leader in the network. Even if the leader failed, other nodes
take over the responsibility and resume the operation.
Each node received the message will produce a response, and send the response, i.e.,
prepare, to every node;
After receiving sufficient such as 2/3 prepare messages from the nodes, each can
commit to the agreement, and send out the commit message to everyone.
Thus, to reach a consensus, there will be three rounds of messaging, one for each pre-
prepare, prepare, and commit message.
Smart contracts allow transactions to be carried out without the need for a
governance, legal system, central authority or external enforcement mechanism.
Smart contracts are created by computer programmers with the help of smart contract
development tools available that are digital and compiled using programming code
languages such as C++, Go, Python, Java.
Trust: All documents are encrypted on a shared ledger. Also all the entities or parties
could have access to these documents.
Security: All documents are encrypted end to end which makes them near-
impenetrable by unethical methods.
Redundancy: Documents are duplicated many times over on the blockchain, and can’t
ever be “lost”.
Savings: Smart contracts save you money by taking out the middleman.
Transparency: For organisations like governments, they could add another level of
transparency to dealings.
Precision: Smart contracts execute the exact code provided, ensuring zero errors.
1. Sequential Execution:
2. Non-deterministic Execution:
Iteration over a map may produce a different order in two executions like in Go
Lang.
Propagate same state to all nodes, verify that the states match.
We do not need to execute a smart contract to all the nodes. Rather, the selected
subset of contract executor executes it and propagates it with other nodes to ensure the
contract’s status is propagated to all the nodes uniformly in the network, and they are on
the same page.
A transition function S x I –> S; takes the current state and input value and produces a
set as the output.
A start state
If there is only a single decision-maker, we don’t need a consensus algorithm. In the case
of two decision-makers (nodes) and the presence of any faults such as crash fault, or
network fault or even if the node behaves maliciously, we can not reach a consensus.
In the case of multiple decision-makers, and collectively, they want to come to a certain
decision, and then we require a consensus algorithm.
In the case of the state machine replication concept, we replicate the common status so
that all the processes have the same view of the state.
Examples:
Network or Partitioned Faults: A network fault occurs because of the link failure,
and the network gets partitioned. This may be because of the edge router failures and,
consequently, hamper reaching the consensus.
PAXOS
RAFT
Paxos
The objective was to choose a single value under the crash or network faults.
The main idea behind the Paxos consensus algorithm is straightforward, and we will
understand it with an example.
Let us consider that we are at the college and after classes, we are going to hang out all
together. We have two options to hang out with classmates after classes: Subway and
Coffee Cafe Day (CCD). So after classes, we can either go to Subway or CCD based on
the collective decision, but everyone will go to the same place. In this case, there is no
central leader. The only way to take a collective decision is that a few of them (in this case,
max could be the two students) will propose an option (i.e., CCD or Subway). Others will
either accept or reject that proposed option, and the majority count will be the final value,
which will be the consensus.
Proposer: The proposer proposes values, and the consensus algorithm should choose
that proposed values.
Acceptor: They form the consensus and accept the values. Whenever they hear a
certain proposal from the proposer, the acceptors either accept or reject the
proposal.
Learner: This learner will determine which value has been chosen by each acceptor
and collectively accept that particular value.
Proposer Process
The proposer initially prepares a proposal number so that this number needs to be
good enough for the proposal to be accepted by the acceptors. The proposal number
forms a timeline, and the biggest number considered up to date.
Acceptor’s Message
Acceptor prepares the response, including accept or decline status, biggest proposal
number, and accepted values. The acceptor can either accept or reject a message
based on the proposed algorithm. The acceptor includes the biggest number that the
RAFT Consensus
The idea behind the Raft consensus algorithm is that the nodes (i.e., server computers)
collectively select a leader, and the remaining nodes become the followers.
The leader is responsible for state transition log replication across the followers under the
closed distributed environment, assuming that all the nodes are trustworthy and have no
malicious intent.
The basic idea of Raft came from the fact that in a distributed environment, we can come to
a consensus based on the Paxos algorithm and elect a leader.
Interestingly, if we have a leader in the system, we can avoid multiple proposers proposing
something altogether.
In the case of Paxos, we don’t have any straightforward mechanism to elect a leader.
However, to elect a leader, multiple proposers propose the thing simultaneously.
Consequently, the protocol becomes complex, and the acceptors have to accept one of the
proposals from the proposer. In that case, we use the highest proposal number for the tie-
breaking mechanism and embed a certain algorithm in Paxos to ensure that every proposal
coming from a different proposer is unique. Thus, all these internal details make the Paxos
more complicated.
Once the nodes receive a voting request, their task is to vote pro or against the
candidate. So, this is the mechanism to elect a leader in the Raft consensus algorithm.
Each node compares the received term and index with the corresponding current
known values.
The idea of Paxos was difficult to prove because the individual nodes propose certain
values and the acceptors accept those values. However, there is no leader in the system,
and individual nodes need to wait for a certain amount of time to see whether someone is
proposing a value. If none of them proposes a value or timeout, then one of the nodes
proposes a value, and the remaining nodes may accept or reject the proposal. If the node is
getting a majority voting, then that node knows that its proposal is being accepted, and then
it sends the accept message to all the nodes. If there are multiple proposers in the system,
it becomes difficult to theoretically prove that the repeated execution of Paxos, which is
called a multi-Paxos protocol, can achieve consensus in the closed distributed system.
When the Paxos designed, there was no leader concept because electing a leader requires
a consensus algorithm. But, once the system has a leader, the entire system becomes
streamline. The Raft algorithm improved the concept proposed in Paxos. It is like, rather
than going for repeated Paxos or multi Paxos, it preferred leader election based on the
majority voting.
In Raft, it first runs a Paxos type of algorithm to elect a leader. But, once a leader is elected,
the elected leader can execute a series of transactions until either leader dies or fails.
However, in Paxos, the multi-Paxos algorithm needs to run for consensus for executing
each transaction.
The Raft consensus algorithm has improved the concept of leader election and made it
easy to understand and easy to prove theoretically.
Paxos and Raft consensus algorithm can tolerate up to N/2 – 1 number of Crash or
Network fault, where N is the total number of nodes in the network. However, what if the
nodes behave maliciously? This particular class of fault is called Byzantine fault, and the
Byzantine fault came from the interesting Byzantine Generals Problem.
Let us understand this concept with an example: The army wants to attack a certain fort,
and this mission is lead by the army General, having two troupes. So, based on the
scenario, the General can either make an order to attack from different sides or retreat.
When the General is trustworthy, he orders the same to both the troupes.
However, when the General is malicious. The General sends an attack message to one
troupe and a retreat message to another troupe. If the General becomes faulty, it becomes
difficult for them to find out what to do. This particular problem is called the Byzantine
Generals Problem, where a particular node can behave maliciously.
Lieutenant Faulty
Lieutenant Faulty
If they go for the majority voting principle, they can analyze and decide to retreat. This
is illustrated as follows:
The algorithm is practical as it ensures safety over an asynchronous network but not
liveness; otherwise, it will violate the impossibility theorem.
The system can also ensure Byzantine failure, and it has low overhead.
For these properties, this algorithm is widely used in permission blockchain applications
such as Tendermint, INB’s Openchain, ErisDB, Hyperledger, etc.
The basic assumption about the system and working environment: The system works in an
asynchronous distributed system, and it can tolerate delay and out-of-order messages. It
can also handle Byzantine failure where arbitrary nodes behave maliciously and privacy,
tamper-proof message, and authentication.
https://notepub.io/notes/blockchain-technology/permissioned-blockchain/what-is-permissioned-
blockchain-practical-byzantine-fault-tolerance-algorithm/
The main idea behind this algorithm is: There is a commander and N lieutenants. The
commander initiates the process and sends an initial message to all the lieutenants in the
closed network. Later, each lieutenant forwards the value received from the commander to
the other lieutenants except the sender. So at the end of the rounds, all the lieutenants
must be having N-1 values, except the offline lieutenants. In the end, they will apply the
majority voting principle and achieves the consensus. This is one of the first algorithms for
Byzantine Generals’ Problem.
Pulse-1 is the initial pulse where the commander sends the message to all the
Lieutenants. Broadcast (N, t=0), where N is the number of processes and t is the algorithm
parameter, denotes the individual rounds. The Commander decides his own value, and in
this case, the possible values are {retreat, attack}. In this example, N = 3 has three different
lieutenants and is trying to reach a consensus.
Each lieutenant receives the message from the commander and checks whether it is a
pulse-1 message or not. If it is a pulse-1 message, and the sender is the commander,
accept it; otherwise, wait for a pulse-1 message. Suppose a pulse-1 message is received
then broadcast this message to all other processes in the network.
All the lieutenants broadcast their values to the other lieutenants except the senders. At the
end of the rounds, all the lieutenants must be having N-1 values, except the offline
lieutenants. In the end, they will apply the majority voting principle and achieves the
consensus.
The system must have a minimum of three lieutenants (N =3) and a commander. So,
out of N number of processes (lieutenants), maximum of F number of the processes
can be faulty, and F + 1 number of processes must be non-faulty such that N = 2*F + 1.
The system should be fully connected, and the receivers always know the identity of
the senders.
The 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.
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- rder payment solutions
built on blockchain bo 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 ...
KYC is a process by which banks obtain information about the identity and address of the
purchasers.
It’s a regulator governed process of performing due diligence for verifying the identity of
clients. This process helps to make sure that banks’ services aren’t misused. The banks
are responsible for completing the KYC procedure while opening accounts. Banks also are
required to periodically update their customers’ KYC details. KYC may be a manual, time-
consuming, and redundant across institutions. Sharing KYC information on Blockchain
would enable financial institutions to deliver better compliance outcomes, increase
efficiency, and improve customer experience.
KYC processes are the backbones of a financial institution’s anti-money laundering efforts.
Find out how businesses are revolutionising the long, tiresome process. Know Your
Customer or KYC processes are the backbones of a financial institution’s anti-money
laundering efforts.
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.
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.
Blockchain agriculture means the use of blockchain in the agricultural sector to improve the
operating process and get profitable results. The use of blockchain in the agricultural sector
ranges from having a sustainable business and reduction of waste, to informed consumer
purchasing decisions, to having smooth future transactions with fraud elimination. There is a
new term that has surfaced in the marketplace, Smart Agriculture. Smart agriculture includes
the utilization of natural resources and the decrease of environmental impact through the
execution of ICTs (information and communication technologies), blockchain, and other modern
technologies for gathering and analyzing data.
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. , IBM For example and
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.
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.
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
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.
Cost efficiency: It becomes relatively economical for one to get a mortgage compared to
the conventional process, where they’d have to pay a third party to streamline the process.
Here, they can do it all on their own, without any intervention from an outsider.
Instant Settlements: Usually, transferring funds takes time. With this, the person will get
their funds right away without having to wait.
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.
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
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.
Lower risk and operational costs: Quickly process credits and guarantees electronically,
gain deep insights into client financial positions and transaction histories, and monitor
transactions from start to finish.
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.
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.
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.
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.
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.
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
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.
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.
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:
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
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.
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.
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.
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.
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.
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.
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.
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
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
People share their personal information online via different unknown sources or services
that can put their identification documents into the wrong hands. Also, as online
applications maintain centralized servers for storing data, it becomes easier for hackers to
hack the servers and steal sensitive information. According to the Breach Level Index,
4,861,553 records are stolen every day, accounting for:
The breach statistics indicate how quickly a hacker can steal personal or other confidential
information.
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.
3. KYC Onboarding
users
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.
4. 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
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
the need for making multiple usernames and passwords can be removed
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.
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.
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.
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.
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.
How block chain is revolutionizing the traditional business network? Explain with
example.
PwC's 2018 global blockchain survey also confirmed that 84 percent of companies,
including the likes of Amazon and Facebook, are already dabbling in it.
Blockchain is a distributed ledger technology that was launched in 2009. This ledger
records transactions arranged in "blocks" and "chained" together.
Aside from providing open-source traceable storage, blockchain offers benefits such as
decentralization, security and immutability. As a consequence, this modern technology has
surpassed its use for only cryptocurrencies, enabling businesses to transact and
communicate seamlessly over the internet. Here are the ways in which blockchain is
fundamentally transforming business-communication networks.
Decentralization
Further, there is no central control of the blockchain and, as such, neither government
nor a central bank or higher authority can influence its use. Plus, those highly
positioned in companies cannot make manipulations to the blockchain, thanks to its
decentralized nature. For businesses, this means they can have secure peer-to-peer
communication without relying on a central authority.
Data Security
Data security is everything for businesses, as it ensures that their records are not
susceptible to an attack. Nonetheless, businesses have been hacked time and again
for relying on traditional methods of storage. In 2013, there was a data breach on
Yahoo's database and three billion records were affected. Likewise, data pertaining to
Blockchain, on the other hand, is a secure platform for storing information. It uses
cryptographic techniques, Merkle trees, hash functions and public and private keys to
make it difficult for a hacker to alter its content. The immutable nature of this technology
ensures that stored content cannot be changed. Also, its high-level security makes it
less susceptible to cyberattacks. Interestingly, there are many blockchain projects (e.g.
Eximchain and Signal) working on enhancing how businesses would safely
communicate data.
Data Privacy
While blockchain's content is open and accessible to anyone, there are permissioned
and permissionless blockchains. The latter ensures that sensitive information is kept
away from the public's eye. In this case, the data is encrypted and can only be
accessed after permission has been granted. Further, a private/permission blockchain
requires the owner or management's approval before participants are added to the
network.
For this reason, there can be centralized control over who can join the network, thereby
offering enhanced data privacy. For instance, blockchain projects like Dust, Debrief and
many more are working to increase data privacy and efficiency and also engage clients,
reducing the potential for sensitive data to be accessed by unauthorized users.
Transparency
Blockchain has fostered singular trust among network participants, since transfers are
guaranteed to be safe and secure. Much more, everyone on the network can see such
transfers in real-time thanks to the transparency offered by blockchain. This helps to
improve accountability and trust between business partners.
The immutable nature of blockchain also offers data integrity, since its content cannot
be changed easily. This means that business partners cannot challenge the legitimacy
of such transfers, because they are able to monitor it. A real-life use case of this is
evident in the healthcare industry, where the technology is used for revenue-cycle
management and fraud prevention.
Traceability
Blockchain's content can be tracked in real-time, which has offered immense benefits
to businesses. Its content is accurate at all times, and moreover, several participants of
the network will see the same information irrespective of where they access it and
when. It, therefore, enables large enterprises to communicate and coordinate supply
chain and logistics information.
It is worth noting that this traceability has aided in verifying the authenticity of rare and
valuable products. In this aspect, customers can easily scan a barcode to determine if
the raw materials used for the products were rightly sourced. It also gives consumers
the confidence that they have purchased authentic products.
UNIT 5
Block chain application development
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.
Blockchain deployment and development with web3, solidity, cakeshop and truffle.
1. Ethereum: It is an open-source and public platform (and operating system) taken into
consideration for blockchain App development and ICOs with smart-contract functionality.
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.
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.
Blockchain is also widely integrated in P2P payment applications for safe cashless
transactions.
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.
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
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.
4. Proof of Concept
6. Development
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:
a. sketches
b. mockups
c. tested product
d. designs
e. information architecture
When the client approves the PoC, the next step is to prepare technical and visual designs
for the application.
6. Development
Development is the significant phase of the blockchain development process, where you
should be ready to build the blockchain app. In this specific stage, you either have to
develop or integrate APIs for particular use cases of the application. The application is built
under multiple versions. Firstly, an application that does not undergo formal testing is a pre-
alpha version of the app. Once the client approves it, the application moves to the next
stage, i.e., alpha, where the developers test the software with white-box techniques. But,
the software might not comprise all the features at this stage. After the alpha version is
released, the app is prepared for the beta version. During Beta Phase, the software
application has the complete feature set but with some unknown bugs. Developers share
the beta version with a particular group of people outside the organization to test its
functionality. Once the beta version is approved and tested, the application moves to the
Release Candidate version, an advanced beta version that is ready to be a final application
and can be launched. 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.
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.
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.
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.
This directly addresses Hyperledger’s purpose: developing robust industrial applications using
blockchain technology while remaining apart from the digital currency creation process.
Traditional blockchain networks can’t support private transactions and confidential contracts
that are of utmost importance for businesses. Hyperledger Fabric was designed in response to
this as a modular, scalable and secure foundation for offering industrial blockchain solutions.
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.
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.
3. Governance and Access Control- Fabric networks consist of channels, which are a
private “subnet” of communication between two or more specific network members,
members on the network 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.
In this part of the article, we will learn about the design of the Hyperledger Fabric System.
1. 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.
2. 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.
3. 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.
5. 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.
6. 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.
Identities
Each of these actors — active elements inside or outside a network able to consume
services — has a digital identity encapsulated in an X.509 digital certificate
The default MSP implementation in Fabric uses X.509 certificates as identities, adopting a
traditional Public Key Infrastructure (PKI) hierarchical model (more on PKI later).
Imagine that you visit a supermarket to buy some groceries. At the checkout you see a
sign that says that only Visa, Mastercard and AMEX cards are accepted. If you try to
pay with a different card — let’s call it an “ImagineCard” — it doesn’t matter whether the
card is authentic and you have sufficient funds in your account. It will be not be
accepted.
Having a valid credit card is not enough — it must also be accepted by the store! PKIs
and MSPs work together in the same way — a PKI provides a list of identities, and an
MSP says which of these are members of a given organization that participates in the
network.
Policies
https://www.youtube.com/watch?v=ng-hMpik9n4
https://www.youtube.com/watch?v=ng-hMpik9n4
Membership Control
https://hyperledger-fabric.readthedocs.io/en/latest/membership/membership.html
Access Control
Access control is a mechanism in computer security that regulates access to the system
resources. The current access control systems face many problems, such as the presence of
the third-party, inefficiency, and lack of privacy. These problems can be addressed by
blockchain, the technology that received major attention in recent years and has many
potentials. In this study, we overview the problems of the current access control systems, and
then, we explain how blockchain can help to solve them. We also present an overview of
access control studies and proposed 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.
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.
Channels
To create a new channel, the client SDK calls configuration system chaincode and references
properties such as anchor peers, and members (organizations). This request creates a genesis
block for the channel ledger, which stores configuration information about the channel policies,
members and anchor peers. When adding a new member to an existing channel, either this
genesis block, or if applicable, a more recent reconfiguration block, is shared with the new
member.
The election of a leading peer for each member on a channel determines which peer
communicates with the ordering service on behalf of the member. If no leader is identified, an
algorithm can be used to identify the leader. The consensus service orders transactions and
delivers them, in a block, to each leading peer, which then distributes the block to its member
peers, and across the channel, using the gossip protocol.
Although any one anchor peer can belong to multiple channels, and therefore maintain multiple
ledgers, no ledger data can pass from one channel to another. This separation of ledgers, by
Transaction Validation
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.
a. 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.
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.
c. 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
App balance check: dApp account should have enough funds for dApp script
actions.
Check that the transaction fee is not less than the minimum fee based on script
actions.
e. 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
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 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 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
If all checks passed, the transaction is saved on the blockchain as successful and the
sender is charged the fee.
Developing Blockchain applications really means developing smart contracts, or as they are
also called: chain code. Smart contracts can be compared to stored procedures in the database
world and mostly deal with getting and setting parameters on business objects, in addition to
doing anything else we want them to do by using either one of the following languages:
JavaScript, TypeScript, Java or Go Developing Smart Contracts for Hyperledger Fabric is best
done in the open source Visual Studio Code environment.
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.
You might also find the following test networks in your MetaMask wallet:
The above networks are for testing purposes only; note that the Ethers of these
networks have no real value.
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.
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.
Static analysis.
Integrated debugger.
Open Remix Browser, and click on the plus icon on the top left side next to the browser to
create a .sol extension file.
Ripple
Ripple It is an open-source protocol designed to allow transactions in a fast and cheap manner.
Ripple is not just a platform but a currency. This platform has its own currency known as XRP
but also allows people to create their own currency via RippleNet. RippleNet is nothing but a
network of institutional payment-providers like banks and money services firms that use
solutions developed by Ripple to offer a frictionless experience to 0 0 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- rder bo 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.
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.
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
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.
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.