Blockchain-Based Market Procurement of Reactive Power

A flexible and adaptable market procurement of reactive power has the potential to improve network efficiency, voltage stability, and operational costs. In Europe, such a dynamic procurement must be in accordance with the European Union directive EU 2019/944 on non-frequency ancillary services. In accordance with this situation, a blockchain-based framework of market procurement of reactive power is proposed and presented in this paper. The devised framework is in alignment with the European Union’s directive to establish a non-discriminatory, transparent, and free market. Moreover, the blockchain-based framework is applicable at all network levels and allows for the variety of different distributed resources to participate. A two-layer blockchain topology is proposed to overcome scalability and transaction time issues. The first main-layer blockchain acts as the agent for trust and guarantees the immutability of data as well as the remuneration of participating market players. The second-layer blockchain facilitates direct access to tendering processes or auctions, fast transactions, and low transaction fees for involved stakeholders. Additionally, a decentralized oracle network is proposed to integrate external data into the second-layer blockchain. Data required for verifying the physical reactive power transactions are delivered by smart meters. The entire procurement process is automated by deploying smart contracts at the various blockchain layers. Thus, in principle, the involved stakeholders are the system operators and market players. For the purpose of validation, the holistic market procurement process is demonstrated and analyzed in a hardware-in-the-loop environment involving reactive power procurement at the distribution network level.


I. INTRODUCTION
A market-based procurement of reactive power is supposed to become very promising in closing the predicted gap of 15 to 35 GVAr reactive power supply in Germany before 2034 [1]. The provision of reactive power in Germany is forecast to exceed costs of 1.1 billion EUR per annum (p.a) in 2035 and could increase to 2 billion EUR p.a in 2050 [1]. Reasons for this development include the phasing out of thermal power plants and a rapid grid transformation to integrate the increasing number of distributed resources. A market framework that leverages the dynamics of a free market is expected to decrease the aforementioned costs. The framework should consider the sovereignty of the system operators which ensure voltage stability of the power grid. As such, a combination of effective incentives and regulatory constraints is desirable for achieving an economic optimum and securing voltage stability. Besides aforementioned aspects, a potential market framework in Europe needs to be in accordance with the European Union directive EU 2019/944 [2]. This directive requires that the market be non-discriminatory, transparent and free.
A conceptual foundation of a market framework was devised in [3] and consists of three procurement methods. The framework aims to achieve an economically optimized outcome by integrating a regulatory, an infrastructure-based, and a market-based procurement method. The regulatory procurement method stipulates technical minimum requirements of facilities, whereas the infrastructure-based procurement method includes the strategic expansion of electrical equipment such as compensators. While regulatory requirements do not typically impose direct costs on the system operator, the infrastructure-based procurement method results in high capital expenditure investments into electrical equipment. In this way, both methods could implicitly limit the costs for a market-based procurement of reactive power. The market-based method could contribute to a more flexible reactive power procurement by the system operator [3], without compromising its sovereignty. In the market-based method, market players would receive the opportunity to offer reactive power to the system operator while the latter could take voltage and network restrictions into account.
At present, a market-based procurement is well established only for market players at the transmission system level [4]. Other network levels are yet to be taken into account, and no matchmaking between local reactive power providers with system operators is performed. In addition, no market incentives for potential stakeholders on provider side are offered. As a result, the reactive power potential of facilities at the distribution network level remains largely unused, although many converter-based resources (CBRs) could provide reactive power [5], [6], [7] at only little time delays [1] and high cost-efficiencies [8]. The currently unexploited potential may facilitate possible savings of 350 to 500 million EUR p.a [1], for Germany alone.
While it is desirable to leverage this potential, the present procurement of exploited reactive power potential has inefficiencies. The state-of-the-art reactive power procurement is often based on undisclosed long-term contractual agreements [4] between a small group of market players and the transmission system operator. Therefore, the long-term contracts are intransparent, reduce flexibility by not adapting to changing network conditions, and may potentially lead to a misallocation of resources due to active power curtailment. For example, local voltage stability problems may be solved more efficiently by a greater pool of aggregated distributed resources [9]. As a result, these resources could provide reactive power and thus reduce voltage-induced redispatch measures. The aforementioned problems should be addressed by a market-based procurement method that is merit-focused.
In [11], [12] variations of optimal power flow-based markets are presented with the aim of achieving a market-clearing and generating price signals for market players. Connected resources at the distribution network level are aggregated and integrated as virtual power plants in [11]. Coordination between system operators across different network levels is presented in [12] as a means to prevent local network congestion. These network congestions can occur if a local reactive power market is operated by each system operator individually. Despite the potential benefits of reactive power markets as in [10], [11], [12], [13], [14], the latter have not yet been implemented in practice. The reasons for the absence of reactive power markets in practice were identified by [15], [16]. These reasons include the lack of conceptual frameworks for contracting, accounting, and incentivizing market players [16], along with insufficient information technology infrastructure, automation, and regulation as potential factors [15].
A key technology that has the potential to accommodate merits such as contracting, automation, and accounting is distributed ledger technology [17]. In particular, the blockchain as a specific type of a distributed ledger possesses the technological potential to provide these merits as well as transparency in terms of market information and data [18], [19], [20], [21], [22]. The transparency of data offered by blockchain could help to promote accessibility and visibility of reactive power providers on all network levels. Blockchain-based approaches for automating contracting and bidding, in the context of grid voltage regulation and optimization, are proposed in [16] and [23]. In addition, the authors of [16] proposed an incentives system for market players through a reputation rating mechanism. However, aspects such as dynamic matchmaking among stakeholders, the scale of transaction time and transaction costs, and the blockchain integration of external measurement data for the verification of transactions are not detailed. These aspects are VOLUME 11, 2023 36107 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.
of relevance for a real-world market implementation that must operate cost-efficiently and within short time frames. Additionally, the authors did not provide an integrated concept for remuneration of market players although financial incentives can increase participation. A large provider side in a reactive power market is imperative for a flexible procurement due to the locality of reactive power supply.

