Methodology for Choosing a Consensus Algorithm for Blockchain Technology Viktoriia Zhebka1, Serhii Zhebka1, Tetiana Bazhan1, Pavlo Skladannyi2, and Volodymyr Sokolov2 1 State University of Information and Communication Technologies, 7 Solomenskaya str., Kyiv, 03110, Ukraine 2 Borys Grinchenko Kyiv University, 18/2 Bulvarno-Kudriavska str., Kyiv, 04053, Ukraine Abstract Blockchain technology is rapidly integrating into various spheres of human activity. Private companies, government agencies, and international organizations are gradually adapting this technology to solve a wide range of tasks. The main areas of its use include financial transactions, document management, digital identification, control of logistics links, and tokenization of physical and classical financial assets. The more a technology develops, the more it needs to be updated and improved. For blockchain, the chosen consensus algorithm is very important. There is a need to ensure control over data and resources and their copies on different nodes to avoid conflicts between nodes. After all, any conflict between nodes can lead to inefficient and inconsistent data storage. As a blockchain is a specialized type of database that stores this data by distributing it among several completely independent nodes, i.e. computers or devices, blockchains allow data to be added to databases and make it impossible to attempt to change or delete them. Therefore, this article is based on the study of the criteria that can help in the selection of a consensus algorithm. Four main criteria are identified, which in combination, allow us to select a consensus algorithm more accurately. The main selection criteria are energy consumption, decentralization, security, and bandwidth. Each feature of these criteria has been considered during the study and highlighted in this article. It is very important to combine different criteria and their parameters to choose the most successful consensus algorithm. Different approaches make it possible to find the most optimal option. Based on the introduced criteria and the proposed methodology, a program for selecting the optimal consensus algorithm has been created using the Python programming language. Keywords 1 Consensus algorithm, energy consumption, bandwidth, decentralization, security, blockchain. 1. Introduction consent of the majority of nodes in the blockchain if the blockchain is large and Blockchains are decentralized, meaning that contains sufficiently independent nodes, which data can be distributed across multiple host makes it impossible for an attacker [1]. servers, which distinguishes them from Blockchain decentralization also comes conventional databases. Decentralization is the with a social and technical challenge, which is main feature of blockchain. maintaining consensus between nodes. Since control over data or resources is Consensus maintenance can ensure that all shared among several nodes simultaneously, it participants agree with the decisions made by makes it very difficult for an attacker to delete the network [2, 3]. or use resources. The process of changing data Consensus maintenance is very important or using resources can only take place with the because, without it, copies of data on different DECaT’2024: Digital Economy Concepts and Technologies, April 4, 2024, Kyiv, Ukraine EMAIL: viktoria_zhebka@ukr.net (V. Zhebka); szhebka@hotmail.com (S. Zhebka); tetiana.olexandrivna@gmail.com (T. Bazhan); p.skladannyi@kubg.edu.ua (P. Skladannyi); v.sokolov@kubg.edu.ua (V. Sokolov) ORCID: 0000-0003-4051-1190 (V. Zhebka); 0009-0007-4620-9888 (S. Zhebka); 0009-0007-6594-1695 (T. Bazhan); 0000-0002-7775-6039 (P. Skladannyi); 0000-0002-9349-7946 (V. Sokolov) ©️ 2024 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) CEUR ceur-ws.org Workshop ISSN 1613-0073 Proceedings 106 nodes may conflict with each other, leading to A successful consensus algorithm should help inefficient and inconsistent data storage. a blockchain application achieve its goal. The Consensus also makes it possible to update the purpose of the blockchain is to provide a tool underlying blockchain protocol, i.e. the rules for decentralized decision-making. The for node interaction and regulation of its complex nature of blockchain consensus stems organization. If it became necessary to modify from its original goal of making decisions the protocol due to security or performance without a central authority. Therefore, the issues, all nodes would have to agree to accept level of decentralization of the consensus the change, as different nodes cannot use algorithm is included in the evaluation criteria. different protocols in the same blockchain. A consensus algorithm with a higher level of Because all nodes in a blockchain are decentralization is considered good [4]. decentralized and work independently, Decentralization plays a key role in a maintaining consensus creates a complex blockchain network as it determines the level problem, which different types of blockchains of power and control distribution among have solved in different ways. Different participants. Let’s consider several criteria solutions for maintaining consensus between that can be taken into account when choosing nodes provide us with technical innovations a consensus algorithm in terms of for further updates of algorithms for decentralization: blockchain technology. • Level of equality (how equally the power is distributed among the network 2. Research Results participants, the fewer centralized control points there are and, the more The first blockchain networks used the Proof- decentralized is the system); of-Work (PoW) consensus mechanism, the • Decentralized decision-making mechanisms main disadvantages of which are high energy (how decisions are made about the costs, low network bandwidth, and high direction of the network development and transaction costs. Alternative mechanisms whether there are mechanisms, which have been developed to overcome these issues. allow participants to contribute to the Currently, the most common replacement for decision-making process). PoW is the Proof-of-Stake (PoS) consensus • Scalability of decentralization (how the mechanism. system decentralizes as the number of The essence of this approach is that to participants and the volume of generate a new block, the holder of the transactions increase; and whether the validator node must stake a certain number of network can remain decentralized over the native tokens and interact with other nodes time and grow in scale). to reach a consensus on the chain. In case the • Fault tolerance to attacks (i.e. how the validator node engages in malicious activity, it system responds to attempts to hack into risks losing the blocked tokens partially or the decentralized structure and whether completely. there are mechanisms to prevent This approach, inherently, has several concentration of power or a controlled vulnerabilities; the main one is the possibility attack). of accumulating a significant number of tokens • The number of nodes (the more nodes in with a small number of related holders, which the network, the more decentralized the can lead to catastrophic consequences for the system can be considered, but it is also entire network. This problem is called capital important to consider how these nodes centralization or oligopoly. are selected and controlled). A typical solution to ensure the consensus • Sybil Resistance (how the system prevents of PoS networks is a scheme for distributing attacks in which an attacker can create rewards and penalties to validator nodes. many artificial identities to gain control The purpose of this paper is to analyze the over the network). criteria and parameters of a blockchain • Algorithmic implementation (how the network to determine the optimal consensus consensus algorithm promotes algorithm. decentralization) [5–11]. 107 Taking these criteria into account helps to transaction speeds, such as payment systems show that the chosen consensus algorithm or micropayments. promotes the highest possible level of Metrics: Number of Transactions Per decentralization in the blockchain network. Second (TPS), transaction confirmation time. Another important criterion is whether the The calculation of transaction speed in the consensus algorithm can fulfill its own goal, form of formulas can look like this: which is to achieve consensus. In the context of 𝑛 𝑣𝑇 = 𝑡 , (1) blockchain and cryptocurrencies, this can be defined as the speed at which the algorithm where 𝑣𝑇 is the speed of transactions; n is the reaches consensus or the amount of number of transactions that have been bandwidth. For example: successfully processed over a certain period; t • Fast action and number of transactions per is the time interval, during which the second (TPS) (i.e. how fast a particular transactions have been processed. consensus algorithm can be processed and 2. Scalability: Scalability determines how how many transactions can be processed easily the network can be increased in size and in one second. This is especially important load to serve more users and transactions for blockchain networks that have a high without losing performance. transaction flow). Metrics: Infrastructure to scale up the • Scalability (how well the algorithm scales network, network bandwidth, horizontal and when the number of participants and the vertical scalability. flow of transactions increase). The formula for calculating the scalability • Processing multitasking (whether the coefficient: 𝑃 algorithm can efficiently process many 𝑀= , (2) к transactions simultaneously). where M is the scalability coefficient; P is the • Latency (how quickly transactions can be maximum number of transactions that the confirmed in the network). network can process within one second; k is • Resource dependence (the system must be the average number of active users in the efficient in terms of resource use). network. • Network efficiency (whether the 3. Decentralisation: This criterion algorithm works well in a network with a indicates the degree of distributed control and large number of participants and a large participation in the network. A higher level of amount of data). decentralization means greater independence • Protocol flexibility (the ability to adjust and security. algorithm parameters to achieve optimal Metrics: Number of nodes, participating in bandwidth in specific conditions) [12–19]. the consensus, concentration of power, These criteria help to establish that the location of geographically different nodes. selected consensus algorithm meets the To find the decentralization ratio, use the network capacity requirements and ensures following formula: efficient transaction processing in the blockchain system. 𝐷 = 1 − 𝐾, (3) The blockchain network criteria play an where D is the decentralization factor and K is important role in the selection of a consensus a value that determines the degree of algorithm and in the process of developing a centralization of control in the network, it can blockchain solution. Let’s consider, in detail, be a numerical value from 0 (full the formulas for calculating the main decentralization) to 1 (full centralization). blockchain network metrics, which will allow 4. Security: Security is defined as the level us to determine the optimal consensus of protection a network has against attacks and algorithm: misuse. The data must be securely protected 1. Transaction speed: This criterion from unauthorized access. determines how quickly the network can Metrics: Level of cryptographic security, process and confirm transactions. It is resistance to 51% attack, protection against important for applications that require high double-spending, vulnerability detection, and remediation. 108 The formula for calculating the security factor: Scaling Score: 𝑆 = 𝑅𝑠 (1 − 𝑅𝑎 ), (4) For Network A (PoW): where S is the security factor, Rs is the level of M = (10 minutes/block)*(1 block/10 cryptographic security, i.e. an assessment of the minutes) = 1 block/minute. level of data protection in the network, which can For Network B (PoS): be a numerical value from 0 (no security) to 1 M = (5 minutes/block)*(1 block/5 (high security); Ra is the risk of attack, i.e. the minutes) = 1 block/minute. probability of an attack on the network. Decentralization Index: 5. Costs: Costs include the cost of operating For Network A (PoW): Decentralisation is the network, including equipment, electricity, difficult to calculate without up-to-date and transaction fees. Low costs can be concentration data. important for maintaining network stability For Network B (PoS): and attracting users [20–24]. Metrics: Network maintenance costs, D = 1–0.9 = 0.1. transaction fees, block mining costs (in the Security Score: case of PoW). For Network A (PoW): The security level The formula for calculating the cost ratio: will be high due to the powerful hash power. 𝑁𝑖 For Network B (PoS): Security can be 𝑁= , (5) 𝑚 determined based on the level of cryptographic where N is the cost coefficient; Ni is the total security and the risk of attack, which are cost of network maintenance, the total cost of difficult to calculate without specific data. maintaining and mining blocks in the network; Cost Index: m is the number of transactions, the total For Network A (PoW): number of processed transactions in the The cost of PoW includes the cost of network. equipment and electricity to mine the blocks. Now consider the calculation of parameters The number of transactions is also difficult to for two imaginary blockchain networks. estimate without specific data. Network A (Proof of Work (PoW): For Network B (PoS): 1. The number of miners: 1000. PoS costs include master node maintenance 2. Transactions flow per second (TPS): 100. and transaction fees. 3. Block size: 1 MB. A consensus algorithm is considered more 4. Time between blocks: 10 minutes. secure if it can protect against different types Network B (Proof of Stake—PoS): of security threats. 1. Number of active master nodes: 500. Therefore, security is a critical aspect when 2. Transactions flow per second (TPS): 200. choosing a consensus algorithm in blockchain 3. Block size: 2 MB. technology. Here are some key security criteria: 4. Time between blocks: 5 minutes. • Attack resistance (how well the system Metric calculation—Transaction speed (TPS): can resist various types of attacks, such as For Network A (PoW): double costs, white hat attacks, consensus 𝑣𝑇 = (100*1,000)/600 = 166,67 attacks, etc;). For Network B (PoS): • Decentralization (the gradient of decentralization can determine how 𝑣𝑇 = (200*500)/300 = 333,33 difficult it is to carry out successful attacks As can be seen, the “Transaction Rate” (TPS) on the system, the more different metric for network B (PoS) is higher than for participants in the network, the more network A (PoW), which indicates that difficult it is to interfere with the network B can process more transactions per consensus). second. According to this data, network B may • Key protection methods (what methods be more suitable for applications that require are used to store and protect the private high transaction speeds, while network A has keys of network participants and the more miners and possibly more security due to security of the key storage system). PoW. 109 • Fault tolerance (restoring the system after • Algorithm efficiency (some PoW errors or attacks is important for the algorithms may be more energy efficient continuous operation of the network). than others). • Algorithmic strength (determining the 1. Proof of Stake (PoS): strength of the cryptographic algorithms, • Selective efficiency (the less currency a which are used in the consensus participant has, the less energy he uses). algorithm. For example, if a hash function • Methods for controlling misuse (it is is used, how resistant it is to collisions and important to have mechanisms to prevent attacks). concentration of power that may affect the • Sybil Attack Resistance (how the system effectiveness of PoS). prevents attacks in which one participant 2. Delegated Proof of Stake (DPoS): can create many pseudo-identities to • Chosen legitimacy (some participants may dominate the network). spend more energy to obtain delegate • Active cooperation (Byzantine Fault status). Tolerance—BFT) (the requirement for the • Flexibility of the voting policy (if the voting network to be immune to attacks that may system is not efficient, it can lead to an lead to a discrepancy in information incorrect distribution of power and energy between participants). costs). • Protocol upgrades and changes (how easy it is to implement changes to the 3. Proof of Burn and other alternatives: consensus protocol, and how much this • Spending strategies (determining exactly can affect network security) [25–27]. how currency is spent in the consensus Finally, one should not consider only process and how this affects energy costs. theoretical aspects. There is another criterion— • Innovative approaches (alternative the energy consumption of the algorithm. If an methods such as Proof of Space (PoSpace) algorithm consumes too much energy, it should or Proof of Time (PoT) may offer lower be changed and more environmentally friendly energy costs). options should be considered. However, the energy consumption criteria The following energy consumption criteria must be balanced with other important aspects, for choosing a consensus algorithm in such as security, decentralization, and blockchain technology should be considered: bandwidth, when choosing a consensus algorithm for blockchain technology. Proof of Work (PoW): Here is a comparative description of • Computational complexity (the more consensus algorithms for different types of difficult the task is for miners, the more cryptocurrencies (Table 1). energy is consumed). Table 1 Characteristics of consensus algorithms Cryptocurrency Type Security Decentralisation Energy consumption Bandwidth Dash Hibrid Medium Medium Medium OK Peercoin Hibrid Medium Medium Low Not So Fast Verus coin Hibrid Medium Medium Low OK Decred Hibrid Hight Hight Medium OK Stratis Hibrid Medium Medium Medium Fast Bitcoin PoW Hight Hight Hight Not So Fast Conflux PoW Hight Medium Low Very Fast Ethereum Classic PoW Medium Medium Medium Fast Monero PoW Hight Hight Medium OK Dogecoin Litecoin PoW Medium Medium Medium OK Ethereum PoS Medium Hight Low Fast Polygon PoS Hight Medium Low Fast TON coin PoS Medium Medium Low Fast Solana PoS Hight Medium Hight Very Fast Cardano PoS Hight Medium Low Fast 110 article. This solution is very useful for the further selection of consensus algorithms and the development of blockchain technology. In general, the criteria, discussed in this article, make it clear how important the method of selecting a consensus algorithm is. After all, a successfully selected consensus increases the efficiency of blockchain technology. This study is limited in time. For the whole population, the consensus algorithm may be useful to study more algorithms and create a larger decision tree, as they all have their characteristics. Also, this article is an impulse to dive deeper and compare performance using benchmarking. For any future work, it would be interesting to have a study on the selection of a consensus algorithm and it is possible to choose a wider list of criteria or reduce it to a minimum. In addition, the blockchain application industry is developing rapidly and new algorithms are being created that can quickly replace the old ones on the market. There is always a need for future research, so it is a necessity to keep up to date with the latest developments in consensus algorithms and blockchain Figure 1: Definition of the consensus algorithm technology. The main steps of determining the consensus algorithm by the selected criteria are shown in References Fig. 1. [1] V. Buriachok, V. Sokolov, P. Skladannyi, 3. Discussion Security Rating Metrics for Distributed Wireless Systems, in: Workshop of the 8th Int. Conf. on “Mathematics. The obtained results formed the basis of the Information Techno-logies. Education:” methodology for determining the consensus Modern Machine Learning Technologies algorithm for the blockchain network. Based and Data Science, vol. 2386 (2019) 222– on the obtained data, a program for 233. determining the optimal algorithm has been [2] B. Bebeshko, et al., Application of Game created in the Python programming language. Theory, Fuzzy Logic and Neural The program allows choosing one of the Networks for Assessing Risks and available consensus algorithms by the Forecasting Rates of Digital Currency, established criteria. The program can be Journal of Theoretical and Applied extended to take into account more metrics Information Technology 100(24) (2022) and conditions for choosing an algorithm. 7390–7404. [3] V. Sokolov, P. Skladannyi, H. Hulak, 4. Conclusion Stability Verification of Self-Organized Wireless Networks with Block The criteria for helping to select a consensus Encryption, in: 5 th International algorithm, by reviewing popular algorithms Workshop on Computer Modeling and and providing a solution in the form of a Intelligent Systems, vol. 3137 (2022) decision tree have been presented in this 227–237. 111 [4] F. Kipchuk, et al., Assessing Approaches and Telecommunication Systems, Vol. of IT Infrastructure Audit, in: IEEE 8th 3421 (2023) 223–230. International Conference on Problems of [15] D. Mingxiao, et al., A Review on Infocommunications, Science and Consensus Algorithm of Blockchain, Technology (2021). doi: 10.1109/ IEEE International Conference on picst54195.2021.9772181. Systems, Man, and Cybernetics (2017). [5] B. Sriman, et al., Blockchain Technology: doi: 10.1109/SMC.2017.8123011. Consensus Protocol Proof of Work and [16] R. Pass, E. Shi, Hybrid Consensus: Proof of Stake, Intelligent Computing and Efficient Consensus in the Applications (2020) 395–406. doi: Permissionless Model, Initiative for 10.1007/978-981-15-5566-4_34. CryptoCurrency and Contracts (2016) 1– [6] S. Bamakan, et al., A Survey of Blockchain 55. doi: 10.4230/LIPIcs.DISC.2017.39. Consensus Algorithms Performance [17] S. King, S. Nadal, PPCoin: Peer-to-Peer Evaluation Criteria, Expert Systems with Crypto-Currency with Proof-ofStake Applications 154 (2020) 113385. doi: (2012). 10.1016/j.eswa.2020.113385. [18] L. Shi, et al., Pooling Is Not Favorable: [7] H. Cho, ASIC-Resistance of Multi-Hash Decentralize Mining Power of POW Proof-of-Work Mechanisms for Blockchain Using Age-of-Work, IEEE Blockchain Consensus Protocols, IEEE Transactions on Cloud Computing 11(3) Access 6 (2018) 66210–66222. doi: (2022). doi: 10.1109/TCC.2022.3226496. 10.1109/ACCESS.2018.2878895. [19] B. Sriman, et al., Blockchain Technology: [8] T. Duong, et al., 2-Hop Blockchain: Consensus Protocol Proof of Work and Combining Proof-of-Work and Proof-of- Proof of Stake, Intelligent Computing and Stake Securely, Computer Security – Applications (2020) 395–406. doi: ESORICS 2020 (2020) 697–712. doi: 10.1007/978-981-15-5566-4_34. 10.1007/978-3-030-59013-0_34. [20] Y. Yu, Analysis of POW in Bitcoin and POS [9] A. Guru, et al., A Survey on Consensus in Peercoin, Highlights in Science, Protocols and Attacks on Blockchain Engineering and Technology 39 (2023) Technology, Applied Sci. 13(4) (2023) 784–788. doi: 10.54097/hset.v39i.6645. 2604. doi: 10.3390/app13042604. [21] Q. Zhang, et al., Blockchain Model [10] S. King, S. Nadal. PPCoin: Peer-to-Peer Testing and Implementation Based on Crypto-Currency with Proof-of-Stake, Improved PBFT Consensus, 11th IEEE (2012) 1–6. International Conference on Intelligent [11] Y. Liu, et al., Hybrid Consensus Protocols DataAcquisition and Advanced and Security Analysis for Blockchain, Computing Systems: Technology and International Conference on Data Applications (IDAACS) (2021). doi: Analytics, Computing and Artificial 10.1109/idaacs53288.2021.9660959. Intelligence (ICDACAI) (2022). doi: [22] S. Zhang, J.-H. Lee, Analysis of the Main 10.1109/ICDACAI57211.2022.00046. Consensus Protocols of Blockchain, ICT [12] B. Lucas, R. V. Paez, Consensus Express 6(2) (2020) 93–97. doi: Algorithm for a Private Blockchain, IEEE 10.1016/J.ICTE.2019.08.001. 9th International Conference on [23] W. Zhao, et al., On Peercoin Proof of Electronics Information and Emergency Stake for Blockchain Consensus, 3rd Communication (ICEIEC) (2019). doi: International Conference on Blockchain 10.1109/ICEIEC.2019.8784500. Technology (2021) 129–134. doi: [13] A. Mackenzie, Memcoin2: A Hybrid 10.1145/3460537.3460547. Proof-of-Work, Proof-of-Stake Crypto- [24] W. Zhao, et al., On Peercoin Proof of Currency (2013). Stake for Blockchain Consensus, 3rd [14] V. Malinov, et al., Biomining as an International Conference on Blockchain Effective Mechanism for Utilizing the Technology (2021) 129–134. doi: Bioenergy Potential of Processing 10.1145/3460537.3460547. Enterprises in the Agricultural Sector, [25] V. Zhebka, et al., Optimization of Machine Cybersecurity Providing in Information Learning Method to Improve the Management Efficiency of 112 Heterogeneous Telecommunication Network, Cybersecurity Providing in Information and Telecommunication Systems Vol. 3288 (2022) 149–155. [26] Z. Zheng, et al., An Overview of Blockchain Technology: Architecture, Consensus, and Future Trends, IEEE International Congress on Big Data (BigData Congress) (2017). doi: 10.1109/BIGDATACONGRESS.2017.85. [27] Z. Zheng, et al., An Overview of Blockchain Technology: Architecture, Consensus, and Future Trends, IEEE International Congress on Big Data (BigData Congress) (2017). doi: 10.1109/BIGDATACONGRESS.2017.85. 113