A state channel monitoring method based on a decentralized oracle

By adopting a decentralized oracle monitoring method in microgrid power trading, the problems of fund security and high monitoring costs caused by offline state channel nodes are solved, realizing a low-cost and secure state channel monitoring service, which is suitable for microgrid power trading systems based on state channels.

CN115642700BActive Publication Date: 2026-01-30HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211370570.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2026-01-30
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

In microgrid power trading, the offline status channel nodes lead to issues with fund security and excessively high monitoring service costs, especially in microgrid environments with high dynamism and a large number of nodes, which existing technologies struggle to address effectively.

Method used

A state channel monitoring method based on decentralized oracles is adopted. Ethereum event logs are monitored through ChainLink smart contracts and oracle nodes. Off-chain processes are initiated to determine node status. A multi-signature mechanism is used to ensure the security and reliability of the monitoring service and reduce monitoring costs.

Benefits of technology

It effectively reduces the economic cost of microgrid nodes, improves the security and reliability of status channels, reduces the requirements for hardware performance, and realizes low-cost status channel monitoring services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115642700B_ABST
    Figure CN115642700B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of microgrid power trading technology, specifically relating to a state channel monitoring method based on a decentralized oracle. The invention includes: a user contract calling an oracle contract; the oracle contract generating a transaction log; the oracle monitoring event log; the oracle processing requests; initiating off-chain processes; the oracle node processing data; the oracle node sending data; and a smart contract processing data. Addressing the problem of excessively high monitoring service costs when applying state channels to the energy internet, this invention proposes a method for optimizing the operating cost of state channels in dynamic microgrids. By studying the transaction process within the state channel and combining smart contract and oracle technology, a state channel monitoring mechanism based on a decentralized oracle is proposed. This invention can be applied to low-cost state channel monitoring services within the architecture of a state channel-based microgrid power trading system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of microgrid power trading technology, specifically relating to a state channel monitoring method based on a decentralized oracle. Background Technology

[0002] In recent years, with the development of renewable energy technologies, microgrids in the energy internet have received increasing attention due to their ability to effectively manage these renewable energy sources. Microgrids can provide a platform for electricity trading between users. How to conduct reliable electricity trading on this platform is the most important issue. Traditional centralized systems may introduce centralized risks. Blockchain technology, with its decentralized characteristics, is well-suited to the microgrid environment and possesses immutability and traceability, making it an effective solution for realizing electricity trading in microgrids. However, the poor scalability and insufficient throughput of blockchain technology itself hinder its practical application in microgrids. Furthermore, microgrids are characterized by high dynamism and a large number of nodes. Therefore, it is necessary to study the high probability of unexpected node offline events in the high-frequency trading energy internet and improve the trading performance of the energy internet through state channel technology.

[0003] A series of problems arise from trusted power exchanges between nodes in a microgrid power trading environment. Although state channels in off-chain scaling technology can solve these problems to some extent, the security of funds within state channels when nodes are offline remains unresolved. Summary of the Invention

[0004] This invention addresses the issue of high economic costs for state channel participants in the monitoring service during state channel-based power trading in microgrids by providing a state channel monitoring method based on a decentralized oracle, which reduces the economic costs of microgrid nodes while ensuring the security of power trading.

[0005] A method for monitoring state channels based on decentralized oracles includes the following steps:

[0006] (1) User contract calls oracle contract: When a node participating in the state channel goes offline, the oracle node calls the user contract's get request function to send a request. Then the user contract transmits the relevant data and calls the Chainlink smart contract. The basis for determining whether a node is offline is that the node has not settled the state channel when more than half of the state channel challenge period has passed.

[0007] (2) Oracle contract generates transaction log: The ChainLink oracle smart contract records an event for the oracle and sends it to the event log of the Ethereum blockchain;

[0008] (3) Oracle monitoring event log: The ChainLink Core in the oracle node receives requests by monitoring the Ethereum event log and routes the task to the ChainLink external adapter;

[0009] (4) Oracle Request Processing: The ChainLink external adapter sends a request to the external API to start an off-chain process;

[0010] (5) Start an off-chain process: The oracle node needs to start an off-chain process. The task of this process is to monitor the blockchain, determine whether the peer nodes participating in the state channel have submitted an expired state, and return a response. The response message format is JSON.

