Next Article in Journal
A Hybrid Approach for Low-Voltage AC Series Arc Fault Detection
Next Article in Special Issue
Impact of Electric Vehicle on Residential Power Distribution Considering Energy Management Strategy and Stochastic Monte Carlo Algorithm
Previous Article in Journal
Toward the Instrumentation and Data Acquisition of a Tidal Turbine in Real Site Conditions
Previous Article in Special Issue
Production and Assessment of New Biofuels from Waste Cooking Oils as Sustainable Bioenergy Sources
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Proof of Work Consensus Based Peer to Peer Energy Trading in the Indian Residential Community

by
Vikash Kumar Saini
1,†,
Chandra Shekhar Purohit
1,†,
Rajesh Kumar
2,*,† and
Ameena S. Al-Sumaiti
3,†
1
Center for Energy and Environment, Malaviya National Institute of Technology, Jaipur 302017, India
2
Department of Electrical Engineering, Malaviya National Institute of Technology, Jaipur 302017, India
3
Advanced Power and Energy Center, Electrical Engineering and Computer Science, Khalifa University, Abu Dhabi 127788, United Arab Emirates
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Energies 2023, 16(3), 1253; https://doi.org/10.3390/en16031253
Submission received: 5 December 2022 / Revised: 6 January 2023 / Accepted: 16 January 2023 / Published: 24 January 2023
(This article belongs to the Special Issue Energy for Sustainable Development and Circular Economy)

Abstract

:
Rooftop solar power generation is becoming more widespread in residential microgrids. As well as new concepts of electricity markets, such as peer-to-peer (P2P) markets, where consumers and prosumers can directly exchange locally generated energy with each other without any intermediary third party for sustainable development. Data security is a big concern with energy trading; therefore, blockchain technology is being used more and more in energy markets. It has the potential to simplify P2P energy trading. In this paper, blockchain is designed to fit into the decentralized nature of the P2P market, securing the payment mechanism and transaction data store. The blockchain-enabled platform is developed using the Proof-of-Work (PoW) consensus algorithm, and is verified with the help of the Postman application programming interface (API). All transactions involving the buying and selling of energy are handled by a miner without the help of any third parties. The study of a five-user residential community, whether the strategy is recommended or not, is validated through simulation findings. An overview of the results revealed that all users benefited from the developed, secure P2P platform.

1. Introduction

1.1. Motivation and Bibliographic Review

The environment is constantly changing, and this change brings with it innovation and efficiency. Change, innovation and progress have resulted in damage to the ecology and climate around us. The ozone layer has been damaged as a result of increasing CO 2 emissions. In addition, other hazardous gases, especially those from fossil fuels, have had a significant impact on climate. Due to the rapid change of climate, high-level reforms should be made to keep the earth. Because of this, in recent decades, the world has shifted from the traditional use of fossil fuels to the use of renewable green eco-friendly resources [1,2,3,4,5]. These days, renewable energy sources are the talk of the world, and their economy is visible [6,7].
The importance of producing clean, renewable energy is essential to ensure a sustainable environment for future generations [8]. P2P energy trading systems are a small step in this direction, which could help the achievement of the sustainable development goals. Energy trading platforms that trade energy among peers focus on efficiency and sustainability. Peers generate all their green energy and distribute it through a peer-to-peer trading system. P2P trading platforms can distribute energy efficiently between the peers. Peers are free to choose any local energy source of their choice, solar panels or wind turbines. As a result of this assumption, the energy system has its grid infrastructure and technologies in a way that includes web-based apps to ensure that users of the grid can access it easily [9]. They leverage block chain technologies to create an open and state-of-the-art internet-based decentralized platform for the exchange of energy data where buyers, sellers, energy producers and energy dealers can easily communicate and work together. In this way, P2P platforms supports sustainable development goals [10].
In the existing energy market system, distributed generation resources and consumer-owned generators (i.e., prosumers) are increasing continuously [11]. The surplus renewable energy produced by producers is supplied directly to the grid. In return, producers obtain some economic incentive depending on the amount of surplus PV electricity supplied to the grid. In addition, it depends on the tariff plan of the different countries and distribution network operators (DNO) [12]. However, the incentives are very small compared to the cost incurred during PV power generation. Consumers do not obtain any incentive to take electricity from the grid; instead, they pay a very high price for the supply of electricity [13]. Therefore, neither the producers nor the consumers are obtaining any benefit in this energy market system. This issue may be overcome by the coming P2P market [13]. In this market, energy is exchanged directly between the two prosumers using the existing electrical grid network without going through a third party (i.e., distributed network operator (DNO)) [14]. In energy trading, peers only use the local network. In energy trading, peers only use the local network, and instead pay network fees or service charges directly to the DNO. In addition, there is no involvement of DNO in decision-making and other planning. Thus, other charges are not applicable on the energy trading platform. Consequently, when there is no third party, there will be no charges other than network charges. This would lead to more incentives for producers and lower costs for consumers.
To achieve energy-related goals, users of a P2P network can share their resources (such as storage space and renewable energy) with their peers. Maximizing the use of renewable energy sources, reducing network maintenance and capital expenditure, reducing peak loads, and minimizing electricity costs are some examples of such goals. Each peer can interact directly with other users of the network without going through a middleman controller, and each user can be either a supplier or a buyer of network resources or both. In addition, a new peer may be added to the network or an old peer may be removed without changing the way the system operates.
Numerous research studies are being conducted to investigate the opportunity of P2P energy trading among various prosumers because of the possible advantages. A prosumer with an energy demand can be taking benefit from other prosumers in their community who have an energy surplus by purchasing the extra energy at a significantly lower price on a P2P trading platform [15]. In Ref. [16], in contrast, prosumers can buy or sell energy from each other under the Feed-in-Tariff scheme that will encourage buyers to buy energy to reduce their electricity costs while maximizing profits for the seller. In Ref. [17], peer-to-peer (P2P) trading platforms use a continuous double auction architecture as the market mechanism. Ref. [18] recommends an auction method based on a hybrid double auction framework that makes it easier for micro-grids to trade energy. It employs a hybrid optimization technique combining model genetic algorithms (GA) and particle swarm optimization (PSO), in order to clean up the auction market. In Ref. [19], the P2P energy trading market based on double auction architecture has been introduced which operates on an hourly forward basis. In Ref. [20], a P2P energy trading network designed based on a non-cooperative and cooperative game theory. A multiagent based P2P energy trading platform is discussed in [21].
Furthermore, various ongoing existing P2P platforms for local energy trading have been presented in Table 1. Yeloha and Mosaic, Vandebron, Piclo, and SonnenCommunity are the regional and national level trading platforms that support the trading between peers, and the owner of the platform acts as a supplier in the energy market. These platforms did not consider Information Communication Technology (ICT). The unit electricity price is changed from time to time in the Vandebron and Piclo platforms for consumers and generators. The importance of energy storage technology is incorporated with the SonnenCommunity platform. Smart Watts and PeerEnergyCloud are ICT based platforms that are more reliable for local P2P energy trading and have proposed various business scenarios for energy trading. The advancement of ICT technology is the primary innovation with these platforms. Finally, Brooklyn Microgrid, Lumenaza, TransActive Grid, SOLshare, Centrica plc and Electron platforms addressed the blockchain technology into energy trading fields to simplify the process of metering and billing in the energy markets. However, the TransActive Grid platform is more interested in introducing a local energy trading market in residential communities.
A significant research gap has not been explored in the literature: how to develop a reliable trading platform without a central controller for energy trading amongst many peers in a community that will guarantee their broad and long-term participation in the electricity market. Therefore, it may not be easy to get prosumers to collaborate and put their trust in one another while exchanging energy. The biggest obstacle to P2P market design is the lack of trust and transparency in trading between peers within the community [36]. The P2P trading network needs to be supplemented by a secure and reliable distributed system that keeps track of all transactions in a way that is immutable, visible, and tamper-proof. Secure transaction approaches are required in local energy trading to secure the openness and reliability of each transaction process for each user [37].
To overcome these difficulties, P2P energy networks typically consist of a virtual trading layer and a physical transfer layer [32,38,39,40]. The virtual trading layer fundamentally imitates a local electricity market, where participating peers of the network communicate crucial data to determine the resource type, resource amount, and price per unit of resource exchanged with another. A virtual layer must be designed upon secured data (i.e., blockchain based layer [41]) that can enable transparent and decentralized transactions. Automation, security, and transparency are all made possible by blockchain technology. The microgrid level blockchain enables trading platform is designed in [42], and the result presents that the system will no longer rely on a centralized system to trade energy.
The money transaction and energy exchange information is collected in the physical layer after the completion of buying and selling bids matching between peers. Furthermore, the physical layer is utilized for actual energy transactions between peers. This layer may either be a system operator or a distribution network operator. It is important to note that the peers of the virtual layer do not immediately influence financial transactions based on how the power is physically distributed. In actuality, the buyer pays the seller to begin the process of transferring the seller’s renewable energy into the distribution system.