B. BLOCKCHAIN-BASED FRAMEWORK
The blockchain is a distributed ledger that allows for mutually unknown stakeholders to interact trustfully without intermediaries [24]. The involved credibility is achieved through asymmetric cryptographic operations that process lists of data and a dedicated consensus mechanism that authenticates blocks in a decentralized manner. An authenticated block is added to the chain and transparently and immutably stores the lists of data. By introducing the concept of smart contracts [25], self-executing contractual agreements can be stored and documented on a blockchain. These smart contracts can operate in a fully automated manner and enable the digital coding of obligations, agreements, and transactions.
Through smart contracts, blockchain-based frameworks have drawn interest for applications in energy-related topics, especially in applications such as decentralized energy trading [22], [26], data storage, grid management, and emission certification [18], [19], [20]. For example in terms of decentralized energy trading, the Brooklyn microgrid serves as a pilot [27]. This project leverages the Ethereum blockchain and allows neighbours to trade their surplus of generated energy. The objective verification of energy trading is performed through smart meters which are connected via their gateways to a blockchain. Overall, the project was evaluated positively, although concerns associated with scalability and legal regulation do remain [28]. Another application is the establishment of a blockchain-based master databank. Such databank stores the location and technical specifications of distributed generators in order to guarantee a synchronous and redundant set of data.
The main barriers for adoption of blockchain-based frameworks are, besides public acceptance and legal conflicts [29], technical challenges such as scalability, data throughput, and the amount of transaction fees [19], [21]. The legal implications of smart contracts and their compatibility with traditional legal contracts are often ambiguous and require additional clarification and research. Moreover, a lack of education and understanding of blockchain technology impedes a comprehensive public acceptance of this new technology. Scalability is a critical challenge for blockchain technology as current systems are not designed to handle large amounts of data, provide cost-efficient and fast transactions, and maintain a high level of decentralization at the same time. This is a problem for blockchain-based frameworks that require high transaction speeds and data throughput, such as those used for financial transactions.

C. CONTRIBUTION
The contribution of this paper is to provide a methodology for a holistic market procurement of reactive power, thereby paving the way for the adoption of reactive power markets in real-world power systems. At the heart of the methodology is a blockchain-based framework that contributes to provide cost-efficient, transparent, and dynamic matchmaking among stakeholders. Transactions are performed within short time frames. Incentives for market players in form of financial remuneration are integrated into the framework. The blockchain-based framework is outlined with respect to privacy, regulatory, and technical requirements. For the latter, the proposed framework addresses technical barriers from Section I-B, such as high transaction fees and high transaction time, by leveraging a two-layer blockchain topology. The scalability of the reactive power procurement refers to the ability of the proposed framework to handle transactions fast and with low costs. As such, the scalability is validated through actual transactions on blockchain test networks. A prototype was built to coordinate stakeholder interactions through a web application and gain experience on the scale of transaction costs. The performed transactions are quantified with respect to their fees and time. Moreover, an automated remuneration of market players is integrated into the prototype and serves as an incentive for participation. The complete blockchain-based procurement process is verified with the aid of a hardware-in-the-loop (HIL) system that represents the power system side. The HIL environment includes a section of a power system at the distribution network level that enables interaction between simulated grid components and the proposed blockchain-based framework.
The paper is organized as follows. An evaluation of the technological environment that supports a blockchain-based procurement of reactive power is provided in Section II. Section III details the proposed blockchain-based framework and its holistic structure. Experimental validation of a full procurement process performed on a HIL system is presented in Section IV. Conclusions are drawn in Section V.

II. EVALUATION OF TECHNOLOGICAL ENVIRONMENT
A blockchain-based market procurement of reactive power calls for essential requirements in the fields of legal regulation [29] and technology. The regulatory aspects are mainly undefined and leave space for interpretation, whereas the technological environment already forms a substantial base. Besides blockchain technology, a key role is attributed to the metering systems as smart meters as well as CBRs with multifunctional features. These three technological key enablers are evaluated in the following sections.