[0011] (6) Oracle node processes data: The ChainLink adapter receives the response. If the response indicates that a malicious node has committed malicious behavior, it returns a boolean variable with a value of true to the ChainLink Core.

[0012] (7) Oracle node sends data: ChainLink Core puts a bool type variable with a value of true into the data field of the transaction and submits it to the ChainLink oracle smart contract;

[0013] (8) Smart contract data processing: The ChainLink oracle smart contract processes bool type variables from multiple oracle nodes. The basis for judging malicious behavior of peer nodes is that more than or equal to N nodes out of M oracle nodes monitor that a peer node on the blockchain has submitted an expired state and send the final result to the user smart contract.

[0014] The beneficial effects of this invention are as follows:

[0015] This invention addresses the issue of excessively high monitoring service costs associated with applying state channels to the energy internet, proposing a method for optimizing the operating costs of state channels in dynamic microgrids. By studying the transaction process within state channels and combining smart contracts and oracle technology, a decentralized oracle-based state channel monitoring mechanism is proposed. Through simulation experiments based on microgrid power trading, the economic cost indicators of this mechanism are compared with those of the Ethereum Raiden network's monitoring service mechanism, demonstrating that the proposed mechanism has the ability to reduce the economic costs of microgrid nodes. This invention can be applied to low-cost state channel monitoring services within a state channel-based microgrid power trading system architecture. Attached Figure Description

[0016] Figure 1 This is an architecture diagram of a state channel monitoring method based on a decentralized oracle in this invention.

[0017] Figure 2 This is a diagram of the monitoring service implementation.

[0018] Figure 3 This is a chart comparing economic costs. Detailed Implementation

[0019] The present invention will now be further described with reference to the accompanying drawings.

[0020] This invention addresses the problem of excessively high monitoring service costs associated with applying state channels to the energy internet, proposing a method for optimizing the operating costs of state channels in dynamic microgrids. By studying the transaction process within state channels and combining smart contracts and oracle technology, a decentralized oracle-based state channel monitoring mechanism is proposed. Simulation experiments based on microgrid power trading compare the economic cost indicators of this mechanism with those of the Ethereum Raiden network's monitoring service mechanism, demonstrating that the proposed mechanism has the ability to reduce the economic costs of microgrid nodes. This invention relates to a low-cost state channel monitoring service designed for application in a state channel-based microgrid power trading system architecture.

[0021] A method for monitoring state channels based on decentralized oracles includes the following steps:

[0022] (1) User contract calls oracle contract: When a node participating in the state channel goes offline, the oracle node calls the user contract's get request function to send a request. Then, the user contract transmits the relevant data and calls the Chainlink smart contract. The criterion for determining whether a node is offline is that the node has not settled the state channel if more than half of the state channel challenge period has passed.

[0023] (2) Oracle contract generates transaction log: The ChainLink oracle smart contract records an event for the oracle and sends it to the event log of the Ethereum blockchain.

[0024] (3) Oracle monitoring event log: The ChainLink Core in the oracle node receives the request by monitoring the Ethereum event log and routes the task to the ChainLink external adapter.

[0025] (4) Oracle processing requests: The ChainLink external adapter sends a request to the external API to start an off-chain process.

[0026] (5) Start an off-chain process: The oracle node needs to start an off-chain process. The task of this process is to monitor the blockchain, determine whether the peer nodes participating in the state channel have submitted an expired state, and return a response. The response message format is JSON.

[0027] (6) Oracle node processes data: The ChainLink adapter obtains a response. If the response indicates that a malicious node has committed malicious acts, it returns a bool variable with a value of true to the ChainLink Core.

[0028] (7) Oracle node sends data: ChainLink Core puts a bool type variable with a value of true into the data field of the transaction and submits it to the ChainLink oracle smart contract.

[0029] (8) Smart contract data processing: The ChainLink oracle smart contract processes bool type variables from multiple oracle nodes. The basis for judging malicious behavior of peer nodes is that more than or equal to N nodes out of M oracle nodes monitor that a peer node on the blockchain has submitted an expired state and send the final result to the user smart contract.