1.2. Aim and Contribution

In this work, a secure blockchain platform designed based on Proof-of-Work (PoW) for the P2P energy trading in the local community. Blockchain reduces the centralized control of organizations responsible for authenticating transactions. This requires a properly functional consensus process to maintain the trustless, immutable, and distributed properties of the network [43]. The two primary consensus technologies currently employed in blockchain-based secure energy trading are PoW and proof-of-stake (PoS), which independently validate transactions. In PoW, miners must spend a lot of money on electricity in order to process a block on the network and solve challenging mathematical puzzles. The machines that produce digital assets through the mining process, which is the process of verifying transactions, are powered by energy. The use of energy is also essential to the security of the network as it enables it to maintain accurate transaction records and adhere to predetermined, reliable monetary policy. Proof-of-work consensus has been incorporated into the bitcoin system, and it is able to mine additional blocks [44]. Furthermore, it maintains the security of the network as it would require a malicious actor to have 51% of the network’s computing power to attack the chain [45]. Miners will have to choose whether to switch to the new split blockchain network or support the original blockchain if the blockchain is forked under the PoW system. To keep up with both, a miner would have to split his processing power between the two fork sides. Proof-of-work systems inherently prevent further forking and incentivize miners to choose the side that does not want to destroy the network by providing financial incentives [45,46].
Despite the advantages mentioned above, PoW can be extremely costly and resource inefficient. Miners may have to deal with a variety of costs, including digital infrastructure equipment that depreciates rapidly [36]. Furthermore, when the network is congested, the transaction costs of the system are high. Having more blocks and miners requires a larger amount of computational mining power. The cost of mining will be expensive as a result of the high energy consumption [47]. To address this issue, proof-of-stake (PoS) [48] has been introduced, modifying the mining probability such that it now depends on participant stake. PoS-based systems are also far more scalable than PoW-based systems and authorize transactions more quickly [49]. By adjusting the system’s parameters or modifying its consensus process, the system can scale to handle more transactions per second than typical existing systems [50]. By reaching a consensus before blocks are created, PoS networks are able to handle thousands of requests per second with latency of less than a millisecond. Decentralized trading systems are implemented in this way, and the computational load is reduced.
On the other hand, Proof-of-Stake has its own unique set of difficulties. For example, the largest token holders still have the ability to control the network. Early adopters and wealthy individuals benefit the most. In contrast to proof-of-work [46], this paradigm lacks a performance history. In addition, forking is not always discouraged in PoS systems. When the blockchain splits, the validators will receive a duplicate copy of their stake on the newly forked blockchain. When a validator authorizes both sides of the fork, they may be able to double spend their coins and double in transaction fees [51].
The above justifications make it clear that both the consensus processes have advantages and disadvantages. Although they all work towards the same basic goal, they employ different strategies to get there. The key difference between the two consensus systems is that transaction verification is delegated and rewarded [52].
The requirements of a network determine the type of agreement that is necessary i.e., fraud prevention, network security and trust-building all require PoW [53]. Due to the security provided by PoW, miners cannot be misled about transactions. Proof-of-work is a technique for protecting the transaction history of a crypto asset, as well as making it more difficult to change data over time [46]. Participating nodes must prove that the task is finished and submitted in order to be approved for adding new transactions to the blockchain, protecting against any malicious behavior [54]. PoW helps in locating the most trusted copy of the blockchain when there are multiple versions on the network. The development of a distributed clock that allows miners to freely enter and leave the network while maintaining a constant operation rate is also dependent on proof of work. Similarly, using POS-based technology has a significant impact on network performance and security. PoS is used when on-chain transactions per second and actual network transfer settlement calls for higher transaction speeds [43]. Furthermore, validators are likely to own a sizable amount of network tokens, which provides them with a financial incentive to maintain the security of the chain [44].
The small scale network has been considered in this study. Therefore, the authors have not considered transactions per second and higher transaction speed for actual network transfer settlement have not been considered in this work. Additionally, the focus of the paper is on security, fraud prevention, and trust-building in networks. Therefore, to achieve this, the paper employs a proof-of-work consensus mechanism, allowing the network to agree on which transactions are valid. Each node in the microgrid is divided into two groups: prosumer that are able to generate their own renewable energy and consumers who need electricity to meet their demand. Additionally, this study assumes that each node is a smart house with IoT devices connected to the Internet and energy storage that can store the energy generated from PV systems. The energy storage architecture is considered in a decentralized manner. The home miner can manage Energy Storage System (ESS) devices as well as track the energy consumption profiles. Prosumer miners have excess energy, so they can participate in energy trading using a private blockchain according to a pre-determined smart contract script. This study focuses on developing countries’ (India, Pakistan, Bangladesh, Brazil, Kenya, Colombia and the Philippines, etc.) scenarios, which have sufficient renewable generation and digital infrastructure. The main research objective of this study is as follows:
  • A blockchain platform developed using a PoW consensus algorithm application with a proper mining mechanism for energy training services;
  • Developed trading platform validated with a case study and analyzed energy trading digits;
  • One-day electricity cost has been calculated for each user with decentralized energy storage architecture and also compared the benefits of the platform over traditional prosumers/consumers to local grid trading.

1.3. Paper Framework

The rest of the study organized as follows: Section 2 describes the various taxonomy of the simulation work with PoW consensus algorithm. In Section 3, develop a blockchain platform for energy trading between prosumer and consumer. Section 4 presents a case study for a validated developed blockchain platform. Section 5 show the implementation of blockchain for the energy trading process. Section 6 presents the results of this research study. Finally, Section 7 brings the essay to a close.

2. Taxonomy of Simulation Work

2.1. Terminology of Blockchain

2.1.1. Layers

Two layers comprise a P2P distributed energy network. The first layer is composed of physical energy networks, while the second layer is composed of virtual energy trading networks [55].
  • Physical Layers: The physical layer is utilized for actual energy transactions between peers. This layer may either be a system operator or a distribution network operator. It is important to note that the peers of the virtual layer do not immediately influence financial transactions based on how the power is physically distributed
  • Virtual Layers: The blockchain-based architecture of the local energy market is provided by the virtual layer energy trading platform, through which all types of data are transferred. For instance, peers’ data on electricity generation, consumption, and demand are transmitted to the virtual layer via smart meters over a communication network. All buy and sell requests are submitted on the virtual layer, where they are matched and accepted, payments are made between peers, and energy is traded on the physical layer. Financial exchanges take place on a virtual layer and have no impact on how energy is physically transferred.