A. BLOCKCHAIN TECHNOLOGY
Blockchain architectures vary depending on their performance, quality attributes, and specific use cases. For example, the public blockchain Bitcoin [24] is designed to provide a high level of security and decentralization over scalability and transaction speed. This is achieved by applying a computationally intensive consensus mechanism that serves the purpose of securing the integrity of peer-to-peer payments. Blockchain architectures can also be distinguished by different taxonomies. For example, a blockchain can be classified as being permissionless or permissioned, depending on the access restrictions for potential participants. A common feature is that all blockchains rely on a signation method, mostly the SHA-256 hash algorithm, and operate on a consensus mechanism [30]. The consensus mechanism influences three quality attributes of blockchains -the degree of decentralization, security, and scalability of the applied blockchain. However, all three attributes cannot be simultaneously achieved for current first-layer (L1) blockchains [31]. For example, Ethereum is the most commonly applied turingcomplete L1 blockchain, i.e. it is able to realize smart contracts [32].
Presently, Ethereum operates on the proof-of-stake consensus. As such, network participants can assign their virtual assets to a validator node in the form of the network's native cryptocurrency. The validator node then authenticates new blocks and their recorded data. Throughout this process, all nodes need to follow protocol-based rules and omit malicious behaviour. In case a validator node fails to comply, its stored assets are at risk of being reduced or eliminated. Proofof-stake is energy-efficient, and results in a high level of decentralization and security [33]. However, on Ethereum every node needs to verify every transaction which inherently limits scalability. The diminished scalability of Ethereum is reflected through a capacity of around 13 transactions per second, a minimum block confirmation time of 12 s, and high transaction fees [34].
To address the scalability issue to enhance the performance of the L1 blockchain, a nested second blockchain can be utilized [35]. This network is referred to as a secondlayer (L2) blockchain and relies on the consensus of the L1 blockchain. The L2 blockchain not only benefits from the security attribute of the underlying L1 blockchain but also has its particular consensus mechanism and architecture. Through these features, an L2 blockchain can balance out weaknesses of the L1 blockchain such as low scalability. As a result, the L2 blockchain can increase data throughput while reducing transaction fees and transaction time [36], [37]. Interoperability between both blockchains is ensured through deployed smart contracts which allow for bidirectional communication on the respective networks and the transfer of digital assets [38], [39].
A similar concept, but for integrating and processing external data onto a blockchain, is called a decentralized oracle network [40], [41]. A decentralized oracle network supports the security attribute of a blockchain to maintain the integrity of its consensus mechanism while providing the ability to access data outside a blockchain. Through distributed nodes, a decentralized oracle eliminates the initial oracle problem of having a potential single point of failure [42], [43]. In this way, the oracle improves the integration process of data with respect to reliability and trustworthiness. This is valid as long as a single data source is truthful, or several distributed data sources are available for the same kind of information.
A decentralized oracle network also operates on a consensus mechanism, but provides an abstraction layer for high-level services and acts as an agent to retrieve and authenticate external data. The external data are queried through application programming interfaces (APIs) and may include data from digital sources such as databanks or data from physical entities such as sensors. The obtained external data, for example from smart meters in energy applications, are required to trigger conditions and consequently execute instructions in smart contracts.

B. SMART METERING
A smart meter is an intelligent measurement system that comprises a measurement unit and a smart meter gateway (SMGW) which allows access for third parties and applications [44]. The SMGW is able to receive price signals and software updates. Moreover, the SMGW can process control signals and initiate switching sequences for hardware connected to the smart meter. In principle, the smart meter is capable of signing certificates digitally and sending measurement data automatically [44]. These features make it desirable for a technical integration of the SMGW into a blockchain architecture.
A technical integration was evaluated in [45]. The work concluded that there are two reasonable approaches. For the first approach, the SMGW sends its data directly to the blockchain node that has to act as a head-end system. This means the blockchain node must validate and decrypt the data from the smart meter before processing it further. The second approach encompasses an intermediate authority, for example additional hardware, as an adapter. The additional hardware would decrypt and prepare the data for the blockchain node. Both concepts are still in their feasibility design phase.

C. CONVERTER-BASED RESOURCES
Converter-based resources such as solar photovoltaic installations, battery storages, and electric vehicles can offer ancillary services [46]. The ancillary services may comprise, for example, active power flexibility, harmonic current compensation or voltage response through the injection of reactive power. As such, CBRs have the potential to provide targeted support to the grid from a bottom-up approach.
The multifunctional behaviour of CBRs can be implemented through smart control strategies for the converter. If necessary, these control strategies provide quick response times in the range of milliseconds to seconds [46], [47]. In this way, CBRs on all network levels can contribute to sustaining system strength and power system stability in terms of frequency, angle, and voltage stability. However, such ancillary services from CBRs come with opportunity costs since the injection of active power could be restricted due to ampacity limits of the converter [48]. Thus, the system operator would VOLUME 11, 2023 benefit from offering appropriate economic incentives but also from improving insight into CBRs in the distribution network. Under these premises, additional functionality of CBRs could be unlocked dynamically as a valuable asset for improving power supply efficiency and reducing network fees [49].

III. PROPOSED BLOCKCHAIN-BASED MARKET PROCUREMENT OF REACTIVE POWER
The overall procurement process is structured into five subprocesses. Each sub-process plays a substantial role in forming a blockchain-based market procurement which is in accordance with the EU directive 2019/944 and fosters a peer-to-peer interaction between the system operator and market players. The sub-processes and the methodology are proposed and outlined in the following.