[0030] To enable the widespread use of secure and intelligent microgrid power trading, this invention replaces the Lightning Network monitoring service with a decentralized oracle. Figure 1 As shown, a low-cost status channel monitoring service is designed, such as... Figure 2 As shown in the figure. A microgrid simulation experiment demonstrates the feasibility of this monitoring service, effectively reducing the economic cost of unexpected node offline events in the state channel and significantly lowering the hardware performance requirements for the nodes providing the state channel monitoring service. The reduced economic cost of monitoring services for microgrid nodes is shown in the figure. Figure 3 As shown in the table below.

[0031] The abstract architecture of the oracle-based state channel monitoring service is as follows: Figure 1 As shown. First, a state channel contract needs to be deployed, and a certain amount of Ether needs to be deposited into it. If the node requires a monitoring service, a user contract and an oracle contract need to be deployed. When a node participating in the state channel goes offline, the monitoring service starts an off-chain process to monitor the blockchain for any illegal transactions. Illegal transactions occur because there are malicious nodes in the state channel system. When the peer node associated with the state channel goes offline, it attempts to put expired states that are beneficial to itself onto the chain. The oracle node needs to receive the state channel change information and start an off-chain process to monitor the latest block on the blockchain for any illegal states. If an illegal state is found, the information is notified to the user contract by submitting a transaction to the blockchain. The user contract will pay gas to the oracle contract, enabling it to call the state channel contract to invalidate the illegal state and close the state channel's settlement.

[0032] Low-cost status channel monitoring services such as Figure 2 As shown, it consists of the following 8 detailed steps.

[0033] (1) User contract calls oracle contract

[0034] First, a user contract is created on the Ethereum blockchain. The user contract only proceeds to the next step when a node goes offline. The node providing the monitoring service is responsible for determining whether a node is offline, and this node notifies the smart contract by calling a function in the user contract.

[0035] (2) Oracle contract generates transaction log

[0036] The oracle contract will then define a request event, write the event information to the event log, and determine whether the state channel peer has uploaded the expired state to the chain. The necessary data for this determination will be handled by the off-chain process.

[0037] (3) Oracle monitoring event log

[0038] The oracle node first obtains the data requested by the user contract from the event log it is listening to. Then, if the oracle node has obtained the specified data, it submits it to the user contract by calling the callback function in the oracle contract through the transaction submission method. Finally, the user contract sends enough gas and the necessary data to the oracle contract.

[0039] (4) Oracle processing requests

[0040] The ChainLink external adapter sends a request to an external API to start an off-chain process. The off-chain process establishes an HTTP connection with the Ethereum full node through the web3.js library.

[0041] (5) Start the off-chain process

[0042] The off-chain process obtains and parses the transaction log information of the Ethereum blockchain, requests data based on the parsed log information, and then constructs a transaction to submit the result to the blockchain after obtaining the requested data.

[0043] (6) Oracle nodes process data

[0044] Oracle nodes use N / M multi-signature transactions and ensure that each monitoring service node possesses only one private key, making transactions submitted to smart contracts on the blockchain valid only if N out of the M monitoring services reach consensus. This is far more robust than trusting a single third party, because the selected monitoring service nodes may compete with each other, thus reducing the likelihood of all of them falsifying their agreements.

[0045] (7) Oracle node sends data