2.1.2. Peers

Peers are those who trade additional renewable energy generated in the neighborhood or inside the network.

2.1.3. Node

Data blocks are linked together to form a blockchain. These data blocks are placed on the nodes of the network. Nodes can be any size or shape (mostly computers, laptops, or even larger servers). Nodes are the foundation of the architecture of a blockchain. Each node on the blockchain is interconnected and regularly exchanges the latest blockchain data, ensuring that each node is always up-to-date. Nodes store, distribute and protect blockchain data. A full node is essentially a piece of equipment (like a computer) that keeps an up-to-date copy of the transaction history of the blockchain.

2.1.4. Miner

Blockchain mining is the process of adding transaction records to the blockchain to secure and verify them. This process of adding blocks to the blockchain enables the processing of transactions and the secure movement of money. This process of blockchain mining is carried out by a global network of individuals called “blockchain miners”. Transactions are first digitally signed and issued by the user, and then transmitted over the blockchain network for verification. This process is known as mining. Miners verify the validity of users and transactions. Verification is a competitive process, as the miner who validates the new block first broadcasts it. The last nodes in the chain validate the broadcast block by stopping mining on that block.

2.2. Consensus Algorithm: Proof of Work (PoW)

According to Bitcoin [56,57], the PoW mechanism searches for a value whose calculation begins with a specific number of zero bits in the hash. To achieve this, a nonce is multiplied by the initial value until the resulting hash starts with the required number of zero bits. After nonce is found and proof of work is received, the block cannot be updated without having worked for that specific block and all subsequent blocks.
Each block has a hash, except for the first block generated by the system (genesis block), which is made up of the hash of the previous block and is not necessary to create the appropriate zero bits, as shown in Figure 1. The hash of the originating block is composed entirely of zeros because it does not contain any preceding blocks.
The proof-of-work protocol is used by Bitcoin 2 to ensure that each participating node is on the same branch of the blockchain [58]. The protocol requires nodes to complete a challenging computing task before a new block is proposed. The node finding the solution initially mines the new block and transmits the information to other nodes in the network so that they can use the data in the block to quickly verify its accuracy. This is because all previous hash values inside the blockchain must be known in order to have valid hash values in future blocks. A single block in history can be modified by an attacker, altering the block hash and rendering the entire successful blockchain invalid. When multiple users verify a block simultaneously, which is highly unusual, the network splits until new blocks have been mined, after which all nodes converge to the most recent longest list of blocks.
A detailed description of the PoW algorithm is presented [56,59]. The bitcoin network employs PoW as a consensus method [60]. In a decentralized network, one has to choose to track the transactions. Random selection is the simplest method; however, it is vulnerable to attack. Thus, if a node wants to publish a block of transactions, it will take a lot of work to prove that the node’s network is unlikely to be attacked. In most cases, the work involves computer computation.
As presented in Figure 1, the blockchain architecture is made up of a series of blocks. This indicates that each block, except the genesis block, has a relationship with the previous block header hash value (“preBlockHeaderHash: h()”). Additionally, each blockchain block consists of two components: a block header and a collection of transaction data. Each node in the PoW network determines a block header hash value.
The block header contains pre, nonce, transaction counter, and Merkle tree parameters. Pre stands for previous block header hash function, nonce for PoW solution of the block. R i stands for the root of the Merkle tree, which is produced by the transaction counter.
A block header hash value is determined by each node in the PoW network. According to Figure 1, block headers contain a nonce and minors, which are regularly changed to generate different hash values. The estimated value, by contract, must be less than or equal to the specified value. When a node receives the required value, it broadcasts the block to all other nodes, which must then independently verify that the hash value is correct. If the block is genuine, then other miners will add this new block to their own separate blockchain. The PoW mechanism in Bitcoin is referred to as mining, and the nodes that determine the hash value are called miners. A valid block can be produced concurrently in a decentralized network. When multiple nodes search for the relevant nonce, it is unlikely that two conflicting forks will simultaneously produce the following block. In PoW protocols, a chain that gets longer is considered real. The mining process continues until a long branch is found. The amount of computer power used by miners uses up a lot of resources. In an effort to mitigate the risks, some PoW technologies have been created that allow some possible side-applications.

2.3. Smart Contracts

A smart contract is a piece of computer software that allows two peers to make real-world contracts. A computer language such as solidity is used to build a smart contract. It comprises an application of logic and an execution condition. When a peer begins a transaction that meets the circumstances, these execution requirements are immediately invoked [61]. The blockchain only keeps the data associated with a smart contract after it is activated. The smart contract [62] is kept in an immutable state by each peer. Smart contracts are used by the majority of blockchains with permission. In contrast to a permissionless blockchain like Bitcoin, where anybody may participate, the members of a permission blockchain are known in advance. It enables the setting of rules governing the blockchain’s operation.

2.4. Data

Data are the most basic need for a block to be recorded on the blockchain. It can be in any format, such as text, audio, video, and potentially other smaller blockchains may all be included. The data we are using are unique to this study. The following attributes are included in the data set:
  • Sender: This area will include the contact details for the information supplier. The user’s unique profile ID will help in supplier to tracking and preservation;
  • Receiver: This section will include the contact information for the buyer. The user’s unique profile ID will help in tracking and keeping track of collecting information, as well as calculating the amount of energy used on a daily basis using data analysis;
  • Transaction: The amount of information exchanged between sender and receiver, known as transaction;
  • Amount Paid: The amount paid in exchange for information. Payments can be made in our blockchain’s native coin, but we also want to include actual money. Real money will have its fundamental worth and will not fluctuate like cryptocurrencies;
  • Timestamp: Timestamping is a key component of blockchain technology that is integrated automatically and categorizes all transactions chronologically;
  • Nonce: A nonce is just a random number generated until the required value is discovered; it is utilized in the Proof of Work process mentioned in the next paragraph.

2.5. Software Platforms for Development

The exact software tools needed to implement the proposed concept are a significant problem. During the research stage, many tools have been investigated and evaluated, which is followed by numerous upgrades. Finally, the following software applications have been chosen.

2.5.1. Postman Tool

Postman is a scalable API testing software tool that integrates rapidly into CI/CD pipelines. APIs enable interoperability between software programs by facilitating API calls.
  • GET Request: Information can be retrieved from a given URL using get requests. The endpoint will not be altered in any way;
  • POST Request: Post requests differ from Get requests in that the user adds data to the endpoint, which involves data modification.

2.5.2. Windows Visual Code

