# A Blockchain-Based Real-Time Power Balancing Service for Trustless Renewable Energy Grids
## 3 Reproduced Real-World Scenario  
We considered that an aggregator virtual operator implements an energy balance service. It administers an amount of distributed energy resources (DERs) on behalf of the transmission or distribution operators to cope with planned or unexpected occasional fluctuations of the grid power (unbalance events) by opportunely modulating its own power contribution.  
The aggregator stipulates contracts with remote owners of distributed energy resources (DERs), of variable plant sizes, i.e., prosumers equipped with either small solar systems, wind turbines, or commercial batteries capable of delivering electric power in the range of a few KW to a MW. The aggregator classifies the managed sources in terms of a few parameters such as the following: (1) the produced power size; (2) the type of source (i.e., wind, solar, batteries, etc.), which can affect its overall reliability and availability; (3) the level of flexibility offered as a percentage of the contractual base power it is able to modulate up or down; (4) the reference time profile, that is the daily time slot(s) in which the power variation can occur.  
We assumed the number of managed DERs as a parameter and that their contractual energy baselines are statistically distributed according to a Poisson curve. Thus, we will have a few large-sized DERs and increasingly many small-sized DERs contributing to the flows of managed energy and data. We will then increment the number of managed DERs and expect that some technical upper limit will be reached. Each DER has to periodically output to the aggregator a real-time reading of its produced power, where one Hz was deemed as a reasonable frequency for all DERs' periodic power readings.  
Occasionally, DERs receive local power modulation requests, to be implemented by the underlying energy plant as an increase/decrease of power by a given amount, which is also parametric. Modulation requests are asynchronous requests issued by the aggregator and implemented evenly by all managed DERs: each will apply the same relative (percentage of) local modulation. A given aggregate modulation command has to be applied inside the same time window by all DERs, and no new command can be issued in time windows that overlap. The time window, or transient window, is defined by two parameters, {start:datetime} and {end:datetime}, indicating the start-time and end-time for the requested aggregate modulation to be implemented. Acceptable transients in the real world can range from a minimum of a few minutes up to a few hours, depending on the context, and the modulation start can be immediate or in the future, e.g., within the next twelve or twenty-four hours. In the investigated scenario, a fifteen-minute window size has been used.  
In the scenarios we studied, the users that are only consumers do not play any active role; however, they might cause an unexpected energy unbalance event for excessive power draw. Being just consumers, they are not involved in the recovery action. Of course, some consumers could proactively reduce their power draw to help with the recovery. In this case, they would have to interact with the aggregator to register their service contracts and log their actual contributions to the blockchain. However, in this paper, consumers are assumed to be just passive users.  
A decentralized application (DApp) has been developed and deployed on an actual blockchain for the described scenario. Tests have then been executed to measure and analyze the blockchain subsystem's performance under variable stress conditions. These have been conceived to allow us to draw appropriate conclusions on the adequacy of the blockchain technology to support real-world applications with timing constraints, like the considered energy-grid-balancing scenario. Full details on the case study's actual implementation are given in the following section.