The research of source-load transaction mechanism based on blockchain

With the development of distributed renewable energy and the energy Internet, the cost of distributed energy participating in traditional power transactions continues to rise, and there is an urgent need for more reasonable transaction mechanisms and efficient information technology to improve the efficiency of distributed energy transactions. The characteristics of blockchain technology are in line with the transaction needs of distributed renewable energy, and it has development potential in energy transactions. Based on blockchain technology, this paper designs a source-load transaction mechanism in which the virtual energy medium is the equivalent of the intermediary. This mechanism can avoid the problem of credit asymmetry between buyers and sellers. We design from three aspects: transaction, payment, and settlement, and verify the actual application. The results show the feasibility and effectiveness of the transaction, provide a new way for multi-frequency and small transaction volume of new energy transactions, and provide new solutions for the consumption of new energy such as photovoltaics and wind power.


Introduction
Blockchain was proposed by Satoshi Nakamoto in 2008 and used to encrypt the Bitcoin system. In recent years, blockchain has been widely used in finance, supply chain, medical and other fields [1]. It can improve the trust between the subjects in the system, reduce operating costs, and improve the security of information and data. Its technical characteristics are highly compatible with the energy field, especially the power industry. Distributed energy has the characteristics of multiple types and wide participation. At present, the proportion of distributed energy participating in electricity trading is increasing, and its types and participation are wide. At the same time, the power market participants present diversified and complex development, and the market competition intensifies. These have led to higher operating and maintenance costs and reduced efficiency in traditional power trading models [2]. Therefore, exploring the new distributed trading models to improving transaction efficiency, while ensuring the balance of interests and transaction security among participating entities, and increasing EEEP 2020 IOP Conf. Series: Earth and Environmental Science 675 (2021) 012142 IOP Publishing doi: 10.1088/1755-1315/675/1/012142 2 the proportion of new energy consumption have become current hot issues. Many scholars have begun to study the application of blockchain technology in the energy fields. As shown in the next paragraph.
Literature [3] focuses on the application of block chains in multi-energy systems and information interconnection problems caused by heterogeneous block chains, and puts forward the necessity and methods of building a multi-energy system transaction system based on heterogeneous block chains technology. Literature [4] designs an integrated energy trading mechanism based on blockchain, and simulates the trading process to verify the validity of the transaction. This mechanism can meet the demand for distributed, small-scale, low-cost trading of integrated energy in microgrid. Literature [5] puts forward some insights on blockchain applications and technologies, and introduces advances in blockchain applications and technologies, as well as possible innovations and research. Literature [6] proposes a resource constrained hierarchical lightweight blockchain framework and its implementation mechanism, and applies it to the industrial Internet of things. At the same time, a lightweight consensus algorithm and a dynamic trust right algorithm are proposed to improve the throughput of the blockchain and reduce the number of transactions verified in the new block. Literature [7] gives a detailed analysis of transactions between photovoltaic power plants based on blockchains in which users participate in interactions, describes the implementation process and provides insights for others.
The organizational structure of this paper is as follows. Section 2 introduces the related technical theory of block chains and power trading. Section 3 designs the transaction mechanism in which the source and the load participate. Section 4 makes a brief verification of the trading mechanism in an application scenario. Section 5 is a conclusion and discussion.

Blockchain technology and characteristics
A blockchain is a digital data structure that combines blocks in a chain. It can be regarded as a technical solution to maintain a distributed database in a decentralized and trustless manner [8]. Block is the basic unit of the blockchain, which is generated by encryption algorithm, so that the relevant data record information cannot be tampered with. At the same time, each block will have a time stamp to ensure the traceability of the blockchain.

