You are on page 1of 6

2021 International Conference on Advances in Electrical, Computing, Communication and Sustainable Technologies (ICAECT) | 978-1-7281-5791-7/20/$31.

00 ©2021 IEEE | DOI: 10.1109/ICAECT49130.2021.9392489

Consensus Algorithms in Blockchain-Based


Cryptocurrencies
1
*Rameez Yousuf, 2Zubair Jeelani, 1Dawood Ashraf Khan, 1Owais Bhat and 3Tawseef Ahmed Teli
1
Department of Computer Science University of Kashmir, J&K, India
2
Islamic University of Science and Technology, J&K India
3
Cluster University Srinagar, J&K India
E-mail : shahrameez019@gmail.com, zubairj347@gmail.com, dawood.khan@uok.edu.in, owais031@gmail.com,
mtawseef805@gmail.com,

Abstract: — Blockchain has been a breakthrough in the Cryptocurrency can be thought of as a digital asset that can
technology since the last decade and is anticipated as the go- be used as a method of transaction between untrustworthy
to thing due to features presented by it. The features such as parties without the need of an intermediary body like a
secure, immutable, transparent, and anonymous makes bank. Carrying out transaction in such a distributed system
Blockchain technology the frontrunner in the untrustworthy
distributed environment. The driving force behind the
wherein the parties are not fully trusted, there is a
Blockchain technology are the consensus algorithms that are requirement of a system that can build the trust among the
at the heart of any Blockchain technology. These algorithms other wise untrusted parties. Consensus algorithms in such
determine the security and performance of any Blockchain. Blockchain-based cryptocurrency systems make sure that
The most popular consensus algorithm is the Proof-of-Work only valid transactions are committed in the system and
which was first used in the Bitcoin. Since then, a number of invalid transactions are blocked.
consensus algorithms have been proposed. This paper
presents a brief overview of the Blockchain Technology and The rest of the paper is organized as follows. Section II
popular cryptocurrencies based on Blockchain. Next, the presents an overview of the Blockchain technology and its
most popular consensus algorithms in the context of
Blockchain and cryptocurrencies are discussed.
architecture. Section III discusses Cryptocurrencies.
Section IV discusses various consensus algorithms and
Keywords—Blockchain, Cryptocurrencies, Consensus their comparison. Finally in section V summarizes the
Problem, PoW, PoS, pPBFT, SCP. work presented in this paper.

I. INTRODUCTION II. BLOCKCHAIN TECHNOLOGY AND ITS ARCHITECTURE

Blockchain technology has been a buzzword in this decade Blockchain is a peer-to-peer network which maintains a
as it offers applicability in various fields such as distributed ledger which is always in sync. Blockchain
healthcare, IoT, supply chain management, agriculture, consists of a number of blocks which are linked together
finance, insurance, and e-voting[1-3]. Blockchain is a by cryptographic functions to create a chain which is
distributed ledger which eliminates the need of a central immutable in nature and is append-only. The blocks
authority for the transactions to occur in the network. It consist of records or transactions which are visible to
addresses the issues such as security and performance anyone. The block size is limited and contains a limited
bottlenecks that are prevalent in centralized systems. number of transactions. Whenever a transaction is added to
Blockchain ensures integrity in an untrustworthy peer-to- a block, it is time stamped so that in future it can be
peer network which consists of both genuine and audited easily. The block diagram of Blockchain is shown
malicious nodes. Blockchain was first implemented in in Figure 1.
2009 in Bitcoin by Satoshi Nakamoto.

The market size of Blockchain technology is ever growing


and it is expected that by 2025 the market size for
Blockchain will reach to USD 39.7 billion.

Although there is a paradigm shift from the traditional


centralized system towards the decentralized Blockchain-
based system, there are still many challenges that the
Blockchain technology need to address. Some of the issues
are security, privacy, speed, adoption, regulation,
awareness, cost and efficiency [4].
Figure 1: Blockchain Technology architecture

