AUTOMATION OF THE SUPPLIER ROLE IN THE GB POWER SYSTEM USING BLOCKCHAIN BASED SMART CONTRACTS

An electricity supply smart contract was developed and demonstrated to perform pre-time-of-use price negotiation between demand and generation and post-time-of-use settlement and payment. The smart contract was demonstrated with 1000 loads/generators with usages simulated using lognormal probability distributions. It combines payment of deposit, negotiation of price based on estimates, settlement based on actual usage and enactment of payments using crypto-currency. The settlement procedure rewards customers that adjusted to balance the system. The smart contract was written in the Solidity programming language and implemented with a simulated Ethereum blockchain using testrpc and go-ethereum. In the example test case, a price was agreed, settled and payment enacted.


INTRODUCTION
Automation of the energy supply role in the GB power system will become possible due to the increasing feasibility of smart contracts and the increase in digital metering across the power system.On the GB system, energy suppliers act as the interface between consumers and generators.They are free to negotiate prices with generators and compete for customers with other suppliers.The bulk of the demand-supply balance is achieved through these negotiations, with the remaining short term imbalance managed by the System Operator through the Balancing Mechanism.Through demonstration of automated negotiation, settlement and payment, with reward for system balancing, this work shows the potential for blockchain based smart contracts to undertake the supplier role.
The intent of the Supplier role, established during the market liberalisation of the 1980s and 90s, is that those Suppliers offering the most competitive offers (in terms of price and/or generation mix) will tend to survive.However, an investigation found that a relatively low proportion of consumers change suppliers or negotiate (~70% of domestic customers stay on default tariffs) [1].There is, therefore, desire to improve the system.The advent of implementable Smart Contracts may give governments and regulators opportunity to reduce overall system costs and ensure competitiveness.
Smart contracts are rules for information exchange that have a common mechanism for definition and enactment.They were described by Szabo in 1994 [2], who later envisaged a mutually trusted virtual computer upon which smart contracts could run [3].Implementations of such virtual computers using modern cryptography are commonly associated with the label "blockchain technology".
Blockchains are data structures (blocks) with cryptographic links from the present state to the preceding state.When changes are made to a block in accordance with a set of rules, a new block is created.Each new block must also contain a cryptographic hash of the previous block.This creates a continuously growing chain of blocks.In many public blockchains, the latest block is agreed upon using Proof of Work or Proof of Stake consensus algorithms.
The growth of blockchain technology for cryptocurrency is well documented [4].Recent advances go further in allowing transactions to define smart contracts.One example, Ethereum, includes a blockchain based 256-bit virtual computer [5] -this allows flexibility in how smart contracts are defined.
There is worldwide research and implementation activity, including many start-up companies [6]- [13], in the area of blockchain based smart contracts for energy systems.Aitzhan and Svetinovic describe a token based peer to peer system for anonymous negotiation of energy prices [14] and Horta et al describe work underway on a blockchain based distributed energy market test system [15].LO3Energy's Brooklyn microgrid project [16] has demonstrated the interaction of electricity metering with a blockchain based smart contract and Ponton claimed the first blockchain based energy trade in Europe [8].SolarCoin, a token for reward of solar electricity generation, has a market capitalisation of ~$6B USD [17].

METHOD Example Supplier Smart Contract
A simple supplier smart contract was implemented on the Ethereum blockchain platform, using a private test net.It shows how a set of rules for a price negotiation and settlement, in which all connected users (demand and generation) have half hourly metering, are defined and enacted.The contract process is shown in Figures 1 and  2. All critical users submit a predicted usage in Wh for the hour ahead to the contract.Losses are estimated by the network operator (simplified to a single entity).A system wide demand/generation imbalance figure is calculated by the contract.If there is excess demand, generation offers are accepted (in order of lowest offer price to highest) until there is excess generation.Conversely, if there is excess generation, demand offers are accepted in order of lowest to highest) until there is excess demand.The contract sends the revised imbalance estimate to the network operator.The accepted non-critical users are paid at their offered price and the accepted offers are used to determine the energy price for the critical users -see final box in Figure 1.
After usage, there is a settlement stage.All users submit their actual metered usage in Wh to the contract.Critical users pay the market price for their usage.Where users meet their estimate they are rewarded.Where they differ from their estimated use in a way that helps system imbalance (e.g.where the system operator would have to call upon emergency generation reserve and the user had reduced demand) they are rewarded.Where they exacerbate system imbalance they are penalised.The reward payment is calculated according to: where is the calculated reward for a given user, is a historical performance factor between 0 and 1, is a users' estimated usage, is a users' actual usage and U is the set of all users.After all of the rewards have been calculated, the sum of all rewards is used to attribute penalties to the relevant accounts: where is the calculated penalty for a given user.
This formulation means users that adjust to balance demand-generation on the system are paid by those that unbalance it.The historical performance factor, , reduces the potential for gaming of the formula through submission of inaccurate estimates.
The smart contract code was written in the Solidity programming language [18].The contract uses the default value token of the Ethereum platform, the Ether -ETH.To participate, users must maintain a deposit from which their usage payment is taken (or into which they are paid).

