0% found this document useful (0 votes)
6 views44 pages

CHP 2 Part 2

The document discusses various consensus protocols used in blockchain technology, including Proof of Work (PoW), Proof of Stake (PoS), and Delegated Proof of Stake (DPoS). It outlines the mechanisms, advantages, and disadvantages of each protocol, as well as their applications and security considerations. Additionally, it addresses potential attacks on blockchain systems and the concept of competing chains or forks within a decentralized network.

Uploaded by

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

CHP 2 Part 2

The document discusses various consensus protocols used in blockchain technology, including Proof of Work (PoW), Proof of Stake (PoS), and Delegated Proof of Stake (DPoS). It outlines the mechanisms, advantages, and disadvantages of each protocol, as well as their applications and security considerations. Additionally, it addresses potential attacks on blockchain systems and the concept of competing chains or forks within a decentralized network.

Uploaded by

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

NOWROSJEE WADIA COLLEGE

DEPARTMENT OF COMPUTER SCIENCE


CS VIII – Blockchain Technology
CHAPTER 2 - How Blockchain Works
PART - II
Prof. Vimala T
CONTENT
Consensus Protocols
✔ Proof of Work
✔ Proof of Stack(PoS)
✔ Proof of Space
✔ Defense against Attackers
✔ Computing Chains
Blockchain Demo
CONSENSUS PROTOCOLS
Consensus means “general agreement” , needed to record information ,
such as balance of every address and transactions on the blockchain.
A consensus mechanism refers to any number of methodologies used to
achieve agreement , trust and security across a decentralized computer
network.
A good consensus protocol can guarantee the fault tolerance and security
of the blockchain systems.
A consensus in a blockchain is a set of rules to be followed to maintain a
blockchain.
It is used to achieve an agreement or adding new data value in the
distributed servers or node in the network.
MCQ 1:

A ___________ mechanism refers to any number of methodologies used to


achieve agreement , trust and security across a decentralized computer
network.
a) PoW
b) Hash
c) Blocks
d) Consensus
These protocols forms the backbone of blockchain by helping all the
nodes in the network by verify the transactions.
A consensus algorithm is a protocol through which all the parties of the
blockchain network come to a common agreement (consensus) on the
present data state of the ledger and be able to trust unknown peers in a
distributed computing environment.
Consensus algorithm or protocol is open source , decentralized platform
and decision making process for a group, where individuals of the group
construct and supports decision for that works.
The most commonly used consensus mechanisms for blockchain
technologies are :
✔ Proof-of-Work (PoW)
✔ Proof-of-Stake (PoS)
✔ Delegated Proof-of-Stack (DPoS)
✔ Proof-of-Elapsed Time (PoET) and so on
Proof of Work (PoW)
The Proof-of-Work (PoW) is a common consensus algorithm used by the
most popular cryptocurrency networks like Bitcoin and Litecoin.
It is the process of building a cryptographic hash.
This concept was first introduced in 1993 by Cynthia Dwork and Moni
Naor and is reintroduced by Satoshi Nakamoto in the Bitcoin
whitepaper in 2008.
It historically originates from its use in Hashcash, which was conceived
by Adam Back as system to limit email spam and Denial-of-Service
attacks.
MCQ 2:
The Proof-of-Work (PoW) concept was first introduced in 1993 by
_______.

a) Cynthia Dwork and Moni Naor


b) Satoshi Nakamoto
c) Vitalik Buterin
d) Adam Back
In the PoW system, blockchain validators take data from a block header as an
input and continuously run it through a cryptographic hash function.
Validators hash negligible variations of the input data by including an arbitrary
random number called a nonce, every time the input data is run through the
cryptographic hash function.
PoW needs high levels of electricity of processing power to resolve that data
gets added to the next block in a blockchain.
Specialized computers called ASICs are required to compute complex
mathematical problems needed for the PoW system.
The PoW is a common consensus algorithm used by the cryptocurrency
networks like Bitcoin and Litecoin.
It requires a participant node to prove that the work done and submitted by
them qualifies them to receive the right to add new transactions to the
blockchain.
MCQ 3:
__________ needs high levels of electricity of processing power to resolve
that data gets added to the next block in a blockchain.