Authorized licensed use limited to: NED UNIV OF ENGINEERING AND TECHNOLOGY. Downloaded on July 19,2021 at 04:32:31 UTC from IEEE Xplore. Restrictions apply.
The blocks in the Blockchain technology consists of block secured by using cryptographic algorithms.
header and transactions. The block header consists of Cryptocurrencies do not require any central authority to
Block version, Merkle Tree hash, nonce, parent hash and make transactions in a distributed peer-to-peer network.
timestamp [6]. Table 1 shows these fields in Bitcoin Block These currencies have no intrinsic value and are not
#45000. These fields are explained as follows. regulated by the governments [7-8]. Some of the popular
cryptocurrencies are Bitcoin, Ether, and XRP. A brief
Block version: Block version defines the version of the description of these cryptocurrencies follows next.
block and the corresponding validation rules defined in it.
The versions of Bitcoin are version 1 (2009), version 2 Bitcoin: Blockchain technology was first implemented in
(2012), version 3 (Feb 2015), and version 4(Nov 2015). Bitcoin by Satoshi Nakamoto in 2009. Bitcoin is a
cryptocurrency that can be transacted between parties
Parent hash: It is a 32 byte hash in the form of SHA256 [5] without any intermediary in a peer-to-peer network. The
and is the hash of the previous block in a Blockchain. By transactions in Bitcoin network are verified by the miners
means of this hash, blocks are linked together in a who get incentives for validating the transactions in the
chronological fashion. Bitcoin network. The blocks in a Bitcoin network are
generated after every 10 minutes. The number of
Merkle tree hash: Merkle tree hash is a 32 byte hash of all transactions committed in a Bitcoin network per second is
the transactions contained in a block. It is useful in the 7. Bitcoin uses the Proof-of-Work consensus mechanism
verification process of the transactions and ensures the to confirm transactions and to generate new blocks [9-10].
integrity of the transactions in a block. Figure 2 shows Bitcoin cryptocurrency values as on 13-
Dec-2020.
Block hash: Block hash is a 32 byte hash which is the hash
of all the fields of a block header including the Merkle Bitcoin suffers from the scalability problem as the
hash. maximum block size is 1MB, which limits the number of
transactions to be executed to around 7 per second. For the
Nonce: It is a 4 byte random number that is used for the new set of transactions, the network has to wait for the
authentication purposes so that a new block is not created creation of a new block which will further increase the
from the previously used hashes that have been used in the latency in the network.
creation of previous blocks. It enhances the difficulty level
in solving a mathematical problem by the miners.

Time stamp: It is a Unix epoch time of 4 bytes and defines


the time when a block was created.

Difficulty: It defines the time taken for the miners to create


a new block. It is adjusted in a way that it takes an
average of 10 minutes to create a block in the Bitcoin
network. Table 1 shows different fields in Bitcoin block
#45000.

Table 1: Block #45000 BTC


Hash 0000000007758365e4eef39e396f257a3caebb285
0906f054066a58ffe657e3b
Time 2010-03-13 00:08
stamp
Diffic 4.53 Figure2: Bitcoin cryptocurrency values as on 13-Dec-2020
ulty
Merkl 456c8415a423176b0c3f537b80cc88f655b3000a3 Ether: Ether overcomes the limitations of Bitcoin in
e root 5aaf4d3e0dad5e6d0ab0928 having the block generation time to around 15 seconds.
Versi 0x1 Ether is a cryptocurrency that is built on the Ethereum
on platform which uses smart contracts to control the
Nonc 1,299,615,251 execution of the transactions [11-12]. Ether used Proof of
e Work as its consensus algorithm till 2015. In 2015, Proof
of Stake was adopted as consensus algorithm by the
III. CRYPTOCURRENCIES Ethereum platform. Figure 3 shows Ether cryptocurrency
values as on 13-Dec-2020.
Cryptocurrencies are digital or virtual money which are

Authorized licensed use limited to: NED UNIV OF ENGINEERING AND TECHNOLOGY. Downloaded on July 19,2021 at 04:32:31 UTC from IEEE Xplore. Restrictions apply.
Each user in an Ethereum network has ETH balance which Table 2 presents the comparison of the cryptocurrencies:
he can send to other users in the network. For a transaction Bitcoin, Ether, and XRP. Bitcoin uses the well-known
to occur in such a cryptocurrency, Gas or fee is required, SHA256 hashing algorithm, Ether uses Ethash and XRP
which is set by the miners. The unit of gas is gwei. uses the Ripple Protocol Consensus Algorithm (RPCA).
Bitcoin tends to be moderately decentralized whereas both
Ether and XRP are highly decentralized. The problem with
the Bitcoin is that its transaction time is quite high. Ether
reduced the time considerably but the transaction time is
yet smaller in case of XRP. Consequently, the transaction
throughput is highest in XRP and smallest in Bitcoin. But,
by far, the Bitcoin is the most popular Blockchain-based
cryptocurrency and enjoys a market capital to the tune of
USD 357.94 billion.

