0% found this document useful (0 votes)
10 views37 pages

Lecture 14 - Blockchain Consensus-I

Uploaded by

imeemkh
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)
10 views37 pages

Lecture 14 - Blockchain Consensus-I

Uploaded by

imeemkh
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/ 37

UESTC 4036: Information Security

Dr. Yao Sun


University of Glasgow
Outline of Lecture

§ PoW
§ PoS
§ Metrics of Consensus

2
Outline of Lecture 15

§ PoW
§ PoS
§ Metrics of Consensus

3
Proof-of-Work
Proof of Work (PoW)
ü Consensus

Consensus means to reach a common agreement.

Once this decision of consensus is reached, the decision must


be communicated to other parties and the system state must
be updated.

Consensus can be applied in different settings.

4
Proof-of-Work
Proof of Work (PoW)
ü Consensus
When talking about consensus in a distributed environment,
two types of nodes generally involved:

1. The legitimate nodes, which are the honest nodes

2. The malicious nodes, which act maliciously.

5
Proof-of-Work
Proof of Work (PoW)
ü Consensus
The system has to operate properly even if any failure
occurs. There are two types of failures occur:

1. Crash failure, which occurs if legitimate node causes any


failure.

2. Byzantine failure, which occurs if malicious node causes


any failure.
6
Proof-of-Work
Proof of Work (PoW)
ü Consensus
The main responsibilities of consensus protocol is:

1. Maintain the data in the ledger (blockchain) in terms of


ordering, originality, and tamper-resistant.

2. Reach agreement among the nodes in the blockchain


network, i.e., to provide Byzantine agreement, even in
the presence of misbehaving nodes.
7
Proof-of-Work
Proof of Work (PoW)
ü Consensus

Some well-known DLTs


and the consensus
algorithms used

8
Proof-of-Work
Proof of Work (PoW)
ü Proof of Work (PoW) Consensus

Proof-of-Work (PoW) is one of the famous consensus


algorithms used in blockchain networks.

It is the building block of Bitcoin blockchain and PoW is


designed for public blockchain. In PoW, consensus finality is
not guaranteed. It is worth noting that in PoW, the miner acts
as both leader and validator node.
9
Proof-of-Work
Proof of Work (PoW)
ü PoW Main Idea

Ø The higher the hash rate, the higher the chances to solve
the PoW cryptographic puzzle.

Ø The node that solves the PoW puzzle will be the winner
and thus will be able to add block to the blockchain and
deserve the reward.

10
Proof-of-Work
Proof of Work (PoW)
ü PoW Nodes

Leader Node: A blockchain node which wins the mining


process and receives the mining reward.

In PoW, this winning will be dependent upon solving a


cryptographic puzzle.

11
Proof-of-Work
Proof of Work (PoW)
ü PoW Winning Probability

The winning probability Pw can be calculated as

where i is the participating blockchain node, N is the total


number of nodes, and ϕ is the computation power of ith
node. 12
Proof-of-Work
Proof of Work (PoW)
ü Example of PoW Consensus Algorithm

Q1: Suppose a blockchain network with seven


participating nodes (N1, N2, ..., N7), having computing
power (hash rate) values (ϕ1, ϕ2, ϕ3, ..., ϕ7). Calculate
the probability of wining the puzzle by each participating
node? The computation power (hash rates) are ϕ1 = 8,
ϕ2 = 4, ϕ3 =5, ϕ4 = 10, ϕ5 = 3, ϕ6 = 1, ϕ7 = 15.

13
Proof-of-Work
Proof of Work (PoW)
ü Example of PoW Consensus Algorithm

Solution: The winning probability Pw of each participating node can


be calculated as

The wining probability of participating node N1 can be calculated as

The winning probability of remaining participating nodes can be


calculated in the similar manner. 14
Proof-of-Work
Proof of Work (PoW)
ü Issues in PoW

Ø PoW is probabilistic in nature as two or more nodes may solve PoW


puzzle simultaneously, which will result in the creation of “fork”.

Ø PoW has a long latency issue, i.e., nodes take time to validate
transactions.

Ø PoW is computationally expensive.

15
Proof-of-Work
Proof of Work (PoW)
ü Fault-tolerant of PoW

PoW consensus is susceptible to 51% attack.

PoW is fault-tolerant to Byzantine Failure.

PoW is attack-resistant against Sybil attacks, where


malicious blockchain nodes create multiple pseudo
identities to launch this attack.
16
Proof-of-Work
Proof of Work (PoW)
ü Fault-tolerant of PoW

Difficulty is one parameter which can be used to deal


with attacks.

When the difficulty level is high in the mining process,


more computing resources are required to solve the
mining puzzles; thus, it will be very hard for the attacker
nodes to consume such high resources to continue their
malicious activities.
17
Outline of Lecture 15

§ PoW
§ PoS
§ Metrics of Consensus

18
Proof of Stake
Proof of Stake (PoS)
ü PoS Main Idea