Supplier Smart Contract Test Case -Negotiation
To test the example smart contract 1000 user accounts were generated with a private blockchain simulation created with testrpc.The first 900 of the users were partitioned into 800 Low Voltage (LV) users, 90 Medium Voltage (MV) and 10 High Voltage (HV).They were designated as critical and their estimated demand and generation usages where created using Numpy's [19], lognormal function with parameters shown in Table 1.The resulting distributions are shown in Figure 3.For the remaining 100 users, designated as non-critical, generation offers were made with lognormal function parameters shown in Table 2.The ETH values depicted are not tied to existing GBP to ETH exchange rates.The 50 LV generator offers and prices are shown in Figure 4.The estimates for the 900 critical users and the offers from the 100 non-critical users were submitted to the smart contract on the testrpc Ethereum blockchain and the price setting function was called using go-ethereum.Estimated losses of 200 GWh were submitted by a designated network operator account.

Supplier Smart Contract Test Case -Settlement
Actual usage readings were simulated by multiplying the arrays of original estimates by normal distributions created by NumPy's normal function, with parameters as shown in Table 3.The HV generation and demand values were left unchanged as were all of the accepted noncritical users.Adjusted nominal losses of 190 GWh were submitted by a designated network operator account.The user accounts each submitted an actual usage reading to the smart contract.Those generators with accepted offers also submitted their usage values.Notional Use of System (UoS) charges were set at 1ETH per user.

Negotiation
Once all estimates and offers were received by the smart contract, the market price setting function ran as described in Figure 1.This resulted in the acceptance of 71 offers from the non-critical generators and a market price of 9 ETH per kWh for critical users.

Settlement
The settlement procedure ran as described in Figure 2.
The price paid per kWh for each user is shown in Figure 5 (note the UoS charge is not included).In this test case as demand exceeded generation in the negotiation phase, generation is paid (positive) and demand is charged.The variability in prices paid by the LV users is due to the increased spread of estimation error (Table 3) and the reward/penalty being attributed per Wh of error (Equations 1 and 2).The mean price received by LV generators is 7.1 ETH/kWh with a range from 10.9 to 2.0 ETH/kWh.The mean price paid by LV loads is 10.7 ETH/kWh with a range from 19.3 to 7.0 ETH/kWh.The mismatch between the load and generation prices is in part due to the losses (the notional UoS charge was excluded from these figures).The next stage of this work is to create a set of tiered smart contracts, tied to the topology of the power network, such that there is clear competition for all services provided to customers including provision for system running costs (e.g.losses, stability, protection), provision of import/export capacity as well as certainty of future availability (e.g.planning, maintenance) whilst not requiring active consumer engagement.The aim is to demonstrate a system that provides clear pricing signals to potential innovators and investors at all levels.

CONCLUSIONS
An energy supplier smart contract for automated negotiation, settlement and payment, with reward for system balancing support was demonstrated.This indicates potential for blockchain based smart contracts to perform a supply role on the GB power system.The demonstrated smart contract includes reward for adjusting demand towards system balance with payments taken from those who adjusted away from system balance.In the example test case, a price was agreed, settled and payment enacted.
Energy supply companies can be viewed as competing sets of demand-generation negotiation rules.There is opportunity for suppliers to encode these rules as smart contracts.Consequently, there is a challenge to system regulators to arrange system information flows from metering (at all voltage levels) to smart contracts in such a way that efficacy of competition is maximised.

Figure 1 .Figure 2 .
Figure 1.Process for negotiation phase of supplier smart contract

Figure 5 . 5 DISCUSSION
Figure 5. Price per unit energy for each load/generator

Table 1 .
Characteristics of smart contract critical user load and generation estimates.

Table 3 .
Adaptations of critical user LV and MV estimates to give simulated actual uses