Reputation-Based Consensus for Blockchain Technology in Smart Grid
Lanqin Sang, Henry Hexmoor
Southern Illinois University at Carbondale
Abstract
Accurate and thorough measurement of all nodes’ trustworthiness should create a safer network environment. We designed a blockchain-based,completely self-operated reputation system, R360, to enhance network security in decentralized network. R360 is a multi-factor measurement on the reputation of all nodes in the network. Specifically, a node’s function, defense capability, quality of service provided, availability, malicious behavior, and resources are evaluated, providing a more accurate picture about a node’s trustworthiness, which in turn should enhance the security of blockchain operations in a non-trust environment. Our design has been implemented on a single-machine, simulated setting, which demonstrates that, comparing to systems with few dimensions, R360’s consensus took less time while at the same time providing better security to the system.Further security analysis shows that our design can defend common security attacks on reputation systems. Such a blockchain-based, self-operated reputation system could be used to manage smat grids for more efficient energy production and delivery.
Keywords
Smart Grid, Blockchain, Reputation-Based, Consensus, R36
1. INTRODUCTION
The development of society and technology demands revolutions in power generation, dissemination, and maintenance. As more and more suppliers and consumers are incorporated onto the power grid, the management and communication systems are increasingly complex, which calls for the transformation of old centralized systems into distributed systems, recently dubbed smart grid. Such distributed systems require novel software platforms for management. Blockchain technology has been applied to many fields to manage distributed systems, such as future energy systems [1]. Blockchain is a distributed ledger system that collects blocks for registering different records of data or transactions. A key module of blockchain is consensus, which guards the system to produce accurate and identical information across the entire network. Blockchain consensus mechanism is a process for all nodes to agree or disagree on a set of transactions, also known as a block. Without the consensus mechanism, there will be no effective blockchain technology. However, current consensus mechanisms have their limitations, including low transaction throughput, weak consistency, and security concerns [2]. Vulnerabilities to attacks, double spending attacks, eclipse attacks, selfish attacks, and flash attacks are all examples[3].
Much research has been carried out to mitigate such limitations. The solutions either improve the low throughput with weak consistency or provide strong consistency but suffer liveness [4]. By and large, all the existing contemporary consensus mechanisms, such as proof-of-work, proof-of-stack and the variants based on them, rely on the assumption that most nodes are honest [5]. Although this assumption is reasonable, it is not based on facts. Recently, reputation-based consensus mechanism in blockchain has attracted attention. Proof of Reputation (PoR) is an upgraded, stronger, and more secure form of Proof of Authority (PoA) [6]. Proof of Reputation (PoR) consensus model depends on the reputation of the participants to keep the network secure. A node must have a reputation that is important such that they would face significant financial and brand value loss if they were to attempt to subvert the system.
Among all consensus strategies, PoR is most promising and deserves further investigation. The salient goal of consensus is to ascertain the data on the network are accurate and identical. If every node on the network is honest, there is no need for relying on a consensus mechanism. On the other hand, if the majority of the nodes on the network are not trustworthy, regardless of the amount of work or how much stake is invested, nothing will be truly meaningful. With reputation as the foundation, we would have know whether a node is trustworthy and how much you can trust it. Our research focuses on PoR. Current reputation-based designs are only based on a few dimensions of a node, such as blockchain functions, service quality, or computer power, and the nodes are treated differently (See Section 2 – Related Research). We propose to improve this situation in our design through a thorough reputation evaluation system, with all nodes having the same opportunities to various roles. In our model, a node’s honest behaviors are rewarded and dishonest behaviors are punished. Nodes will be selected to publish blocks and vote commensurate with their reputation scores. According to [3], a reputation system must have the following three properties: (1) it must provide information that allows buyers to distinguish between trustworthy and non-trustworthy sellers; (2) it must encourage sellers to be trustworthy, and (3) it must discourage participation from those who are not trustworthy [7]. Thus, we propose the following design principles for our reputation system:
1. The basic properties of reputation. The concept of trust is always related to behavior or context[8]. A high level of reputation and trust obtained in a context or through a behavior is not transferable to another context. For example, being a good doctor should not imply the person would be a good manager. The reputation of a person acting as a doctor or a manager needs to be treated separately. In the application to smart grid, a node’s leadership reputation and voting reputation must be managed separately.
2. Fairness. A node’s computation power, online time, etc. will be considered towards the node’s reputation score. Time decay will also be considered.
3. Reputation-based qualifications and privileges. A node’s qualifications and privileges to create blocks or to vote depend on its reputation scores.
4. Multidimensionality. We introduce the R360 concept, which encapsulates the notion that a node’s reputation will be measured in multiple dimensions. According to [9], a reputation system includes the following fundamental dimensions: history, context, collection, representation, aggregation, entities, presence, governance, fabric, interoperability, control, evaluation, data filtering, and data aging, all of which have been used in reputation measurement. Based on these dimensions, we elaborate the design of our reputation system.
5. Two-tier block leader’s and voter’s selection. We first screen potential block leaders and voters by their total reputation to make sure they are good nodes in general. Then the leader will be selected by its block creation score and the remaining members of the consensus group will be selected by their voting scores. This strategy is extensively used as common selection principles in society, such as human employment practice.
2 Related Research
The rest of paper is organized as following, Section 2 introduces related research, Section 3 presents our reputation-based model, Section 4 discusses the implementation and evaluation, and Section 5 outlines security analysis. We culminate the paper with concluding remarks.
Classic consensus mechanisms include Proof of Work (PoW), Proof of Stake (PoS) and Practical Byzantine Fault Tolerance (PBFT) [10]. PoW is the first public blockchain consensus that was introduced in Bitcoin [11]. In this consensus mechanism, all nodes in the network are asked to solve a computationally expensive PoW problem. Whichever node that solves this puzzle first will be allowed to create a new block and other nodes can verify if this block is valid. PoW is vulnerable to 51% attack [10]; PoS [12] is the most popular alternative mechanism to PoW, whose goal is to overcome PoW’s common limitations. In a PoS-based blockchain, mining a block is replaced by validating a block. The algorithm randomly selects validators to create new blocks and the probability of a node validating the next block is proportional to the stakes/assets it invests. Since the wealthiest validators administer the blockchain, this may introduce unfairness to the PoS consensus mechanism; Practical PBFT is a widely used mechanism. PBFT works on the assumption that at least 2/3 of the total number of nodes are honest [13].
Reputation-based consensus is quite different on how to select the block leader and consensus group members, how to produce reputation scores, and how to calculate or assign reputation scores. We outline a few of these systems next.
In reported research, only a few dimensions have been used to evaluate nodes’ reputation, whereas in some cases, some nodes are selected as judges/monitors to evaluate other nodes. Such designs are vulnerable and have inherent flaws. For example, a node that provides good services might have attacked other nodes. A node with much resources may launch selfish attacks. The process of monitor selection might be biased. Overall security can be greatly enhanced by adding additional security measures[22]. In this paper, we attempt to measure a node’s reputation in multiple dimensions and provide all nodes with equal opportunities in order to overcome these flaws and potential biases. We name our reputation measurement system R360, in which we evaluate every node by its function, defense capability, offense, quality of service, availability, and resources. Our system also takes time decay into account. A node’s behavior and ability determine its reputation scores, which in turn renders qualifications and privileges to the node. Penalties will be assessed for a node’s incorrect decisions or inaction with free rides. Any serious offense will wipe out all of a node’s positive reputation scores. If a node makes a correct decision on a block, it will be rewarded even if the block failed to validate. All nodes in the blockchain network form a self-managed dynamic system to provide a relatively trusted network environment.
3 System Model
3.1 System Composition
Whether a node is trustworthy or not depends on several factors. The R360
reputation system includes the following components, shown in Figure 1:
Figure 1. Reputation Structure
3.2 Reputation Score of Factors
The total reputation score of a node will be the sum of its six scores obtained
in individual attributes:
Figure 2. Block Structure
3.3 Consensus Mechanism
Figure 3 is the consensus flow chart.
Figure 3. The Consensus Process
4 Implementation and Evaluation
4.1 Block Composition and Block Voting
Each block contains two sub-blocks as shown in Figure 2. One is normal transaction block, named business block, and the other is reputation transaction block, named reputation block, which contains reputation transactions.
5. A block will be validated only when both sub-blocks are validated by at least 2/3 of the voters.
4.2 Consensus Algorithms
Table 1 lists the nomenclature for the consensus algorithms. Algorithm 1 is run by all nodes to select the block leader and the group of voters.
Algorithm 2 updates the block leader’s and voters’ reputation scores after a block is validated.
Algorithm 3 updates all nodes’ transaction creation scores after a block is validated.
Algorithm 4 updates the block leader’s and voters’ reputation scores when a block fails to validate.
Algorithm 5 will run after a block is validated and will update all nodes’ reputation according to the reputation transactions in the reputation block. The transactions in the reputation block are sorted by timestamps before the update to ensure the correct chronological order of transaction creation.
Table 1 . Nomenclature
4.3 Experimental Environment
4.4 Consensus Performance Evaluation
We evaluated the performance of R360 relative to other reputation systems in three scenarios. The first one is business transactions only, with no reputation transactions, which is named Function. A node’s trustworthiness is measured by its leading score and voting score. The second scenario included also service reputation transactions. In this model, each run contains half business transactions and half service reputation transactions. The third is R360, which measures a node’s trustworthiness from six dimensions, including function, resource, availability, defense, offense and service. In R360, half of the total transactions are business transactions, and half are reputation transactions.
As we can see from Figure 4, the time needed to do consensus increases as the number of transactions goes up. This is understandable because the complexities of our design are O(N2 ), O(NT), and (T 2 ), where N is the number of nodes in the network system, and T is the number of transactions in a block.
Table 2, 3, and 4 display Function, Service, and R360 performances, respectively. Table 5 lists the sub-reputation systems and their corresponding transaction typestransactions.
With the same number of transactions, R360 took the shortest consensus time, followed by service reputation, and function reputation model took the longest. This is because the complexity for the consensus algorithm is O(T2 ).
Table 2 . Function Performance
Table 3 . Service Performance
Table 4 . R360 Performance
Figure 4. Consensus Performance
For R360, the total transactions are divided equally between business transactions and reputation transactions, and its complexity is half of O(T2 ). The service reputation transactions contain more information in its subtype than other reputation transactions, which is why service model took a little more time than R360. However, the time difference is insignificant. As the number of transactions goes up, the difference in time among the three models increases. R360 increases more slowly than the other two models. If R360 system can greatly increase a node’s defensibility and reduce its offense ability, the reputation transactions can be reduced to contain only resource, availability, and service transactions, the block can have more business transactions while maintaining the security of the network. However, because R360 collects more information to measure a node’s trustworthiness, more bandwidth will be required. More extensive experiments are needed to evaluate how R360 affects the overall network traffic.
4.5 Security Testing
We also carried out a security test with selfish attack in four scenarios: the leading node added an extra transaction to the to-be-proposed block, removed a transaction from the block, changed a transaction’s rate value, and changed the evaluation’s receiver. From Table 6, we can see that the consensus failed when the block leader modified a transaction. This is because the voters uncovered their local blocks were not the same as the altered blocks, so they failed the proposed blocks.
Table 5 . Reputation System Transactions
Table 6 . Selfish Attack
5 Security Analysis
We tested selfish attack with R360 system. In this section, we analyze the threats of other common security attacks on R360.
6 Conclusion
A new system, R360, has been designed to thoroughly measure and maintain the reputation of nodes in an untrusted network. The design has been implemented to test the consensus performance and security. The results show that R360 takes less consensus time and enhances system security. Our experiments showed R360 can prevent selfish attack. Further analysis illustrates that it can prevent common attacks on blockchain reputation system. By putting on strict reputation evaluation rules, R360 can greatly enhance the security in untrusted blockchain smart grid. However, it also increases the network traffic. Our design was simulated on a single computer. Future work should implement R360 on real network systems to test its network performance and security. Additionally, the scoring system may need to be optimized. Further study on how such reputation scores affect individual node’s behavior is also desirable.
References
[1] Zhaoyang Dong, Fengji Luo, Gaoqi Liang. Blockchain: a secure, decentralized, trusted cyber infrastructure solution for future energy systems. Journal of Modern Power Systems and Clean Energy, 6:958—-967, Jul. 2018.
[2] Cong T. Nguyen, Dinh Thai Hoang, Diep N. Nguyen, Dusit Niyato, Huynh Tuong Nguyen, Eryk Dutkiewicz. Proof-of-stake consensus mechanisms forfuture blockchain networks: Fundamentals, applications and opportunities. IEEE Access, 7:85727–85745, 2019.
[3] N Anita., M Vijayalakshmi. Blockchain security attack: A brief survey. pages 1–6, 2019.
[4] Jiangshan Yu, David Kozhaya, Jeremie Decouchant, Paulo EstevesVerissimo. Repucoin: Your reputation is your power. IEEE Transactions on Computers, 68(8):1225–1237, 2019.
[5] Yunhua He, Hong Li, Xiuzhen Cheng, Yan Liu, Chao Yang, Limin Sun. A blockchain based truthful incentive mechanism for distributed p2p applications. IEEE Access, 6:27324–27335, 2018.
[6] Blockchain consensus encyclopedia infographic. https://tokenseconomy.gitbook.io/consensus/chain-based-proof-of-capacity-space/proofof-reputation-por.
[7] Paul Resnick, Richard Zeckhauser. Trust among strangers in internet transactions: Empirical analysis of ebay’ s reputation system. The Economics of the Internet and E-commerce (Advances in Applied Microeconomics, 11:127–157, 2002.
[8] Emanuele Bellini, Youssef Iraqi, Ernesto, Damiani. Blockchain-based distributed trust and reputation management systems: A survey. IEEE Access, 8:21127–21151, February 2020.
[9] Ferry Hendrikx, Kris Bubendorfer, Ryan Chard. Reputation systems: A survey and taxonomy. Journal of Parallel and Distributed Computing, 75:184–197, 2015.
[10] Muhammad Baqer Mollah, Jun Zhao, Dusit Niyato, Kwok-Yan Lam, Xin Zhang, Amer M.Y.M. Ghias, Leong Hai Koh, Lei Yang. Blockchain for future smart grid: A comprehensive survey. IEEE Internet of Things Journal, pages 1–1, 2020.
[11] Satoshi Nakamoto. Bitcoin: A peer-to-peer electronic cash system. 2008.
[12] Nick Szabo. Smart contracts : Building blocks for digital markets. 2018.
[13] Lanqin Sang, Henry Hexmoor. Information-centric blockchain technology for the smart grid. International Journal of Network Security & Its Applications, May 2021.
[14] Dodo Khan, Low Tang Jung, Manzoor Ahmed Hashmani. Proof-of-review: A review based consensus protocol for blockchain application. International Journal of Advanced Computer Science and Applications(IJACSA), 12(3), 2021.
[15] Qianwei Zhuang, Yuan Liu, Lisi Chen, Zhengpeng Ai. Proof of reputation: A reputation-based consensus protocol for blockchain based systems. IECC ’ 19: 2019 International Electronics Communication Conference, pages 131–138, July 2019.
[16] Fangyu. Gai, Baosheng. Wang, Wenping. Deng, Wei. Peng. Proof of reputation: A reputation-based consensus protocol for peer-to-peer network. International Conference on Database Systems for Advanced Applications, pages 666–681, 2018.
[17] Jie Duan, Mo-Yuen Chow. A resilient consensus-based distributed energy management algorithm against data integrity attacks. IEEE Transactions on Smart Grid, 10(5):4729–4740, 2019.
[18] Jose E. Fadul, Kenneth M. Hopkinson, Todd R. Andel, Christopher A. Sheffield. A trust-management toolkit for smart-grid protection systems. IEEE Transactions on Power Delivery, 29(4):1768–1779, 2014.
[19] Zheyuan Cheng, Mo-Yuen Chow. Reputation-based collaborative distributed energy management system framework for cyber-physical microgrids: Resilience against profit-driven attacks. pages 1–5, 2020.
[20] Tonghe Wang, Jian Guo, Songpu Ai, Junwei Cao. Rbt: A distributed reputation system for blockchain-based peer-to-peer energy trading with fairness consideration. Applied Energy, 295:117056, 2021.
[21] Wenjun Cai, Wei Jiang, Ke Xie, Yan Zhu, Yingli Liu, Tao Shen. Dynamic reputation–based consensus mechanism: Real-time transactions for energy blockchain. International Journal of Distributed Sensor Networks, 16(3):1550147720907335, 2020.
[22] Logan O.Mailloux, Michael R.Grimaila, John M.Colombi, Douglas D.Hodson, Gerald Baumgartner. Emerging trends in ict security. ScienceDirect, pages 5–23, 2014.
[23] G¨obel, J. and Krzesinski, A.E. Increased block size and Bitcoin blockchain dynamics. 2017.
[24] Chrysanthos Dellarocas. Mechanisms for coping with unfair ratings and discrim- inatory behavior in online reputation reporting systems. ICIS: International Conference on Computers and Information Systems, pages 520–525, 2000.