[0046] The process of a decentralized oracle node acquiring data and submitting it to the oracle contract involves four steps: Httpgetwithunrestrictednetworkaccess (specifying the data source and access path); Jsonparse (iterating through the specified data source and returning the results); Ethbytes32 (formatting the acquired data into a string and converting it to Solidity's bytes32 format and Ethtx); and finally, submitting the processed data to the blockchain.

[0047] (8) Smart contract data processing

[0048] The user contract places the necessary data in the transaction's `data` field and sends the data to the oracle contract by submitting the transaction. Upon receiving the transfer, the oracle contract checks its validity, parses the data contained in the transaction, and then modifies a public variable on the blockchain to notify the monitoring service node to suspend the settlement of the state channel.

[0049] Although multiple monitoring service nodes may provide services, a malicious actor's settlement attempt only requires one interaction with the state channel contract. To reduce the number of interactions with the state channel contract in the network, for each state channel, N monitoring service nodes W1, W2, ..., W... need to be randomly selected. n And the remaining unselected monitoring service nodes will be used as backups. Once a malicious actor attempts to settle the channel, the timeframe until the challenge period of the status channel will be divided into N+1 time periods, with each monitoring service node W... i Each monitoring service is responsible for performing its work during its designated time period i. If an assigned monitoring service fails to respond during its time period, it will be removed and the next monitoring service node will take over. If all N designated monitoring services fail, any backup monitoring service node can interact with the state channel contract during the N+1th time period to prevent malicious settlement of the state channel. It should be noted that the above mechanism allows for the possibility that a peer might engage in malicious behavior after a state channel user goes offline, causing all monitoring service nodes to malfunction; however, the actual probability of such an event occurring is very low.

[0050] The state channel monitoring mechanism based on decentralized oracles includes the following main modules:

[0051] (1) The user contract will only proceed to the next step when the node is offline. The node providing the monitoring service is responsible for determining whether a node is offline. This node notifies the smart contract by calling a function in the user contract. The user contract will then define a request event containing the ID of the state channel to be monitored. The event is triggered using the emit keyword and written to the Ethereum event log. Then, it will determine whether the state channel peer has put the expired state on the chain. The necessary data for this determination is submitted to the user contract by the off-chain process. First, the off-chain process obtains the ID of the state channel to be monitored from the monitored event log and submits it to the oracle node. If the state channel peer has engaged in malicious behavior, the oracle node will submit a boolean value to the user contract by calling the callback function in the oracle contract through a transaction submission. Finally, the user contract sends sufficient gas to the oracle contract.

[0052] (2) Off-chain process: An HTTP connection is established with the Ethereum full node via the Infura service to obtain transaction log information of the Ethereum blockchain. The log information is parsed using the web3.js library to request data. Once the requested data is obtained, a transaction is constructed and the result is submitted to the blockchain. By utilizing N / M multi-signature transactions, i.e., a multi-signature mechanism where N out of M signatories must agree for execution, it is ensured that each monitoring service node possesses only one private key. Transactions submitted to the smart contract on the blockchain are only valid when N out of the M monitoring services reach consensus. This is much stronger than trusting a single third party, because the selected monitoring service nodes may compete with each other, thus the possibility of all of them falsifying is very low.

[0053] (3) After receiving the transfer, the oracle contract will check the validity of the transfer and parse the data information contained in the transaction. Then the oracle contract will change a public variable on the blockchain to notify the monitoring service node to suspend the settlement of the state channel.

[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1.A state channel monitoring method based on a decentralized oracle, characterized in that, Comprise the following steps: (1) User contract calls the oracle contract: when the node participating in the state channel is offline, the oracle node calls the user contract to request the function to make a request, and then the user contract delivers the relevant data and calls the Chainlink smart contract; wherein the basis for judging whether the node is offline is that the node has not settled the state channel when the time exceeds half of the challenge period of the state channel; (2) The oracle contract generates a transaction log: the ChainLink oracle smart contract records an event for the oracle and sends it to the event log of the Ethereum blockchain; (3) The oracle monitors the event log: the ChainLink Core in the oracle node receives the request by monitoring the Ethereum event log, and routes the task to the ChainLink external adapter; (4) The oracle processes the request: the ChainLink external adapter sends a request to the external API to start an off-chain process; (5) Start the off-chain process: the oracle node needs to start an off-chain process, and the task of this process is to monitor the blockchain to determine whether the peer node participating in the state channel has submitted an expired state, and return a response, and the message format of the response is JSON; (6) The oracle node processes data: the ChainLink adapter obtains the response, and if the response result is that the malicious node has performed malicious behavior, a bool type variable with a value of true is returned to the ChainLink Core; (7) The oracle node sends data: the ChainLink Core puts the bool type variable with a value of true into the data field of the transaction and submits it to the ChainLink oracle smart contract; (8) The smart contract processes data: the ChainLink oracle smart contract processes the bool type variables from multiple oracle nodes, and determines whether the peer node has performed malicious behavior according to the fact that more than or equal to N nodes of M oracle nodes monitor that the peer node has submitted an expired state on the blockchain, and sends the final result to the user smart contract.

Citation Information

Patent Citations

  • Block chain-based time service oracle machine implementation method

    CN110633286A

  • Block chain oracle state monitoring method

    CN113872828A