Blockchain-based power trading system for microgrid

. Direct trading between entities in the microgrid is the trend of micro-grid electricity trading. However, the lack of trust and endorsement among multiple entities in micro-grids makes it difficult to complete direct electricity transactions, which limits the green energy efficiency. To solve this problem, firstly, a blockchain-based microgrid power transaction level model and power transaction process management process are proposed. Secondly, an access interface between the microgrid smart terminal and the blockchain is designed to realize the connection between the blockchain and the underlying equipment. The system is implemented in an island microgrid, which realizes the peer-to-peer trading between power suppliers and users. The system builds a bridge among entities in microgrid and makes the power trading open, transparent and traceable.


Introduction
Microgrid [1] is a small power generation and distribution system composed of renewable energy power generation units, power consumption units, energy storage units, and load dispatching.With the continuous increase of generation efficiency of low-carbon and clean energy (such as wind and solar energy), the centralized energy trading form led by traditional power supply companies is difficult to adapt to the characteristics of flexible microgrid, power production and time-changing demand [2] .
In the traditional energy trading market, most of the transactions are conducted in a centralized mode.The advantages of centralized power trading are unified management and unified standards, which play a key role in the stable operation of my country's traditional power supply and grid.However, with the continuous emergence of distributed renewable energy, centralized and unified transactions have also exposed many problems [3] .Firstly, the response to electricity metering and accounting is not transparent enough.Secondly, it is difficult to form a reasonable market supervision mechanism, and finally, the market mechanism is not enough.Flexible, electricity prices cannot fluctuate with market demand.In order to solve the above problems, a distributed market transaction mechanism is needed to adapt to this diversified energy transaction.
In the few past years, there are some application systems about blockchain-based power trading systems [4,5,6] .Based on the blockchain, the US Energy Administration's LO3 project has developed a distributed photovoltaic power sales platform Transactive Grid, which realizes the recording, pricing, trading and settlement.The European Micro-Generation Energy Market project is a trading platform built on blockchain technology that distributes energy produced by communities or households.Although these projects have successfully carried out attempts to apply blockchain to the field of power trading, they have been carried out at the application level without mentioning the implementation of the underlying hardware interface.
This paper proposes a micro-grid-oriented power transaction level model based on blockchain, and designs each layer.The system is implemented in an island microgrid, which realizes the peer-to-peer trading between power suppliers and users.The system builds a bridge among entities in microgrid and makes the power trading open, transparent and traceable.

Architecture of the blockchain-based trading system
Blockchain has digital signature, hash chain and consensus algorithm.These security mechanisms to solve the trust problem of electricity transactions in the microgrid and provide a trusted transaction platform for all parties in the transaction.Based on the blockchain platform, combined with the power Internet of Things technology, the source, network, and load information are connected to the blockchain energy network, and the power generation, transmission, users and energy storage are unified into the energy Internet system, and unified coordination, management and optimization.As is shown in Figure 1, the entire system is divided into 4 levels: interface layer, interconnection layer, blockchain layer and platform layer.Communication layer.data and information transmission protocols, channels and their realization, forming a wireless or wired information interconnection network.
Blockchain layer.Introduce blockchain technology in microgrid power transactions to realize the credibility, transparency and self-organization optimization of power transactions.Mainly use blockchain's distributed accounting, smart contracts, digital signatures and other functions to realize direct electricity transactions between electricity producers and users, and ensure the authenticity of data and the traceability of transaction records.Using the smart contract mechanism of the blockchain, the electricity purchase or sale agreement is converted into a smart contract code that can be automatically triggered to execute, so that the transaction links such as price negotiation, settlement and supervision of the transaction are intelligent and automated.
Application layer.Relying on the cloud platform, it provides users with a unified access interface for using the system, provides end-user-oriented common services, supports the redefinition and re-construction of various components, so as to quickly derive new application systems, such as load Trend prediction, scheduling optimization, trading platform, etc.

Trading procedures
The transaction process is divided into three stages: pricing, transaction completion, and settlement.Its core processing flow and algorithm are encapsulated as a blockchain smart contract.Once the conditions are met, the system automatically triggers the completion.The entire transaction process is automatically completed according to the agreed rules.The process is shown in Figure 2 and detailed as follows.

Pricing stage
Summarize the power generation capacity of the power generation unit in the next time period and the power consumption of the user in the next time period, and finally reach a reasonable price according to the power purchase and sales strategies of different stages formulated by the parties.In order to maintain the balance of the interests of all parties, using the supply and demand information stored in the blockchain, combined with the multi-time-scale pricing model and the electricity price specified by the market supervision department, the final electricity price is a price that is allowed to fluctuate to a certain degree within a specified range.

Transaction stage
Based on the blockchain power transaction model, the relationship between power generation units, distribution parties, energy storage units, and power users is considered.The supply and demand information issued by each subject and the signed supply and demand contract do not need to be authenticated by an intermediate authority.The system guarantees that the transaction data has the properties of tamper-proof and non-repudiation.
The cryptographic principle of the blockchain can ensure that the transaction information has the above properties.The principle and technology of traceability, tamper-proof and smart contract based on the blockchain can support the establishment of a transparent and efficient power supply and demand transaction model.