Key technologies of blockchain.
The key technologies of the blockchain mainly include asymmetric encryption algorithms, consensus mechanisms and smart contracts.
Asymmetric encryption algorithm. A Blockchain use an asymmetric encryption algorithm to ensure the information security of users between networks and solve the trust problem [8]. Compared with symmetric encryption, asymmetric encryption algorithms use public and private keys as the keys for encryption and decryption [9]. The commonly used asymmetric encryption algorithms mainly include: knapsack algorithm, RSA, ECC (elliptic encryption algorithm), etc.
Consensus mechanism. Consensus mechanism is an important mechanism to maintain the safe and stable operation of blockchain, which determines the speed and security of consensus in the whole system [10]. It can synchronize the information when all nodes participate in storage, achieve consensus on transactions, and ensure the interests of all nodes and the reliability of the blockchain network. At present, the common consensus mechanisms in blockchains include: Proof of Work (Po W), Proof of Stake (Po S), Proof of Authorized Share (DPo S), Practical Byzantine Fault Tolerant Algorithm (PBFT), etc.
Smart contract. Combining smart contract with blockchain, the blockchain will monitor the execution status of smart contract in real time. After confirming that the execution conditions of smart contract are met, the smart contract will be triggered to automatically execute specific transactions or pre-defined rules and procedures. The code of smart contract is open and cannot be tampered with, which ensures the reliability of contract execution results. Decentralization. There is no centralized management organization in a blockchain, and all nodes jointly maintain the whole system. The nodes verify the transaction by digital signature without mutual trust, which ensures the reliability of the system.
The information cannot be tampered with. To tamper with the information in a blockchain, more than 51% of the nodes need to be modified at the same time, which requires high computing power to ensure that the data in the system is difficult to tamper with.
Traceability. Every transaction in the blockchain is connected to two adjacent blocks through cryptographic methods. So, any historical transaction information can be traced back.

Electricity trading
China's electricity transactions are centralized through the electricity trading center. The transaction mode is divided by time and can be divided into forward transactions and spot transactions. Spot transactions are used as a supplement to forward transactions. Distributed renewable energy, such as wind power and photovoltaic, is unstable in power generation and difficult to accurately predict its power. Therefore, it mainly participates in spot trading in the power market.
The source-load power transaction mode with virtual energy medium as intermediary equivalent is suitable for spot trading of wind power, photovoltaic and other new energy. It is expected to realize the benefit distribution of transaction subjects, improve transaction efficiency, ensure transaction security and reduce transaction costs.
The virtual energy medium here is different from the general electronic currency. It is a virtual code generated by an algorithm based on the blockchain technology framework. It does not require the participation of a central institution. The value transfer of each participant in the power transaction can be achieved. It can meet the energy supply and service demand of high efficiency, low cost, quick response and free choice of power users

Trading mechanism
The trading system consists of four parts: virtual energy medium issuing and trading platform, power supply enterprises, power grid enterprises or end users, and payers. The transaction, settlement and payment activities are completed automatically in the system, and do not rely on the third-party intermediary. As shown in Figure 1.  In the figure, the virtual energy medium issuing and trading platform is a decentralized virtual trading environment based on blockchain, which owns and is responsible for maintaining the infrastructure and resources of the entire trading system. The Power supply enterprises are power providers, responsible for the sale of electricity products. The power grid enterprises or the end users are the power buyers, who are responsible for purchasing electricity commodities and paying the corresponding fees according to the quantity and price of electricity. The payers are the third party, who are responsible for paying and cashing, such as Alipay, UnionPay and so on.
The transaction process is as follows. First, the trading platform issues virtual energy medium, creates an account for each participant, and manages the virtual assets of registered users. Then, the power grid enterprises or end users purchase virtual energy medium from the platform in bulk, and pay cash to the platform through a third-party payment. Next, the power supply enterprises generate electricity, and the power grid enterprises pay the virtual energy medium to the power supply enterprises according to the catalog electricity price and on-grid electricity, or the end users pay the virtual energy medium to the power supply enterprises according to the market transaction price and electricity. Finally, the power supply enterprises use the virtual energy medium to exchange cash for the platform, and the platform transfers the cash to the power supply enterprises through a third payer. In this process, the platform must also prove to the power supply enterprises the true issuance price of virtual energy medium. Figure 2 shows the payment process for power supply companies to sell electricity.

Power supply enterprises
Trading platform Transfer virtual energy medium Return receipt The power grid enterprises (or end user) buy electricity from power supply enterprises and pay through virtual energy medium. In this process, the transfer between virtual accounts is completed through the trading platform. Participants of this interactive activity are power grid enterprises (or end users), power supply enterprises and trading platform.
First the power supply enterprises generate electricity, and the power purchase users send the corresponding value virtual energy medium to the power supply enterprises according to the catalog electricity price and electricity generated.
Then, the power supply enterprises check whether the virtual energy medium received are signed and authenticated by the payers, transfer the virtual energy medium to the account, and provide the receipt to the power grid enterprises (or end users). Figure 3 shows the payment process for power grid enterprises (or end users) to purchase virtual energy medium.  The power grid enterprises (or end users) purchase virtual energy medium from the platform and pay cash to the platform through third-party payment. Power grid enterprises (or end users), trading platform and payers are involved in the activity.

Power grid enterprises (or end users) purchase virtual energy medium.
First, the virtual energy medium trading platform publishes the type and real price of the virtual energy medium currently issued, and then, power grid enterprises (or end users) select the type and quantity of virtual energy medium to be purchased.
Next, according to the request of power grid enterprises (or end users), the virtual energy medium platform constructs corresponding quantity and type of virtual energy medium, and sends the virtual energy medium to the payer.
Finally, the third-party payment verifies whether the price of virtual energy medium binding is consistent with the price previously disclosed. If the verification is passed, the payer will authenticate through digital signature and forward the authenticated virtual energy medium to the power grid enterprises (or end users). The platform records the virtual energy medium into the virtual account of power grid enterprises (or end users). At the same time, the payer transfers the corresponding amount from the real account of the power grid enterprise (or end user) to the platform account.

Settlement mechanism
In the settlement stage, the real price of virtual energy medium is announced by the platform, and the information is open and transparent. Any user can obtain the current issuing status of virtual energy medium.  The power supply enterprises exchange virtual energy medium for cash at the end of a certain period through the trading platform. After verifying the validity of the virtual energy media, the platform proves the total issuing price of the batch of virtual energy medium, and transfers the cash to the power supply enterprise through the third-party payer. Because of the introduction of blockchain technology, power supply enterprises do not need to verify the certificate issued by the platform. Power supply companies, platforms and payers participated in the interactive activity. As shown in Figure 4.

Application scenario analysis
This section takes the photovoltaic microgrid transaction as an example to illustrate the application scenario of the transaction mechanism in the photovoltaic settlement collaborative platform of company A. The process is as follows.
First of all, there are photovoltaic power generation users B and C applying for full capacity and surplus energy respectively, and the trading platform records the information of photovoltaic power generation projects, including the information of photovoltaic users and meters.
Secondly, the trading platform regularly obtains the base number of electricity meters from the electricity meter equipment every morning, and the blockchain executes the electricity smart contract to calculate the increment of the current day's electricity, and judges the legitimacy of the electricity data. If the electricity quantity is legal, the electricity will be sent to the electric meter node (virtual node) of the platform through the blockchain to realize the data chain storage and complete the electricity data collection of the day.
Then, the platform confirms the current day electricity data of PV users B and C, rejects the wrong electricity data, and confirms that the data is correct.
Finally, the platform regularly triggers the smart contract for electricity fee settlement. The smart contract for electricity settlement on the blockchain calculates the data of electricity meters based on the total electricity quantity, electricity price and subsidies of photovoltaic users B and C, and sends the data such as electricity charges to the settlement node of the photovoltaic platform through the blockchain, so as to realize the data storage on the chain and complete the electricity fee calculation.
The settlement node confirms that all information is correct, initiates a settlement application and generates electricity fee settlement voucher. The node reconfirms the electricity fee information and initiates a payment application. The platform generates electricity payment voucher at the same time.
In the actual test results, the blockchain successfully created three types of nodes: company, photovoltaic users and electricity meters. After uploading the electricity data template, the blockchain generates blocks with transaction records. After the transaction platform confirms that the electricity data is passed, the electricity contract is automatically triggered, and the blockchain successfully generates the block with the electricity transaction record, and transfers the electricity of the meter address to the virtual meter node. The virtual energy medium is used to certify the actual electricity and realize the electricity transfer. After the execution of the electricity contract, the electricity fee contract is automatically triggered. The blockchain successfully generates the block with the electricity transaction record, and transfers the electricity fee in the platform's electricity fee address to the photovoltaic users. The virtual energy medium is used to certify the actual electricity charge and realize the electricity fee transfer.

Conclusions and discussions
In this paper, starting from the process of photovoltaic, wind power and other distributed renewable energy participating in electricity spot trading, this paper puts forward the corresponding trading mechanism, which is divided into three parts: transaction, payment and settlement. The feasibility and effectiveness of this trading mechanism are verified by the actual application scenarios of photovoltaic trading.
Compared with the traditional power transaction, the source-load transaction mechanism based on blockchain is more suitable for the power transaction participated by distributed energy. Compared with the latest research progress, the research angle is different. This paper elaborates from the aspects of transaction, payment and settlement, and verifies the transfer of virtual energy medium in the actual application scenario.