A. METHODOLOGY
The methodology involves the design and implementation of a blockchain-based market procurement of reactive power as shown in Fig. 1. Relevant market interactions are numbered by point #1 to point #9 in the devised framework and are explained in detail in the scope of the five sub-processes. Additionally, the methodology includes a two-layer blockchain topology, which consists of a first-layer blockchain and a second-layer blockchain. This topology is also explained within the scope of the five sub-processes. The L1 blockchain serves as the agent for trust and security, while the L2 blockchain is applied for managing frequent transactions. Smart contracts are deployed on both blockchains to establish interoperability for transferring digital asset ownership information. The interoperability among the two layers allows stakeholders to take advantage of the low transaction costs and the high transaction speed of the L2 blockchain.
The smart meter serves as an objective authority for verification of physical energy transactions. It retrieves terms and conditions of tendering processes from smart contracts. The smart meter quantifies the delivered reactive energy which is then integrated as verified data on the L2 blockchain through a decentralized oracle network. According to the verified data, a smart contract accounts the provided reactive energy and performs a remuneration. The remuneration of market players is based on the L1 blockchain and utilizes dedicated utility tokens. Overall, the methodology demonstrates the potential of blockchain technology for managing physical energy transactions and improving market efficiency through integrated contracting, accounting, and remuneration processes.

B. REGISTRATION AND MASTER DATABANK PROCESS
For requesting and procuring reactive power, the system operator must have a detailed insight into the various types of CBRs, their location, and technical parameters. These data should be publicly available and published for all stakeholders to provide a high level of transparency. Therefore, the technical data of facilities are published on the permissionless L2 blockchain by the system operator, as illustrated by point #1 in Fig. 1, after a facility audit. The technical data are stored in the format of a master databank and assigned to the public key of the market player's corresponding smart meter for verifying physical energy transactions.
The market player receives a registration code from the system operator. The received code links the market player's personal public key with the data of his facility on the master databank, when he registers on the L2 blockchain. In this way, the technical data are authenticated and assigned to the public key and thus to the identity of the respective market player. As a result, market players are authorized to make transactions on the L2 blockchain for their assigned facilities. These transactions are performed without the barrier of paying high transaction fees, as would be the case on the underlying L1 blockchain.
The aforementioned public key is a string of characters that is made publicly available. It only offers a certain level of anonymity, which is referred to as pseudo-anonymity. This means that the public key does not directly reveal the identity of the respective stakeholder. However, in some cases, it is possible to link the public key to the identity of its owner. When that occurs, sensitive data associated with the public key can also be linked to the respective stakeholder. Therefore, personal data are stored off-chain with a clear law-conforming identity and access management. This means personal data are not published on any blockchain but centrally managed on servers of the system operator. This is in line with the concept of securing personal circumstances according to the European Union's General Data Protection Regulation (GDPR) and Germany's Federal Data Protection Act (BDSG).

C. CONNECTIVITY PROCESS
After completion of the registration process and publication of technical facility details, market players are able to participate in the procurement process of reactive power. Market players indicate their readiness by connecting to the L2 blockchain and broadcasting status details on the quantity and type of ancillary service they wish to provide, as denoted by point #2 in Fig. 1. Such transactions are performed on the L2 blockchain for a low transaction time, scalability, and transparency. Once the status details are updated on the L2 blockchain, the system operator can retrieve this information on connected facilities, as marked by point #3, and consider it for performing network optimizations.

D. SYSTEM OPERATOR PROCESS
The system operators monitor their respective network levels and decide on measures in the case of voltage support issues. One measure may include the operation and switching of the system operator's electrical equipment. Another measure constitutes the market-based procurement of reactive power.
In preparation for the market-based procurement of reactive power, a distributed voltage optimization is conducted according to point #4 in Fig. 1. The necessary status details for the optimization can be retrieved from the L2 blockchain. As a result of the optimization, market players and their facilities may be identified for supporting voltage stability through provision of reactive power. If this is the case, then an auction or tendering process for reactive energy is initiated. The tendering of reactive energy has the advantage of allowing market players to accept tendering offers with respect to their marginal costs. As given by point #5 in Fig. 1, a tendering offer with selected market players is performed on the L2 blockchain.
It is a benefit of the blockchain-based market procurement to allow for transparent records of the tendering offers. In this way, excluded market players and the corresponding technical justification for the exclusion can be transparently stored on the L2 blockchain. This supports auditing by authorities. The recording supports the principle of non-discrimination of the EU directive 2019/944 to be inclusive for all qualified market participants, unless there is an objective justification for exclusion.
On the L2 blockchain, the system operator tenders an offer with an adequate remuneration to the public addresses of qualified market players. An adequate remuneration is network dependent, but should at least exceed the operational and opportunity costs of requested market players in order to be economical. As remuneration, a utility token labeled as power quality (PQ) token is employed and further explained in Section III-F. According to the EU directive 2019/944, the market player has the freedom of choice to accept the offer of the system operator. If the offer is accepted, the market player is obliged to deliver the quantity of reactive energy in the inquired time period. The smart meter that is affiliated with the market player's facility receives details on the confirmed tendering process through the decentralized oracle network. These details are required for verification of the physical energy transaction.

