Management of Blockchain Based Hybrid P2P Energy Trading Market

In the local energy trade market peer to peer energy trading and generation of local energy can condense the cost of energy consumption and harmful gases emission ( results in to generate the energy at consumer’s end the renewable energy sources are used) and rise the resilience of smart grid. However, privacy issues and trust may available in the trading of local energy with peers. To manage the energy trading a centralized system can be utilized but it faces the several issues and also it promotes the overall system cost. In this tabloid, based on the blockchain system a hybrid P2P energy trading market is proposed. This system totally decentralized and this system allows that members in trading market can able to interact with each other member and can able to trade the energy without the third party involvement. In the blockchain based energy exchange market the smart agreements play a vital role. Smart agreements follows the all the essential rules in the energy trading. To develop the hybrid electricity exchange market the 3 smart agreements are proposed in this tabloid. The three smart agreements are Main Smart agreement, P2P smart agreement and Producer to Grid smart agreement. Initially the market member interacts with main smart agreement and for further process it follows the other 2 smart agreements. The implementation of an efficient hybrid energy exchange market is the main objective of this tabloid and also reduces the cost of energy and peak to average ratio of electricity.


I. INTRODUCTION
For the new technologies expansion electricity has become an analytical supporting principal that is necessary. In human adequacy many fields it has supported and provided the technologies. For contemporary technologies it is the foremost driving commodity and in its absence, they are useless. Communication, innovation, education, transportation, computation, business, etc., all fields the electricity role cannot be denied. With every passing day the electricity demand is radically growing and also its design is dynamic. A utility needs the backup install power plants to meet its energy demand, which results in higher production cost, harmful gasses emission, etc., because it has no control above the request method. The power grid modern form has appeared as a smart grid. Amid producers and energy consumers, it has two way communications and allows efficient energy supervision. It conserves electricity and eliminates the thermal power plants requirement. By making the electric grid maintainable it also decreases the cost of electricity ingesting. The power grid evolution created the electricity market revolution, to control the electricity generation and electricity distribution in the market, where new members has been hosted. Distributed energy generation based on renewable energy sources has been famous due to its environmental friendly electricity generation method. Declining solar panels and wind turbines costs allows DEG development in smart homes and micro-grids. Furthermore, cheaper and smaller sensors, new communication algorithms and smart devices provide the techniques for healthy peer to peer communication amid electricity generators and patrons in a market. This market condenses the cost of electricity ingesting. The environmental factor which highly affects the RESs generated electricity amount, e.g. sunshine a solar panel amount and wind speed and wind turbines obtain a certain period. Due to the intermittency and uncertainty characteristics on non-conventional source energy fails to withstand the reliability, so the consumer's energy connection with main grid is compulsory. With the appearance of contemporary technologies, the smart energy market is widely centralized. Robustness, scalability, privacy issues and security are the major problems in a centralized P2P energy exchange market. Furthermore, the energy interchange amid the two lives is controlled as a center of monitoring all transactions and is responsible for implementing the market algorithm. Both of the energy producers and consumers needs to pay some amount to the central body which leads to higher cost of energy ingesting for consumers and less income for energy producers. Besides, still the local energy market participants are get additional welfares when compared to exchange of energy with the smart grid. The small scale energy 204 producers are empowered by P2P energy alliance and they are encouraged by promoting the local generation. The P2P trading in the local market requires the innovative and improved guidelines for trading the successful operation. These guidelines should be safe, clever and reliable. For the reliable and safe decentralized P2P energy exchange market implementation the blockchain has appeared as a user-friendly, promising and efficient technology. This allows the transparent communication of the local energy market participants and allows the results of energy allies in a wide and unlikely environment. To keep the coalition date about the energy expanse the blockchain is used. And also maintain the record of its price though preserving the healthy atmosphere for energy producers and consumers.