a) PoET
b) PoW
c) PoS
d) BFT
This whole mining mechanism of bitcoin needs high energy consumption
and longer processing time.
Consensus Mechanism of PoW
It uses cryptographic hashing puzzle to make sure that a certain amount of
work has been done before a block is created.
Bitcoins PoW uses SHA – 256 has a function to create a hashing puzzle.
Blocks in a blockchain network are created by a special type of validator node
called as miner.
These miner nodes compete with each other to solve the hashing puzzle in
order to produce a block to be appended to the ledger.
Blockchain miners will start to solve the hashing puzzle whenever they have
data that needs to be included in a block.
The figure shows the basic structure of a block header used a PoW based
blockchain application.
A puzzle solver will create a hash value of the header, generally using the SHA
– 256 hash function.
The puzzle here is to find a hash value for the header so that the hash begins
with a known number of zero bits.
Pros and Cons of PoW :
Pros:
Highest scalability and security.
A complete decentralization achieved by it.
Nodes are easy to implement.
Protection from DDoS-attacks (Distributed Denial of Service)
Cons:
It is a power-hungry and resource-intensive protocol.
Low performance
MCQ 4:
Which of the given below is the disadvantage of Proof-of-Work?
a) A complete decentralization achieved by it.
b) It is a power-hungry and resource-intensive protocol.
c) Nodes are easy to implement.
d) Protection from DDoS-attacks
Where PoW used
Bitcoins
Etherium
Bitcoin Cash
Litecoin
Zcash
Proof of Stack
Proof of Stack (PoS) protocols are the consensus mechanisms for
blockchains that work by selecting validators in proportion to their
quantity of holdings in the associated cryptocurrency.
This algorithm was created in 2011 as an alternative to PoW.
It has a different way to verify and validate the transactions or blocks.
Once the user is selected to validate the block and accurately verify all
transactions in that block.
MCQ 5:
___________ protocols are the consensus mechanisms for blockchains that
work by selecting validators in proportion to their quantity of holdings in
the associated cryptocurrency.
a) PoS
b) PoSpace
c) PoET
d) PoW
It evolved as a low – cost, low – energy consuming alternative to the PoW
algorithm.
It involves the allocation of responsibility in maintaining the public ledger to a
participant node in proportion to the number of virtual currency tokens held by
it.
It differs with the PoW mining consensus mechanism where blocks are
validated based on the stake of the network participants.
Unlike running hash functions, validators stake resources primarily in the form
of digital money or tokens.
The validator of every block is then randomly selected from the stakeholders
based on the amount of computational power allocated.
The Ethereum , which is the world’s largest blockchain network in terms of
developer activity has initiated to switch from PoW to PoS in an attempt to
increase the networks scalability and reduce excessive electricity wastage.
Pros and Cons:
Pros:
High performance
Scalability
Smart-contract support
Increased protection from malicious attack.
Cons:
Medium security
Nothing-at-stake problem
In PoS, an attacker would need to possess greater than 50% of the
currency to gain control over the network compared to 51% in PoW.
One possible attack over a PoS consensus-based network is a bribe
attack.
Delegated Proof-of-Stack
DPoS is a popular evolution of the PoS concept, whereby users of the
network vote and elect delegates to validate the next block.
Delegates are also called witnesses or block producers.
Using DPoS, you can vote on delegates by pooling your tokens into
a staking pool and linking those to a particular delegate.
You do not physically transfer your tokens to another wallet, but instead
utilize a staking service provider to stake your tokens in a staking pool.
A limited number of delegates (most protocols choose between 20 and
100) are chosen for each new block, so the delegates of one block might
not be the delegates of the next.
Elected delegates receive the transaction fees from the validated block,
and that reward is then shared with users who pooled their tokens in the
successful delegate’s pool.
MCQ 6:
In DPoS ___________ are also called witnesses or block producers.
a) Hash
b) blocks
c) delegates
d) miners
The more you stake, the higher a share of the block reward you recieve.
The rewards are shared based on each user’s stake; so if your stake
represents 5% of the total staking balance, you would receive 5% of the
block reward.
The first iteration of DPoS was developed in 2014 by former EOS Chief
Technology Officer (CTO) Dan Larimer.
Larimer first implemented the consensus algorithm on decentralized
crypto exchange platform BitShares in 2015.
Pros and Cons:
Pros
Scalability and speed
Better distribution of rewards
Real-time voting security
Energy efficiency
Less hardware
An incentive to “behave”
Cons
It's easier to organize an attack
The rich may get richer
Apathy can kill
Delegates could form cartels
Where DPoS is used?
BitShares
Lisk
EOS
Steem
Ark
Nano
Cardano
Tezos
TRON
MCQ 7:
Which of the given below is an advantage of DPoS.
a)It's easier to organize an attack
b) The rich may get richer
c) Delegates could form cartels
d) Real-time voting security
Proof of Space
Proof of Space, also known as PoSpace, is a network consensus protocol
similar to the Proof of Work consensus protocol.
Instead of the computational resources, PoSpace uses disk storage to
validate transactions.
PoSpace consumes disk space and incentivizes miners with the most
considerable disk space allocated to a block.
Implemented using the hard-to-pebble graphs, this data structure is used
to solve the pebbling game.
The pebbling game consists of pebbling vertices in a graph only if all the
parent vertices have been pebbled.
Pebbling refers to storing the parents’ hash values, and removing the
pebble refers to freeing the memory.
All the feasible solutions to the problem are generated randomly, called
plots.
These plots are stored on the disks and solved using an algorithm called
Once the solutions are computed, the miners compare their solutions, and
the solution with the best time and space complexity is rewarded with the
next block.
Pros and Cons
Pros
Low energy and low cost required by storage.
Cons
This consensus protocol again favors the miners with the maximum
amount of space. It is resource biased, and therefore, miners with less
amount of space cannot participate actively. This is a problem that goes
against the concept of decentralization.
Where Proof-of-Space is used?
Signum Network (formerly Burstcoin)
SpaceMint
Chia
Spacemesh
Proof of Elapsed Time
Proof of Elapsed time is a network consensus protocol developed by the
Intel Corporation.
The algorithm is predominantly used in permissioned blockchain ledgers.
For example, Intel Software Guarded Extension (SGX) is used in
networks using PoET.
MCQ 8:
Which cryptocurrency presented two papers presenting a new protocol
based on Proof-of-Space and Proof-of-Time?
a) Signum network
b) SpaceMint
c) Chia
d) SpaceMesh
used to allocate blocks to miners on the network.
In permissioned blockchain systems, the miners’ identity is determined
before allowing access into the network. Therefore, anonymity is not a
feature in this protocol.
Each node in the network is assigned a random waiting time.
The first node to complete the randomly chosen period validates the new
block.
The specialized hardware puts the processor to sleep during the wait
time—this repeats over all the blocks in the network.
Pros and Cons:
Pros
It ensures that the trusted code indeed runs within the secure
environment and is not alterable by any external participant.
It also ensures that the results are verifiable by external participants and
entities, thereby enhancing the transparency of the network consensus.
Cons:
The major disadvantage of this algorithm is its dependency on specialized
hardware. This exposes it to various security vulnerabilities due to the
lack of standardized and tried and tested protocols.
Where it is used?
IBMs Hyperledger Sawtooth supports PoET mechanism for custom
blockchain applications development.
Defense against Attackers
A blockchain system is protected with the help of ledgers and
cryptographic keys, attacking and manipulating it becomes extremely
difficult.
The attacker must intrude into every system on the network to
manipulate the data that is stored on the network.
Blockchain technology enables decentralization through the participation
of members across a distributed network.
There is no single point of failure and a single user cannot change the
record of transactions.
When building an enterprise blockchain application, its important to
consider security at all layers of the technology stack, and how to
manage governance and permissions for the network.
A comprehensive security strategy for an enterprise blockchain solution
includes using traditional security controls and technology – unique
controls.
A blockchain derives its safety advantages from its nodes / peers, which
are decentralized in nature, where each node has a copy of valid
transactions.
Blockchain safety can be described as a defense against central, external,
malicious and unintended attacks to transaction data and information in
one block.
List of defenses includes:
✔ Risk identification
✔ Threat prevention
✔ Effective threat mitigation utilizing security policies
✔ Equipment and IT infrastructure.
Security concepts and principles in Blockchain
✔ Penetration Security : technique involving multiple data protection
corrections. This supports the idea that data protection is more
effective across multiple layers than in a single safety layer.
✔ Maximum prerogative : access to information is limited to the
lowest possible level in this approach, thereby improving a high
degree of trust.
✔ Vulnerabilities Detection : verifies and manages vulnerabilities
through identification, authentication, modification and patching.
✔ Risk Management : by detecting , assessing and managing threats,
this approach measures danger within a system.
✔ Patches Control : by purchasing, reviewing and deploying updates ,
this technique patches the faulty part as software, program, operating
system, firmware etc.
It implements a number of techniques to ensure transaction information
protection and block details irrespective of the blocks use as well as
results.
MCQ 9:
__________ verifies and manages vulnerabilities through identification,
authentication, modification and patching.
a) Risk Management
b) Vulnerabilities Detection
c) Maximum prerogative
d) Patches Control
Possible attacks in Blockchain

