Performance Evaluation and Cyberattack Mitigation in a Blockchain-Enabled Peer-to-Peer Energy Trading Framework
Abstract
:1. Introduction
- The blockchain-enabled peer-to-peer energy trading framework implementation and prototype design is presented.
- R3 Corda is used for enacting smart contracts for client communications. A thorough performance evaluation of this prototype is presented herein.
- A novel class of cyberattacks in energy trading, such as delay trading and discard, is introduced. We design a threat-model, adversary effect, and mitigation of these attacks. The double-spending attack in the proposed energy trading process is also mitigated through the presence of the notary in the network.
- We also develop, analyze various smart contracts, deploy nodes, state test, signer test, and transfer command contract rules in order to handle a novel peer-to-peer energy trading process in the proposed framework.
- We carry out measurement and benchmarking of performance parameters such as message rate and flows, metering, send and receive rate, throughput, JVM heap memory usage, and latency, by using Grafana visualization tool for the proposed P2PET.
- The framework provides a confidential identity security to all the trading participants by using network map services. The identities are only distributed to other participants on a need-to-know basis. We integrate use of the latest and far more reliable transaction broadcasting and validation services such as notary, attachment, and network map services.
2. Literature Review
3. System Architecture for Proposed Framework
3.1. Proposed Network Model
- Nodes and Vaults: Corda network is a permissioned peer-to-peer network of nodes that accesses control by a doorman. Each producer and consumer node runs the Corda software as well as the Corda applications, known as Cordapps. Each node in the network maintains a vault. The vaults also maintain the consumed and unconsumed energy states.
- Node Identities: Each node has an well-known identity which is used to represent the transaction. We designed two types of identities: legal and service identities. Legal identities are used for the producer and consumer transactions. Service identities are used for those providing transaction-related services, such as notaries and Oracle. Our proposed framework is designed to generate confidential identities for nodes for individual transactions.
- Network Map Service: The network map service in the proposed network publishes the IP addresses of all the participants in the energy trading process. The consumer may query about their demand of energy; similarly, the producer may write their supply of excess energy. All the nodes in the network can be reached with the identity certificate from network permissioning services. This certificate guarantees the node identities while communicating with other peers in the network. It generates confidential identities that are not published in network map services. It ensures the transaction participants’ identities even if an intruder attacker obtains access to the unencrypted transaction. The chain linking to confidential identity is disclosed only on a need-to-know basis.
3.2. Proposed Ledger, States, Transactions, Time Window, Notary, and Contract
- Ledger: The participants of our proposed framework maintain separate databases of facts or states in their ledgers shared with everyone if they need it. However, unlike Bitcoin, the transactions are not globally broadcasted. Therefore, we share facts or states with the participants on a need-to-know basis. When peers make transactions, their respective ledger is updated only. Considering an instance, if person X makes 3 KW of energy trading to Y and makes an entry into the Corda network about an energy transaction, then both X’s and Y’s ledgers receive updates but nobody else in the network is allowed to know about the transaction.
- States: It is defined as an immutable object that represents the facts from one or more peers from the Corda network, at a particular point of time. These are differentiated by marking the current state as historic and creating an updated state. It also contains states such as consumer states as historic data and current states as nonconsumed data. It also marks a timestamp along with the states. The state objects are stored in a vault from time to time.
- Transactions: The first transaction would have zero inputs, i.e., X does not have energy in the DLT. X is issuing energy, so there is no input state and one output state in the first transaction. Since producer and consumer are both participants in the transaction, they both need to input their signature, as shown in Equation (15).After one or two transactions, the vault represents the unconsumed and consumed energy amount along with the payment state. The payment state needs to be signed by the consumer, as shown in Equation (16).For each transaction, a unique transaction hash is generated. Index is the count of the state.
- Attachment: Attachments used in the framework contain a large set of data that can be used across different transactions. The attachment contains historic trading data, table of prices for different qualities of produced energy, such as solar and wind, maximum and minimum prices, etc. Each transaction can refer to zero or more attachments. The information in these attachments can then be used to validate the transaction.
- Commands: Including a command in a transaction allows it to indicate the transaction’s intent, affecting how we change the validity of the transactions. Settle command is used to settle the producer’s and consumer’s energy amounts by signing both of them. Similarly, the pay command is used and signed by the consumer as they are the owner of the cash, shown in Equation (16).
- Time Window: In our proposed peer-to-peer energy trading framework, the transfer and payment settlement transaction need to be performed in a certain timeframe. Thus, the time window in our network represents a transaction commit validation before or after a particular time, or within a particular timeframe. For our application, we used from and to date along with time duration for trading.
- Notary: The transaction uniqueness consensus is achieved through notary network services. Basically, this consensus solves the problem of double-spending attack in a peer-to-peer energy trading process, because it signs a particular transaction that consumes any of the transaction state of the proposed system. The transaction and system finality is achieved by this. Without a notary, the trading transaction can be neither finalized nor notarized.
- Contract: A transaction is valid if it is digitally signed by all required signers and if it is contractually valid. In the proposed work, the energy state requires an energy contract, which have certain rules as described in Algorithm 1. We used two algorithms for the proposed framework. Algorithm 1 describes the peer-to-peer energy trading process in a Corda network where the energy producer and consumer can process their demand and request through an API. Algorithm 2 performs a matching in the Corda network by comparing the digital signature of each party, demand from producer, and request from consumer. Algorithm 2 performs energy matching from the consumer and producer by a notary available in the Corda network. Similarly, the payment state would also refer to payment contract.
- Flows: A flow is a sequence of steps that represents a node behavior to achieve a specific ledger update. It also automates the process of agreeing on ledger updates. Automatic common tasks can also be provided with the help of a builderin flow. Figure 3 represents the flows in our proposed framework. Request energy and pay cash are sub-flows used in the proposed framework. A flow that started as a sub-process is known as a sub-flow.
Algorithm 1: Peer-to-peer energy trading in Corda network. |
Algorithm 2: Notary validation by energy matching attachment. |
4. Threat Model
4.1. Attacking Capabilities of the Adversary
4.2. Aim of the Opponent
5. Implementation
5.1. Deployment of Nodes
Listing 1. Deploying nodes on Corda network. |
5.2. State Test
5.3. Energy Trading Contract Test
Listing 2. Energy state test. |
5.4. Running The Nodes
5.5. Transaction Explorer
6. Performance Analysis, Cyberattack Mitigation, and Discussion
6.1. Mitigating Cyberattack
6.2. JVM Heap Memory and CPU Performance
6.3. Measurement of P2P
6.4. Measurement of Message Rate and Flows
6.5. Metering
6.6. Throughput
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Pradhan, N.R.; Singh, A.P.; Kumar, N.; Hassan, M.; Roy, D. A Flexible Permission Ascription (FPA) Based Blockchain Framework for Peer-to-Peer Energy Trading with Performance Evaluation. IEEE Trans. Ind. Inform. 2021, 17, 5779–5789. [Google Scholar] [CrossRef]
- Pradhan, N.R.; Singh, A.P. Performance Analysis of a Blockchain Based Peer-to-Peer Energy Trading Framework. In Proceedings of the 2021 IEEE 4th International Conference on Computing, Power and Communication Technologies (GUCON), Kuala Lumpur, Malaysia, 24–26 September 2021; pp. 1–7. [Google Scholar] [CrossRef]
- Gorski, T.; Bednarski, J. Applying Model-Driven Engineering to Distributed Ledger Deployment. IEEE Access 2020, 8, 118245–118261. [Google Scholar] [CrossRef]
- Chowdhury, M.J.; Ferdous, M.S.; Biswas, K.; Chowdhury, N.; Kayes, A.S.; Alazab, M.; Watters, P. A Comparative Analysis of Distributed Ledger Technology Platforms. IEEE Access 2019, 7, 167930–167943. [Google Scholar] [CrossRef]
- Gorski, T.; Bednarski, J.; Chaczko, Z. Blockchain-based renewable energy exchange management system. In Proceedings of the 2018 26th International Conference on Systems Engineering (ICSEng), Sydney, NSW, Australia, 18–20 December 2018; pp. 1–6. [Google Scholar] [CrossRef]
- Corda Enterprise Version 4.3 Documentation. Available online: https://docs.corda.r3.com/index.html (accessed on 4 December 2021).
- Pradhan, N.R.; Singh, A.P. Smart contracts for automated control system in Blockchain based smart cities. J. Ambient. Intell. Smart Environ. 2021, 13, 253–267. [Google Scholar] [CrossRef]
- Lin, J.; Pipattanasomporn, M.; Rahman, S. Comparative Analysis of Blockchain-based Smart Contracts for Solar Electricity Exchanges. In Proceedings of the 2019 IEEE Power & Energy Society Innovative Smart Grid Technologies Conference (ISGT), Washington, DC, USA, 18–21 February 2019; pp. 1–5. [Google Scholar] [CrossRef]
- Aggarwal, S.; Kumar, N.; Tanwar, S.; Alazab, M. A Survey on Energy Trading in the Smart Grid: Taxonomy, Research Challenges and Solutions. IEEE Access 2021, 9, 116231–116253. [Google Scholar] [CrossRef]
- Pradhan, N.R.; Singh, A.P.; Verma, S.; Kaur, N.; Roy, D.S.; Shafi, J.; Wozniak, M.; Ijaz, M.F. A Novel Blockchain-Based Healthcare System Design and Performance Benchmarking on a Multi-Hosted Testbed. Sensors 2022, 22, 3449. [Google Scholar] [CrossRef] [PubMed]
- Aggarwal, S.; Kumar, N. A Consortium Blockchain-Based Energy Trading for Demand Response Management in Vehicle-to-Grid. IEEE Trans. Veh. Technol. 2021, 70, 9480–9494. [Google Scholar] [CrossRef]
- Grafana—Open Source Analytics and Monitoring Solution for Every Database 2020. Available online: https://www.grafana.com/ (accessed on 27 January 2022).
- Mohanty, D. R3 Corda for Architects and Developers: With Case Studies in Finance, Insurance, Healthcare, Travel, Telecom, and Agriculture; Apress: New York, NY, USA, 2019. [Google Scholar]
- Pradhan, N.R.; Rout, S.S.; Singh, A.P. Blockchain Based Smart Healthcare System for Chronic—Illness Patient Monitoring. In Proceedings of the 2020 3rd International Conference on Energy, Power and Environment: Towards Clean Energy Technologies, Shillong, Meghalaya, India, 5–7 March 2021; pp. 1–6. [Google Scholar]
- Di Silvestre, M.L.; Gallo, P.; Ippolito, M.G.; Musca, R.; Sanseverino, E.R.; Tran, Q.T.T.; Zizzo, G. Ancillary Services in the Energy Blockchain for Microgrids. IEEE Trans. Ind. Appl. 2019, 55, 7310–7319. [Google Scholar] [CrossRef]
- Hassija, V.; Chamola, V.; Krishna, D.N.G.; Guizani, M. A Distributed Framework for Energy Trading Between UAVs and Charging Stations for Critical Applications. IEEE Trans. Veh. Technol. 2020, 69, 5391–5402. [Google Scholar] [CrossRef]
- Shafeeq, S.; Zeadally, S.; Alam, M.; Khan, A. Curbing Address Reuse in the IOTA Distributed Ledger: A Cuckoo-Filter-Based Approach. IEEE Trans. Eng. Manag. 2020, 67, 1244–1255. [Google Scholar] [CrossRef]
- Park, J.; Chitchyan, R.; Angelopoulou, A.; Murkin, J. A block-free distributed ledger for p2p energy trading: Case with IOTA? In International Conference on Advanced Information Systems Engineering; Springer: Cham, Switzerland, 2019; pp. 111–125. 2p. [Google Scholar]
- Wang, N.; Zhou, X.; Lu, X.; Guan, Z.; Wu, L.; Du, X.; Guizani, M. When energy trading meets blockchain in electrical power system: The state of the art. Appl. Sci. 2019, 9, 1561. [Google Scholar] [CrossRef]
- Chen, Y.; Tan, Y.; Zhang, B. Exploiting vulnerabilities of load forecasting through adversarial attacks. In Proceedings of the 10th ACM International Conference on Future Energy Systems (e-Energy), Phoenix, AZ, USA, 25–28 June 2019; pp. 1–11. [Google Scholar]
- Pang, Z.H.; Fan, L.Z.; Guo, H.; Shi, Y.; Chai, R.; Sun, J.; Liu, G.P. Security of networked control systems subject to deception attacks: A survey. Int. J. Syst. Sci. 2022, 53, 3577–3598. [Google Scholar] [CrossRef]
- Stellios, I.; Kotzanikolaou, P.; Psarakis, M.; Alcaraz, C.; Lopez, J. A survey of IoT-enabled cyberattacks: Assessing attack paths to critical in-frastructures and services. IEEE Commun. Surv. Tutor. 2018, 20, 3453–3495. [Google Scholar] [CrossRef]
- Pradhan, N.R.; Singh, A.P.; Verma, S.; Wozniak, M.; Shafi, J.; Ijaz, M.F. A blockchain based lightweight peer-to-peer energy trading framework for secured high throughput micro-transactions. Sci. Rep. 2022, 12, 14523. [Google Scholar] [CrossRef] [PubMed]
References | Year | Objective | Performance | Limitation | Performance Evaluation |
---|---|---|---|---|---|
Want et al. [19] | 2019 | Energy trading meets blockchain in electrical power system. | It slows down network computing over the time and makes the network less transparent. | Full transparency. | No |
Chen et al. [20] | 2018 | Discussed vulnerabilities of load forecasting through adversarial attacks. | Only calculated average response time, throughput, and average message time based on Ethereum. | Full transparency. | Partially |
Stellios et al. [22] | 2018 | To survey IoT-enabled cyberattacks and assessing attack paths. | Demonstrable different cyberattack in a blockchain network. | Increased computing power needed. | No |
Pradhan et al. [23] | 2022 | IOTA, a lightweight ‘Tangle’-based framework (third-generation distributed ledger technology) to create a market for trading energy that uses a DAG. | Verifiable secure sharing of large number of microtransactions. | Only light wallet such as IOTA 2.5.4 IRI can support. | Partially |
Pradhan et al. [1] | 2021 | This manuscript includes both an on-chain and off-chain permissioning scheme for energy users through the Orion and Metamask wallets. | SIt uses Hyperledger Besu and Istanbul Byzantine Fault Tolerant (IBFT) 2.0 consensus algorithm to implement contract. | Scalability. | No |
Pang et al. [21] | 2022 | It gives a survey in detail on recent developments on the security of NCSs deception attacks. | Security incidents reported in recent years are reviewed and a couple of prevailing cyberattacks are analyzed. | Related to deception attack only. | No |
Proposed Approach | 2023 | To design and propose an efficient blockchain-based peer-to-peer energy trading system with Corda services and cyberattack mitigation. | Transaction explorer, vault query explorer, CPU usages, JVM memory, flow started, flow stopped. | Fault tolerance. | Yes |
Requirements | Specification |
---|---|
Operating system | Ubuntu Linux 18.04 (16 GB RAM) (64 bit) |
Java | Java 8 and JDK |
R3 Corda | VS Code-Extension Corda 0.0.3 |
Developer tool | IntelliJ IDEA 2021.3 |
cURL tool | Version 7.74.0 |
Docker engine | Version 17.06.2 |
Node JS | Version 10.21 |
NPM | Version 6.14.4 |
VS code | 1.49.1 |
Grafana Prometheus Dashboard (performance measurement) | 7.5.2 |
Node Name | Flows Started | Flows Completed | CPU Usage | JVM Memory Usage (Heap) | Notary Flow Duration (5 m) | Uptime in Minutes | ||
---|---|---|---|---|---|---|---|---|
Max. | Avg. | Max. in MB | Avg. in MB | |||||
Producer | 0 | 0 | 31.17 | 8.17 | 408.5 | 316.8 | 0 | 15 |
1 | 1 | 10.79 | 4.58 | 408.5 | 321.0 | 1 | 30 | |
109 | 109 | 39.73 | 9.86 | 411.0 | 343.7 | 0.22 | 45 | |
404 | 400 | 5.81 | 5.54 | 167.39 | 158.86 | 0.8 | 60 | |
Consumer | 0 | 0 | 30.00 | 7.93 | 412.4 | 315.0 | 0 | 15 |
1 | 1 | 8.39 | 4.13 | 415.1 | 312.3 | 1 | 30 | |
90 | 89 | 16.87 | 6.67 | 419.3 | 345.7 | 0.22 | 45 | |
410 | 416 | 5.71 | 4.89 | 166.87 | 154.11 | 0.8 | 60 | |
Notary | 0 | 0 | 28.97 | 7.64 | 406.5 | 312.3 | 0 | 15 |
1 | 1 | 5.93 | 3.84 | 415.3 | 316.8 | 1 | 30 | |
96 | 96 | 12.66 | 5.56 | 410.2 | 327.5 | 0.22 | 45 | |
392 | 398 | 6.57 | 5.88 | 165.25 | 152.35 | 0.8 | 60 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Pradhan, N.R.; Singh, A.P.; Sudha, S.V.; Reddy, K.H.K.; Roy, D.S. Performance Evaluation and Cyberattack Mitigation in a Blockchain-Enabled Peer-to-Peer Energy Trading Framework. Sensors 2023, 23, 670. https://doi.org/10.3390/s23020670
Pradhan NR, Singh AP, Sudha SV, Reddy KHK, Roy DS. Performance Evaluation and Cyberattack Mitigation in a Blockchain-Enabled Peer-to-Peer Energy Trading Framework. Sensors. 2023; 23(2):670. https://doi.org/10.3390/s23020670
Chicago/Turabian StylePradhan, Nihar Ranjan, Akhilendra Pratap Singh, S. V. Sudha, K Hemanth Kumar Reddy, and Diptendu Sinha Roy. 2023. "Performance Evaluation and Cyberattack Mitigation in a Blockchain-Enabled Peer-to-Peer Energy Trading Framework" Sensors 23, no. 2: 670. https://doi.org/10.3390/s23020670
APA StylePradhan, N. R., Singh, A. P., Sudha, S. V., Reddy, K. H. K., & Roy, D. S. (2023). Performance Evaluation and Cyberattack Mitigation in a Blockchain-Enabled Peer-to-Peer Energy Trading Framework. Sensors, 23(2), 670. https://doi.org/10.3390/s23020670