Blockchain Tech Neo This Is The Techneo Guid Book For Blockchain
Blockchain Tech Neo This Is The Techneo Guid Book For Blockchain
Module
Introduction to Blockchain
1
Sylabus
11 What is a
Merkle trees.
blockchain, Origin of blockchain (cryptographicallysecure hash functione), Foundation of blockchain:
1.2 Components of blockchain, Block in blockchain, Types: Public, Private, and Consortium, Consensus Protocol,
imitations and Challenges of blockchain.
Ga What is a private blockchain? Enlist few examples of a private blockchain and state its advantages and
Ga.
disadvantages.
What is a consortium/federated blockchain? Enlist few examples of a consortium/federated blockchain
and state its advantages and
disadvantages. **. 1-28
GQ. Differentiate between different types of blockchain.. . 1-29
1.7.4 Consensus Protocol. 1-29
GQ. What is a consensus protocol?. 1-29
1.7.4.1 Consensus.. 1-29
1.7.4.2 Distributed Consensus. 1-31
GQ. What is distributed consensus ? . ... 1-31
GQ. State the properties of a distributed consensus protocol. .
. 1-32
1.8 Limitations and Challenges of Blockchain. 1-33
1.9 Biockchain Implementation Limitations..*** ** 1-33
GQ. What are the potential solutions for the scalability problem of blockchain?. 1-33
1.9.1 Limited Scalability. 1-33
1.9.2 Limited Privacy . ..1-36
9.3 Lack of Technical Knowledge.. o******** 1-36
1.9.4 Security Concems and Flaws. .. 1-36
1.10 Blockchain Implementation - Challenges...
1-37
1.10.1 Transaction Processing Speed. 1-37
1.10.2 Complexity.. . 1-37
1.10.3 Implementation and Operation Cost..
1-37
1.10.4 Storage Constraints..
1.10.5 Lack of Governance and Standards..
GO. How does lack of govemance and standards affect the blockchain ?..
1.10.6 Lack of Formal Contract Verification... ***.
By definition. blockchain is a decentralized computation and information sharing platform that enables multiple
authoritative domains, who do not trust each other, to cooperate, coordinate, and collaborate in a rational decision
making process.
The keyword that we have in the abovementioned
definition is decentralized, which is an important aspect
of blockchain.
Computation and information sharing platform is the
next keyword that will help in specifying blockchain
broadly to be a decentralized database, which helps in
cooperation between multiple authoritativedomains
This technology is useful when multiple parties or
individuals want to cooperate with each other and they
want to come to a common platform so that they can
share information amongst themselves. (JAT)Fig. 1.1.1 : Structure of a decentralizednetwork
Multiple authoritative domains do not trust each other, so what blockchain does is it combines these multiple
authoritative domains in a common platform so that they can cooperate, coordinate, and collaborate in application
development process or business intelligence process.
Traditional way of sharing documents, which we do
Person A
process, one of the main disadvantagesis that
and Person B will not be able to simultaneously edit the
document. The ideal solution where simultaneous
editing of the document can be done is with the help of
shared Google docs where both Person A and Person B
can edit or write the document simultaneously.
However, the problem of shared Google doe platform is
that the environment is still centralized. (A)Fig. 1.1.3
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) Tech-Neo Publications.ASACHIN SHAH Venture
Blockohain(MU-Sem 7-Comp.) (Introductionto Blockchain)....Page no... (1-
on arises that does this type of centralized system harm or what is the disadvantage that if we use
a
d ehvironment for cooperation during this kind of information sharing plattorm.
1.1.1 Problems wlth a Centralized System
- -.
What problemsare associatedwith a centralized
Q Differentiatebetweencentralized,
system?
-
decentralized,
---- ----
and distributed
architecture
e
major problem of
centralized system is that it works as a
a
Dandwidth is single point of failure. For example, if sufficient
available to load the Google doc, then a
not
person will not be able to edit the document. You will have
to
un you connect to the Internet and
load the Google doc platform. The other
Google's server or your computercrashes. problem that could arise is what if
One crazy morning
Master Service
(1A4)Fig. 1.14
In that case, the entire informationgets lost or even if you want to take
only after loading the backup, you will be able
a
backup, you will have to load the backup and
to
necessary to shift from a centralized process it further. Because of the
platformto a distributed abovementionedreasons, it is
In a distributedplatform, there platform.
are three different
types of architecture:
1. Centralized architecture: There is a
coordination system and whatever informationcentral coordinationsystem and every node is
the nodes want to connected to the central
central coordinationsystem. The share, the information shall be
all of the individual nodes will
problem with this architectureis that if the central shared by the
get disconnected. coordinationsystem fails, then
2. Decentralized architecture: Here, there are few
coordinatorscooperate with each other, and the coordinatorsrather than a
individual nodes, single coordinator,and all these
architecture, if a particular coordinator fails or they are connected to these
coordinators.In this
coordinatorshave failed can get connectedto other multiple coordinators fail, then the individual
perform the operation with the available coordinatorsthat are nodes whose
coordinators. working and can share the
number of failures can be tolerated until the In' this
type of architecture,the informationor
network and because of multiple network becomes advantage is that
multiple
simultaneous failure if thedisconnected.This architecture works on top of a
disconnected,then the individual nodes will not be able network gets
partitioned or the network grts
to
by a complete distributedarchitecture. cooperate with each other. This
problem can be solvd
(MU-New Syllabusw.e.f academic year 22-23)(M7-85)
Tech-NeoPublications
A SACHIN SHAH Venture
Blockchain(MU-Sem.7-Comp.) (Introductionto Blockchain)...Pageno...(1-5)
3. Distributed architecture : There is no centralized coordinator and all the nodes participate in the information
sharing process or application development where they coordinate with each other and collectively develop the
Completerelianceon single
point (centrallzed) Is not safe
Decentralized: Multdple
points of coordinatioon
Distributed: Everyone
collectively execute the job
Link
Station
(145Fig. 1.1.5
These are the advantages or disadvantages of a decentralized platform and distributed platform over a centralized
platform. However, in the today's world, it has been observed that centralized architectures are good but are not
scalable and not robust to failure.
Therefore it is essential that we move from a centralized architecture to a decentralized architecture or distributed
architecture. Blockchain is a platform that supports a decentralized platform or distributed platform where information
can be shared amongst users in a trust worthy manner.
Geng strted
ewww.rs
E
Everyone edits on their local copy of the document
the Internet ta kes care of ensuring consistencCy
(1A6Fig. 1.1.6
This is an ideal use case where blockchain platform can be used. This platform, which is spanned over a network, will
help in creating this type of coordination where Person A will keep his/her own copy of the document and Person B will
keep his/her own copy of the document.
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) Tech-Neo Publications..ASACHIN SHAH Venture
Bloockchain (MU-Sem. 7-Comp.) (Introductionto Blockchain)..Page no... (1-61
em can independently write their personal copy and then the blockchain platform will ensure that they ae
g nside the document are getting synchronized with each other, and with time, both of them will be able to see
the most
updated copy
they will be able to update over the most updated copy.
or
the advantage of a blockchain technology over a complete centralized architecture or an architecture where a
shared copy exists between
multiple parties.
Blockchain
A decentralized database with strong consistency
support
(147)Fig. 1.1.7
1.1.3 Simplified Architecture of a Blockchain
-
--
simplified
----
architecture of a blockchain.
--- - -- - - - -
In a typical blockchain
architecture,every individual node maintains a local
the copy of the blockchain (i.e., ä local copy of
global data sheet). The systems task
is to ensure that all these
individual copies are consistent with each other.
Consistency means that the local copies that every node has are identical and
these copies are
the global information. always updated based on
For instance, if node A wants to enter some
information to its blockchain,then the entered
to all the copy of the blockchain that information will get updated
every node (i.e., nodes B, C, D, E, F, and G)
platform of blockchain which possess. This is the architectural
supports strong consistency among the local
has. replica/local information that every node
The local information is called a
public ledger. A
public ledger works like
database where it contains
a
Alice Bob
F100
Public Ledger Public Ledger
offEve of Jane
Eve Jane
(1A9)Fig. 1.1.9
There are four participants Alice, Bob, Eve, and Jane. Now, Alice wants to make a transaction of Rs. 50 to
Assume that Alice has Rs. 100 with here. The public Bob. In this case, another information needs to be
ledger is available to Alice, Bob, Eve, and Jane, which updated to all the public ledgers available with Alice,
has the initial content/information that Alicehas Bob, Eve, and Jane.
(i.e., Rs. 100). Therefore, this transaction gets updated in all local
copies of the public ledger.
Now, Alice wants to make a transaction of Rs. 80 But, from Alice's public ledger, it is evident that she
to Jane. initially had Rs. 100 out of which she gave Rs. 50 to
Bob. So now by
combining both the transactions,she
has only Rs. 50 available with her. If
Alice tries to
make a transaction of Rs. 80, then this
transaction is not valid.
particular
Therefore, all parties will come to know from their
public ledger that
this transaction is not valid and it is
blocked and it cannot be included in their
public
ledger.
Public Ledger Public Ledger
PublicLedger Public Ledger
of Alice of Bob of Alice of Bob
Alice: F10o Alice:1000 Alice:10o
Alice Bob: Alice Bob: Alice Bob: Alice:100
50 50 T50 Alice
F50
Bob:
BobEve:
30
80 BobEve: BobEve: 80
Alice Bob 30 30 Alice
Bob
BobEve
T30
PublicLedger Public Ledger Public Ledger
of Eve of Jane of Eve Public Ledger
Alice:100 Alice:100 Alice:100 of Jane
Alice Bob: Alice Bob: AliceBob: Alice:100
T50 50
50 AliceBob:
50
Bob Eve BobEve: BobEve:
S30 30 30
BobEve
Eve Jane T30
Eve
Jane
(IA14Fig. 1.1.14
(1A15) Fig. 1.1.15
Consensus: "Ensure that local copies are consistent and updated." This is an essential aspect in the concept of
blockchain. As discussed earlier, there exists a local copy of the information available to every individual parties
and there is no such central platform like the bank which will maintain the consistency of the information.
Therefore, consensus mechanism ensures that whatever local copy every individual party has, they are
consistent/identical with each other.
Security: "Data needs to be tamper proof. Clients may act maliciously or can be compromised." The data that is
inserted in a public ledger or blockchain needs to be secure and tamper proof. Because blockchain is distributed to
individual parties, everyone is maintaining their local copy of their blockchain. So, it is possible that an individual
might make a change in the local copy and broadcast saying that this is the updated information. But the other
nodes in the network must be able to understand that whatever this individual is broadcasting is a false/tampered
information and the other nodes should not accept such type of information.
Privacy and Authenticity: "Data/transactions belong to various clients; and privacy and authe nticity needs to be
ensured." The data that is present in the blockchain belongs to several clients, and so, it is essential that both
privacy and authenticity needs to be safeguarded.
Essential keywords
Open:Acessibleto al Distributedor Decentralized:No single party control
Efficient:Fast and scalable Verifiable: Everyone can check the validity of information
o Wherex and n are integers and % is the modular (reminder after division by n) operations. x can be of any arbitrary
length, but H(r) lies between 0 to n -1.
deteministicalgorithmcan computex).
The red fox Cryptographic BFD8 7558 7851 4F32 D1C6
Property 2: For two different x and
r
umps ouer
the blue dog
hash
function
7581 79A9 ODA4 AEFE 4819
H
The red fox
o
Property 3: Avalanche effect: Let us jumps oevr
Cryptographic
hash
FCD3 7FDB 5AF2 C6FF 915F
the blue dog functon D401 COA9 7D9A 46AF FB45
consider x is the message and H(r) is its
The red fox
respective message digest. Avalanche jumps oer
Cryptographic 8ACA D682 D588 4C75 4BF4
hash 1799 7D88 BCF8 9289 6A6C
effect means a small change in x results in he blue do0g function
a
significantchange in H(x). (1A1Fig. 1.2.1
This is how the concept of chain of block by connecting them with the hash function was used to cryptographically
secure the time stamp value of a digital document. This is how individual hash values are helping to connect the blocks
one after the other and making the blocks as tamperproof.
HrooHash(HotH,)
Merkle Trees : It is a tree structure
where the leaf nodes will contain the
hash of the document and every
L Hash L, Hash
individual node or the intermediate node
will contain the hash of the combination
Ho=Hash(HootHo1) H,Hash(H10tH11)
of the left child and the right child.
The example of a binary Merkle tree is L2 Hash 2 Hash L2 Hash L2 Hash
Fig. 1.2.3.
The leaf node (L) contains the hash of
HooHash(DHoHash(D,) H10Hash(D|H,=Hash(D)
the contents of the documents D, D2. D Da
D, and D4. The intermediate node
contains the hash value of Hoo and Ho1
and their combined hash value (i.e., H). (1A18)Fig.1.2.3 : Structure of a Merkle tree
At root level, the root contains the combined hash (i.e., Hoo) of its left child and the right child. This means that if any
change is made in any of the documents, then the change will get reflected in their respective hash values. For instance,
if any change is made in D, then the change will get reflected in Ho. Ho, and
H
Now, if we wish to secure a number of documents together (ie., D,, D,, D, and D,), then we can just propagate or
publicize the root value.
Feer-to-peer networks : Whenever data blocks are shared in a peer-io-peer network, it is essential that data blocks are
eceived in an undamaged or in an unaltered way and other peers are not lying about a block (i.e., they are sharing a
Dlock, but that block is not an updated block). In that case if the root hash of the Merkle tree, which is the Merkle root,
is shared, then Merkle root ensures that
none of the documents has been altered.
Bitcoin implementation: This is one of the most popular use of the Merkle tree (i.e., bitcoin implementation).It is one
of the most
popular cryptocurrency which forms one of the basis for blockchain technology. We want to identify that
the shared information is
unaltered, and no one is lying about a transaction.
So, here too we can construct a Merkle tree of all transaction
together, and if someone is denying one particular
transaction, then the Merkle root will change, and by looking into the Merkle root, we would be able to validate
whether
a set of transactions have been transmitted from node
one to another node in an unaltered way.
Blockchain 2.0 : Because of the revolution in bitcoin,
many mainstream companies began to use the central blockchain
idea and build alternative systems for use in
industry, manufacturing,supply chain, finance, governance, IoT, etc. This
movement of academia, industry,and startups is termed Blockchain 2.0.
R
Regulator
B2B
Blockchain
Performs transaction User
Blockchain oversight
Architect
J Designs
Accesses Membership
security Services
Creates Blockchain certificates
Blockchain applications
Developer
Accesses
data
Operates Accesses Traditional
Data Sources
to logic
Blockchain
Network Traditional
Operatoor Processing
Platforms
2 Blockchain developer
A blockchain developer will take what has been architected and he/she will develop the actual code that will run on
the blockchain network.
The developer of applications and smart contracts that interact with the blockchain and are used by blockchain
users.
6. Membership services
It is an important component. It defines or provides the identity for users to come and transact on the blockchain.
For example, when you open an account in the bank, the bank gives you a username and password for login to
access web services.
The membership service will provide a digital certificate that will allow an individual to transact on the network.
7. Blockchain user
A blockchain user will perform business transactions on the blockchain. These users could belong to multiple
organizations that are participating in the blockchain network.
He/she is a business user operating in a business network. Blockchain users interact with the blockchain using an
application. However, they are unaware of the blockchain.
8. Blockchain regulator
The regulator could be an optional actor in a blockchain solution. The regulator might have read only access onto
the network where he/she might have some oversight into whether the transactions performed are legitimate or not.
Whether the transactions are compliant with the policies set by the blockchain regulator.
A blockchain regulator is responsible for the overall authority in a business network. In paticular, they may
require broad access to the contents of a ledger.
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) eTech-Neo Publications..ASACHIN SHAH Venture
Blockchain(MU-Sem.7-Comp.) (Introductionto Blockchain)..Page no.. (1-14
. or Dlockchain components are available in the market. Some of the major components in a blockchain
As can be seen in the figure, every block has a hash, which is being chained together. For instance, Block 15 has a hash
value 57ec2fda71, which is getting stored in Block 16. The same process is observed in Block 16 and Block 17.
A block is a sequence of transactions, i.e., each block can have multiple transactions in them and each transaction can
specify which smart contract got invoked or which specific funetion got invoked and which user invoked the transaction
.e., some identity of the user will be there in the transaction followed by other details).
"Each block can have zero or more transactions and some additional metadata". Note that the first block that is getting
created the blockchain is called the genesis block, which has special information about the configuration of the
network itself, who the participants are, and other configuration information. The genesis block does not have any user
transactions, but other blocks in the blockchain can have one or more transactions.
Transaction Transaction
Transaction
Transaction
Block
The Fig. 1.44 shows an example of a transaction and how a
ledger might work.
myCar.vin=
As it can be seen from the ig.1.4.4 that there is a smart
1234.
contract that takes it input for instance an owner
(let's say a car) and the owner of the car is set to Matt. Wortd State "Invoke,myContract
setOwner, myCar, Matr
From the above code snippet, we have a setOwner( ) where it sets the owner of a car to a new person, and the new
myCar owner=Matt
myCar,make Audi
is the output that got written from the contract. All of this gets writen as a blockchain transaction in the blockchain as
one of the blocks.
throughout and then the hlock gets added with the legitimatetransactionon to the blockchain,and once a transactionis
committed on to the blockchain, it will be called as the final transaction.
There is an eent that gets emited, as shown in the figure, which means that the transaction has been simultaneously
committed on all the nodes in the blockchain. The generated events can be used to perform additional processing within
an organization.
Client
Develops Application
Blockchain
Developer D
SDK
Develops Submits
Smart
Contract
Emits
Event
Ledger
Block
Emits
1.4.4 BlockchainEvents
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) Tech-Neo Publications..ASACHIN SHAH Venture
Blockchain(MU-Sem. 7-Comp.)
(Introductionto Blockchain).Pageno...(1-1R
Integrating with existing systems
T
2. Blockchain
1.System
Events Events
Existing
3. Call into Blockchain Network Systems
from ExistingSystems
= 4. Call out
Transfom
to
Two-way exchange
Blockchain Network
Existing Systems Existing
Systemss
-Events from blockchain network create
actions in existing systems
-
Cumulativeactions ininteraction
result in blockchain existing systemns -
Transfomation between blockchain and
existing systems formats
(1A26) Fig. 14.7
GQWNhat are the various components that are present inside a block that help in forming a blockchain ?
.
that they are authorized to see. (1A27Fig. 1.5.1: Components within the block of a blockchain
Block #500312
Summary Hashes
0000000000000000000301fcfeb141088a93b77dcOd5257
1a1185b42526ae2tb
NumberOf Transactions 2580 Hash
Previous Block 0000000000000000004b1ef0105dc1275b3adfd067aed63a43324929bed64d7
Output Total 10,857.62500453BTC
EstimatedTransactionVolume 2,331,80756289BTC Next Block(s) 000000000000000000282ac9977c3d103a3c6bd873b
1f7744eBd42b8329baa6
Marked Root a8976ed0487a29c73057e12d89afata0c01e02782cba6c89b7019e51296475oc
TransactionFees ,19384324BTC
Height 500312(Main Chaln)
Timestamp 2017-12-2020:02.40
2017-12-20 20:02:40
RecelvedTime
Relayed By BTC.TOP Be YourOwn Bank
Use yourBlockchainwallet
Difficulty 1,873,105,475,221.61 to buy bítcon now
Bits 402691653 OETSTARTED
Size 1093.292kB BLOCKCHAIN
Weight 3992.963kWU
Version Ox20000000
Nonce 900685155
Block Reward 12.5 BTC
Transactions
2017-12-2020:02:40
Nkhja23hjhikajditijkihilkidijhuyebduejikusk7 19.08384324BTC
No inputs (Newly Generated Coins) NIkhja23hjhj|kajdfhjkjhlikjdfjhuyebduel|kusk]7
Unable to dectde output address
0BTC
19 0338432 Brc
block hash. Every block inherits from the previous block. Herein,
we use previous block's hash to create the new block's hash,
thereby making blockchain tamperproof.For instance, if we wish Ha= Hash(H) Block 3
block, then he/she has a make changes in all blocks which are
there after the tampered block. We want to make this problem as
complicated such that by the time some person will tamper cetain Block 5
H4=Hash(Ha)
blocks, new blocks will get added and he/she will never be able to
reach up to the last block (ie, changing the hash value for the last
block). This how the blocks are made tamperproof. (1A29) Fig. 1.5.3
(MU-New Syllabus we.f academic year 22-23)(M7-85) Tech-Neo Publications..ASACHIN SHAH Venture
(1.2
Blockchain(MU-Sem. 7-Comp.)
(Introductionto
Blockchain)..Page no...
= (1-20)
Mining statistics used to construct the block
H Hash(H-1|IT II Nonce)
Mining is the mechanism to generate the hash.
Generated Previous Set of Random
The mechanism needs to be Nonce Value
complicatedenough Hash Value Hash Transactions
value. For example, the complexity in bitcoin is such that whenever we are generating this hash value, we need to find
out the nonce such that whate ver be the value of H, it will have 20 zeros in its prefix or 1" 20 bits will be zero.
By the propertyof the hash function, if H, is known, then we will not be able to find out the nonce (message), but if the
nonce (message) is known, then only it is possible to find out H. So, the miners have to change the value of nonce so
that the objective is met.
The objectiveis that the generatedhash value will have some certain number of zeros in the beginning.The complexity
of the mining algorithm depends on the number of zeros that are
present at the beginning of the generated hash value.|
The complexityincreaseswhen more time is required to calculate the nonce value.
The blockchainheader contains the
following parameters(i.e., mining statistics):
Timestamp:It contains the timestampto identify when mining has been performed.
o Nonce: It provides the corresponding hash value.
o Difficulty:It determines how difficult it is to obtain the nonce to meet the criteriaof the
certain number of zeros
complexity of having
at the prefix of a hash value.
Merkle tree root: This stores the informationor a hash
value of all transactions. All
transactionsare organized in a
Merkle tree structure. Note that the root of the Merkle tree is a
verificationof all the transactions.
o In a Merkle tree, at the leaf node, there exist a
hash of the transactions
node (i.e., Ho and Hi) contains the hash of the (i.e., T, Ta, T3, and Ta). Every intermediate
combined hash values (i.e., Hoo and
respectively). Hoi and Hio and H
o Also, the root contains again the
combined hash values of its left tree
Root Hash
(i.e., Ho) and right tree (i.e., H).
Interestingly, if we wish to make a HroolFHash(Hg+H) KMerkle Root
change in T3, then Hio would get
changed followed by changes in H and L Hash
L Hash
finally changes in Hot So, it is evident HoFHash(HootHo1)
that if someone changes a transaction, H-Hash(H10tH)
then the root hash will change, and once L2 Hash
L Hash
the root hash changes, then L2 Hash
theooHash(T,) HoFHash(T2
all L Hash
subsequent hash of all the blocks will
get change because they are linked with
HAoFHash(T)H,HashT
each other.
(IA3)Fig. 1.5.5 Merkle tree root
(MU-New Syllabus w.e.f academic year 22-23)M7-85)
Tech-NeoPublications.A SACHIN SHAH enture
Blockchain(MU-Sem.7-Comp.) (Introductionto Blockchain)...Pageno...(1-21)
How does a block header look?
GQ. With a suitable diagram, explain the structure of a block header with a list of transactions.
Summary
Number Of Transactions 2580
Output Total 10,857.62500453 BTC
Estimated Transaction Volume 2,331,80756289 BTC
Transaction Fees 7,19384324 BTC
Relayed By BTC.TOP
Difficulty 1,873,105,475,221.61
Bits 402691653
Size 1093.292 kB
Hash value of
the current block
Hashes 0000000000000000000301fcfeb141088a93b77dcOd52571a1185b42526ae2fb
Hash
Previous Block 0000000000000000004b1ef0105dc1275b3adfd067aed63a
43324929bed64td7
O000000000o00000000282ac9977c3d103a3c6bd873b17744e8d42b8329baa6
Next Block(s)
Marked Root a89769d0487a29c73057e
12d89afafaOc01e02782cba6c89b7019e5129d475cc
(IA3) Fig. 1.5.7
If any change is made in one of the transaction, then the Merkle root gets changed. If the Merkle root changes, then the
value gets changed. If the hash value of the current block changes, then the hash value of the next
correspondinghash
block changes.
have change the entire blockchain. In addition, the hash
Ultimately,everythinggets changed and so the attacker will
to
Transactions in a block
1. Transactions are organized as a Merkle tree. The Merkle root is used to construct the block hash.
2. If you change a transaction, then you need to change all the subsequentblock hash.
in blockchain.
3. Inference : The difficultyof the mining algorithmdetermines the toughnessof tamperingwith a block a
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) Tech-Neo Publications..ASACHIN SHAH Venture
Blockchain(MU-Sem. 7-Comp.) (Introductionto Blockchiain)...Pageno... 1-22
Transactioninformatloninside
a block
Users with a unique ID
Transactions
2017-12-2020:02:40
317ebtaOd52571a1185b42526a3d787
NoInputs (Newly Generated Coins) 19.69384324 BTC
1H296kJKF2HLPGY15UWLB5M9qGNxvt8tHJ
Unable to decode output address
OBTC
19 69384324 BTC
Transactiont
Hash value of this
transaction
type of
transactionsare called double spending, and both these transactionscannot
be valid simultaneously.
In a
of double
centralizedsystem like a banking agency, it is easy to validate such kind
spending. So, when a person submits a transaction to a bank, the
A:50
A-C:50
bank can validate whether that person is performing a double
spending and
take the necessary actions.
(1A89Fig. 1.5.9 : Double Spending
However, in decentralizednetwork, how the problem of double spending can
a
be avoided so that an
be able to make two transactionswith the same individual will not
cryptocurrency.
Handle doublespending using blockchain
In order to prevent double spending, we use blockchain so that
the details about
the transactions that are sent art
forwarded to all the users in a network or as many as other
computers in the network as
possible. We use blockchain
which is a constantly growing chain of blocks, to contain a
record of all such
maintainedby all the peers in a cryptocurrency(i.e., bitcoin) network. truncations, and this blockchain is
So, everyone has the
copy of the blockchain.
(MU-New Sylabus we.f academic year 22-23)M7-85)
Tech-NeoPublications..ASACHIN SHAH Venture
Blockchain(MU-Sem. 7-Comp.) (Introductionto Blockchain)...Pageno...(1-23)
To he accepted in a chain, transaction blocks must be validated and must include proof of work (PoW) - a
computationally difficult hash generated by the mining procedure. Blockehain ensures that if any of the block is
modified, then all following blocks will have to be recomputed. When multiple valid continuation to a chain of blocks
appear, only the longest branch is accepted and it is then extended further (ie., longest chain). Once a transaction is
committed in the blockchain, everyone in the network can validate all transactions by using a sender's public address.
This is how validation prevents double spending, especially in bitcoin.
1.6.1 BlockchainLayers
Blockchain layer: This layer consists of consensus algorithms, the medium, and interface for a P2P network that
decides how data is placed in several packets and then transmitted between peers. It handles the mining layer, protocols
that decide consensus methods and participation, nodes that execute protocols, and the distributed ledger.
Internet layer: Blockchain works over the internet. This layer connects all networks together (i.e., smartphones, IOT
devices,etc.).
Presentation Layer
ApplicationLayer
Wallets DecentralizedApplications Smart Contracts Web Browsers
Blockchain Layer
TCPInfrastructure
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) Tech-Neo Publications...ASACHIN SHAH Venture
no..(1.
Blockchain (MU-Sem. 7-Comp.) (Introductionto Blockchain)..Fage 1-24
1.6.2 Advantagesof Blockchain
--
single central control.Removesany single point of failure by replicatingthe ledger at every node n the network.
Better communicationbetween nodes promotes transparencyand faster consensus and data synchronization.A
Allows for
multiple entities who do not trust each other to transact directly with one another.
Ensures valid and accurate data.
Removal of middleman reduces overall transactioncost.
Lontains a verifiable record of all transactions made that are auditable.
o Risk of double
spending is mitigatedbecause of consensus algorithms.
a 1.6.3 Disadvantagesof Blockchain
In certain
cases, the
traditional database may be more suitable and perform a task faster and cheaper.If a fully
functional database and network are
already
in place, then the benefits of introducingblockchain may not produce the
required returns on investment.
Nodes with high
computingpower can take control of the network, thereby impactingdecentralization.Data integrityis
obtained at the expense of time.
Every node needs to run the blockchainto verify transactionsand maintain consensus.
Enormous computing power is needed miners
by leading to substantialenergy consumption and wastage. Nodes may
select transactionswith higher rewards.
Not every node has the
ability to maintain and run a complete copy of the blockchain,thereby
immutability.In smallerblockchains,there is a risk of 51% attack (i.e., if a affecting consensus and
group of malicious nodes can get 51% of the
mining hash rate, then the group can manipulatetransactions).
a1.7.1 Introduction
Blockchainis a digital ledger that is distributed,upheld by
consensus, immutable, and auditable.
A distributed ledger is a decentralized ledger of all the information that is recorded on the blockchain by consensus. In
other words, a distributed ledger technology is defined as a decentralized database that can securely record and share
financial, physical, or electronic access across a geographical network through transparent updates of information.
A distributed ledger can be considered to be a database similar to an accounting ledger where financial transactions are
recorded, except that it is not recorded to financial data. Herein, transaction refers to any digital data such as text,
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) eTech-Neo Publications..A SACHIN SHAH Venture
(Introduction to Blockchain)...Page no... 1-2
Blockchain (MU-Sem.7-Comp.)
Such decentralization is different from the one that is
observed in blockchain. In DLT of blockchain, a
database copy is available on every user's computer.
This database is independent of a central authority and
any changes to the ledger have to be agreed upon by
all nodes.
Such a mechanism is called as the consensus
mechanism. Once consensus is attained, the database is
updated to all nodes in the network. At any given point
in time, information is synchronized across all nodes; so,
it is referred to (1IA40)Fig. 1.7.4: DistributedLedger Technology
as distributedconsensus.
-
Buyer creates a Transaction is distributed
transaction or and validatedvia
a block Gryptographichashing Seller receives
Transaction
blockchain is committed to
and miners are rewarded
the tansacton
out transactions in a
bitcoin that permitted anybody connected to the intenet to carry
1 public blockchains was
Advantages
1. Anybody can join public blockchain.
Disadvantages
1. Transaction speed of public blockchain is less (ie., a transaction could be completed within a few minutes or might
take several hours).
2. It suffers from scalability G.e., the more the number of nodes that join the network, the clumsier and slow it
becomes).
3. It uses the choice of consensus method (e.g, bitcoin uses PoW, which consumes a lot of energy).
2. Private blockchain : It is type of blockchain that works in a restrictive environment (i.e., in a closed network). It is
also a permissioned blockchain that is under the control of an entity. It is suitable for organizations who only want
selected participants to access a blockchain network.
Organizations can set different parameters, such as
accessibility and authorization, to the network. Private
blockchain is similar to a public blockchain, but the only
difference is that it allows selected participants to access
the network, thereby offering such participants
transparency, trust, and security. A private blockchain is
usually centralized (i.e., only one authority manages the
entire network). (IM2Fig.1.7.6:: Private blockchain
Examples: HyperledgerFabric, HyperledgerSawtooth,and Corda
Advantages
1. A privateblockchainis relativelyfast as comparedto a public blockchain.This is because there are a few participants in
the network, which means that it takes a shorter amount of time for the network to reach consensus resulting in faster
transactions.
2. They are much more scalable.This is possible because only a few nodes are authorizedto validate transactions.For a
private blockchain, the network size does not matter. Here, centralization aspect for making a decision is of utmost
importance.
Security could be an issue in a private blockehain. This could happen when a certain number of nodes compromise the
consensus method that is utilized by the private network.
3. Consortium/Federated blockchain
-.
-- -
GQ What is a consortium/federated blockchain? Enlist few examples of a consortium/federated blockchain and state its
advantages and disadvantages.
------------- --
It is a type of blockchain that is preferred by organizations who require both public as well as private blockchain
In a consotium/federated blockchain, certain aspects of an organizations are made public, while others remain
private. Note that the consensus method in a consortium/federated blockchain is managed by preset nodes. Even
though such type of blockchain is not open to mass people, it still holds a decentralized nature.
A consortium/federatedblockchain is managed by more than one
organizations.As a result, there is no one
single
force of centralized outcome. In consortium/federated blockchain, there exists
a a validator node that not only
validates transactions but also initiates or receives transactions.
The member nodes on the other hand can only receive or initiate transactions. Overall, a consortium/federated
blockchain offers all the features of a private blockchain, including transparency, privacy., and efficiency,. without a
single party having the entire power.
Manufactures/Suppliers
Logistics
Distributors
Customers
Permissioned
Service Companies
Advantages
1. Better customizability and control over resources. 2. Better scalability and offers access controls.
3. More secure and efficient.
Disadvantages
1. Even though a consortium/federated blockchain is secure, the entire network can be compromised due to a member's
integrity.
2. Less transparency
3 Censorship and enforced regulations might adversely affect network functionality.
4 Less anonymous comparedto public and private blockchain.
(MU-New SMlabus wef academic year 22-23)(M7-85) el Tech-Neo Publications.ASACHIN SHAH ture
Ven
Blockchain(MU-Sem.7-Comp.) (lIntroductionto Blockchain)...Pageno... (1-29)
Comparison between different types of blockchain
------
1.7.4.1 Consensus
The concept of consensus is an interesting topic in a decentralized or a distributed network. Consensus means a
procedure to reach a common agreement in a distributed or decentralized multi-agent platform.
A typical example of a consensus mechanism is shown below.
In an army there are four generals, and they are taking Atac
some kind of important decisions, and when the
generals are taking decisions in a decentralized or a
distributed way (i.e., they have their own policies to
Lake the decision), they can either make an attack or
can either retreat from an attack.
Retreat
In a consensusalgorithm,all these generalsindividually Retreat
express their opinion, and from their individual opinion
by applying some kind of a choice function, which can
be the majority of the decision in this case, the
system/environment takes an appropriate decision.
In this case, there are three generals that are making a Attack
choice to perform an attack. So, with a majority
principle, the system can come to a consensus that they
should make an attack collectively.
Such type of consensus technique is important for
a a
Attack Attack
Attack
However, General 2 is a malicious
malicious call to General 1 and asksgeneral
who makes a Attack
for retreat whereas
General 2 makes a call to General 4, General 2
perform an attack. In says to
decentralizedenvironment,the
a
complete distributed
a or
generals mist get confused.
a1.7.4.2 DistributedConsensus
40
10 40
G What is distributed consensus ? 10
******* *************
30
30
can be achieved.
(1A46)Fig. 1.7.10: Distributed Consensus
There are four nodes. The individualnodes make a choice of 10, 20, 30, or 40, and they inform their individual choices
to all other nodes in the network and whenever every node receives all the choices from all the neighbors, they can
apply a choice function (ie., max. function) to determine what the maximum value is. So, from the figure, it is evident
that every node will reach to the value 40 if they apply the maximum function of all the received values.
Achieving consensus in such a type of architecture is easy and straightforward. It is possible only under certain
scenarios (ie., the system needs to be faulttess there should not be any failure in the system so that every individual
node can receive the message correctly and the system should behave in a synehronous manner - all messages will be
(e-g, link failure) and the network gets partitioned. From Server B
the below figure, we can see that there are three servers A,
B, and C, which are interconnected to each other.
(I447Fig. 1.7.11
(MU-New Syllabus w.e.f academic year 22-23)(M7-85) Tech-Neo Publications..ASACHIN SHAH Venture
Blockchain(MU-Sem.7-Comp.) (Introduction to Blockchain)...Page
no... (1.a.
(1-32
when the link between Server A and Server C fails as well as the link between Server B and Server C fails, the network
partitoned into two halves, as shown in dotted circles, and there is no message passing /communication betwe
tween
the partitionednetworks as the connectinglink has failed.
ch kind of
partition can happen in the network, and so, it is called as a partition rau
This type of network failure can hamper reaching consensus. Because of partition fault, nodes in one partitio
iion become
De atalica.
cannot
nodes in another partition for communication, and so, general consensus
rEn and network or partitioned faults take place because of hardwareor software failure
Dyzantine faults : It is a kind of fault that is more difficult to handle in a distributed environment. iere, a node start
ng maliciously, and it is difficult to interpret the nature of the node. Sometimes the node could send a positive
c or sometimes it could send a negative vote. In case of the abovementioned two faults, we can identity the effects of
a network faut
pends on the malicious
or a crash fault. Nonetheles,the effect
nature of the node. Sometimes
of a byzantine fault is
difficultto guess becaluset omplerely
a node can give a vote against the consensus or sometimes, it
gve a vote in favor of the Therefore, handling byzantine nodes becomes difficult in a
typical
d consensus.
distributed system.
U
Properties of a distributed consensus protocol
------ -.
GQ State the properties of a distributed consensus protoco
-- ---
Termination : Every corect individual decides some value at the end of the consensus protocol. In other words
whosoever is the non-faulty node in the network, the non-faulty node must terminate the protocol and decide on one
Integrity: Every correct individual decides at most one value, and the decided value must be proposed by some
individual. This property ensures that the consensus value should not deviate from the values that are proposed by
individual nodes in the network.
Agreement : Every corect individual must agree on the same value. All the individual nodes in the network must agre
on the same value. Whene ver all nodes agree on the same value after termination, we declare that the system ha
reached consensus.
property ensures that a node will never converge to an incorrect value or the correct individuals will never converge to
an incorrect value.
Liveness : Every correct value must be accepted eventually (i.e., something good will eventually happen). If some good
values are proposed, then those values will be committed eventually, although there could be some time lag or delayin
but after the consensus protocol terminates, a consensus value is expected to be achie ved out of
reaching the consensus,
it.
While dealing with consensus, we need to deal with the following types of message passing systems.
Synchronous message passing system : The message must be received within a predefined time interval. So, we have
a strong guarantee on the message passing delay and we know in advance what can be the maximum delay of messag
passing for a particular network. Such type of message passing system offers simplificationin designing the protoco
which means that waiting for a specific amount of delay will be worth because it is assured that within that time
message will be received. Designing a distributed system in a synchronous environment is much easy because of
enture
(MU-New Syllabus w.e.f
academic year 22-23)(M7-85) Tech-Neo Publications.A SACHIN SHAH Ven
Blockchain(MU-Sem.7-Comp.) (Introductionto Blockchain)...Pageno...(1-33)
strong assumption of the message passing delay, and that is why if we wait for a certain amount of delay, it is expected
that we will receive all the messages
Asynchronous message passing system: There is no upper bound on the message transmission delay or the message
time. Here, there no time constraint, i.e., a message can be delayed for an arbitrary period of time or the
reception
message delivery time be arbitrarilylong. So, in case of an asynchronousmessage passing system, we cannot wait
can
for a finite duration to recive messages with a guaranteed probability. Designing a distributed system in an
asynchronous environment is not that easy because we do not have sufficient amount of delay. Moreover, we also need
to deal with the type of fault that may arise because of the asynchronous nature of the system. Achieving consensus in
an asynchronousmessage passing system is not that easy when comparedwith a synchronousmessage passing system.
FLP8S (Impossibilityresult) : In a purely asynchronousdistributedsystem, the consensusproblemis impossible(with
a deterministic solution) to solve if in the presence of a single crash failure. However, randomized algorithms may exist.
Synchronous consensus
There exists various consensusalgorithmsthat have been exploredby the distributedsystem community.
Raft Byzantine fault tolerant (BFT)
Paxos
can access.
Limitations
of others.
Message passing requires a closed environment,i.e., everyone needs to know the identity
for Internet grade computing, i.e., at which location
should the shared memory be
2 Shared memory is not suitable
placed ?
LIMITATIONS
1.9 BLOCKCHAIN IMPLEMENTATION
--.
of blockchain?
GQ. What are the potential solutions for the scalabilityproblem --
(4) As the blockchain grows in size, only a few nodes will be able
to process a block at some
possibility of reverting to centralization. point, posing the
The challengeof scaling a blockchaincan be comes down to two main
factors
(1) The blockchain itself expands in size as more
peaople utilise it. Each node must keep
history. The bitcoin blockchainalone has a storage of 163
a more detailed storage-
amount of data, which means that anyone starting a
Gigabytes as of March 2018. Every node must store this
bitcoin node must have at least this much
figure is only going to rise. storage space. This
() There is no incentive to be
node that manages the
a
ledger. Miners, who receive a bitcoin block
block they create and add to the chain, are the
only people who have reward for each
incentiveto keep the
an
Maintaining a node becomes more difficult and expensive for a network running.
Single person as a result of
may run the network, but nodes are in charge of
keeping the ledger up to date. these two issues, Miners
This creates challenge for any blockchain; in order to scale, the
a
network must be
corporations,and research organisationsall have diferent centralised.Developers,blockchain
solutions to offer.
being used. Sharding is one solution that is currenty
Each node in the sharding process is not required to handle all of the
split into separate shards, removing the data. The entire
need for each node to end-to-endblockchainstate can
save a subset of the state with shards. keep all of the data.
Specific nodes would only have
(MU-New Syllabus w.e.f academic year 22-23)(M7-85)
Tech-NeoPublicationsASACHIN SHAH Ventur
(Introductionto Blockchain)...Page no... (1-35)
Blockchain(MU-Sem.7-Comp.)
initiated the blockchain, they are only directed to the shards that they impact..
As a result, when transactions are on
entire state, each shard will only process a subset of it. However, in order to automatically
Rather than processing the
establish reliable connectivity across the shards, a commanding mechanism is required.
off-the-shelf hardware,
exploring the possibility of nodes running independently regular
on
Some initiatives are also
issue.
delivering completedecentralisation while also addressing scalability
the
from fast
network using Shardus (a project). The blockchain will benefit
Experts are building an all-peer-to-peer
well as security assurance, as a result of sharding and auto-scaling.
throughput, low latency, and immediate finality, as
This is supportedby a proof-of-quorumalgorithmand the Shardus DistributedLedger
As the network grows in size, this one addresses the issues of linear scalability and state sharding.
(2) Increasing the block size (Bitcoin architecture-specific): More transactions can be stored in each block if the
transactions per second.
block size is increased. This lets the network to handle more
(5) Off-chain computations: TrueBit is an example of an off-chain calculating solution that enables scalability
transactions across Ethereum smart contracts. TrueBit, like state channels, relies on an external layer of the
blockchain to do the heavy lifting. Off-chain computation is a notion in which all difficult mathematical operations
are handled by a layer apart from the blockchain. This will not only relieve the Ethereum Blockchain of its strain,
This computing model is not used by all
but will also lower transaction verification and processing expenses.
blockchain nodes.
Instead, only a select few will perform difficult computations in conjunction with a deposit. If the participant's
solution is correct, the participant receives both the award and the deposit. Otherwise, the deposit is forfeited.
Verifiers are also used to perform verification in off-chain computation. By adding a separate layer to the
blockchain, this approach ensures that procedures with slow transaction speeds are executed independently.
Transactions can be executed in less than a second by moving them off-chain, while information from public
ledgers has a higher level of privacy.
0 Proof-of-stake (PoS) : Instead of computing power, stakeholders vote with money (or, in the case of Ethereum.
ether). Bitcoins and Ethereum work on the Pow case, which is a system in which difficult mathematical equations
must be solved in order for the verification mechanism and transaction processing to function. As a result, the
speed of transactions on Ethereum's blockchain slows. Because PoW has drawbacks, a new proof-of-stake
mechanism was developed to achieve faster transactional speeds and higher levels of security.
The other major distinction berween the proof-of-work and proof-of-stake models is that in POs, validators do not
ean ethers but instead receive a transaction fee for their efforts. Pos will have much faster transaction speeds.
) Transient blockchain : Saito has come up with a novel solution to both isues, To avoid the growing pains of
keeping large ledgers permanently, Saito devised a transitory blockchain that deletes itself at predetermined
intervals kaown as 'Genesis Periods. A user can keep any information on-chain by paying a small fee, which is
effectively the cost of the storage that it uses. The second option presented by Saito is to provide an incentive to
this is similar to the probabilistic mechanism used by Bitcoin miners to spend money in order to make money.
he difterenceis that Saito, by doing work for the network, assists it in scaling. Although these technologies have
brought limited improvements to date, the fundamental constraints are due to present systems' low storage and
computingcapabilities.
Hardware scalability : The cost of hardware is
rising as the popularity of blockchain grows. This raises the cost of
entrance into mining, causing it to become more centralised. Aside from that, there are energy and economic concerns.
1.9.2 Limited Privacy
Even though identities in a distributed
ledger are anonymous, by looking at the transaction address, it is feasible to
correlate the user identity with that address and
obtain information about the user. Because anyone can create a new
wallet anonymouslyand transact through that wallet, blockchain transactions are not tied to one's status.
Tdentity verification data, like as
security numbers, cannot be stored
that is not controlled in openly in public smart contracts. Another factor
an open, ultimatelyunsecured smart contract is credential management.
(3) Crypto wallet theft: The vast majority of investors and users keep their bitcoin wallet files on their personal
computers, making them vulnerable to malware attacks.
The main problem with blockchain is a lack of knowledge about the technology. Particularly in non-banking areas,
there is a general misunderstanding of how it works. In addition, the following factors must be taken into account.
1.10.1 TransactionProcessingSpeed
One of the other obstacles that blockchain faces is scalability in terms of transaction processing speed. Contrary to
popular belief, the most popular cryptocurency, Bitcom, can only process an average of 7 transactions per second.
At the same time, Visa can handle 24000 transactions per second and PayPal can handle approximately 200 transactions
per second. Bitcoin Cash has a transactionrate of 50 to 60 transactionsper second, which is still low when comparedto
Visa. Among all cryptocurrencies, Ethereum is the slowest, ith only about 20 transactions per second.
Transaction speed has been hampered by the EthereumBlockchain's growing size and complexity, and transactions can
now take hours or even days to validate.The DirectedAcyclic Graph (DAG) has a solutionfor slow transactionspeeds
DAG has solved the problem by confirmingtransactionson a per-transactionbasis rather than a block-by-blockbasis.
DAG allows users to handle each other's transactions on a microscale rather than waiting for miners to execute a large
block of transactions, lowering transaction fees and increasing speed.
1.10.2 Complexity
The underlying technology of blockchain is diffcult for beginners to understand because the code contains a large
number of mathematicalcomputations.Blockchaintechnologyis stillin its infancy in termsof maturity,with numerous
new processes, standards, and unique technical elements.
Another aspect of blockchain that adds to its complexity is that it is based on decentralisation and encryption as its basic
backbone.As a result, various difficulties arise in its functionalities, such as transaction speed, transaction verification,
and data limits that can be transferred or received.
The expansion of the blockchain network introduces a new layer of complexity to the system. Blockchain, like any
other decentralised system, is susceptible to fraudulent attacks that have the poteatial to corrupt the network. A robust
network algorithm connects a large number of users and nodes to form a stable blockchain network.
Even though blockchain provides users with reduced transaction costs, the underlying technology and implementation
costs are not insignificant.Four inputs have a significantimpact on the expenses of both public and private blockchain
solutions, and they are fully dependent on the use case and the goals that a company achieves.
There are other factors to consider, but the following are the most important
(1) Transaction volume (2) Transaction size
(MU-New Syllabus w.ef academic year 22-23)(M7-85) Tech-Neo Publications.ASACHIN SHAH Venture
Blockchain(MU-Sem. 7-Comp.) (Introduction to
Blockchain)..Page
(1-38
no.., (1.
more nodes an
Tequires a significant amount of computing power, and the blockcnan B
other connections are added. All
of this adds to the operating expenses
Ihe development of blockchain soBlutions is typically an agile process, which raises costs due tO ne involvement at
Numerous blockchain networks have emerged on the market as a result of the emergence of over 2000 cryptocurrencies
and thousands of applications that use distributed ledger technology. Because there are no worldwide standards for
(4) Alternative consensus algorithms: Two alternative consensus procedures are delegated proof-of-stake(DPoS)
and practical byzantine fault tolerance (pBFT). These two alternative consensus mechanisms are more appropriate
for non-financial blockchains. As of now, these methods necessitate additional research and development for a
variety of application situations.
(5) Delegated proof-of-stake (DPoS) : A small number of delegates will maintain the ledger in this approach, and
users will vote for them using a real-time algorithm. The network's throughput is significantly higher due to the
fewer active nodes. Because each node is paid through inflation, it makes sense to keep a large data centre for
network support. The disadvantage of the DPOS is that it is centralised. This means greater network control and
less ability to be transparent and open. As a result, if a user can buy more votes, they can easily control and change
the network rules to their benefit.
Every node in the pBFT algorithm authenticatesthe block's state in turn. PBFT is capable of performing a variety of
functions very efficiently, resulting in higher throughput and lower resource utilisation costs.
The disadvantage of pBFT is that it is easily vulnerable to Sybil attacks due to the low cost of adding new network
nodes. Fraudsters may be able to establish more nodes and attack the entire chain if they reach 33% of the network.
In contrast to the Bitcoin network, which requires 50% of the network to gain control, pBFT requires only 33% of the
network to gain control, making the pBFT more vuinerable to takeover.
1.10.8 SimplifledMining
Mining fora common blockchain cryptocurrency, such as bitcoin, has created an oligopoly problem. The vast majority
of mining power is concentrated in a few mining pools that split revenue. This directly contradicts the fundamental
principle of bitcoin and cryptocurrency decentralisation.
Ethereum is based on the proof-of-work (PoW) algorithm. Only when the validation conditions are met are the blocks
created and connected to the Ethereum network. This method ensures that each transaction is legal. Despite the fact that
this PoW technique secures transactions and transfers, it has some limitations.
validated before entering the system and confirmed after entering the system.
of the blockchain. Another common cause of system
parase garbage in, garbage out" refers to data in the context
C
failure is human error.
Though we can think of the blockchain as a single database with each block serving as a storage stack, the date
appended to the database is entered by humans in the first mile.
If this data is to be emror-free, it must be correctly fed at the entry point. However, no method or system exists to
validate the data that is entered to be processed within the blockchain network. As a result, trust is an issue, because
incorrect data entered into a blockchain could contaminate the data of the entire system.
Chapter Ends...
O00
Module
Tools and Applicationsof
Blockchain
Syllabus
on any of the
Corda, Ripple, Quorum and other Emerging Blockchain Platforms, Blockchain in DeFi: Case Study
Blockchain Platforms.
.6-2
6.1 Overview of Ripple.
Ga. What is ripple? Explain its payment system. ****************************as*******a***0**n********"****° **************** .6-2
ChapterEnds. ******
*******************
***e******e*es*t ...6-19
Blockchain(MU-Sem 7-COMP)
(Tools and Applicationsof Blockchain)....Pageno. (6-2)2
W 6.1 OVERVIEW OF RIPPLE
Messaging in Corda is similar to the email system, and its privacy can be understood with the example given
tracts
Fig. 6.2.1,which is representingdifferent users and the shared contract. There is no single central storage, and
are not shared with all the nodes in the system.
(MU-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-Neo Publications...A SACHIN SHAH Venture
Blockchain(MU-Sem7-COMP)
(Tools and Applicationsof Blockchain)...Pageno. (6-4
Let consider the example of users B, C, and D who
us 2
common contract 3, which is unavailable
are
sharinga
to user A, and contract
5 is shared between users C and
D, and communication related
with contract 5 is not shared with
remaining users A and B. 2
Consider the application where
the seller of a
want to reveal the
product does not 5
identity of its consumers to its competitor. In
such scenarios, sellers can
perform transactions without sharing
details to other parties ,which are not involved in
the transaction.
Corda is scalable and
supports billions of transactionsdaily across
the
industry and allows interoperability Users: A, B, C, D Contract: 1,2, 3, 4,5
applicationscoexistingtogether on the network. amongst multiple
Corda is architected in such
(107)Fig. 6.2.1: Cordacontractsharing
way that different versions of corda can coexist on the same
a
will continue
running on the later versions. Corda contracts involve external facts network, and applications
like share price, interest and conditions governing contracts
rate, FX conversion,etc.
These details are
kept off-chain and provided by trusted oracles.
provides consistent, transparent, and resilient Consensus pool (notary node) in the Corda architecture
prevents the double-spending unique consensus services, and Corda's UTXO
state machine model
problem.
Corda allows
businessesand individuals to perform transactions
broadcastingover the network. The parties involved in the privately concerning only members involved withouut
highly scalable. Developerson Corda use transactionsare legally identifiableon the
network wide standardsto network, which is
Similar other blockchain
to develop interoperableapplications.
networks, Corda, transactionsare
in
global broadcast instead it prefers cryptographically
upon, but it does not permit chained to the transactionsit
depends
transaction to authorized parties whose peer-to-peermessage sending and avail informationof
assured identity is maintained. All
maintains a global ledger messages on Corda are encrypted, and it
includingall transactions.
Quorum is an Ethereum-baseddistributed
network with transaction ledger protocol that allows for the creation of
privacy support. J.P. Morgan Chase created the a
permissionedblockchain
use cases; it was
recently acquired by ConsenSys. open-source project with a focus on financial
Quorum introducedinto the larger
was
ecosystemof permissionedblockchainsto address the
Carry out private transactionsas well as smart contract following requirements:
operations.
Implementmultiple consensus mechanismsin a
plug-and-playmanner.
o
Manage network permissionsin a flexible and expressivemanner.
Quorum is modelled after the official Go
choice is that by minimizing implementationof the Ethereum protocol (geth).The
changes to Go-Ethereum,future versions of the public Ethereum reasoning behind this
maintained Each Quorum node providestwo code base can be
primary services. easily
Quorum Client: This is the extended geth client that is
protocol (by acceptingconnectionsonly from
in-charge of executing the Ethereum
permissionednetwork participants)and the consensus peer-to-peer (p2p)
2.
Privacy Manager : It is
software module that allows for private transactions and
a
algorithm.
is made private smart contract operations.It
up of two parts, i.e., the transactionmanager and the
crypto enclave. Because of its
auditable, and immutable characteristics,blockchain or distributed ledger cryptographicallysecure,
provides a secure, shared platform for
decentralizedapplications(Dapps) and data. However, for a blockchainto be suitable for
ariven enterprises,several enterprise-
requirements must be met. Privacy, performance, and permissioning are the most
requirements. important of these
JsON RPC
DAPPs Enhanced Pluggable HTTPS
Transaction
RPC API consensus Enclave
manager
Wallets Access control
(permissioning)
Quorum node
of geth. Because it is a fork of geth, it continues to benefit from the ongoing research
The Quorum node is a small fork
and development within the ever-expanding Ethereum community as well as the incredible work of the geth development
tandem with Geth releases to reflect the most recent enhancements.
team. As a result, Quorum is regularlyupdated in
architecture of Quorum, let's look at how it achieves all of the enterprise features
Now that we've covered the high level
we discussed earlier.
Private transactions
We'll look at how Quorum supports key enterprise features like privacy, performance, and permissioning.
PartyA
Lookingat the above figure, we can deseribe the process step by step as presentedbelow:
1. Party A sends a transaction to their Quorum node, indicating the transaction payload and specifying private for to be
Party B's public keys. It is optional for party A as well.
2. Party A's Quorum node sends the transaction to its paired transaction manager, requestingthat the transactionpayload
be stored.
3. The transaction manager of Party A contacts the associatedenclave to validatethe
sender and encrypt the payload.
Party A's enclave validates Party A's private key and, if valid, processes the transaction.
5. Party A's encryptedpayload'sSHA3-512 hash
transaction manager computes the and stores the encryptedpayload and
encryptedrandom master keys (RMKs) againstthe hash in the database.
6. The transaction manager of Party A then securelytransfers (via HTTPS):
The encrypted payload
RMK encrypted with the shared key generated by the enclave processing in Step 4.
3. A block containing transaction AB' is created and distributed to all network parties.
View of party C
Block
Farty C Transaction
Quorum node C manager for node Enclave for node C
DAPP C
Public Kivate DE
C
Fig. 6.3.3:Party
which identifies
to process the transaction. A V value of 37 or 38,
When the block is processed, all parties will attempt
each Quorum node.
the transaction as a private transaction whose payload requires decryption, will be recognised by
transaction. The hash is
transaction to see if they are the owner of the
The node then queries their associated manager
used as the index for this lookup.
C will receive NotARecipient message and will skip the update its Private StateDB
Transaction. It will not
Party a
View of Party B
Block
Fig. 6.3.4:Party B
The enclave validates the signature,then decrypts the symmetric key with the party's private key stored in the enclave,
1.
now-revealed symmetric key, and returns the decrypted payload to the
deerypts the transaction payload with the
transaction manager.
The decrypted payload is then sent to the EVM by the transaction managers for parties A and B for contract code
2.
execution. This execution will only update the Quorum node's Private StateDB.
Node A
Usingxsalsa20poly1305 Using curve25519xsalsa20poly1305
Transaction to produce
Payload oontainer to produce
manager Enclave |Recipient box boxed packets(orypto_box)
Payload
SHA3 Hash encryptedwithl Random Master key
for payload
symmetric key nonce
containeer
Fig.6.3.5:Enclave processing
"Party A's Enclave validates Party A's
This
private key and, if validated,processes the transaction. "
10-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-NeoPublications...ASACHIN SHAH Venture
Blockchain)..Page no.(6-11
Blockchain (MU-Sem7-COMP) (ToolsandApplicationsof
Quorum is a good choice for enterprise use cases because of its improvedperformance
Enterprise permissioning mechanism
grade scheme used for
mechanism is common and standard enterprise
The role based access control (RBAC) a
level control.
providingorganisational access
to enterprise systems. It
control mechanism
is a de facto mechanism for providing a common enterprise grade access
t
such as Windows and RedHat,
in operating systems
1S used in a lot of business systems. RBAC is also implemented
demonstrating its industry-wide acceptance and usability.
as standard RBAC. It
on the same principles
Quorum implements a modified subset of the RBAC standard. It operates
over who can join the
ensuring the necessary control
well as rule-based permissioning,
provides role-based access as
organisation or a sub-organization.
and belongs to an
Node: A geth node that is a member of the network
actions that an account is permitted to carry out. (for example, value
Permission: A description of the types of
smart contract deployment, or smart contract execution)
transfer,
Roles Nodes
Nodes
Accounts
SubOrg1
Accounts
Organization
Network
Roles Roles Nodes
SubOrg2
Accounts
Voters
Organization 2 Organization 3
Network
Node(s)
STATUSES
Organization(s)
User Account s)
External off-chain 1:M, M:1,1:1 ROLES
entity STATUSES
This architecture is depicted in Figure 7, where the network is the top level entity, containing an organisation or several
organisations, each of which contains accounts and nodes as well as relevant access and status types.
Also, keep in mind that the user is an external entity that exists outside of the network. It could be a company or a single
user. The key concept here is that in the permissioning mechanism, a user is mapped to Ethereum accounts, It can he
one-io-many, many-to-one, or one-to-one relationship. A single organisation, for example, represented by a username,
the blockchain.
can be linked to multiple accounts on
Similarly, multiple external entities can be represented on the chain by the same account. A single user can be assigned
to a single account. The benefit of this approach is that there is no need to keep on-chain records of users, which not
MU-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-Neo Publications...ASACHIN SHAH Venture
Blockchain)...Page no.(6-13)
Blockchain(MU-Sem 7-COMP) (Tools and Applicationsof
level, whereas nodes are assigned
their business function and
access
ACcounts are assigned roles and statuses based on
Consensus
There is no need for an expensivePoW consensus mechanism because consortium chains are permissioneca.
chains. As a result, Quorum provides various consensus mechanisms that are better suited for private blockchains.
o RAFT-based Consensus: A crash fault tolerant (CFT) consensus model for faster
block generation,transaction
finality, and on-demand block generation.
Istanbul BFT Convergence: It is a BFT algorithm that is based on the Practical Byzantine Fault Tolerant (PBFT)
o
consensus algorithm. It allows for immediate transaction completion. It guarantees liveness and safety under
and 3f + 1 in 3f + 1
standard Byzantinefault threshold assumptionsof in a partiallysynchronousnetwork a
network configuration.
o
Clique Consensus: Clique is a POA consensus algorithm included with the public Go Ethereum client (geth).
Quorum is used in a variety of applications, including logistics, healthcare, identity, property. payments, capital
markets, and post-trade.
Some of the projects are listed below, along with a brief description:
1. Tokenised cash: Developed by IHS Mark it, this is a distributed ledger that records all cash transactions.
2. JPM Coin: Created by J. P. Morgan, it is intended to allow for the immediate settlement of transactions between
clients of the bank's wholesale payments business.
3. Loan Marketplace: It is a decentralised loan marketplace. Stream Source technologies created it.
4. Proxy voting increases transparency in AGM voting between issues and investors.
verify payments.
7. Supply chain tracking: A cryptographic provenance platform that allows the authenticity of high-priced goods to
be proven.
(MU-New Syllabusw.ef academic year 22-23) (M7-85) Tech-Neo Publications..ASACHIN SHAH Venture
Blockchain (MU-Sem 7-COMP)
(Tools and Applicationsof Blockchain)...Pageno...
(6-14)
(MU-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-NeoPublications...ASACHIN SHAH Venture
Blockchain (MU-Sem7-COMP) (Tools&Applicatlonsof Blockchain)..Pageno. (6-15)
(MU-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-Neo Publications..A SACHIN SHAH Venture
Blockchain(MU-Sem7-COMP)
Interoperability:The modular software stack of (Tools &Applcationsof Blockchain)..Pageno.(6-16)
integrate and complementone another. Ethereum ensures that DeFi protocols and
applicationsare designed
interfaces, and
Developers and product teams can build on
top of existing protocols,customise
integrate third-party applications with DeFi. As a
"money legos." result, DeFi protocols are frequently referred to as
Asset management
You are the custodian of your own crypto funds with DeFi protocols. Crypto wallets such as MetaMask, Gnosis Safe,
and Argent enable you to interact with decentralized applications to do everythingfrom buying, selling, and transferring
crypto to earning interest on your digital assets in a simple and secure manner. You own your data in the DeFi space
MetaMask, for example, stores your seed phrase, passwords, and private keys locally on your device in an encrypted
format so that only you have access to your accounts and data.
The rules of the game have changed for organisations that have increased institutional-grade requirements for allocating
capital to DeFi. Wallets like MetaMask Institutional make cryptoeconomic research, pre- and post-trade compliance,
best trade execution, reporting, and, of course, crypto custody easier for these organisations.
DAOs
A DAO is a decentralized autonomous organisation that cooperates in accordance with transparent rules encoded on the
Ethereum blockchain, obviating the need for a centralized, administrative entity.
uDerivatives
Ethereum-based smart contracts allow for the creation of tokenized derivatives, the value of which is determined by the
performance of an underlying asset and in which counterparty agreements are hardcoded in code.
DeFi derivatives can represent both real-world assets and cryptocurrencies, such as fiat currencies, bonds, and
commodities.
Composability is one of the core design principles of DeFi protocols, which means that different components of a
system can easily connect and interoperate. As evidenced by the wide range of integrated DeFi applications,
composable code has created a powerful network effect in which the community builds on the work of others.
Many people compare DeFi development to building with legos, hence the increasingly popular moniker "money
legos." Ethereum developers and product teams can now build and launch DeFi protocols with the full-stack tooling and
security integrationsthey require, thanks to Truffe's smart contractlibraries,Infura's API suite, and Diligence'ssecurity
tools.
DEXs
DEXs are cryptocurrency exchanges that operate without a central authority, allowing users to transact
peer-to-peer
while maintaining control over their funds. Because crypto assets are never in the custody of the exchange, DEXs
reduce the risk of price manipulation, as well as hacking and theft.
DEXs also provide token projects with liquidity that often rivals that of centralized exchanges, with no listing fees.
Until recently, projects would pay millions of dollars to have their token listed on a centralized exchange
Some exchanges use varying degrees of decentralization, with centralized servers hosting order books and other features
but not storing users' private keys. AirSwap, Liquality, Mesa, Oasis, and Uniswap are some of the most popular DeFi
DEXs right now. MetaMask Swaps, a DeFi liquidity data aggregator,optimises trading experiences by providingDeFi
users with unparalleled insight, allowing them to identify the best price quote, optimal gas prices for the given quote,
and the lowest failure rates.
Gaming
DeFi's modularity has opened up opportunities for product developers to integrate DeFi protocols directly into platforms
across a wide range of industries. Because of their built-in economies and innovative incentive models, Ethereum-based
games have become a popularuse case for decentralized finance
PoofTogether, for example, is a no-loss audited savings lottery that allows users to buy digital tickets by depositing DAI
stablecoins, which are then pooled and lent to the Compound money market protocol to earn interest.
(MU-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-Neo Publications...ASACHIN SHAH Venture
Blockchain(MU-Sem7-COMP) (Tools &Applicationsof Blockchain)...Pageno.(6-18)
Identity
Decentralized finance protocols combined with blockchain-based identity systems have the potential to enable
previously excluded users to gain access to a truly global economic system. DeFi solutions, rather than traditional data
points such as home ownership and income, can reduce collateralization requirements for people who do not have extra
funds and help assess users' creditworthiness through attributes such as reputation and financial activity.
The DeFi space values data privacy and open access to personally identifiable information. Anyone with an Internet
connection can use DeFi applications while keeping control over their data and assets.
Insurance
DeFi is still a developing space, with risks associated with smart contract bugs and breaches. A number of innovative
insurance alternatives have entered the market to assist users in purchasing coverage and protecting their holdings.
Nexus Mutual. for example, offers Smart Contract Cover, which protects against unintended uses of smart contract
code.
Margin Trading
Unlike traditional finance, where margin traders can
leveragetheir trades by borrowingfunds froma broker (which then
serves as collateral for a loan), DeFi
margin trading is powered by decentralized, non-custodial lending protocols like
Compound and dYdX.
Because smart contracts automate traditional brokerage activity, some in the DeFi ecosystem have begun to refer to the
rise of "autonomous money markets."
Payments
Peer-to-peer payment is arguably the cornerstone of the DeFi space and the blockchain ecosystem as a whole.
Blockchain technology is designed to allow users to exchange cryptocurrencysecurely and directly with one another,
eliminating the need for middlemen.
DeFi payment solutions are helping large financial institutions streamline market
infrastructure and better serve
wholesale and retail customers while also creating a more open economic
system for underbanked and unbanked
populations.
Prediction markets
Blockchain-based prediction markets capitalise on the collective wisdom of the crowd by allowing users to vote and
trade value on the outcome of events.
Market prices then become crowdsourcedindicators of an event's likelihood.
Augur, a popular DeFi betting platform,
includes predictionmarkets for election results, sports games, economic events, and other
topics.
(MU-New Syllabus w.e.f academic year 22-23) (M7-85) Tech-Neo Publications...ASACHIN SHAH Venture
(6-19)
Blockchain (MU-Sem7-cOMP) (Tools&Applicationsof Blockchain)..Page no.
Savings more than traditional savings accounts by
accounts that can earn exponentially
Many DeFi apps offer interest-bearing interest rate tied to supply and demand.
pool protocols like Compound, based on a dynamic
plugging into lending
no-loss savings game in which participants win or
Dharma, and PoolTogether, a
Popular savings apps include Argent,
lose all of their money.
savings innovative mechanisms. Yield
has exploded in response to these
"Yield farming" is one DeFi activity that in order to maximise returns.
idle crypto assets around in different liquidityprotocols
farming is the practise of moving
The frenzy of interest in DeFi yield farming
has resulted in an abundance of memes.
Stable coins
stable asset basket of assets, such as fiat, gold, or other cryptocurrencies, is
Any cryptocurrency that is pegged to a or
referred to as a stablecoin.
make blockchains a viable
Stablecoins were created in order to reduce the volatility of cryptocurrency prices and
institutional
and borrowing platforms, and even
payment solution. They are now used for remittance payments, lending
use cases such as central bank digital currency(CBDC)
staking
Ethereum
Users will be able to stake their ETH and earn rewards as validators
or through staking providers as the
network transitions to a Proof of Stake consensus algorithm with Ethereum 2.0.
interest (rewards) for
Staking on Eth2 is similar to investing in an interest-bearing savings account: stakers earn
Synthetic Assets
assets that provide exposure to other assets such as gold, fiat currencies,
Synthetic assets, like stablecoins, are crypto
and cryptocurrencies.
contracts with built-in agreements and incentive mechanisms serve as
Tokens locked into Ethereum-based smart
collateralization ratio of 750 percent to help the network absorb
collateral. The Synthetix protocol, for example, uses a
price shocks.
Tokenization
Tokenization is a pillar of decentralized finance and a built-in feature of the Ethereum blockchain. Tokens not only
application, Ethereum-based tokens have emerged as a secure and digital alternative for users all over the world to
access, trade, and store value.
Trading
and token swaps,
Trading in the DeFi space includes a variety of activities, such as derivatives trading, margin trading,
and takes place across an ever-growing and integrated network of exchanges, liquidity pools, and marketplaces.
Decentralized exchanges provide cryptocurrency traders with lower exchange fees, faster transaction settlement, and