❖ Distributed Denial of Service


(DDoS)
Blockchain ❖ Timejacking
network attacks ❖ Routing attack
❖ Sybil attack
❖ Eclipse attack

Blockchain ❖ Phishing attack


attacks Wallet attacks ❖ Dictionary attack

Smart contract ❖ Vulnerability in contract source code


attacks ❖ Vulnerability in virtual machine
❖ Double spending attack
❖ Race attack
Attack during transaction
❖ Finny attack
verification
❖ 51% majority attack
❖ Alternative history attack

❖ Selfish mining
Mining pool attack
❖ Fork-after-withhold
MCQ 10:
Which of the following comes under blockchain wallet attack?
a) Timejacking
b) Phishing
c) Sybil
d) Eclipse
Competing Chains
Blockchain forks are an important concept in Blockchain.
A fork refers to competing or coexisting side chains within the same
network.
Due to decentralized structure of the network, the occurrence of forks
seems to be natural.
Blocks are propagated through the network and arrive at different nodes
at different times. This is called orphan blocks.
The longest blockchain becomes the distributed ledger of record which is
then adopted by all computer nodes, distinct blocks will occasionally be
added (near) simultaneously creating a ‘fork’ (two competing chains).
One of these chains will ultimately be discarded eg if another block is
successfully added to the second chain it will become clear that the
second blockchain is longer.
A ‘Fork’ occurs when two blocks are formed at the same time
Block