E. VERIFICATION PROCESS
The SMGW sends and receives data through the decentralized oracle network and a corresponding API. In this process, the oracle network acts as intermediary head-end system and ensures the integrity of the data. The data are cryptographically processed by the oracle network, and the public key of the smart meter public key infrastructure is paired with the smart meter's private key of the L2 blockchain. As such, the smart meter is capable of signing transactions on the L2 blockchain.
Through smart contracts deployed on the L2 blockchain and on the oracle network, an interoperability channel is established, as illustrated by point #6 of Fig. 1. This channel allows for communication between both networks. In this way, the smart meter can retrieve terms and conditions of tendering processes in order to act as objective authority for verification, as shown through point #7 in Fig. 1. The verification of physical energy transactions is pull-based, i.e. the smart contract on the L2 blockchain requests data from the smart meter via the oracle network. The requested data are preprocessed on the smart meter, before it is sent to the oracle network. In doing so, the smart meter only provides a verification response, denoted by point #8, under two conditions. Either the energy procurement period is completed or the requested quantity of reactive energy has been delivered within the given time period. Through this, frequent transactions and data exchange between the smart meter and the L2 blockchain are avoided. As a result, information that needs to be stored on the L2 blockchain or the oracle network is minimized and thus transaction fees can be reduced.

F. REMUNERATION PROCESS
The remuneration of market players is based on the L1 blockchain as the agent for trust. This trust is created through the high degree of decentralization and establishment of the L1 blockchain which provides security for digital assets. Moreover, L1 blockchains and their underlying cryptocurrencies are generally listed by global exchange platforms. These platforms facilitate the conversion of cryptocurrencies into fiat currencies and vice versa.
For conducting financial transactions, a smart contract is deployed on the L1 blockchain in order to create the PQ utility token. This utility token serves the purpose of remuneration for ancillary services, specifically here for the reactive power procurement. The system operator can obtain PQ tokens by interacting with the respective smart contract on the L1 blockchain. Such interaction entails a conversion from well established cryptocurrencies or stable coins into the PQ tokens. Most cryptocurrencies are still highly volatile, whereas stable coins are designed to be pegged to the value of a fiat currency and allow for better financial planning. Thus, a conversion from stable coins to the PQ tokens could be advantageous for a blockchain-based market procurement.
After interaction with the smart contract, the obtained PQ tokens are locked on the L1 blockchain so that they can be transferred to the L2 blockchain. For the transfer, another smart contract is deployed on the L2 blockchain. Both smart contracts establish a channel for transferring digital asset ownership information according to point #9 in Fig. 1. Thus, the channel facilitates interoperability between both blockchain layers. The interoperability allows for the utilization of the PQ tokens as payment method for ancillary services on the L2 blockchain. Stakeholders can hence, take advantage of the low transaction fees on the L2 blockchain. On the L2 blockchain, the market players are remunerated according to the provided reactive energy and may accumulate a substantial amount of PQ tokens. Moreover, the market players have the security of withdrawing and converting PQ tokens into other cryptocurrencies on the L1 blockchain by reversing the aforementioned transfer process. Nevertheless, transactions with the L1 blockchain are rather costly and therefore performed infrequently.

IV. VALIDATION OF PROCUREMENT PROCESS THROUGH MARKET SCENARIO
A market scenario is devised to validate the proposed holistic blockchain-based procurement of reactive power and its implication on power system operation. In this context, the test setup shown in Fig. 2 was developed. The test setup comprises a frontend designed at TU Berlin, dedicated blockchain and oracle networks with deployed smart contracts as the backend, and a Typhoon HIL system.