II. SYSTEM MODEL
In this tabloid, the energy exchange market based on the blockchain with 3-layered architecture is represented. Fig-.1 shows the 3layerd architecture system model. The architecture presents the layers and its corresponding apparatus. The 3 layers in the model are Physical layer, Virtual layer and Application layer. In physical layer, the energy exchange market's physical structure is represented. Also, the utility grid and smart homes are comes under this layer, where they are connected each other to energy as well as information transfer. The energy is transferred from the grid to the smart homes through the power lines. Also, the same power lines are used to transfer the electricity amid smart homes. The smart homes are furnished with PV panels, Energy Storage Systems (ESSs), Smart meter and Smart appliances. PV Panels refers its present data of energy generation, ESSs operates based on PV panel's results and it refer its information of present status and smart meter receives the information about the consumption of energy from the smart appliances. Based on this record the smart meter processes to obtain information about smart home's present energy status. Smart homes will come under the one of the following 3 stages, such as extra energy stage, deficit energy stage and equilibrium stage. The smart homes owner could be able to act as both energy consumer as well as energy producers based on the current energy stage of smart home. The smart meter provides the smart home's state information to the virtual layer. It provides the participation for trading. The blockchain is applied in the virtual layer. Entire users in the market are the blockchain's nodes and have a distributed register's copy. Through a smart agreement, in the energy exchange market an energy producers can places the bid for energy selling. The smart agreement follows entire rules and market algorithms of energy exchange amid both customers. The transaction is done when all the rules are satisfied, or else the transaction is inverted and an error message is sent to the particular customer. When the transaction is confirmed then the new block is formed and is connected to the previous block's chain. The present block's header holds the preceding block's hash, thus maintaining the entire chain of blocks. This layer comprises all the APIs needed to interact with the smart agreement. The application layer is this architecture's third layer. At application layer, through the decentralized applications (DApps) and user interface the smart agreements can by interacted by the user, and also user can maintain the information and follow the important statics records. Through the application layer a network applicant can communicate with the system. The transactions details of request and energy consumption data's are entered by using the DApps in application layer. The information maintain in the system is sent to the smart agreements; the second layer holds the smart agreements. In the second layer the user's request are processed and the transaction is sanctioned when entire the energy exchange conditions are satisfied. At the physical layer the actual energy transmission is takes place.

III. MARKET MEMBERS
Market member's two types of energy ingesting record is considered for the hybrid P2P energy exchange market's execution. Two kinds of utilization are taken in to the account to determine its form of energy ingesting, such as shiftable and non-shiftable. The market member's characteristics are not exposed. In the network, each member has their own private and public security keys and member's public keys are distributed to others. By using the public key of member, other member cannot predict the private key for the same of public key member. From their public keys to create the matchless code of address for the member, a hash function is used. By using the matchless code the member can be identified during energy exchange on the network. Characteristics of the member on the network are kept confidentially. Based on the form of energy ingesting and using RES local energy generating capability the members in the market are characterized, such as electricity prosumers and electricity consumers. Electricity consumers further characterized as students and singles.

IV. LOAD CONSUMPTION
The electricity consumer's load consumption in depends on, in a particular time period the number of appliances used and its span of operational period and rated power. Span of operational time and rated power varies to every electrical appliance. Power ingesting of electrical consumer is calculated by following equations. The equation 1 represents the energy ingesting by the electricity consumers.
Where, L C (t) is at a time interval t, the load consumption of entire functioning appliances at consumers end. PO C (a) is rated power of the appliances of the consumers end. St(a)(t) is status of appliances. The equation 2 represents the energy ingesting by the electricity prosumers.
Where, L Pr (t) is at a time interval t the load consumption of entire functioning appliances at prosumers end. PO Pr (a) is rated power of the appliances of the prosumers end. G re (t) is power generated by using renewable energy at prosumers end. The equation 2a represents the appliances in the both ends on/off status.

206
The equation 3 represents total load at a time interval t.
The equation 4 represents total load ingested in a day.

