{'fraction_non_alphanumeric': 0.024935511607910577, 'fraction_numerical': 0.00547585645110196, 'mean_word_length': 4.8840367461057115, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Real-Time Bidding Model of Cryptocurrency Energy Trading Platform

: Blockchain technology provides a comprehensive solution to user access and energy trading for distributed energy Internet. Achieving market-based pricing, increasing the earnings of energy suppliers, attracting foreign capital and facilitating the upgrade of solar and wind energy are pressing issues. Drawing on the practices of centralised exchanges and blockchain cryptocurrency, the author designed the Cryptocurrency Energy Trading Platform (CETP), dividing the permissioned blockchain into the Energy Blockchain Platform (EBP) and the Energy Cryptocurrency Exchange (ECE). The frequently used real-time bidding scenario and the seldom-used power-using scenario are separated from each other. A market welfare model for real-time bidding is established and veriﬁed. With Energy Blockchain Cryptocurrency (EBC) as the trading medium, the platform allows external bidders to get involved in the bidding and transactions, which not only attracts the social capital to be used in the development of energy Internet but also helps stabilise the energy market prices, thus, advancing the energy Internet.


Introduction
China's energy is mainly composed of five types of energy sources: fire power, water conservancy, nuclear power, wind power and solar energy, as shown in Figure 1, of which thermal power generation occupies a dominant position. As China's pressure to reduce carbon dioxide emissions increases, China restricts the development of fossil energy from policy and investment levels, and encourages the development of solar and wind energy [1,2]. Because of China's limited water resources, the growth rate of hydropower is limited and cannot grow rapidly [3]. Nuclear energy is affected by reactor safety, nuclear waste disposal, and the risk of weapon material proliferation, and its development is limited. Therefore, nuclear energy accounts for a relatively small proportion of China's energy sources [4]. Using 2016 data as the base, solar and wind energy are growing rapidly, far exceeding thermal power and hydropower. The annual growth rate of thermal power and hydropower is below 5%, and the annual growth rate of solar and wind power is more than 10%. For example, the growth rate of solar power was 68.7% in 2017, and the growth rate of wind power was 34.6% in 2020. Solar and wind energy have gradually become an important part of the power supply. However, in the current electricity market, the grid-connected electricity price of solar and wind energy is not market-oriented. The grid-connected price of solar and wind energy cannot change due to fluctuations in market demand and inability to buy clean energy at low prices. However, the grid-connected electricity price of solar and wind energy in the current electric power market is not marketoriented. The grid-connected price cannot change with fluctuations in market demand, and at the same time, electricity consumers cannot purchase clean energy at low prices. It is a pressing task to achieve real-time bidding and trading of solar and wind energy and facilitate the development of solar and wind energy with the market-based mechanism. Blockchain technology provides a new solution to the energy Internet. However, as a distributed ledger blockchain logs completed transactions only and shares transaction information with other blocks [5,6], it cannot share information, such as quotations, in real-time, and therefore, cannot be used as an information release platform. Moreover, energy Internet users cannot obtain information about unspecified users, including the wallet address of the other party. Therefore, blockchain cannot function as a quotation transaction system, it can only be used as a transaction ledger system. Cryptocurrency is a virtual currency that leverages an encryption algorithm to ensure safety. The currency is also known as digital encrypted currency. Blockchain technology provides a safe distributed transaction environment for cryptocurrency and accelerates its development [7]. Permissioned Blockchain means that every node participating in the blockchain system is licensed, and unauthorised nodes are not allowed to access the system. Permissioned blockchain solutions adopt more efficient consensus algorithms and smart contracts. A role-based access control model provides controlled access of resources to members [8]. Implementation of a permissioned blockchain is used to ensure that only known agents are permitted to access the system [9]. The authors in [10] proposed a framework for DR registry and implemented it as a proof of concept on Hyperledger Fabric, using real assets in a laboratory environment in order to study its feasibility and performance. The permissioned blockchain has the following features: (1) Only certified members are allowed to participate and attacks are avoided from external users. (2) The consensus mechanism only needs to focus on efficiency without considering security. The system has a faster transaction speed and a higher transaction processing capacity. (3) No miners need to maintain the system, which can effectively reduce transaction costs. (4) The user's identity information is authenticated by the administrator of the permissioned blockchain, which can better protect the user's privacy information during the transaction process.
Past studies have provided their research on cryptocurrency and blockchain technology and added valuable input to the literature. With the success of Bitcoin in financial markets [11], there is huge potential for blockchain technology to be applied to the energy sector [12]. As the application of blockchain expands from the field of finance to energy, the concept of an "energy blockchain" has been proposed [13]. Microgrid systems are Blockchain technology provides a new solution to the energy Internet. However, as a distributed ledger blockchain logs completed transactions only and shares transaction information with other blocks [5,6], it cannot share information, such as quotations, in real-time, and therefore, cannot be used as an information release platform. Moreover, energy Internet users cannot obtain information about unspecified users, including the wallet address of the other party. Therefore, blockchain cannot function as a quotation transaction system, it can only be used as a transaction ledger system. Cryptocurrency is a virtual currency that leverages an encryption algorithm to ensure safety. The currency is also known as digital encrypted currency. Blockchain technology provides a safe distributed transaction environment for cryptocurrency and accelerates its development [7]. Permissioned Blockchain means that every node participating in the blockchain system is licensed, and unauthorised nodes are not allowed to access the system. Permissioned blockchain solutions adopt more efficient consensus algorithms and smart contracts. A role-based access control model provides controlled access of resources to members [8]. Implementation of a permissioned blockchain is used to ensure that only known agents are permitted to access the system [9]. The authors in [10] proposed a framework for DR registry and implemented it as a proof of concept on Hyperledger Fabric, using real assets in a laboratory environment in order to study its feasibility and performance. The permissioned blockchain has the following features: (1) Only certified members are allowed to participate and attacks are avoided from external users. (2) The consensus mechanism only needs to focus on efficiency without considering security.
The system has a faster transaction speed and a higher transaction processing capacity. (3) No miners need to maintain the system, which can effectively reduce transaction costs. (4) The user's identity information is authenticated by the administrator of the permissioned blockchain, which can better protect the user's privacy information during the transaction process.
Past studies have provided their research on cryptocurrency and blockchain technology and added valuable input to the literature. With the success of Bitcoin in financial markets [11], there is huge potential for blockchain technology to be applied to the energy sector [12]. As the application of blockchain expands from the field of finance to energy, the concept of an "energy blockchain" has been proposed [13]. Microgrid systems are widely used across the world for providing demand response management between users and service providers [14]. Blockchain has the characteristics of information disclosure and security, which can provide a secure and trusted environment for microgrids [15,16]. Microgrid power is transmitted through the grid line, and microgrid branches will increase power losses [17]. Voltage and power quality problems exist in microgrids when switching between grid-connected mode and island mode [18]. In addition, the application of blockchain to microgrids needs to be combined with the concept of economic management to form a comprehensive framework [19]. Blockchain's trusted feature allows companies to cooperate with business partners safely in a shielded environment [20]. Blockchain technology can be used not only for cryptocurrencies and fintech, but also for power and energy systems. In the Brooklyn microgrid project (US), blockchain-based electricity transactions among consumers (P2P transactions) were implemented for the first time ever in April 2016 [21]. The authors in [22] propose a blockchain-based energy trading model that allows prosumers to trade energy in the grid. The authors in [22] propose blockchain-based architecture for distributed management, control, and validation of DR programs in smart grids. The approach was validated using a prototype implemented in an Ethereum platform. Microgrid peer-to-peer (P2P) energy trading is often described as an auction game [23]. Consumers and producers participating in the microgrid, such as residents and electric vehicles [24], can benefit from energy transactions [25]. Blockchain technology provides a safer system for peer-to-peer energy trade and ensures the reliability and security of the trading system [26].
The deficiencies of current research on blockchain trading platform are as follows: (1) It is generally assumed that consumers and producers can conduct P2P transactions directly, without considering the matching process between users and the release of transaction information. Due to the distributed characteristics, participating users cannot know the counterparty information, so blockchain is not suitable for information publishing and sharing systems [27]. (2) It is impossible to realise real real-time bidding by setting electricity quantity and electricity price in advance and using a blockchain transaction function to complete an irrevocable quotation [28]. (3) Users of the platform need to write a smart contract to participate in transactions.
Smart contracts have high requirements and are prone to error risks, which are not conducive to users' use and attracting new users [29]. (4) Power consumption is a period of continuous process, and transaction confirmation is a time point. The risk of fraudulent transaction may exist if they are not synchronised.
Blockchain uses cryptocurrencies as the medium of exchange and uses consensus mechanisms to verify transactions [30]. Cryptocurrencies have high potential value and could revolutionise the traditional financial industry in the future [31,32]. A bidding strategy for the multi-energy market is presented, in which reserve price adjustment and a dynamic compensation mechanism are innovatively integrated into an adaptive learning process [33]. Its price is predicted according to the cryptocurrency's past price inflations by using a time series consisting of daily ether cryptocurrency closing prices [34]. Bidding helps to maintain market price stability, match deals and increase market attractiveness. This paper introduces a Cryptocurrency Energy Trading Platform (CETP) based on Energy Blockchain Cryptocurrency (EBC) to implement market-based pricing safely and efficiently. The platform is composed of two sub-models; first, the Energy blockchain Platform (EBP) that combines power generation and use with the EBC. Suppliers generate power and EBC, whereas demanders use power and EBC. Blockchain technology is used to ensure secure transactions. The other sub-model is the Energy Cryptocurrency Exchange (ECE) that realises information sharing and frequent trading via the traditional, mature financial exchange system. Energy suppliers, consumers and external bidders take EBC as the bidding object and carry out real-time bidding of energy transactions.
The contributions of this paper are summarised as follows: (1) Using blockchain technology and taking the main grid as the centre, an energy Internet trading platform CETP is constructed based on a permissioned blockchain. (2) CETP uses EBC as the token of electricity transaction between participants and indirectly realises real-time electricity bidding through real-time bidding against EBC. (3) Referring to the exchange model, ECE realises the release of trading information and matching of trading, and realises the independence of electricity bidding and electricity trading. (4) Introduce bidders to participate in real-time bidding, attract more user funds to participate and maintain the relative stability of electricity price.
The rest of this paper is structured as follows: Section 2 shows the transaction processes of CETP, EBP and ECE and introduces their functions; Section 3 builds the user welfare model based on ECE bidding, Section 4 presents the test scenarios and validation results, while Section 5 discusses the current limitations of the paper and the direction in which it can be extended, as well as the future research agenda.

CETP Transaction Flow
In order to solve the deficiencies of the existing blockchain trading system and meet the needs of frequent bidding and information sharing, this paper splits energy trading and energy bidding into two different models, which constitute CETP as a whole. CETP covers two modules, namely EBP and ECE ( Figure 2). The main grid power plant is not included in the energy blockchain system. Other participants in the system are energy suppliers, large power grids, energy consumers, bidders and centralised exchanges. EBP centres on the main grid, whereas ECE centres on the changes. The supply and demand match in EBP conduct transactions and achieve power transfer via the main power grid. Energy blockchain Cryptocurrency (EBC) is based on the consensus mechanism of CETP. Similar to Bitcoin, ETH and other blockchain tokens, EBC can be directly transferred among users to carry out transaction function. The contributions of this paper are summarised as follows: (1) Using blockchain technology and taking the main grid as the centre, an energy Internet trading platform CETP is constructed based on a permissioned blockchain. (2) CETP uses EBC as the token of electricity transaction between participants and indirectly realises real-time electricity bidding through real-time bidding against EBC. (3) Referring to the exchange model, ECE realises the release of trading information and matching of trading, and realises the independence of electricity bidding and electricity trading. (4) Introduce bidders to participate in real-time bidding, attract more user funds to participate and maintain the relative stability of electricity price.
The rest of this paper is structured as follows: Section 2 shows the transaction processes of CETP, EBP and ECE and introduces their functions; Section 3 builds the user welfare model based on ECE bidding, Section 4 presents the test scenarios and validation results, while Section 5 discusses the current limitations of the paper and the direction in which it can be extended, as well as the future research agenda.

CETP Transaction Flow
In order to solve the deficiencies of the existing blockchain trading system and meet the needs of frequent bidding and information sharing, this paper splits energy trading and energy bidding into two different models, which constitute CETP as a whole. CETP covers two modules, namely EBP and ECE ( Figure 2). The main grid power plant is not included in the energy blockchain system. Other participants in the system are energy suppliers, large power grids, energy consumers, bidders and centralised exchanges. EBP centres on the main grid, whereas ECE centres on the changes. The supply and demand match in EBP conduct transactions and achieve power transfer via the main power grid. Energy blockchain Cryptocurrency (EBC) is based on the consensus mechanism of CETP. Similar to Bitcoin, ETH and other blockchain tokens, EBC can be directly transferred among users to carry out transaction function. In contrast, ECE supports direct transactions between the supply and demand parties, and deals with the ownership delivery of EBC and legal tender. Therefore, trust and transaction risks will not be a concern among CETP users, as transaction costs are reduced and transaction efficiency is improved. As a centralised system, CETP does not need a consensus mechanism to ensure transaction security. The key task with CETP is to improve the transaction speed and system performance. Therefore, the PBFT of the alliance chain Hyperledger Fabric is used in the CETP consensus mechanism, which is more efficient in block generation compared with POW (Proof of Work) and POS (Proof of Stake) In contrast, ECE supports direct transactions between the supply and demand parties, and deals with the ownership delivery of EBC and legal tender. Therefore, trust and transaction risks will not be a concern among CETP users, as transaction costs are reduced and transaction efficiency is improved. As a centralised system, CETP does not need a consensus mechanism to ensure transaction security. The key task with CETP is to improve the transaction speed and system performance. Therefore, the PBFT of the alliance chain Hyperledger Fabric is used in the CETP consensus mechanism, which is more efficient in block generation compared with POW (Proof of Work) and POS (Proof of Stake) and realises faster transaction confirmation [35]. CETP decomposes electricity trading and bidding in the traditional energy internet, using the main grid for power transmission, reducing the construction cost of shared facilities and encouraging energy users to get involved in the bidding. This helps realise fair competition based on supply and demand relations.

Energy Blockchain Platform Transaction Flow
In order to solve the problem of energy trading and supply and demand matching, users can realise P2P energy trading. We design the counterparty scheme of main grid as user. First of all, the main grid acts as a dealer to indirectly realise P2P transactions. Second, the main grid acts as a power resource pool. Producers sell electricity into the main grid resource pool and consumers buy electricity from the resource pool. Therefore, this scheme does not need to consider whether the quantity of power supply and demand matches, and breaks through the limitation of traditional P2P transaction supply and demand matching. Participants of the energy blockchain access the grid-centric blockchain system and get an electronic wallet after registration [36]. As shown in Figure 3, with blockchain as the centre, power transfers between energy suppliers and consumers via the main grid, and electricity bills are paid in the energy blockchain with EBC. Energy suppliers use smart meters to connect power to the grid and data to the blockchain. Smart meters not only record the power connected to the grid but also write user information and electricity information into the energy blockchain with Oracle [37]. Based on electricity data, the energy blockchain awards power suppliers with EBC according to fixed algorithm rules and saves EBC in the suppliers' wallets. The process is similar to minting, which increases the EBC supply in the market. Energy consumers such as factories, families and electric vehicles get connected to the main grid to pay for power with EBC, reduce the EBC in the market and keep the total amount of EBC stable. Energy blockchain Platform facilitates energy transactions between suppliers and consumers via the main grid. Transactions with open and credible results are settled with blockchain technology. and realises faster transaction confirmation [35]. CETP decomposes electricity trading and bidding in the traditional energy internet, using the main grid for power transmission, reducing the construction cost of shared facilities and encouraging energy users to get involved in the bidding. This helps realise fair competition based on supply and demand relations.

Energy Blockchain Platform Transaction Flow
In order to solve the problem of energy trading and supply and demand matching, users can realise P2P energy trading. We design the counterparty scheme of main grid as user. First of all, the main grid acts as a dealer to indirectly realise P2P transactions. Second, the main grid acts as a power resource pool. Producers sell electricity into the main grid resource pool and consumers buy electricity from the resource pool. Therefore, this scheme does not need to consider whether the quantity of power supply and demand matches, and breaks through the limitation of traditional P2P transaction supply and demand matching. Participants of the energy blockchain access the grid-centric blockchain system and get an electronic wallet after registration [36]. As shown in Figure 3, with blockchain as the centre, power transfers between energy suppliers and consumers via the main grid, and electricity bills are paid in the energy blockchain with EBC. Energy suppliers use smart meters to connect power to the grid and data to the blockchain. Smart meters not only record the power connected to the grid but also write user information and electricity information into the energy blockchain with Oracle [37]. Based on electricity data, the energy blockchain awards power suppliers with EBC according to fixed algorithm rules and saves EBC in the suppliers' wallets. The process is similar to minting, which increases the EBC supply in the market. Energy consumers such as factories, families and electric vehicles get connected to the main grid to pay for power with EBC, reduce the EBC in the market and keep the total amount of EBC stable. Energy blockchain Platform facilitates energy transactions between suppliers and consumers via the main grid. Transactions with open and credible results are settled with blockchain technology.

Energy Cryptocurrency Exchange Transaction Flow
In order to solve the limitations of blockchain technology, realise the timely processing of trading information release, transaction matching and high-frequency trading and ensure the security of trading, we designed a set of independent trading systems by referring to traditional exchanges. Traditional exchanges publish bidding information and pair transactions safely and efficiently [38]. Participants conduct real-time EBC bidding and transactions after binding identity information with the digital wallet. Both seller and buyer are the centralised exchange ECE. When the seller sells EBC, EBC would be transferred to the exchange ECE. After receiving EBC, ECE makes a quote based on the seller's

Energy Cryptocurrency Exchange Transaction Flow
In order to solve the limitations of blockchain technology, realise the timely processing of trading information release, transaction matching and high-frequency trading and ensure the security of trading, we designed a set of independent trading systems by referring to traditional exchanges. Traditional exchanges publish bidding information and pair transactions safely and efficiently [38]. Participants conduct real-time EBC bidding and transactions after binding identity information with the digital wallet. Both seller and buyer are the centralised exchange ECE. When the seller sells EBC, EBC would be transferred to the exchange ECE. After receiving EBC, ECE makes a quote based on the seller's price. The quote is updated in real-time, including the price and the amount of EBC charged at the price. When ECE is paired successfully, the transaction is based on the priority of price and time. After the transaction, ECE will handle the EBC delivery between the buyer and the seller. ECE supports 7 × 24 trading. All participants compete fairly and EBC prices are adjusted based on market bidding. With open bidding, ECE achieves optimal market resource allocation, avoids the intervention of centralised institutions and gives full play to the regulation role of the market. ECE allows external bidders to participate in the transactions, who get extra earnings by selling EBC out at high prices and buying EBC at low prices. This enhances the stability of the EBC market price. Figure 4 presents the ECE architecture.
price. The quote is updated in real-time, including the price and the amount of EBC charged at the price. When ECE is paired successfully, the transaction is based on the priority of price and time. After the transaction, ECE will handle the EBC delivery between the buyer and the seller. ECE supports 7 24 × trading. All participants compete fairly and EBC prices are adjusted based on market bidding. With open bidding, ECE achieves optimal market resource allocation, avoids the intervention of centralised institutions and gives full play to the regulation role of the market. ECE allows external bidders to participate in the transactions, who get extra earnings by selling EBC out at high prices and buying EBC at low prices. This enhances the stability of the EBC market price. Figure 4 presents the ECE architecture.

Energy Cryptocurrency Exchange Model and Welfare Analysis
Market supply and demand can be adjusted by price in real-time. When the market price drops, the EBC price will be lower than the cost of some power suppliers, discouraging the suppliers from power generation or EBC sales. Under this circumstance, consumers would buy more EBC, which will drive the price up. When the market price rises, suppliers will increase power generation and consumer demand will decrease, resulting in a drop in the EBC price. In addition, real-time price adjustments encourage energy suppliers to update the production equipment, reduce the production costs and get additional earnings. Price fluctuations encourage consumers to make proper use of energy, realise stable power consumption and save resources.

Welfare Model Based on Energy Blockchain Cryptocurrency Bidding
Assume that there are M energy suppliers in the model, the number of suppliers participating in EBC transaction at time k is m ,

Energy Cryptocurrency Exchange Model and Welfare Analysis
Market supply and demand can be adjusted by price in real-time. When the market price drops, the EBC price will be lower than the cost of some power suppliers, discouraging the suppliers from power generation or EBC sales. Under this circumstance, consumers would buy more EBC, which will drive the price up. When the market price rises, suppliers will increase power generation and consumer demand will decrease, resulting in a drop in the EBC price. In addition, real-time price adjustments encourage energy suppliers to update the production equipment, reduce the production costs and get additional earnings. Price fluctuations encourage consumers to make proper use of energy, realise stable power consumption and save resources.

Welfare Model Based on Energy Blockchain Cryptocurrency Bidding
Assume that there are M energy suppliers in the model, the number of suppliers participating in EBC transaction at time k is m, m ∈ [1, M], there are N power consumers and the number of consumers participating in EBC transaction at time k is n, n ∈ [1, N]. The energy suppliers and consumers both transact with the main grid. The stock EBC in the market represents the awards for the power produced previously. The suppliers could generate power at full capacity without considering whether the power consumption size at time k matches the power generation size. The EBC price at time k, p k , is the result of the current supply-demand gaming. The market supply and demand at different moments are constantly changing. Subject to the supply and demand relationship, which further affects p k , the total market supply and demand at time k is shown below: where T k D represents the sum of the EBC demand q k i under different coefficients α i of n consumers at time k, i.e., the total demand for EBC at the time of k. T k S represents the sum of the EBC supply q k j under different coefficients β j of m suppliers at time k, i.e., the total supply of EBC at the time of k. α i and β j are influenced by many factors, such as price and preference.
Supplier costs decide the price set when it gets connected to the grid prices and consumer costs are expressed as the main grid price. The costs of most energy suppliers are lower than those of consumers, because user costs are decided by different factors. Suppliers' costs are occasionally higher compared with consumers' costs. As shown in Figure 5, part of the blue dots are below the red dots. n consumers at time k , i.e., the total demand for EBC at the time of k . S T represents the sum of the EBC supply k j q under different coefficients j β of m suppliers at time k , i.e., the total supply of EBC at the time of k . i α and j β are influenced by many factors, such as price and preference. Supplier costs decide the price set when it gets connected to the grid prices and consumer costs are expressed as the main grid price. The costs of most energy suppliers are lower than those of consumers, because user costs are decided by different factors. Suppliers' costs are occasionally higher compared with consumers' costs. As shown in Figure  5, part of the blue dots are below the red dots. In order to simplify the discussion, producer and consumer are regarded as two different wholes in this paper, and all producer costs and consumer costs in the market are fitted separately. Assume that d  In order to simplify the discussion, producer and consumer are regarded as two different wholes in this paper, and all producer costs and consumer costs in the market are fitted separately. Assume that p k d is the fitting result of the grid-connected prices of all suppliers at time k, i.e., the lower limit of power prices at time k. p k u is the fitting result of the purchasing prices of all consumers at time k, i.e., the upper limit of power prices at time k. When the real-time price p k is higher than p k u , the consumer will purchase power from the main grid directly. When the real-time price p k is lower than p k d , the supplier will sell power to the main grid rather than to the market. p k often fluctuates between p k u and p k d , as shown in Figure 6.  Consumers are power users and their utility is negatively correlated to the EBC prices. The higher the prices, the better the utility. The consumer utility function at time k is shown below: where x k i is the EBC purchased by consumers at time k, and α the non-negative parameter. The consumer utility experiences a marginal decrease. When p k equals the lower limit of p k d , the consumer utility is the highest. The power price of the main grid is subject to different factors. According to the price table of the State Grid, factors that affect consumer

prices include Electricity Type (ET), Voltage classes (VC), Electricity Peak Valley (EPV) and
Step Electricity Consumption (SEC). The consumer costs are shown below: where α i , β i , γ i , δ i are the coefficients of different consumers, µ i is the random disturbance parameter and CC k i is the price at which consumer i purchases power from the main grid. The utility purchased is the basic utility. The utility purchased at price p k u is the market utility. The consumer welfare is the difference between market utility and basic utility. The lower the p k , the better the total utility. The total consumer welfare at time k is calculated as below: Suppliers are power sellers and their utility is positively correlated to the EBC prices. The higher the prices, the better the utility. The supplier utility function at time k is shown below: where y k j is the EBC sold by suppliers at time k, β the non-negative parameter. The supplier utility experiences a marginal decrease and the generation tendency is in positive correlation to the prices. The higher the prices are, the stronger the generation tendency. When p k equals the upper limit of p k u , the supplier utility is the highest. The grid-connected power price of the main grid is subject to different factors. According to the price table of the State Grid, factors that affect supplier prices include ET, Geographic Classification (GC), Base Price (BP) and Subsidised Prices (SP). The supplier costs are shown below: where α j , β j , γ j , δ j are the coefficients of different suppliers, µ j is the random disturbance parameter, and CS k j is the price at which supplier j gets connected to the main grid. The utility gained is a basic utility. The utility gained at price p k d is the market utility. The producer welfare is the difference between the supplier cost and the actual price p k . The higher the price p k , the better the total utility. The producer welfare at time k is calculated as below: Total welfare of consumers and suppliers is at the highest when equilibrium price p k e is achieved. In this paper, the equilibrium price p k e is calculated as the mean of the sum of p k u and p k d . The total welfare is the sum of the supplier welfare and the consumer welfare. Consumer welfare decreases as the price increases, whereas supplier welfare increases as price increases. As the welfare experiences a marginal increase, the total welfare is the best when p k equals p k b . The total welfare at all times model based on EBC is shown below:

Introduce a Bidder Welfare Model
To maximise social welfare, p k should be made as close to p k e as possible via real-time bidding. Traditional consumers and suppliers focus on their own needs and pay little attention to price stability. This paper introduces the external bidders into the bidding transactions, with reference to the model used by traditional exchanges. External bidders are not involved in energy production and consumption. They only participate in EBC bidding transactions. Assume that there are V external bidders and the number of bidders engaged in EBC transactions at time k is v, v ∈ [1, V]. External bidders buy EBC when p k is lower than p k e and sell EBC when p k is higher than p k e , thus gaining earnings and keeping p k within a stable range. The bidding price range after the introduction of external bidders is shown below: where σ is a transaction trigger threshold, usually expressed as the multiple of simple standard difference and M k d is the bidding purchase price. When p k is lower than M k d , the bidders tend to buy EBC. M k u is the bidding purchase price. When p k is higher than M k u , the bidders tend to sell out EBC. The price trend is shown in Figure 7, where the black line is the real-time price p k , the orange line is the equilibrium price p k e , the dark blue line is the selling price M k u and the green line is the purchasing price M k d .  The participation of bidders affects the EBC demand and supply. Below is the total demand and supply after the introduction of external bidders.
where T k D and T k S are the total purchase demand and total bidder sales demand at time k, respectively. q k i and q k j are the demand and supply at time k, respectively. (A v ) k b is the purchase demand of the v-th bidder at time k, and (A v ) k g is the sales demand of the v-th bidder at time k. α, β are the non-negative coefficients at purchase and sales, and ω is the participation of the bidders, the value of which is between [0, 1] (zero for no participation and one for full participation). The total market demand is the sum of the total demand of all participants and bidders, and the total supply is the sum of the total supply of all participants and bidders. When p k equals the equilibrium price p k e , the market welfare is the best. The welfare model after the introduction of external bidders is shown below.

Simulation Results
This paper used Python for numerical simulation. Assume that there are 500 consumers and 500 suppliers participating in EBP transactions on CETP. Under the traditional pricing mechanism, i.e., time-of-use power price (TOU), the welfare of suppliers and consumers varies in different phases. The total welfare of the energy Internet after the introduction of EBC real-time bidding is shown in Figure 8, where the yellow line represents the optimal total welfare at the equilibrium price p k e , the black line represents the total welfare at the real-time price p k and the green represents the social welfare of TOU. Compared with the total welfare of the TOU power price, the total welfare based on EBC transactions sees remarkable improvement. price e k p , the market welfare is the best. The welfare model after the introduction of external bidders is shown below.

Simulation Results
This paper used Python for numerical simulation. Assume that there are 500 consumers and 500 suppliers participating in EBP transactions on CETP. Under the traditional pricing mechanism, i.e., time-of-use power price (TOU), the welfare of suppliers and consumers varies in different phases. The total welfare of the energy Internet after the introduction of EBC real-time bidding is shown in Figure 8, where the yellow line represents the optimal total welfare at the equilibrium price e k p , the black line represents the total welfare at the real-time price k p and the green represents the social welfare of TOU.
Compared with the total welfare of the TOU power price, the total welfare based on EBC transactions sees remarkable improvement.  Assume that there are 1000 external bidders participating in EBP transactions and set three parameters ω ∈ [0, 0.5, 1] based on formula (11). Both suppliers and consumers are under normal distribution: k ∈ [0, 24], p ∈ [0, 10], U ∈ [0, 100] and σ = 0.75. The price trend after the introduction of external bidders is shown in Figure 9, where the price curves in black and blue and red lines represent the real-time price p k when ω = 0, ω = 0.5 and ω = 1. As more external bidders get involved, the price fluctuations become more stable and the market price gets closer to the equilibrium price.

Conclusions and Discussion
Centreing on the main grid, CETP solves the limitation of existing blockchain trading platforms. EBP realises the direct EBC and electric power transaction of energy Internet users, and solves the restriction of P2P transaction. ECE realises the function of When the real-time price p k equals the equilibrium price, the total market welfare is the best. The green line is the welfare under the TOU power price scheme, where the consumers can only purchase power from the main grid. The consumers and suppliers cannot trade with each other directly. The changes in the welfare function demonstrate a tiered pattern as the prices fluctuate. The total market welfare is shown in Figure 10, where the total welfare decreases when p k deviated from p k e . In the same figure, the black, blue and red lines represent the market prices when ω = 0, ω = 0.5 and ω = 1, respectively. The results show that when ω = 0, there are only EBP transactions. Market-based bidding can elevate the consumer and supplier welfare significantly compared with the TOU power pricing mechanism. Moreover, the introduction of external bidders helps p k get close to p k e . The more bidders, the smoother the p k . The total welfare rises up as the bidders get more involved in the transactions.

Conclusions and Discussion
Centreing on the main grid, CETP solves the limitation of existing blockchain trading platforms. EBP realises the direct EBC and electric power transaction of energy Internet users, and solves the restriction of P2P transaction. ECE realises the function of

Conclusions and Discussion
Centreing on the main grid, CETP solves the limitation of existing blockchain trading platforms. EBP realises the direct EBC and electric power transaction of energy Internet users, and solves the restriction of P2P transaction. ECE realises the function of information publishing and bidding, breaking through the limitation of blockchain technology that does not support information sharing and high frequency trading. After CETP is introduced into Energy Internet, efficient real-time bidding and energy trading are realised, and the overall social welfare of energy Internet participants is improved. The increase in income will stimulate the growth of the supply side, attract more producers to join the energy Internet and the existing producers will also increase their input and capacity. With the increase in capital input, it promotes the technological innovation and upgrading of electric energy production equipment, reduces producer cost and increases income. Market-based electricity prices also improve the consumer end and consumers increase consumption to improve welfare. External bidders not only maintain market stability but can also match transactions and increase market attractiveness. However, the system could be improved in several ways. Firstly, as the centre, the main grid has absolute control, and there is a risk that the main grid can do evil and cannot cope with it. Secondly, market-based price fluctuations depend on the approximate balance between supply and demand, which may lead to the failure of market-based bidding in extreme cases. Finally, ECE trading time and settlement time may affect market price fluctuations.
The cryptocurrency in the model in this paper is generated based on the consensus algorithm of blockchain. The difference in consensus algorithms affects the efficiency of transaction and system performance [39]. However, this paper does not specify which consensus algorithm should be used. The current five main consensus algorithms are proof-of-work, proof-of-stake, delegated-proof-of-stake, load balance and a trust-based approach. Other consensus algorithms have also been proposed, such as a tax-aware society-centric consensus algorithm [40], trust value-based consensus algorithm [41] and a randomised consensus algorithm [42], etc. These consensus algorithms may be combined with our CETP and EBP.
The analysis in the paper shows that CETP can effectively improve overall social welfare, and the simulation results are also verified. The limitations of this model can be extended. First of all, the current scheme only considers the main network as the central mechanism, and the main body of the central mechanism can be expanded, such as introducing community energy storage as the central system [43,44]. In this way, communities can construct community microgrids independently of the main grid. Compared with the main grid, intra-community energy transactions can effectively reduce transaction costs and improve community welfare. Secondly, the model assumes that the external bidder only participates in the bidding and not in production and consumption, so the behaviour of the bidder can be extended. By referring to a blockchain shared mining pool [45,46], the mechanism of a shared production equipment pool is introduced. External bidders can purchase the right to use equipment through the production equipment pool to sell power generation. External bidders can not only trade in ECE to maintain market stability, but also participate in production to increase social supply according to market price. This not only expands the limitation of business scenarios proposed in this paper, but also provides a direction for future research.