A. PREREQUISITES FOR VALIDATION
The HIL environment simulates a distribution network section, which is shown in Fig. 3. The configuration of the simulated network is based on [7], whereas the line parameters are based on the CIGRE medium voltage benchmark distribution network [50]. The simulated network experiences an undervoltage problem during heavy loading. This undervoltage problem can be mitigated through the procurement of reactive power by local market players.
As part of the validation, the reactive power procurement is analyzed according to the process order in Fig. 1. The procurement is validated with respect to transactions on the L2 blockchain. Moreover, the transparency of transactions is assessed. The scalability of the procurement process is examined through quantification of transaction fees and transaction time. Finally, digital assets between the two blockchain layers are transferred to validate interoperability. The frontend serves hereby as supervisory control to constitute the interactions between the system operator, market player, and smart meter.
The frontend is a web application, which was created using the Angular framework. According to Fig. 2, the web application communicates with the Typhoon HIL system via Modbus for monitoring the simulated network, but also for sending setpoints. Moreover, the frontend enables interaction with the deployed smart contracts on the blockchain layers. As an example, the frontend perspective of the distribution system operator (DSO) is shown in Appendix A.
As L1 blockchain and part of the backend, Ethereum with its Goerli test network [51] is selected since it is the most decentralized network realising smart contracts. Moreover, Ethereum has a large community and offers interoperability to a variety of other decentralized networks and applications. However, Ethereum's blockchain architecture causes scalability issues such as high transaction fees and moderate transaction time. Thus, the Polygon blockchain with its Mumbai test network [52] is selected as nested L2 blockchain. The Polygon blockchain operates on the proof-of-stake consensus and utilizes a side-chain architecture for transaction processing. Due to this architecture, the L2 blockchain circumvents scalability issues of the L1 blockchain. For retrieving external data of the smart meter and integrating it onto the L2 blockchain, the oracle network provider Chainlink [53] is chosen.
Transactions of the procurement process can be characterized by the metrics transaction fee and transaction time. Transaction fees are paid to compensate network nodes for maintaining their respective service and for performing the consensus mechanism. For determining transaction fees in the validation process, an interaction with a smart contract is quantified in gas units. Gas units are variable and depend on the computational complexity of the executed smart contract as well as the amount of data to be stored on the blockchain. Through offering higher transaction fees per unit of gas, it is possible to accelerate the time in which a transaction is publicly confirmed by the network nodes. In this way, network nodes are incentivized to grant certain transactions preferential confirmation and thus a faster transaction time. The transaction fees per unit of gas are quantified in GWEI. Originally, GWEI is a denomination for one-billionth of one Ether, the native cryptocurrency of the Ethereum blockchain. In the context of this work, one GWEI is equal to 1 · 10 −9 MATIC, the native cryptocurrency of the applied Polygon L2 blockchain.
The second metric to be validated is transaction time which is calculated by measuring the difference between the timestamp of broadcast of the transaction and the provided timestamp of confirmation. The timestamp of confirmation is displayed on the transaction receipt. In order to set a common benchmark for the amount of transaction fees, the influence of transaction fees on the transaction time is examined. Therefore, four different transaction fees per unit of gas are paid and analyzed for ten transactions each. The results for the Polygon L2 blockchain are shown in Fig. 4.
One GWEI transaction fee resulted in a median transaction time of 7 s, whereas higher transaction fees resulted in median  transaction times of 5 s or less. The average block creation time on the Polygon L2 blockchain is about 5 s. This means that the majority of transactions are recorded and confirmed in the next possible block of the blockchain if the median transaction time is less than 5 s. As given by Fig. 4, median transaction times of 5 s or less are achieved for transaction fees of 5 GWEI or higher. As a trade-off between transaction time and fees, 5 GWEI transaction fees per unit of gas are set for all conducted transactions on the L2 blockchain. These transaction fees are manually adjusted in each stakeholder's blockchain wallet before the respective stakeholder signs and commits a transaction. A blockchain wallet stores the stakeholder's private key and provides the ability to send and receive virtual assets.
Dedicated blockchain transactions lead to operational measures in the simulated network section in Fig. 3. This network comprises a transmission network with a short-circuit ratio (SCR) of 5 and a medium-voltage feeder with line impedances downstream. Corresponding network parameters are characterized in Appendix B. Two CBRs and a large load of 2.5 MW can be connected to the medium-voltage feeder through the switch S1. Once the switch S1 is closed and the load is connected to the network, the network voltage at bus B1 falls outside the voltage band defined here by 11 kV ±5 % of 11 kV. This is shown in Fig. 5.
The violation of the defined voltage band requires an intervention for voltage support. For supporting the grid voltage at bus B1, the system operator may contact the two CBRs PV 1 and PV 2. Both CBRs are located in the low-voltage network and are interfaced through a smart meter.

B. VALIDATION OF TRANSPARENCY
It is assumed that PV 1 and PV 2 already completed the registration process with the system operator, as it was described in Section III-B. As a result, their technical data are stored and linked to their public keys on the Polygon L2 blockchain. Therefore, they are able to participate in the procurement process as potential market players.
Both market players may indicate to the system operator their readiness to participate in the provision of reactive power by interacting with a dedicated smart contract on the L2 blockchain. In doing so, the market players signal their availability and specify the amount of reactive power that they can provide. More technical insights of the data flow on the L2 blockchain are provided in Appendix C for the validation process. The recently stored information is utilized by the system operator to query available market players while considering additional technical data. The technical data may involve the exact location of the market player's facility, the type of facility including power constraints, and the public address of the corresponding smart meter. Such information on market players is publicly retrievable from the L2 blockchain. An example is represented in Appendix D for the public address of PV 1.
Based on the retrievable information, the system operator can run a voltage support optimization for initiating a tendering process, in which the system operator makes offers to market players. Such offers are again public and immutably stored on the L2 blockchain. Thus, all stakeholders have transparent insight into remuneration offers and services requested from market players. This process differs from the present procurement where negotiations are non-public and contracts between system operators and market players are not disclosed. After the voltage support optimization, an offer is made by the system operator to market player PV 1. This is illustrated in Appendix E. The offer can entail, for example, the time period for service provision, the requested reactive power, and the number of PQ tokens as remuneration. Moreover, the market player's response to such an offer is stored and displayed for transparency.