V. ELECTRICITY COST
Price of the electricity is classified into two types for cost of electricity such as utility grid issued price and price fixed in local market. To attain the final cost of electricity we have to analyze it based on both prices. The electricity cost that acquired from the grid is calculated based on the grid issued price. The electricity cost that acquired from the local market is calculated based on the fixed price in market. The equation 5 represents the electricity cost for consumer at a time interval t.
Where, ( ) is electricity cost for consumer at a time interval t.
( ) is consumer acquired quantity of power from grid at a time interval t.
( ) is consumer acquired quantity of power from the local market at a time interval t. is grid issued price. is market fixed price. The equation 6 represents the electricity cost for prosumer at a time interval t. Where, is prosumer's profit in a day. The equation 9 and 10 represents the cost of consumers and prosumers for a day respectively.
Then the equation 11 shows the monthly consumption cost for the consumers.
The equation 12 represents the monthly consumption cost for the prosumers. Where, monthly consumption cost is difference between costs of the prosumer to profit of the prosumer.

VI. PAR OF ELECTRICITY MARKET
In energy trading PAR is a significant factor. It affects the main grid's reliability and efficiency. The equation 13 represents the PAR factor of an energy trading market with hybrid P2P energy.

VII. LOCAL TRADING PRICING MECHANISM
In electricity trading the utility grid issued price is set amid the lower and upper limits, and no prosumer will acquisition the electricity for more expansive from the main grid. And also prosumer will not vend the electricity for low price to the main grid. Hence, the price of electricity trading is always fixed amid the limits. All prosumers in the market will offer their available extra energy for bid at the market bidding time.
The equation 14 shows the price bids of electricity offered by the prosumer to sell their available extra energy to the market. Where, Price P1 is the first prosumer's offered price and there are n number prosumer. Price Pn is last prosumer offered price. Equation 15 represents the lowest price from set of prices placed by the prosumer and is selected as the price of electricity trading in the market.

VIII. BLOCKCHAIN SMART AGREEMENTS
Blockchain is a procedural resolution for a reliable distributed record that is clearly secured and open. Blockchain's each block has two kinds of parts such as header and body. The header stores the previous block's hash value and body stores the data. This data consists the transaction's records and information; multiple transactions can be stored in each block. The current block's hash value is created by using the previous block's hash value, current block's information and arbitrary number. By linking the entire blocks in a consecutive method the blockchain's reliability is guaranteed. Development of smart grid application, data records in each block contains the transaction information's. Quantity of energy, receiver and sender of energy, transaction time, and price, participant's status and their current balance. In a real-time the information is aired over the network after a block is created. In the chain the new block is added only after the confirmation. To mine this block's key the agreement algorithms are used, which allows all nodes on the network to enhance blocks to its chain. The blockchain's important constituent is smart agreement, for a fruitful transaction it consist all essential rules. Before obligating a transaction it checks the predefined circumstances. In a smart grid energy market, the energy transactions amid two participants are controlled by smart agreement control by following the predefined rules. Once rules are organized on the network then it cannot be altered in smart agreements. For all participants it guarantees translucent energy exchange market. Besides, for the energy and payments of market participants they trust the smart agreements. To control the actions of trading, the smart agreement eradicates the central party's requirement. In this tabloid, 3 smart agreements are discussed about efficient P2P and P2G energy trading.

Main Smart Agreement
In the local energy market, to control entire energy trading operations a main smart agreement is established. The smart agreement is directly interacted by the market participants. Initially algorithm checks the user's validity and permits the registered user to contribute in the local energy exchanging. Algorithm1 represents the main smart agreement's basic steps. In second step, the algorithm checks the both P2P and P2G smart agreement's status, while participant of market sends an energy excess or energy shortage requests. Then checks the user's validity and whether it is registered in the market or not. It continues to following step, if a participants are already registered or else it register the market participant first and stores the required information. While an