Transaction settlement
After the transaction is completed (power delivery), the matching information and transaction record data of the supply and demand parties are transmitted to the blockchain, and then the batch of transactions are settled, and finally the smart contract is triggered to complete the transfer of funds from the user to the supplier.Automatic transfer.In the transaction settlement process, the core technology of the blockchain, such as cryptography, smart contracts, and consensus mechanisms, needs to be based.In the transaction system process, the transaction system needs to write or query the block data.In the pricing stage, the power production unit and power users write pricing data to the blockchain through the application interface or the blockchain client interface, including the power supply unit ID, the amount of power generation, the time, and the release of electricity prices.In the transaction phase, it is necessary to write the transaction power, price, execution period and prepaid margin to the block.
Relying on the blockchain distributed ledger and data identification function, establish a transaction supervision system, evaluate the actual effect of transactions, evaluate and punish users, ensure that the data of each process such as transaction declaration and settlement cannot be tampered with, and improve the efficiency and authority of supervision.

Transaction pricing method
In order to encourage green energy consumption and increase the utilization rate of new energy, we propose a power transaction pricing method.The method takes transaction volume, duration, subsidy factors, grid load and other factors into account.The entire microgrid maximizes the objective function of consumption of new energy to encourage the consumption of new energy, as shown in (1) The objective function maximizes the total consumption of new energy in each period, where ܲ ‫)ݐ(‬ is the generation power of the i-th new energy power generation unit in period t. ܶ ο is the length of the period during which the new energy unit maintains a certain power.ܴ (ܶ ο , ‫)ݐ‬ is subsidy income obtained from the power generation period t.In order to encourage the consumption of new energy and inspire new energy producers to provide more new energy, the system seeks to provide price subsidies for new energy at the right time, as shown in (2).
For new energy power generation users, submit the expected electricity to the trading market, hoping to obtain the greatest benefit.In order to encourage the absorption of more new energy capacity within the microgrid, the subsidy income ܴ (ܶ ο , ‫)ݐ‬ of the electricity sold is affected by its output ܲ (‫,)ݐ‬the price of electricity ‫,ݐ(ܨ‬ ݆)in the current period and the subsidy factor ߤ. When the total output of all power generation units in the microgrid is greater than the total load, the subsidy factor is less than 1, otherwise greater than 1, which encourages the enthusiasm of the power generation units to produce.During the same period, the price of electricity ‫,ݐ(ܨ‬ ݆) is allowed to vary within a certain range ‫ܨ‬ ‫,ݐ(ܨ‬ ݆) ‫ܨ‬ ௫ .

System implementation
The system was implemented in an island microgrid.The test system includes 3 wind turbines, household photovoltaic power generation units, energy storage devices, and energy consumption equipment (charging piles, water purification devices, and household electricity).In the Internet of Things technology, the application of blockchain-based power trading systems, supply and demand balance, and microgrid status monitoring has been realized, realizing the direct connection and distributed management of new energy generation and consumption, and improving energy utilization efficiency.

Building a point-to-point direct power transaction system
The distributed micro-grid power transaction platform realizes automatic transaction of supply and demand with controllable prices, and completes blockchain digital signatures, key management and measurement certification.The power generation side (fans, photovoltaics, energy storage) publishes the available power supply on the blockchain.The users can choose to purchase (via APP, Web and other software) the right energy.On the electricity side, the grid smart contract provides transaction rules for both supply and demand parties to realize point-to-point automatic transactions, save transaction records that cannot be tampered with, and complete fee payments.The trading platform implements incentive mechanisms (points, rewards, etc.) to encourage users to choose the appropriate form of electricity and power consumption at the appropriate time.

Security measures
In-depth integration of identity authentication, measurement authentication, smart contracts, equipment status, etc. related to distributed energy transactions with the blockchain architecture, we design a blockchain-based distributed green energy transaction system.The system is a blockchain-based system in that the authentication, measurement, and contract events in the microgrid area are non-centralized, and the speaker block node is established at the microgrid boundary to establish a "shadow centre".The structure of the "shadow centre" is not only suitable for the current central operation and management form, but also to achieve a new form of efficient distributed energy trading within the microgrid.This exploratory application can find practical and feasible projects for the blockchain technology.
All energy-consuming users and owners of distributed energy generation on the island can participate in market transactions.The system provides reliable measurement authentication technology.All measurement data on the blockchain further ensures the reliability and traceability of measurement data.Smart contracts ensure the fairness of all market participants.In the recharge and settlement link, the grid company recharges through a unified interface, and the tokens in the account on the chain are recovered during settlement, and then the payment is made to the bound bank card.

Conclusion
This paper introduces a method to build a smart, convenient, and efficient blockchain-based power trading system, to achieve point-to-point trading platform between power suppliers and users.The platform improves the efficiency of power consumption, and provides a way to build a clean, low-carbon, safe and efficient modern energy system.

Fig. 1 .
Fig. 1.Architecture of the blockchain-based trading system, four layers.Interface layer.The device layer provides a ubiquitous Internet of Things interface layer for various physical devices, mainly to complete the intelligence of power generation devices, energy storage devices and electrical equipment, such as sensing device status, monitoring device operation, data collection and networking Functions such as communication protocol.By defining standard interfaces, the standardization of terminal and blockchain communication interfaces and the virtualization of terminal devices are Conferences 47, 03009 (2022) CCCAR2022 https://doi.org/10.1051/itmconf/20224703009