C. VALIDATION OF TRANSACTION METRICS
The system operator tenders an offer for market player PV 1 based on the results of the voltage support optimization, as detailed in Appendix C. Thus, the system operator specifies contractual details onto the L2 blockchain and conducts a transaction. Such a transaction is analyzed with respect to the metrics transaction fee and transaction time. All transaction metrics are based on the average values of ten transactions.
The transaction metrics for tendering an offer and for the subsequent response of market player PV 1 are presented in    [54], a 5 GWEI transaction fee for the tendering process corresponds to costs of 0.0007 EUR and results in an average transaction time of 5.5 s. The system operator tenders an offer for market player PV 1. This offer is confirmed by network nodes within 5.5 s and requires transaction costs of 0.0007 EUR. In case multiple offers are tendered, the transactions costs for the system operator would increase proportionally. Under the assumption of an instant retrieval of the blockchain data and a direct response of market player PV 1 to the system operator's offer, it takes 5.2 s until PV 1 commits immutably on the L2 blockchain and reactive power is procured. The costs for this transaction amount to 0.0005 EUR and must be covered by market player PV 1.
Subsequently, PV 1 begins to support the grid voltage by providing the requested amount of reactive power in the inquired period of time. This can be seen in Fig. 7. The metrics for the total procurement process are provided in Table 1. In Table 1, the tendering and acceptance process add up to a total of 10.7 s and 0.0012 EUR until a contractual agreement is formed.

D. VALIDATION OF CONTRACT FULFILMENT
The contractual agreement may be rescinded unilaterally by the system operator if desired. However, this would come along with an automated contractual reimbursement of market player PV 1. This will not be discussed in further detail in this paper, because an ideal procurement process of reactive power from PV 1 is assumed. When PV 1 accepts the offer of the system operator, smart meter SM 1 fetches the contractual terms on the L2 blockchain through the oracle network. Only SM 1 can verify reactive energy transactions of PV 1, since its public address is assigned to this market player in the respective smart contract. Once the period of reactive power procurement expires, the respective smart contract queries the quantity of reactive energy from SM 1 via the oracle network. As a result, SM 1 sends the measured quantity of reactive energy via an API to the oracle network. The deployed smart contract on the L2 blockchain fetches the data from the oracle network and executes a remuneration in PQ tokens. In this way, market player PV 1 is remunerated according to the verified reactive energy.
For validation of contract fulfilment, verification of reactive energy provision and the subsequent remuneration of a market player was performed. For this, PV 1 provided 50 % and 100 % of the requested reactive energy, respectively. Results are presented for two transactions and can be traced publicly with the transaction hashes in Appendix F. The whole remuneration and verification process took an average of 58.8 s for ten conducted transactions until it was completed. Detailed metrics of the contract fulfilment process are provided in Table 1. The average costs amounted to 0.068 EUR, where 0.066 EUR are caused by the oracle network for running the specific verification node. Thus, the total market scenario process adds up to 0.0692 EUR and requires 69.5 s from offer to remuneration.

E. VALIDATION OF INTEROPERABILITY
Market player PV 1 is remunerated in PQ tokens on the L2 blockchain. But, on the L1 blockchain, PV 1 may want to convert them into fiat currencies, other tokens or services from decentralized applications. Conversely, the system operator deposits PQ tokens on the L1 blockchain and in this way guarantees a sufficient and secure contribution of PQ tokens on the L2 blockchain. For utilizing PQ tokens on both blockchain layers, the channel to transfer digital asset ownership is validated. Firstly, PQ tokens are deposited on the L1 blockchain and transferred to the L2 blockchain. Secondly, PQ tokens are withdrawn on the L2 blockchain and transferred to the L1 blockchain. The results are presented in Table 2.
The transfer of PQ tokens causes high costs of 8.03 EUR and 14.29 EUR, respectively. The reasons for this are the interaction with the L1 blockchain and the differing complexity of the deployed smart contracts. Moreover, the time taken to finalize the transfer of digital assets between both blockchain layers is relatively long. This stands in contrast to a lower transaction time for separate transactions on each blockchain. As a result, the transfer of digital assets between both blockchains should be reduced to a minimum.

V. CONCLUSION
A holistic blockchain-based framework for facilitating a market-based procurement of reactive power was devised. The framework takes into consideration key hallmarks of a liberal market such as being non-discriminatory, transparent, and free. The framework enables effective matchmaking between system operator and market players, while satisfying a scalable allocation of reactive power procurement. The scalability is achieved through a permissionless secondlayer blockchain. The transaction fees accounted for less than one-hundredth of a Euro per transaction due to the second-layer blockchain. The second-layer blockchain also ensured that the procurement process of reactive power was finalized in about 10 s. This was validated through actual smart contract transactions on the second-layer blockchain, demonstrating the interaction between the system operator and a market player.
An experimental setup was developed to present the blockchain-based procurement of reactive power at the distribution network level. The setup involved simulating a network in a hardware-in-the-loop environment. The simulated network benefits from local grid voltage support that was offered by market players and their converter-based resources. To this end, converter-based resources provided reactive power. The delivered reactive power was measured and verified through simulated smart meters. Communication with the smart meter was performed via an application programming interface and an oracle network. The oracle network is responsible for processing data from the second-layer blockchain and the smart meter. Through this, measured off-chain data are capable of triggering smart contract instructions on the second-layer blockchain, and can therefore initiate an automated remuneration process. The necessary trust for remuneration on the second-layer blockchain is fostered by adding a well-established first-layer blockchain and a channel for exchanging digital assets with the second-layer blockchain. Thus, the framework provides a high degree of decentralization and security through the firstlayer blockchain. The remuneration process was performed in the form of power quality token transactions and represents a way to eliminate intermediaries as financial institutions. As a result, the holistic blockchain-based framework enables direct interactions between the system operator and market players.
For further research, the presented framework can be extended to procurement processes of other ancillary services. Different auction and tendering mechanisms can be explored to identify the most efficient allocation methods with respect to maximizing economic benefits. Legal and regulatory barriers should be further examined in order to progressively reduce them.