Block Block Block Block Block

Block

The block on the first shorter chain will become ‘orphaned’.


The transactions in the orphaned block will need to be incorporated into
the longer chain that has ultimately become the ledger of the record.
If a miner discovers the correct the block , it is immediately sent to its
neighbours.
These nodes closest to the original miners of the block will start building
their chain based on this block and continue working on next blocks.
If a fork comes into existence this way, the issue is normally resolved
within one block.
The reason is that one group of miners will find a next solution first,
even if the computer power within the network is evenly distributed
among the several competing groups.
The next solution will be shared among the network nodes , accepted and
spread through the network.
The competing nodes will receive this next solution, accept it and stop
working on the competing solution , thereby resolving the fork.
Competing chains are two different sides of the network that hold two
different chains , and attempts to extend them further.
At some point , some miner will solve the hash puzzle , and we will
propagate his next new block.
BLOCKCHAIN DEMO
How Blockchains accumulate Blocks?
1. A node starts a transaction by signing it with its private key.
2. The transaction is propagated by using much desirable Gossip protocol
to peers, which validates the transaction based on pre-set criteria.
3. Once, the transaction is validated, it is included in a block, which is then
propagated on to the network. At this point, the transaction is considered
confirmed.
4. The newly created block now becomes part of the ledger and the next
block links itself cryptographically back to this block. This link is a hash
pointer.
5. Transactions are then reconfirmed every time a new block is created.
Tiers of Blockchain Technology
Blockchain 1.0
This was introduced with the invention of Bitcoin and is basically used for
cryptocurrencies.
Blockchain 2.0
This Blockchains are used by financial services and contracts are
introduced.
Blockchain 3.0
Generation 3 Blockchains are used to implement applications beyond the
financial services industry and are used in more general purpose industries
such as government, health, media, the arts and justice.
Generation X (Blockchain X)
A vision of Blockchain singularity where one day we will have a public
blockchain service available that anyone can use just like the Google search
engine.
Case Study
An example of vehicle tracking ownership is given.
By using shared ledger on a blockchain network, every participant can
access , monitor and analyze the state of the vehicle irrespective of where
it is within its life cycle.
Tracking Vehicle Ownership Blockchain
THANK YOU

You might also like