Table 2: Comparison of Bitcoin, Ether, and XRP.


Cryproc Hash Decentra Trans Throu Cons Mar
urrency ing lization action ghput ensus ket
algor time Algor Capit
ithm ithm al
Bitcoin SHA Moderat 10 7 PoW $357
256 ely min .94B
Ether Etha High 15 sec 15-20 PoW/ $66.
Figure3: Ether Cryptocurrency values as on 13 Dec 2020. sh PoS 47B
XRP RPC High 4 sec 1500 RTP $52.
XRP: XRP, Ripple cryptocurrency is built on XRP A 06B
Ledger; an open source and permission-less Blockchain
network. It takes 3-5 seconds for the settlement of a IV. CONSENSUS ALGORITHMS
transaction in Ripple network. This cryptocurrency came
into existence to address the issues of transfer of funds Byzantine Generals’ problem [13] is a serious problem in a
between banks which would otherwise take days for the distributed environment wherein a node can send
conversion of money and the subsequent settlement of the conflicting information to other nodes in the network. The
transactions. Byzantine Generals problem consists of generals who need
to attack a city; the only way to win the battle is when all
The validators in the Ripple network ensure that the nodes the generals attack at the same time. However, in order to
in the network follow the RTXP protocol. xRapid, xVia make all the generals inform about the time of attack,
and xCurrent products are offered by the Ripple network messengers are used. The problem with using messengers
to the companies to transfer money to any part of the is that the information may be intercepted or modified,
world in a matter of seconds. Figure 4 shows the value of messenger may get killed, or the messenger may give false
XRP cryptocurrency as on 13-Dec-2020. information to the generals. So the messenger is an
untrustworthy entity in this scenario.

Blockchain comes to the rescue to solve the Byzantine


Generals problem. In a Bitcoin network, the nodes can be
thought of as generals. The condition to reach a decision
here is that there must be less than 3m+1 traitors in the
network, where m is the number of malicious nodes. The
validating nodes in the network validate and verify each
message in the network and keep the traitors at bay. The
nodes in the network reach consensus with the help of
consensus algorithms. A review of the important
consensus algorithms used in Blockchain networks is
presented next.

Proof-of-Work
Proof-of-Work (PoW) is a consensus algorithm used in
permissionless Bitcoin network. PoW proves to the
Figure 4: XRP values as on 13-Dec-2020. network server that some computational work has been
performed by the nodes in the network. The network

Authorized licensed use limited to: NED UNIV OF ENGINEERING AND TECHNOLOGY. Downloaded on July 19,2021 at 04:32:31 UTC from IEEE Xplore. Restrictions apply.
server gives problems such as Hash sequences, In Fig 6, blocks B0 and B1 are created without any
computational puzzles or other mathematical problems to problem in the network. However, blocks B2 and B3 are
be solved by the nodes in the network. The nodes perform created almost at the same time; so both the blocks are
the computations and provide answers to the network appended in the Blockchain on different branches using
server which then reward the nodes that compute the forking. At this point, the mining power is controlled by
correct answers. Figure 5 shows this scenario. the malicious nodes which results in the faster creation of
blocks, B4 and B5. Hence, blocks B3, B4, and B5 are
created by malicious nodes. The rule for the Blockchain in
this case is to follow the longest chain which results in the
rejection of block B2 in our example. Now, the network is
controlled by the malicious nodes which can hamper the
creation of further legitimate blocks in the network.

Proof-of-Stake
To address the issues of PoW, Proof-of-Stake (PoS) was
conceptualized and implemented in many systems
including the Ethereum platform. In PoS, a validator can
mint/forge a block or verify transactions according to the
stake he puts in the network. If a validator confirms a
fraud transaction, he may lose his stake in the network
Figure 5: Proof-of-Work [14].