APPENDIX A
The frontend for the DSO is shown in Fig. 8. It includes the topology of the analyzed network section and monitors relevant data such as voltages and power flows. Moreover, the frontend enables an interaction with the deployed smart contracts on the various blockchain layers.

APPENDIX B
The simulated distribution network section is operated within a Typhoon HIL environment. The applied parameters for relevant network components can be seen in Table 3.

APPENDIX C
Insights of the L2 blockchain data flow are provided in Fig. 9 for the market scenario process. The source code of used smart contracts is verified and traceable on the Mumbai test network of the Polygon blockchain. There, all four contracts in Fig. 9 are deployed under the addresses in the respective grey boxes. In this way, the contracts themselves give transparent insights into transactions performed by them.
The transactions that cause transaction fees on the L2 blockchain are illustrated with dashed lines. The red lines present the data flow of the procurement process according to the validation performed in Section IV-C. The procurement process begins after the voltage optimization when potential market players are addressed by tendering offers in the Trad-ingGame contract.
A requirement for tendering an offer is a sufficient amount of PQ tokens in the TradingGame contract to guarantee the remuneration of market players. Therefore, the Token contract was deployed for creating the PQ token as remuneration and providing other necessary functions. These functions are called by the TradingGame contract and include, inter alia, a function for checking the token balance of an address, and a function for transferring tokens. Both function calls are denoted with the capital letters A and B in Fig. 9, respectively. Once written in the smart contract, market players can view the details of the offer and accept it. The offer acceptance is written by the respective market player into the TradingGame contract. Subsequently, offer details are processed to the Validation contract and corresponding PQ tokens are transferred as well.
Validation of the contract fulfilment was performed in Section IV-D. Additional technical details on the validation process are provided at the bottom of Fig. 9. There, the validation process is highlighted by green lines. Details on an accepted offer are processed by the corresponding simulated smart meter in the HIL system. The smart meter verifies the reactive energy transaction. Afterward, it forwards the amount of provided reactive energy to an HTTP Representational State Transfer (REST) API which is hosted on the public internet. The Validation contract queries details on this energy transaction to the Oracle contract which forwards the query to the aforementioned API. Thus, the Oracle contract operates as the interface between data on the blockchain and off-chain data. The API serves the Oracle contract and provides a response that includes the energy transaction details of the smart meter. The received details are written into the Oracle contract and forwarded to the Validation contract. There, the remuneration process is executed and PQ tokens are transferred to the public address of the market player. The transfer of PQ tokens and the storing of energy transaction details cause state changes on the blockchain, and therefore transaction fees.

APPENDIX D
In this appendix, data on the particular market player PV 1 are queried from the L2 blockchain. Therefore, an interaction with the smart contract at address 0xA00010d8cD1BD889a8 a960F419670d61C9B6F91a on the Mumbai test network of the Polygon blockchain is initiated. By calling the smart contract's function clientList with the public key of PV 1 as the argument, technical details for this market player's facility can be retrieved as depicted.

APPENDIX E
A list of all offers for providing ancillary services is transparently retrievable from the L2 blockchain. An example can be seen for market player PV 1 and its public address when calling the smart contract's function offerList.

APPENDIX F
Transactions for reactive power procurement were conducted on the Mumbai test network of the Polygon blockchain. The transactions are publicly traceable. The corresponding transaction hashes are stored in Table 4.
STEFAN HÄSELBARTH received the B.Sc. and M.Sc. degrees in electrical engineering, with a specialization in electric networks and power electronics, from Technische Universität Berlin, in 2018, where he is currently pursuing the Ph.D. degree. During his studies, he was with Ubitricity, an electric vehicle charging infrastructure startup, where he was involved in the development of one of the first electric vehicle charging stations worldwide to be integrated into lampposts. Since February 2018, he has been a Research and Teaching Assistant with Technische Universität Berlin. His research interests include the control of power converters, their contribution to sustaining power quality through the provision of ancillary services, and the decentralized market procurement of such services.
OSKAR WINKELS is currently pursuing the degree in computer engineering with Technische Universität Berlin. His bachelor's thesis was written on the topic of a supervisory control and data acquisition platform for a power hardwarein-the-loop system. He has worked on various robotics systems, including autonomous planes and vehicles, and satellite base stations in both hardware and software. He also works as a system administration freelancer for various nonprofit organizations.