In Proof-of-Stake (PoS) category of consensus protocol, the


selection of miners is dependent upon the amount of stakes
each node carries instead of its computational power.

The higher the stake a node has, the higher the chances to
select that node as a winning miner node.

19
Proof of Stake
Proof of Stake (PoS)
ü PoS Advantages

Ø Less consumption of energy.


Ø Lower requirements in terms of nodes' computation power
(hardware).
Ø Faster transaction confirmation speed due to single block
generation in each round.

20
Proof of Stake
Proof of Stake (PoS)
ü PoS Winner

In PoS consensus, the winner is the one which has a higher


stake.
These stakes can be in any form like
Ø The amount of cryptocurrency a node owns.
Ø The amount of digital token a node carry.
Ø The amount of energy a node has.
Ø The amount of computational power a node has.
21
Proof of Stake
Proof of Stake (PoS)
ü Issues in PoS

The network/blockchain system is subject to


dominance by the most significant token holders.

more token -> high winning probability -> more


rewards -> more token

22
Proof of Stake
Proof of Stake (PoS)
ü Issues in PoS

Issue related to message transmission loss and


delay:

If there is any delay or link connectivity issues, nodes


may not have the recent copy of the ledger and thus,
results in the synchronization problem.
23
Proof of Stake
Proof of Stake (PoS)
ü Issues in PoS

Issue related to message communication among the


committee members of some PoS variants:

Without timely sharing of messages among the committee


members, the performance of PoS consensus algorithm can
be seriously degraded.

24
Proof of Stake
Proof of Stake (PoS)
ü Issues in PoS

Issue related to reward and incentivization:

In PoS, reward should be awarded in such a manner that all


the nodes get equal opportunity to participate in the mining
process.
Otherwise, a situation will arise when only the mining node
which has the higher stake will always get rewarded and
always wins the mining process. 25
Proof of Stake
Proof of Stake (PoS)
ü Comparison between PoS and PoW

26
Outline of Lecture 15

§ PoW
§ PoS
§ Metrics of Consensus

27
Metrics of Consensus
Metrics of Consensus
ü Metrics
Performance and scalability of IT systems have always
been the key non-functional metrics that are used to
gauge a blockchain consensus.
1. Performance
Ø Transaction Throughput
Ø Block Confirmation Time

2. Scalability
28
Metrics of Consensus
Metrics of Consensus
ü Transaction Throughput

Transaction throughput is defined as the number of


transactions per second a blockchain network can
process.

Ø The basic component of blockchain is Transaction (Tx).


Ø These transactions are assembled to form a block.
Ø Different blocks are linked together to form the
blockchain.
29
Metrics of Consensus
Metrics of Consensus
ü Transaction Throughput
Transaction throughput is measured in Tx/s, where Tx is the number of
transactions and ‘s’ means second. It can be calculated as

where “Block Size” is the size of the block and varies from blockchain
to blockchain, and “Block Time” is the time required to add a block to
the blockchain – average.
30
Metrics of Consensus
Metrics of Consensus
ü Block Confirmation Time

It is defined as the time to confirm the block and it tells us


how quickly a block can be confirmed in a blockchain.

Ø Depending upon the underlying blockchain, it can


further be dependent upon the number of blocks.
Ø A new block must wait before it is confirmed.
Ø It can be measured in seconds.
31
Metrics of Consensus
Metrics of Consensus
ü Impact of Tx Throughput and Block Size

The figure shows the


impact of block size (MB)
over Throughput
(Tx/seconds)where we
kept transaction size is
500 Bytes and block
confirmation time is 10 s.
32
Metrics of Consensus
Metrics of Consensus
ü Impact of Block Confirmation Time and Tx Throughput

The figure shows the


impact of block
confirmation time
(seconds) over
Throughput (Tx/second).
Here, we kept block size
is 1MB Bytes and Tx
size is 500 Bytes.
33
Metrics of Consensus
Metrics of Consensus
ü Impact of Transaction Size and Tx Throughput

This figure shows the


impact of transaction
size (bytes) over
Throughput (Tx/second).
Here, we kept block
confirmation time is 10 s
and block size is 1 MB.
34
Metrics of Consensus
Metrics of Consensus
ü Example

Q2: Suppose a blockchain network has a block size of 2


MBytes, transaction size of 500 Bytes, Block generation
time is 200 s, and it requires to wait for 10 blocks to
confirm any new block. Calculate average block
confirmation time and transaction per second (throughput)
of this blockchain network?

35
Metrics of Consensus
Metrics of Consensus
ü Example

Solution:

The transaction throughput is 200 Tx/s and average block


confirmation time is 2000 s.
36
Metrics of Consensus
Metrics of Consensus
ü Scalability

Scalability of blockchain networks is the ability of that


platform to support increasing load of transactions, as well
as increasing the number of nodes in the network.

Off-chain solutions:
built on top of the main blockchain and handle most of the
transactions. (Sidechains, Payment Channels, etc.)

37

You might also like