PoW consensus algorithm is used to confirm the PoS networks are more decentralized in nature as
transactions that are submitted to the network. It is further compared to PoW networks and allows sharding to
used in the creation of blocks which holds the transactions. improve the scalability of the network. In PoS, the attacker
These two operations are overseen by the special nodes in needs 51% of the cryptocurrency to execute 51% attack
the network and are called miners. which is very less likely. It can result in the loss of
holdings an attacker possesses in case the value of the
In PoW, the complexity of a problem to be solved by the cryptocurrency falls. Ether, NXT, PeerCoin
nodes is determined by the number of users, load on the cryptocurrencies use the PoS consensus algorithm.
network, and the current power. It is adjusted in such a
way that it takes around 10 minutes for the creation of a Byzantine Fault Tolerance
block. Once the block is created, all the unconfirmed Byzantine Fault Tolerance (BFT) consensus mechanism
transactions are placed in a new block and are confirmed uses messages to reach consensus in a network which
later. This newly created block is linked with its previous consists of both genuine and faulty nodes.
block to create a chain of blocks to enhance security.
In a faulty network, consensus can be reached when there
Despite being the driving force in cryptocurrencies, PoW are more than two-third genuine nodes in the network. The
suffers from issues. The first issue is that it consumes a lot network can tolerate at most m faulty nodes when there are
of computational power which results in the consumption 3m+1 correctly working nodes in the network [13].
of large amount of electricity. Secondly, it may suffer from
51% attack in which 51% of the total mining power of the Practical Byzantine Fault Tolerance (pBFT) operates in
network is controlled by the malicious nodes. The rounds within which it selects a node as a primary node
malicious nodes while controlling the network can create a and the other nodes as the secondary nodes.
new chain of block which is longer than the original one.
This process is called forking. In a Blockchain network the pBFT reaches the consensus after the termination of the
longest chain is followed and as a result of which the following rounds in the sequence as follows:
transactions can be denied and reversed. In Figure 6, 51% a) In the first phase called the request phase, client
attack is shown. sends a request to the primary or leader node in the
network.
b) Upon the receipt of request from the client node, the
primary nodes broadcast this message to the
secondary nodes.
c) In the third phase, the primary as well as the
secondary nodes sends their reply to the client node.
d) The consensus is reached when the client node
receives the same reply from at least m+1 nodes in
Fig 6: 51% attack the network, the network being tolerant to a

Authorized licensed use limited to: NED UNIV OF ENGINEERING AND TECHNOLOGY. Downloaded on July 19,2021 at 04:32:31 UTC from IEEE Xplore. Restrictions apply.
maximum of m faulty nodes. The whole scenario is
shown in Figure 7 below.

Fig 9: Safety over liveliness

E. Comparison of Consensus Algorithms


PoW consensus algorithm is implemented in Bitcoin
network which is a permissionless network; anyone can
join the network and participate in the mining process. The
PoW consumes a lot of energy in the form of electricity to
run the mining process. The block creation time is also
high in PoW systems and is around 10 minutes with the
throughput of around 7 transactions per second. This low
throughput of the transactions results in the delay of the
Fig 7: pBFT rounds execution of the transactions.
pBFT is inclined more towards centralization rather than PoS works in a permissionless network which does not
decentralization because there is a single authority that consume huge energy like PoW. The block creation time is
decides which validators the network should trust. significantly low around 1 minute in case of PoS and the
throughput is good. Peercoin is an example which uses
D. Stellar Consensus Protocol PoS.
Stellar Consensus Protocol (SCP) is an open membership
consensus protocol and is a construction for Federated pBFT consensus algorithm is applicable to a permissioned
Byzantine Agreement (FBA). In this protocol, each network which is more centralized in nature. The blocks
validator choses other validators which it can trust. This are created at a much faster rate and the transactions are
list of validators is called quorum slice. The quorum slices settled in a matter of seconds.
of each validator overlap to form a quorum. Figure 8
below shows the concept of SCP. SCP is a permissionless protocol which is fully
decentralized in nature and is energy efficient as it requires
messages to reach the consensus process. The transaction
speed is very fast and the block creation time is also very
less. The comparison of consensus algorithms is given in
table 3.

V. CONCLUSION

Blockchain technology was introduced as the base


Fig 8: SCP
technology for driving the Bitcoin, the largest
cryptocurrency in the world today. Blockchain technology
In Figure 8 there are 4 quorum slices A, B, C, and D. The
has been used in various fields because of its unique
validators in each quorum overlap to reach the consensus.
features. The cryptocurrency is a very serious as well as
sensitive application of the Blockchain technology and
SCP consensus mechanism has the following four
therefore, demands utmost security, fast transaction
properties that coexist at the same time: decentralization,
processing and reliability. Consensus algorithms help to
low latency, flexible trust, and asymptotic security. In a
introduce security in Blockchain-based cryptocurrency
distributed asynchronous system such as Stellar, two of the
systems. However, some cryptocurrencies are computation
three properties i.e., fault tolerance, safety, and liveliness
intensive utilizing a lot of energy whereas some are more
can be guaranteed [15]. SCP uses nomination protocol and
centralized than others. We have a myriad choice of
ballot protocol to reach consensus. SCP prefers safety over
consensus algorithms available for use. The choice of a
liveliness. Figure 9 shows this feature.
particular consensus algorithm will depend on the specific
application. In general, the desirable features of a