On your desktop, Visual Studio Code (VSC) is a small-but-powerful source code editor for Linux, macOS, and Windows. In addition to a huge community of extensions for additional languages and runtimes (including Java, C++, C#, PHP, and Python, etc.), it has built-in support for Node.js, TypeScript, and JavaScript.

2.5.3. Git Bash

Git Bash is a program that imitates the Git command line on the Operating System. It is a command-line shell for enabling git via the system’s command line. A shell is a type of terminal program that allows users to communicate with an operating system via typed commands. Git Bash is a package that installs Bash, several commonly used bash programs, and Git on Windows. The user interacts with the repository and git elements via commands in Git Bash.

2.5.4. Node.Js

Node.js is a framework for quickly building scalable and agile network applications and is based on the JavaScript engine in Chrome. Node.js is fast and efficient because of its event-driven and non-blocking I/O architecture. As a result, it is ideal for real-time, data-intensive applications.

3. Development of the Blockchain Platform

This framework enables a network to be created with any arbitrary number of nodes. When it is first started, each node has a set of neighbors, although after startup, nodes in this list can be added or removed. Each node selects its local blockchain state, active transaction log, and a group of neighbors. Each node also acts as a miner for the network. In order to mine new blocks and develop their blockchain first, miners always work to solve proof-of-work. A miner notifies his neighbors when he has successfully mined a new block. The information is shared asynchronously, and the miner immediately starts working on the next block. Different nodes may receive information in different orders because the information is distributed asynchronously. Assuming that the two nodes are executing as separate processes on the same system and are using ports as stand-ins for their physical locations, the network delay between them is measured by the difference in their port numbers. Each node exposes multiple HTTP endpoints that can be used to exchange this information to contribute new data, such as transactions or new blockchains. Additionally, these queries are completed asynchronously to avoid interference with mining operations. Nodes validate a new blockchain upon receipt, and if the new blockchain is longer than their current version, they update their copy. Some transactions may go uncommitted during the merge process; as a result, nodes merging the blockchain keep track of any such transactions and add them back to the list of pending transactions. To provide their state information, nodes also provide other HTTP endpoints. These are used to implement network-built visualization tools. The development stages of the blockchain platform are as follows:
  • Node Connection/ Making Peers: First, connect the virtual node to our window by sending a POST request to the Postman API Tool, as shown in Figure A1 in Appendix A. Nodes can be of any type, primarily computers, laptops, or even larger servers. Initially, three virtual nodes are created at a Windows server computer’s IP address (“http://127.0.0.1:”). Each node has a unique ID, 50001 to 5003, as shown in Figure A2 in Appendix A. All nodes on a blockchain are connected and regularly exchange updated blockchain data.
  • Block and Blockchain: The block is the fundamental unit of a blockchain. A blockchain data structure is built by linking these blocks in a sequential sequence. Hash, data, and previous hash are the characteristics that make up the block as shown in Figure A3 and Figure A4 in Appendix A.
  • Mine Block: The basic structure of the blockchain is shown in Figure A5 in Appendix A, i.e., it has a transaction or genesis block which is predefined in any blockchain network because, initially, its index value is 1. The adding process of transaction index value is shown in Figure A6 in Appendix A. The transaction index increases after mining, which means that the transaction is added to the block. To add a transaction to a block, one must first mine that transaction as a fundamental principle of blockchain technology, as shown in Figure A6 in Appendix A. In the mining process, it solves some mathematical equations to add up the transactions in the stipulated time. The miner obtains a reward after each successful mining of a transaction that is being added to the block. By using GET request, we mine the block in the blockchain using postman API.
  • Adding a Transaction: In the Postman API, a transaction is created using JSON format as shown in Figure A7 in Appendix A by using a POST request. However, if we request to obtain a chain in Postman API, it will not add that transaction to the blockchain as shown in Figure A8 in Appendix A. Because a fundamental blockchain principle states that any transaction will be added to the block after the mining process, and because we did not mine our block, the transaction was not added to the block. After the mined, the block transaction is added in the blockchain as shown in Figure A9 in Appendix A.
  • Actual chain: After adding a transaction to the blockchain, we obtain the actual chain using a GET request in the Postman API. As a result, in Figure A10 in Appendix A, a complete transaction added from the mining reward to the genesis block is presented in that blockchain. It shows this by using this timestamped transaction with a different nonce value. We can create an energy trading platform using these back-end programs. It shows the basic development of blockchain architecture using these software tools. These types of transactions occur in energy trading between nodes, and that’s how we secure the trading data using blockchain technology.

4. Case Study

In this study, a local energy network is made so that people in the same area can share energy. All the houses are interconnected, and they can communicate and share energy among themselves. The per-day electricity cost of a community house is calculated in two scenarios. Scenario: 1 shows that all the homes in the community are connected to the grid and that the grid can meet all the homes’ needs at grid prices. Scenario: 2 houses have PVs installed, and they trade their extra PV power with their neighbors safely.
Scenario: 1 The electricity purchase cost from the grid to meet the jth consumer’s demand presented in Equation (1):
G j = t T α t d j , t
Scenario: 2 Prosumer investment and operation cost determined in this scenario. The main goal of Prosumers is to minimize the total investment and operating cost. The overall total cost T C j of jth prosumer is represented in Equation (2):
T C j = I j + O j + G J , t
The I j and O j are the present investment cost and operating cost of the jth prosumer, respectively. Power capacity and energy storage capacity combined make up the daily investment cost of the jth prosumer’s energy storage system, as presented in Equation (3):
I j = r 365 ( 1 1 + r y ) c P P j c a p + c E E j c a p
The power capacity and energy capacity of the energy storage device are taken into separate consideration while calculating the investment cost. The cost of energy capacity mostly comprises the cost of energy storage devices, while the cost of power capacity primarily involves the cost of an energy conversion converter. The j t h prosumer benefits from energy shifting because its reduced overall operating cost is equal to the sum of the cost of energy received from the grid when PV generation is insufficient to meet j t h prosumer demand and the revenue from energy sold back into the grid or traded with peers:
O i = t T Δ t α t d j , t + P j , t C P j , t D P j , t p v + + β t d j , t + P j , t C P j , t D P j , t p v
s.t.
0 P j , t C P j c a p
0 P j , t D P j c a p
E j m i n E j , t E j m a x
E t j , t = E t j , ( t Δ t ) + Δ t η C P j , t C + P j , t p v + P j , t D η D
The energy storage charging and discharging limit are presented in Equations (5) and (6), respectively. The minimum and maximum energy limit of the energy storage during the operation is presented in Equation (7). The present state of energy storage has been tracked between successive time interval using Equation (8) considering charging and discharging efficiency.

4.1. Case Study Data

The data for this study are taken from five consumer residential societies of IIT Bombay [63]. In the five houses, three are the consumers represented by C 1 , C 2 , and C 3 and two are the prosumers which are represented by P 1 and P 2 . The prosumer have installed 5 kW and 2 kW rooftop solar power systems. Prosumers have installed battery energy storage at their premises. Energy storage helps to prosumers for maximum uses of generated PV power. Additionally, it reduces the need to rely on the grid during periods of high demand. The technical specification of energy storage has been presented in Table 2. The deep learning model i.e., LSTM has been used in the day ahead forecasting. The LSTM model is more capable of capturing nonlinearity of data pattern and gives the better accuracy as presented in Refs. [64,65]. The performance metrics of the forecasting results are presented in Table 3 and Table 4 without assessment of input data uncertainties. The forecasted PV power generation profile has been shown in Figure 2 for a specific day (11 May 2017). The forecasted demand profile of individual consumers has been shown in Figure 3, and observed that consumer C 3 has large demand; therefore, it will participate in a local energy sharing market to reduced their energy bill. The day ahead forecasted electricity grid price profile has shown in Figure 4, which is taken from an IEX web portal [66]. The prosumers P 1 and P 2 have excess energy after fulfilling their own demand compared to both prosumers that will participate in the energy sharing process.

4.2. Simulation Assumptions

The simulations assumptions of this study for the users include how they are shared energy in the community and how blockchain technology can be used with energy-sharing digits. The energy trade will be conducted on the basis of their excess PV power generation and demand. There are certain assumptions made for this approach as follows:
  • The energy trading price assumed 2.10/KW for the selected day, which is the 10 % less to one day average electricity price. It will be updated for each day, but the fixed for the whole day;
  • The prosumer will first meet his own demand; then, if the PV power generation is excess to the demand, then the trade will be executed;
  • The prosumers must have a minimum of 0.5 kW of excess PV power to participate in the trading process;
  • The installed storage capacity at Prosumer miners’ homes is equal to the required energy to meet the demand. Therefore, after the charged energy storage, and they sell excess PV power to consumers in PV hours;
  • In this study, the 9:00 a.m. to the 5:00 p.m. time interval has been assumed for the trading.
  • We have 5 kW and 2 kW PV power generation units on two prosumers.
  • If a prosumer has no excess PV power equal to the demand of all consumers, he will first trade the one that has higher demand.

5. Implementation of BlockChain for Trading

Based on the platform built in Section 3, the blockchain-enabled platform is used to trade energy with a neighborhood of five homes. First, five virtual nodes are created at the Windows Server computer IP address (“http://127.0.0.1:”). The nodes are displayed from a separate screen, as shown in Figure 5. Each node has a unique ID as shown in Figure A2. Consumers ( C 1 , C 2 , and C 3 ) and Prosecutors ( P 1 and P 2 ) are the blockchain miners of the trading process. The node IDs are 5001 and 5002, which represent the charger miners P 1 and P 2 , respectively. Consumer miners C 1 , C 2 , and C 3 are assigned the remaining IDs 5003, 5004, and 5005. All nodes on a blockchain are connected and regularly exchange updated blockchain data.

Energy Trading Process

The prosumer miner continuously tracks its own consumption and available energy in its energy storage. If the prosumer miner finds that the energy available in the storage is insufficient, and is less than the specified required amount. According to the specified terms and conditions of the smart contract, the trading process will start between P-1 and P-2 miners. When the energy storage is fully charged and excess PV power continues coming from solar, then prosumer miners can trade excess PV power generation to consumer miners at a defined trading price to generate revenue. Consumer miners are also interested in buying energy from prosumer miners at less than grid prices. In this way, miners participate in the trading process to reduce their electricity costs or generate revenue. The implementation guidelines for miners are as follows:
  • P-1 and P-2 miners must register in the smart contract, which contains the terms and conditions of the transaction, in order to sell energy. The smart contract is added to the block once the PoW has been validated;
  • Consumer and prosumer miners both contribute to the finalization of transaction prices and the script of laws and regulations. The price and transaction processing are added to the block after the PoW is validated;
  • The matching transaction starts once the consumer’s miner alerts the consumer miner of his wish to make a purchase if he notices a demand for energy;
  • The energy transaction is finished if the transaction matching is successful. As a consequence, consumer miners obtain energy, and prosecutor miners profit from this.

6. Results and Analysis

In this section, energy trading digits between miners are presented with blockchain data. In addition, prosumers’ and consumer miners’ one-day electricity costs have been calculated in two scenarios. The blockchain enables P2P energy trading and has been considered in Scenario: 2. The detailed analysis of the results is as follows:

6.1. Energy Trading Digits

Transactions between nodes in relation to time are shown in Table 5, with consumer miners being the first to trade with consumer miners with maximum demand. Table 5 presents the amount of energy traded between miners and their total cost based on a predetermined selling price. The total energy traded from individual consumer miners to individual consumer miners is presented in Table 6. The PV power output of P 1 miners exceeds their required energy demand. Therefore, trading points are higher with individual consumer miners than with P 2 miners. Figure 6 shows aggregate demand, PV power demand, peer demand, and grid power numbers for individual miners. Maximum energy trading by P 1 miners, as P 1 miners have more PV power capacity than they demand.

6.2. Blockchain with Trading Data

As discussed earlier in Section 3, the trading points of all transactions between connected nodes will be stored on the blockchain for the privacy and security of the users. Through that process, transactions are added to the blockchain, so that these transactions are tamper-free and the assets of the blockchain cannot be changed. Transaction points are stored in the blockchain as a sender (consumer) amount and a receiver (consumer) amount. Digits are stored on the blockchain with value, as shown in Figure A11. The actual timestamp also stores the index value, previous hash function value, and sender and receiver sum digits.

6.3. Economic Analysis

The electricity cost for a day has been calculated based on the respective prosumers and consumers of PV power generation and demand, as presented in Table 7. In Scenario: 1, the total cost of the users is calculated based on the demand of the respective users. In Scenario: 2, the total one-day electricity cost has four components. The investment cost only applies to prosumers because they have installed the PV and battery at their residence. The cost of energy to buy off the grid applies to each user. However, P-1 and P-2 store the additional PV power in a storage system and use it when needed, so their grid cost is zero. The operating cost or revenue of storage also applies to P-1 and P-2. This component is negative, meaning they received revenue from additional energy sold to C-1, C-2, and C-3. The net electricity cost for P-1 and P-2 is negative, excluding investment costs, meaning that P-1 and P-2 make a profit by trading excess energy with their peers. The net electricity cost for C-1, C-2, and C-3 is derived by combining the cost of energy from the grid with the cost of energy from peers. In Table 7, the net electricity cost for the day specified in Scenario: 2 is lower than in Scenario: 1.

7. Conclusions

In order to reduce the dependency for trusted peers to transactions and improve the authenticity and reliability of data, this study was started to build an energy trading platform among nodes in a residential microgrid setting using PoW enabled smart contracts and blockchain technology. This study demonstrated that the trading platform offers both buyers and sellers the chance to generate positive profit through participating in the trading process. The findings of this study also indicate that the excess energy generated by each node can be exchanged effectively in the context of a microgrid with less assistance from a distribution system operator (DSO). Additionally, it has been seen that the payment module properly transfers funds to players’ accounts without the involvement of a third party. Additionally, the use of blockchain technology leads to the chaining together of transaction data into blocks. Thus, it becomes impossible to tamper with. In comparison to traditional database technology, it can be said that blockchain technology increases the authenticity and trustworthiness of data. The proposed study does not support undeveloped countries or rural areas of developing countries due to a lack of development in recent advancement in technology and digital infrastructure. This study has been conducted considering developing countries (India, Pakistan, Bangladesh, Brazil, Kenya, Colombia, the Philippines, etc.) scenarios, which have sufficient renewable generation and digital infrastructure.
At the transaction level, there are still several significant obstacles for blockchain technologies utilized in the electricity sector, despite the fact that numerous kinds of blockchain for P2P energy exchange have been copied or implemented in current times. Future research will thus concentrate on how blockchain technology might be incorporated into the technical operation of electricity grids. A transaction may be compared to a direct control system where the inputs are money, and the outputs are goods. This conviction drives us to concentrate on integrating blockchain technology into distributed control of power systems in order to increase the scope of potential application scenarios. In addition, overheating of transformation stations problem may include overcoming the DNO problems.

Author Contributions

Methodology, V.K.S., C.S.P. and R.K.; Investigation, R.K.; Writing—review & editing, V.K.S. and A.S.A.-S. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported in part by the Aspire Virtual Research Institute (VRI) program, Award # VRI20-07.

Data Availability Statement

Data available on request due to restrictions.

Acknowledgments

This is to acknowledge the value of NEP 3.0 program is supporting the leadership of Ameena S. Al-Sumaiti.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Blockchain Implementation Code

Figure A1. Node connecting using POST request.
Figure A1. Node connecting using POST request.
Energies 16 01253 g0a1
Figure A2. Different nodes of Blockchain.
Figure A2. Different nodes of Blockchain.
Energies 16 01253 g0a2
Figure A3. Construction of Block and PoW.
Figure A3. Construction of Block and PoW.
Energies 16 01253 g0a3
Figure A4. Construction of Blockchain.
Figure A4. Construction of Blockchain.
Energies 16 01253 g0a4
Figure A5. Obtain the current status of Blockchain.
Figure A5. Obtain the current status of Blockchain.
Energies 16 01253 g0a5
Figure A6. Mined a Block using GET request.
Figure A6. Mined a Block using GET request.
Energies 16 01253 g0a6
Figure A7. Adding a transaction.
Figure A7. Adding a transaction.
Energies 16 01253 g0a7
Figure A8. Transaction will not be added in a block.
Figure A8. Transaction will not be added in a block.
Energies 16 01253 g0a8
Figure A9. Transaction added after mining.
Figure A9. Transaction added after mining.
Energies 16 01253 g0a9
Figure A10. Actual chain after transaction.
Figure A10. Actual chain after transaction.
Energies 16 01253 g0a10
Figure A11. Sender and receiver amount digits in an actual chain.
Figure A11. Sender and receiver amount digits in an actual chain.
Energies 16 01253 g0a11

References

  1. Guzs, D.; Utans, A.; Sauhats, A.; Junghans, G.; Silinevics, J. Resilience of the Baltic Power System when Operating in Island Mode. IEEE Trans. Ind. Appl. 2022, 58, 3175–3183. [Google Scholar] [CrossRef]
  2. Hassija, V.; Chamola, V.; Garg, S.; Krishna, D.N.G.; Kaddoum, G.; Jayakody, D.N.K. A Blockchain-Based Framework for Lightweight Data Sharing and Energy Trading in V2G Network. IEEE Trans. Veh. Technol. 2020, 69, 5799–5812. [Google Scholar] [CrossRef]
  3. Judge, M.A.; Khan, A.; Manzoor, A.; Khattak, H.A. Overview of smart grid implementation: Frameworks, impact, performance and challenges. J. Energy Storage 2022, 49, 104056. [Google Scholar] [CrossRef]
  4. Marot, A.; Kelly, A.; Naglic, M.; Barbesant, V.; Cremer, J.; Stefanov, A.; Viebahn, J. Perspectives on Future Power System Control Centers for Energy Transition. J. Mod. Power Syst. Clean Energy 2022, 10, 328–344. [Google Scholar] [CrossRef]
  5. Al-Sumaiti, A.S.; Salama, M. Review on issues related to electric energy demand in distribution system for developing countries. In Proceedings of the 3rd IET International Conference on Clean Energy and Technology (CEAT), Kuching, Malaysia, 24–26 November 2014. [Google Scholar]
  6. Al-Sumaiti, A.S. The role of regulation in the economic evaluation of renewable energy investments in developing countries. In Proceedings of the 2013 7th IEEE GCC Conference and Exhibition (GCC), Doha, Qatar, 17–20 November 2013; pp. 39–43. [Google Scholar]
  7. Saad Al-Sumaiti, A.; Kavousi-Fard, A.; Salama, M.; Pourbehzadi, M.; Reddy, S.; Rasheed, M.B. Economic Assessment of Distributed Generation Technologies: A Feasibility Study and Comparison with the Literature. Energies 2020, 13, 2764. [Google Scholar] [CrossRef]
  8. Aziz, M.; Dagdougui, H.; Elhallaoui, I. A Decentralized Game Theoretic Approach for Virtual Storage System Aggregation in a Residential Community. IEEE Access 2022, 10, 34846–34857. [Google Scholar] [CrossRef]
  9. Liu, Y.; Yu, Y.; Gao, N.; Wu, F. A Grid as Smart as the Internet. Engineering 2020, 6, 778–788. [Google Scholar] [CrossRef]
  10. Zafar, B.; Ben Slama, S. Energy Internet Opportunities in Distributed Peer-to-Peer Energy Trading Reveal by Blockchain for Future Smart Grid 2.0. Sensors 2022, 22, 8397. [Google Scholar] [CrossRef]
  11. Luo, Y.; Itaya, S.; Nakamura, S.; Davis, P. Autonomous cooperative energy trading between prosumers for microgrid systems. In Proceedings of the 39th Annual IEEE Conference on Local Computer Networks Workshops, Edmonton, AB, Canada, 8–11 September 2014; pp. 693–696. [Google Scholar]
  12. Al-Sumaiti, A.S.; Salama, M.; Konda, S.R.; Kavousi-Fard, A. A guided procedure for governance institutions to regulate funding requirements of solar PV projects. IEEE Access 2019, 7, 54203–54217. [Google Scholar] [CrossRef]
  13. Jiang, X.; Sun, C.; Cao, L.; Ngai-Fong, L.; Loo, K.H. Peer-to-Peer Energy Trading With Energy Path Conflict Management in Energy Local Area Network. IEEE Trans. Smart Grid 2022, 13, 2269–2278. [Google Scholar] [CrossRef]
  14. Tushar, W.; Yuen, C.; Mohsenian-Rad, H.; Saha, T.; Poor, H.V.; Wood, K.L. Transforming energy networks via peer-to-peer energy trading: The potential of game-theoretic approaches. IEEE Signal Process. Mag. 2018, 35, 90–111. [Google Scholar] [CrossRef] [Green Version]
  15. Zhang, Z.; Li, R.; Li, F. A Novel Peer-to-Peer Local Electricity Market for Joint Trading of Energy and Uncertainty. IEEE Trans. Smart Grid 2020, 11, 1205–1215. [Google Scholar] [CrossRef]
  16. Aznavi, S.; Fajri, P.; Shadmand, M.B.; Khoshkbar-Sadigh, A. Peer-to-peer operation strategy of PV equipped office buildings and charging stations considering electric vehicle energy pricing. IEEE Trans. Ind. Appl. 2020, 56, 5848–5857. [Google Scholar] [CrossRef]
  17. Wang, Z.; Yu, X.; Mu, Y.; Jia, H. A distributed Peer-to-Peer energy transaction method for diversified prosumers in Urban Community Microgrid System. Appl. Energy 2020, 260, 114327. [Google Scholar] [CrossRef]
  18. Zaidi, B.H.; Hong, S.H. Combinatorial double auctions for multiple microgrid trading. Electr. Eng. 2018, 100, 1069–1083. [Google Scholar] [CrossRef]
  19. Khorasany, M.; Mishra, Y.; Ledwich, G. Auction based energy trading in transactive energy market with active participation of prosumers and consumers. In Proceedings of the 2017 Australasian Universities Power Engineering Conference (AUPEC), Melbourne, VIC, Australia, 19–22 November 2017; pp. 1–6. [Google Scholar]
  20. Amin, W.; Huang, Q.; Afzal, M.; Khan, A.A.; Umer, K.; Ahmed, S.A. A converging non-cooperative & cooperative game theory approach for stabilizing peer-to-peer electricity trading. Electr. Power Syst. Res. 2020, 183, 106278. [Google Scholar]
  21. Zhou, Y.; Wu, J.; Long, C. Evaluation of peer-to-peer energy sharing mechanisms based on a multiagent simulation framework. Appl. Energy 2018, 222, 993–1022. [Google Scholar] [CrossRef]
  22. Swarm Energy. Lichtblick. Available online: https://www.lichtblick.de/privatkunden/schwarm-energie (accessed on 3 January 2023).
  23. Smart Watts. Available online: http://www.iis.fraunhofer.de/en/ff/ener/proj/smart-watts.html (accessed on 3 January 2023).
  24. Brandherm, B.; Baus, J.; Frey, J. Peer Energy Cloud–Civil Marketplace for Trading Renewable Energies. In Proceedings of the 2012 Eighth International Conference on Intelligent Environments, Washington, DC, USA, 26–29 June 2012; pp. 375–378. [Google Scholar]
  25. Open Utility. A Glimpes into the Future of Britain’s Energy Economy. Available online: https://piclo.uk (accessed on 3 January 2023).
  26. Vandebron. Available online: https://vandebron.nl (accessed on 3 January 2023).
  27. Yeloha. Available online: http://www.yeloha.com (accessed on 3 January 2023).
  28. SonnenCommunity. Available online: https://www.sonnenbatterie.de/en/sonnenCommunity (accessed on 3 January 2023).
  29. Community First! Village. Available online: http://mlf.org/community-first (accessed on 3 January 2023).
  30. TransActive Grid. Available online: http://transactivegrid.net (accessed on 3 January 2023).
  31. Electron. Available online: http://www.electron.org.uk (accessed on 3 January 2023).
  32. Mengelkamp, E.; Gärttner, J.; Rock, K.; Kessler, S.; Orsini, L.; Weinhardt, C. Designing microgrid energy markets: A case study: The Brooklyn Microgrid. Appl. Energy 2018, 210, 870–880. [Google Scholar] [CrossRef]
  33. Centrica. Available online: http://www.centrica.com/news/centrica-and-lo3-energy-deploy-blockchain-technology-part-localenergy-market-trial-cornwall (accessed on 3 January 2023).
  34. Lumenaza. Available online: http://www.lumenaza.de/en (accessed on 3 January 2023).
  35. UNFCCC. ME SOLshare: Peer-to-Peer Smart Village Grids, Bangladesh. Available online: https://unfccc.int/climate-action/momentum-forchange/ict-solutions/solshare (accessed on 3 January 2023).
  36. Tushar, W.; Yuen, C.; Saha, T.K.; Morstyn, T.; Chapman, A.C.; Alam, M.J.E.; Hanif, S.; Poor, H.V. Peer-to-peer energy systems for connected communities: A review of recent advances and emerging challenges. Appl. Energy 2021, 282, 116131. [Google Scholar] [CrossRef]
  37. Bao, J.; He, D.; Luo, M.; Choo, K.K.R. A Survey of Blockchain Applications in the Energy Sector. IEEE Syst. J. 2021, 15, 3370–3381. [Google Scholar] [CrossRef]
  38. Devine, M.T.; Cuffe, P. Blockchain Electricity Trading Under Demurrage. IEEE Trans. Smart Grid 2019, 10, 2323–2325. [Google Scholar] [CrossRef]
  39. Saini, V.K.; Vyas, S.; Sujil, A.; Kumar, R. A Secure Energy Transaction Platform for Prosumers in a Smart Community. IEEE Smart Grid Newsl. 2022. [Google Scholar]
  40. Cheng, S.F.; De Franco, G.; Jiang, H.; Lin, P. Riding the blockchain mania: Public firms’ speculative 8-K disclosures. Manag. Sci. 2019, 65, 5901–5913. [Google Scholar] [CrossRef]
  41. Guerrero, J.; Chapman, A.C.; Verbič, G. Decentralized P2P energy trading under network constraints in a low-voltage network. IEEE Trans. Smart Grid 2018, 10, 5163–5173. [Google Scholar] [CrossRef] [Green Version]
  42. Kavousi-Fard, A.; Almutairi, A.; Al-Sumaiti, A.; Farughian, A.; Alyami, S. An effective secured peer-to-peer energy market based on blockchain architecture for the interconnected microgrid and smart grid. Int. J. Electr. Power Energy Syst. 2021, 132, 107171. [Google Scholar] [CrossRef]
  43. Guo, H.; Yu, X. A Survey on Blockchain Technology and its security. Blockchain Res. Appl. 2022, 3, 100067. [Google Scholar] [CrossRef]
  44. Baliga, A. Understanding blockchain consensus models. Persistent 2017, 4, 14. [Google Scholar]
  45. Sayeed, S.; Marco-Gisbert, H. Assessing blockchain consensus and security mechanisms against the 51% attack. Appl. Sci. 2019, 9, 1788. [Google Scholar] [CrossRef] [Green Version]
  46. Bard, D.A.; Kearney, J.J.; Perez-Delgado, C.A. Quantum advantage on proof of work. Array 2022, 15, 100225. [Google Scholar] [CrossRef]
  47. Xue, T.; Yuan, Y.; Ahmed, Z.; Moniz, K.; Cao, G.; Wang, C. Proof of Contribution: A Modification of Proof of Work to Increase Mining Efficiency. In Proceedings of the 2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC), Tokyo, Japan, 23–27 July 2018; Volume 1, pp. 636–644. [Google Scholar]
  48. Saad, M.; Qin, Z.; Ren, K.; Nyang, D.; Mohaisen, D. e-pos: Making proof-of-stake decentralized and fair. IEEE Trans. Parallel Distrib. Syst. 2021, 32, 1961–1973. [Google Scholar] [CrossRef]
  49. Liu, C.; Zhang, X.; Chai, K.K.; Loo, J.; Chen, Y. A survey on blockchain-enabled smart grids: Advances, applications and challenges. IET Smart Cities 2021, 3, 56–78. [Google Scholar] [CrossRef]
  50. Luu, L.; Narayanan, V.; Zheng, C.; Baweja, K.; Gilbert, S.; Saxena, P. A secure sharding protocol for open blockchains. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, 24–28 October 2016; pp. 17–30. [Google Scholar]
  51. Akbar, N.A.; Muneer, A.; ElHakim, N.; Fati, S.M. Distributed Hybrid Double-Spending Attack Prevention Mechanism for Proof-of-Work and Proof-of-Stake Blockchain Consensuses. Future Internet 2021, 13, 285. [Google Scholar] [CrossRef]
  52. Wan, S.; Li, M.; Liu, G.; Wang, C. Recent advances in consensus protocols for blockchain: A survey. Wirel. Netw. 2020, 26, 5579–5593. [Google Scholar] [CrossRef]
  53. Kalla, A.; De Alwis, C.; Porambage, P.; Gür, G.; Liyanage, M. A survey on the use of blockchain for future 6G: Technical aspects, use cases, challenges and research directions. J. Ind. Inf. Integr. 2022, 30, 100404. [Google Scholar] [CrossRef]
  54. Vangulick, D.; Cornélusse, B.; Ernst, D. Blockchain for peer-to-peer energy exchanges: Design and recommendations. In Proceedings of the Power Systems Computation Conference (PSCC), Dublin, Ireland, 11–15 June 2018; pp. 1–7. [Google Scholar]
  55. Belotti, M.; Božić, N.; Pujolle, G.; Secci, S. A Vademecum on Blockchain Technologies: When, Which, and How. IEEE Commun. Surv. Tutor. 2019, 21, 3796–3838. [Google Scholar] [CrossRef] [Green Version]
  56. Nakamoto, S. Bitcoin: A peer-to-peer electronic cash system. Decentralized Bus. Rev. 2008, 21260. [Google Scholar]
  57. Gramoli, V.; Staples, M. Blockchain standard: Can we reach consensus? IEEE Commun. Stand. Mag. 2018, 2, 16–21. [Google Scholar] [CrossRef]
  58. Guo, J.; Ding, X.; Wu, W. A Blockchain-Enabled Ecosystem for Distributed Electricity Trading in Smart City. IEEE Internet Things J. 2021, 8, 2040–2050. [Google Scholar] [CrossRef]
  59. Porat, A.; Pratap, A.; Shah, P.; Adkar, V. Blockchain Consensus: An analysis of Proof-of-Work and its applications. Available online: http://www.scs.stanford.edu/17au-cs244b/labs/projects/porat_pratap_shahj_adkar.pdf (accessed on 1 December 2022).
  60. Zheng, Z.; Xie, S.; Dai, H.; Chen, X.; Wang, H. An overview of blockchain technology: Architecture, consensus, and future trends. In Proceedings of the 2017 IEEE international congress on big data (BigData congress), Boston, MA, USA, 11–14 December 2017; pp. 557–564. [Google Scholar]
  61. Lu, Y. The blockchain: State-of-the-art and research challenges. J. Ind. Inf. Integr. 2019, 15, 80–90. [Google Scholar] [CrossRef]
  62. Wang, S.; Ouyang, L.; Yuan, Y.; Ni, X.; Han, X.; Wang, F.Y. Blockchain-enabled smart contracts: Architecture, applications, and future trends. IEEE Trans. Syst. Man Cybern. Syst. 2019, 49, 2266–2277. [Google Scholar] [CrossRef]
  63. Mammen, P.M.; Kumar, H.; Ramamritham, K.; Rashid, H. Want to Reduce Energy Consumption, Whom should we call. In Proceedings of the Ninth International Conference on Future Energy Systems, Karlsruhe, Germany, 12–15 June 2018; pp. 12–20. [Google Scholar]
  64. Saini, V.K.; Singh, R.; Mahto, D.K.; Kumar, R.; Mathur, A. Learning Approach for Energy Consumption Forecasting in Residential Microgrid. In Proceedings of the 2022 IEEE Kansas Power and Energy Conference (KPEC), Manhattan, KS, USA, 25–26 April 2022; pp. 1–6. [Google Scholar]
  65. Saini, V.K.; Kumar, R.; Mathur, A.; Saxena, A. Short term forecasting based on hourly wind speed data using deep learning algorithms. In Proceedings of the 2020 3rd International Conference on Emerging Technologies in Computer Engineering: Machine Learning and Internet of Things (ICETCE), Jaipur, India, 7–8 February 2020; pp. 1–6. [Google Scholar]
  66. IEX (Indian Energy Exchange). Available online: https://www.iexindia.com (accessed on 1 December 2022).
Figure 1. Proof of Work (PoW) algorithm.
Figure 1. Proof of Work (PoW) algorithm.
Energies 16 01253 g001
Figure 2. Prosumer PV power generation profile.
Figure 2. Prosumer PV power generation profile.
Energies 16 01253 g002
Figure 3. Prosumer and consumer load profile.
Figure 3. Prosumer and consumer load profile.
Energies 16 01253 g003
Figure 4. Electricity price profile.
Figure 4. Electricity price profile.
Energies 16 01253 g004
Figure 5. Blockchain for the trading process.
Figure 5. Blockchain for the trading process.
Energies 16 01253 g005
Figure 6. Consumer and prosumer demand meet chart.
Figure 6. Consumer and prosumer demand meet chart.
Energies 16 01253 g006
Table 1. Summarize details of existing P2P Platforms.
Table 1. Summarize details of existing P2P Platforms.
Existing ProjectCountryDetailsReference
Lichtblick Swarm EnergyGermanyDesigned a trade platform for neighborhood customers using information technology.[22]
Smart WattsGermanyUtilize information and communication technology to maximize energy efficiency. This platform uses a smart meter gateway as an interface to the Internet of Energy for an effective operation devoid of any kind of control system.[23]
Peer Energy CloudGermanyDesigned an energy trading platform using cloud-based technology that takes into account the predicted profiles of nearby appliances.[24]
PicloUKDesigned for the direct energy trading. The challenge is that that is no discussion about the local energy market.[25]
VandebronNetherlandDesigned for the prosumers who trade directly. The cost determined by prosumers using this platform. It links the generator, prosumers, and consumer to maintain equilibrium in the wholesale energy market.[26]
Yeloha and MosaicUSDesigned for the non-solar commercial community, they do not own a PV system. They are paying for PV power generated as a result of lower electricity consumption costs.[27]
SonnenCommunityGermanyDesigned a trading platform with battery energy storage.[28]
Community First! VillageTexasDesigned community-based energy trading platform.[29]
TransActive GridUKDesigned a trading platform including blockchain technology.[30]
ElectronUKDesigned a blockchain and ICT based energy trading platform.[31]
Brooklyn MicrogriUSADesigned blockchain-enabled trading platform for energy trading within communities.[32]
Centrica plcUKDesigned a blockchain-enabled local energy trading platform by using storage, RE generation, and flexible demand.[33]
LumenazaGermanyDesigned a local energy trading platform for regional and national level[34]
SOLshareBangladeshDesigned small-scale energy trading market to connect local consumers who installed PV systems at their homes.[35]
Table 2. DESS and CESS specification.
Table 2. DESS and CESS specification.
S.No.SpecificationValue
1. η C 0.96
2. η D 0.96
3.Capital cost of E j c a p 18,000 Rs/kWh
4.Capital cost of P j c a p 6000 Rs/kW
5. S O C m i n 20%
6. S O C m a x 80%
Table 3. Prediction performance measures on individual users’ load forecast error data.
Table 3. Prediction performance measures on individual users’ load forecast error data.
User ID18 May 2017
MAEMSERMSE
P-10.00450.00220.00189
P-20.01470.00450.0182
C-30.00450.000570.0050
C-40.00850.000320.0025
C-50.03090.000870.0368
Table 4. Prediction performance measures on PV forecast error data.
Table 4. Prediction performance measures on PV forecast error data.
User ID18 May 2017
MAEMSERMSE
5 kW User0.003150.00250.0068
2 kW User0.08570.00280.011
Table 5. Energy sharing data.
Table 5. Energy sharing data.
TimeTrading BetweenEnergy (kWh)Price (Rs.)
09:00 AMP 1 C 2 0.5471.148
P 1 C 1 0.2870.602
10:00 AMP 1 C 3 2.2424.708
P 2 ⟹ C 2 0.6071.274
P 2 C 1 0.2350.493
11:00 AMP 1 C 3 1.4593.063
P 1 C 2 0.5221.096
P 1 C 1 0.2220.466
12:00 PMP 1 C 3 1.1042.184
P 1 C 2 0.5651.186
P 1 C 1 0.2700.567
01:00 PMP 1 C 3 1.2662.658
P 1 C 2 0.5331.119
P 1 C 1 0.2240.470
02:00 PMP 1 C 3 1.3542.843
P 1 C 2 0.5541.163
P 1 C 1 0.3200.672
03:00 PMP 1 C 3 1.3982.935
P 2 C 2 0.4210.884
P 2 C 1 0.3170.665
04:00 PMP 1 C 3 1.2282.578
Table 6. Total energy trade between prosumer and consumers.
Table 6. Total energy trade between prosumer and consumers.
ProsumersTotal Trade Energy (kWh)
C 1 C 2 C 3
P 1 3.9062.72110.051
P 2 0.5521.0280
Table 7. One day total electricity cost (Rs.) of prosumer and consumers.
Table 7. One day total electricity cost (Rs.) of prosumer and consumers.
UserScenario: 1Scenario: 2
Grid
Cost
(Rs./Day)
Investment
Cost
(Rs./Day)
Cost of
Energy Buy
from Grid
(Rs./Day)
Cost of
Energy Buy
from Peers
(Rs./Day)
Operating
Cost
(Rs./Day)
Net Electricity
Cost
(Rs./Day)
P 1 10.5379.45-- 29.465 20.015
P 2 32.87927.50-- 3.318 24.445
C 1 14.881-9.7533.9375-13.690
C 2 23.280-13.1397.910-21.049
C 3 95.114-66.35821.222-87.58
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.

Share and Cite

MDPI and ACS Style

Saini, V.K.; Purohit, C.S.; Kumar, R.; Al-Sumaiti, A.S. Proof of Work Consensus Based Peer to Peer Energy Trading in the Indian Residential Community. Energies 2023, 16, 1253. https://doi.org/10.3390/en16031253

AMA Style

Saini VK, Purohit CS, Kumar R, Al-Sumaiti AS. Proof of Work Consensus Based Peer to Peer Energy Trading in the Indian Residential Community. Energies. 2023; 16(3):1253. https://doi.org/10.3390/en16031253

Chicago/Turabian Style

Saini, Vikash Kumar, Chandra Shekhar Purohit, Rajesh Kumar, and Ameena S. Al-Sumaiti. 2023. "Proof of Work Consensus Based Peer to Peer Energy Trading in the Indian Residential Community" Energies 16, no. 3: 1253. https://doi.org/10.3390/en16031253

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop