## 1 Introduction
Blockchain can also be employed for secure decentralized energy management [25]. Another study [26] has used blockchain to design privacy-protected search scheme for malicious servers. Moreover, it can also be applied to data sharing schemes to ensure the fairness of incentives [27]. The integration of blockchain technology into energy trading is a novel and promising area of research, and many studies have made efforts in this regard [28]. Before formally attempting to combine blockchain with the energy trading model, some researchers first studied the application of distributed systems to the energy market. Proof by facts, Peer-to-Peer (P2P) network model enables the energy market to operate in a consumer-centered manner and support the participation of the so-called \"prosumers\", which has greatly improved the flexibility of the traditional mode of energy market [29; 30]. As shown in [31], P2P network can create a competitive energy market and increase the overall efficiency of the power market. Additionally, the distributed system can also provide high-precision demand response signals [32], reduce cost and improve speed [33]. Moreover, it solves the problem of system scalability and mobility, and creates a competitive market that benefitssmall-scale prosumers [34]. There are also some studies on the optimization of the interaction between the main grid and the microgrid. For instance, the authors of [35] addressed the case in which two microgrids isolated from the main grid exchange energy in a P2P manner; both a centralized solution and a distributed solution are proposed to minimize the cost of power generation and transportation. In [36], a hierarchical power scheduling approach is proposed to optimize the power management in a smart grid with a microgrid and cooperative microgrids. Additionally, to improve the utilization of renewable energy, an adaptive distributed energy scheduling scheme is proposed in [37] to coordinate the microgrids and renewable energy generation. Many studies have shown the advantages of introducing blockchain technology into the energy trading systems [38; 39]. For example, high computing capacity can be realized with blockchain at a low cost, and the consensus mechanism can ensure the optimal solution. In addition, it can prevent fake transactions and establish an open and transparent credit system [40]. All nodes can work independently towards system equilibrium without central supervision [32]. The application of cryptography in blockchain can solve a number of system security problems [34; 41] and significantly reduce costs [42]. More generally, blockchain enhances the role of consumers in the system and their choices [42]. In [43], the authors evaluated the local electricity market based on blockchain, and the model shows that the system has already been in the early maturity stage. Currently, blockchain-based energy trading is not just a theoretical topic, but there are already many practical applications. For instance, Exergy team developed Brooklyn microgrid in April 2016, which is the world's first practical blockchain-based energy trading platform [44]. In France, there is a project named Sunchain [45], which uses the Hyperledger Fabric platform to create a blockchain virtual network for solar energy prosumers and can efficiently deal with the energy transactions at low cost. Although only a limited number of users are involved in Sunchain project, the development of solar power in social housing has been realized and the share of electricity generated per unit of housing can be traced. Power Ledger in Australia is a trustless, transparent, and interoperable energy exchange platform with transaction tokens that enable retailers to perform simple power transactions with each other and receive payments in real time from automated settlement systems [46].