Authorized licensed use limited to: NED UNIV OF ENGINEERING AND TECHNOLOGY. Downloaded on July 19,2021 at 04:32:31 UTC from IEEE Xplore. Restrictions apply.
consensus algorithm for cryptocurrency systems include [7] Y. Yuan and F.-Y. Wang, “Blockchain and Cryptocurrencies:
Model, Techniques, and Applications,” IEEE Transactions on
permission-less, low power utilization, fast transaction
Systems, Man, and Cybernetics: Systems, vol. 48, no. 9, pp.
processing/ low latency and security. In this paper, we 1421–1428, Sep. 2018.
presented an overview of the Blockchain technology, [8] G. W. Peters, E. Panayi, and A. Chapelle, “Trends in Crypto-
Blockchain-based cryptocurrency systems and consensus Currencies and Blockchain Technologies: A Monetary Theory
and Regulation Perspective,” SSRN Electronic Journal, 2015.
algorithms used in these systems.
[9] R. Böhme, N. Christin, B. Edelman, and T. Moore, “Bitcoin:
Economics, Technology, and Governance,” Journal of
REFERENCES Economic Perspectives, vol. 29, no. 2, pp. 213–238, May 2015.
[10] C. S. Wright, “Bitcoin: A Peer-to-Peer Electronic Cash
[1] N. Chowdhury, “Applications of Blockchain,” Inside System,” SSRN Electronic Journal, 2008.
Blockchain, Bitcoin, and Cryptocurrencies, pp. 177–198, Aug. [11] D. Vujicic, D. Jagodic, and S. Randic, “Blockchain technology,
2019. bitcoin, and Ethereum: A brief overview,” 2018 17th
[2] T. Wang, L. Yu, and Y. Li, “Blockchain Technology and Its International Symposium INFOTEH-JAHORINA (INFOTEH),
Applications,” Advances in Logistics, Operations, and Mar. 2018.
Management Science, pp. 1247–1260, 2021. [12] L. W. Cong and Z. He, “Blockchain Disruption and Smart
[3] “Applications of blockchain technology in different domains,” Contracts,” The Review of Financial Studies, vol. 32, no. 5, pp.
Blockchain and the Digital Economy, pp. 115–172, Jul. 2020. 1754–1797, Apr. 2019.
[4] D. Preethi, N. Khare, and B. K. Tripathy, “Security and Privacy [13] L. Lamport, R. Shostak, and M. Pease, “The Byzantine generals
Issues in Blockchain Technology,” Blockchain Technology and problem,” Concurrency: the Works of Leslie Lamport, Oct.
the Internet of Things, pp. 245–263, Dec. 2020. 2019.
[5] S.-H. Lee and K.-W. Shin, “An efficient implementation of [14] O. Vashchuk and R. Shuwar, “Pros and cons of consensus
SHA processor including three hash algorithms (SHA-512, algorithm proof of stake. Difference in the network safety in
SHA-512/224, SHA-512/256),” 2018 International Conference proof of work and proof of stake,” Electronics and Information
on Electronics, Information, and Communication (ICEIC), Jan. Technologies, vol. 9, 2018.
2018. [15] M. David. "The stellar consensus protocol: A federated model
[6] Z. Zheng, S. Xie, H. Dai, X. Chen, and H. Wang, “An Overview for internet-level consensus." Stellar Development
of Blockchain Technology: Architecture, Consensus, and Future Foundation 32 (2015).
Trends,” 2017 IEEE International Congress on Big Data
(BigData Congress), Jun. 2017.

Table 3: Comparison of consensus algorithms


Consensus Blockchain Energy Decentralized Low Flexible Block creation Asymptotic
Speed Example
Algorithm Type Saving Control Latency Trust time(minutes) Security
PoW Permissionless No Slow Yes No No 10 No Bitcoin
PoS Permissionless Partial Normal Yes May be No 1 May be Peercoin
pBFT Permissioned Yes Fast No Yes Yes 0.06 Yes Hyperledger
SCP Permissionless Yes Fast Yes Yes Yes 0.08 Yes Stellar

Authorized licensed use limited to: NED UNIV OF ENGINEERING AND TECHNOLOGY. Downloaded on July 19,2021 at 04:32:31 UTC from IEEE Xplore. Restrictions apply.

You might also like