Block chain data auditing method and system, computer equipment and storage medium
By using audit contracts on the blockchain to generate audit events and allocate audit nodes and aggregation nodes for data audit processing, the problem of high data privacy protection and accuracy of audit results in the existing technology is solved, and efficient and accurate data audit is achieved.
Patent Information
- Application Number
- CN202510603629.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-05-12
AI Technical Summary
The existing blockchain data auditing methods cannot meet application scenarios with high requirements for data privacy protection, and cannot ensure the accuracy of audit results, and are vulnerable to interference and tampering by malicious nodes.
Audit events are generated through audit contracts, audit nodes and aggregation nodes are allocated, data auditing is performed, and the accuracy and privacy of audit results are ensured through zero-knowledge verification.
It realizes protection of data privacy, avoids exposure of sensitive information, and filters malicious nodes through aggregation nodes, improving the accuracy of audit results.
Smart Images

Figure CN120110645A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain data auditing method, system, computer device and storage medium. Background Art
[0002] In the field of cross-chain data auditing, some existing auditing methods usually perform data verification and auditing based on the consensus mechanism of a specific blockchain. Some auditing schemes rely on the nodes of the target blockchain itself to perform auditing tasks. The nodes of the target blockchain itself audit and check the blockchain data according to predefined rules. Due to the transparency of blockchain data and the reliance on the target blockchain's own nodes for auditing, the process is susceptible to interference from malicious nodes.
[0003] For example, malicious nodes may tamper with audit parameters, provide false audit results, or even jointly launch attacks, affecting the accuracy of the audit. Therefore, performing audits directly on the target blockchain cannot meet application scenarios with high requirements for data privacy protection, and cannot ensure the accuracy of audit results. Summary of the invention
[0004] The present application provides a blockchain data auditing method, system, computer device and storage medium to solve the problem that the existing blockchain data auditing method cannot meet the application scenarios with high requirements for data privacy protection and cannot ensure the accuracy of the audit results.
[0005] In a first aspect, the present application provides a blockchain data auditing method, which is applied to auditing a blockchain, and the method comprises: Upon receiving an audit request sent by an audit client, an audit event corresponding to the audit request is generated through an audit contract, wherein the audit request is used to request to obtain the data audit result of the target block data in the target blockchain after audit processing according to a preset audit scheme, and the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each of the committee nodes, wherein the role type of the committee node is an audit node or an aggregation node; Broadcasting the audit event, wherein the audit node is used to pull the target block data from the target blockchain based on the audit event, and perform audit processing on the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node is used to aggregate the node audit results of multiple audit nodes based on the audit event to obtain a node aggregation result; Upon receiving the node aggregation result sent by the aggregation node, using the audit contract to perform zero-knowledge verification on the audit proof in the node aggregation result to obtain a verification result; When the verification result is that the verification is passed, the audit parameters in the node aggregation result are fed back to the audit client as the data audit result.
[0006] In a second aspect, the present application provides a blockchain data auditing method, which is applied to a computing node, and the method includes: When an audit event published by an audit blockchain is monitored, the audit contract in the audit blockchain is called to determine the role type of the computing node, wherein the audit event includes the storage location of the target block data in the target blockchain, the committee node that responds to the audit request, and the role type of each of the committee nodes, the committee node is a computing node participating in the audit process, and the role type of the committee node is an audit node or an aggregation node; When the role type of the computing node is an audit node, the target block data is pulled from the target blockchain according to the audit event, and the target block data is audited according to the preset audit scheme to obtain a node audit result; or, When the role type of the computing node is an aggregation node, the node audit results of multiple audit nodes are aggregated to obtain a node aggregation result, and the node aggregation result and the audit proof are sent to the audit blockchain, wherein the audit blockchain is used to feed back the node aggregation result as a data audit result to the audit client corresponding to the audit request after the audit proof is audited.
[0007] In a third aspect, the present application provides a blockchain data audit system, the system comprising: An audit client, used to initiate an audit request, wherein the audit request is used to request to obtain the data audit result after the target block data in the target blockchain is audited according to a preset audit scheme; An audit blockchain, used to generate an audit event corresponding to the audit request through an audit contract, wherein the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each committee node, wherein the role type of the committee node is an audit node or an aggregation node; broadcasting the audit event, wherein the audit node is used to pull the target block data from the target blockchain based on the audit event, and perform audit processing on the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node is used to aggregate the node audit results of multiple audit nodes based on the audit event to obtain a node aggregation result; upon receiving the node aggregation result sent by the aggregation node, using the audit contract to perform zero-knowledge verification on the audit proof in the node aggregation result to obtain a verification result; when the verification result is a passed verification, the audit parameters in the node aggregation result are fed back to the audit client as the data audit result; The target blockchain is used to provide the audit node with the target block data to be audited, and the target blockchain is any blockchain to be audited.
[0008] In a fourth aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned blockchain data auditing method when executing the computer program.
[0009] In a fifth aspect, the present application also provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the above-mentioned blockchain data auditing method.
[0010] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, when receiving an audit request sent by the audit client, generates an audit event corresponding to the audit request through an audit contract, wherein the audit request is used to request to obtain the data audit result of the target block data in the target blockchain after the audit processing is performed according to the preset audit scheme, and the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each of the committee nodes, and the role type of the committee node is an audit node or an aggregation node; broadcasting the audit event, wherein the audit node is used to pull the target block data from the target blockchain based on the audit event, and audit the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node is used to aggregate the node audit results of multiple audit nodes based on the audit event to obtain a node aggregation result; when receiving the node aggregation result sent by the aggregation node, the audit contract is used to perform zero-knowledge verification on the audit proof in the node aggregation result to obtain a verification result; when the verification result is verification passed, the audit parameters in the node aggregation result are fed back to the audit client as the data audit result.
[0011] Based on the above method, the audit blockchain generates corresponding audit events for audit requests through smart audit contracts, so as to allocate multiple audit nodes and an aggregation node that respond to audit requests to the audit client. Each audit node audits the same target block data to obtain node audit results. The aggregation node aggregates the node audit results provided by multiple audit nodes to obtain node aggregation results. The audit blockchain performs zero-knowledge verification on the audit proof, which can avoid the audit blockchain from knowing the audit content, thereby avoiding the exposure of sensitive information to meet application scenarios with high requirements for data privacy protection. In addition, by aggregating the node audit results of multiple audit nodes through the aggregation node, malicious audit nodes can be filtered out to avoid malicious nodes tampering with audit results or providing false audit results, thereby improving the accuracy of the audit results, so as to solve the problem that the existing blockchain data audit method cannot meet the application scenarios with high requirements for data privacy protection and cannot ensure the accuracy of the audit results. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0014] One or more embodiments are exemplarily described by the figures in the corresponding drawings, and these exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0015] Figure 1 A schematic diagram of the structure of a blockchain data audit system provided in an embodiment of the present application; Figure 2 A flowchart of a blockchain data audit method provided in an embodiment of the present application; Figure 3 A flowchart of a blockchain data audit method provided in an embodiment of the present application; Figure 4 A flowchart of a blockchain data audit method provided in an embodiment of the present application; Figure 5 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0017] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0018] Figure 1 This is a schematic diagram of the structure of a blockchain data audit system in one embodiment. Figure 1 , the blockchain data audit system includes: The audit client 110 is used to initiate an audit request, wherein the audit request is used to request to obtain the data audit result after the target block data in the target blockchain 140 is audited according to a preset audit scheme; The audit blockchain 120 is used to generate an audit event corresponding to the audit request through an audit contract, wherein the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each committee node, wherein the role type of the committee node is an audit node 132 or an aggregation node 131; broadcasting the audit event, wherein the audit node 132 is used to pull the target block data from the target blockchain 140 based on the audit event, and perform audit processing on the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node 131 is used to aggregate the node audit results of multiple audit nodes 132 based on the audit event to obtain a node aggregation result; upon receiving the node aggregation result sent by the aggregation node 131, performing zero-knowledge verification on the audit proof in the node aggregation result using the audit contract to obtain a verification result; when the verification result is a passed verification, the audit parameters in the node aggregation result are fed back to the audit client 110 as the data audit result; The target blockchain 140 is used to provide the audit node 132 with the target block data to be audited. The target blockchain 140 is any blockchain to be audited.
[0019] Specifically, the audit client 110, the audit blockchain 120, and the target blockchain 140 are connected through a network. The audit client 110 is any client that initiates an audit request, which can be implemented using a desktop terminal or a mobile terminal. The mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc.
[0020] A smart audit contract is deployed on the audit blockchain 120, which is responsible for managing the key information and rule execution of the audit process, such as node registration, state management, result verification, etc. The client registers on the audit blockchain 120 to become a computing node 130, that is, the computing node 130 is used to indicate the user node that has successfully completed the registration on the audit blockchain 120, and the computing node 130 is used to participate in the audit process to obtain equity rewards. In the initial state, the audit contract does not register the computing node 130. Any user node can provide a public key, IP address, and equity (Token) to call the audit contract and register a computing node 130. This process allows a wide range of participants to join the audit system, increasing the decentralization and reliability of the audit. The committee composed of computing nodes 130 undertakes specific audit computing tasks, and the on-chain audit contract and the off-chain computing nodes 130 work together to complete cross-chain data audits.
[0021] The target blockchain 140 is any blockchain 120 to be audited that provides parameters to be audited. When different blockchains 120 to be audited need to be audited, the auditing blockchain 120 can allocate different committee nodes to different blockchains 120 to be audited to achieve synchronous auditing of different blockchains 120 to be audited.
[0022] The blockchain data audit system implements an audit protocol, and the audit protocol applies an incentive mechanism to reward honest node behavior and punish improper node behavior. Honest nodes participating in the audit protocol will receive continuous rewards to compensate for the computing resources they provide, and these rewards can motivate more computing nodes 130 to actively and honestly participate in the audit work. And the computing nodes 130 that behave improperly may be cut and lose some or all of the deposited rights. The aggregation node 131 filters the misbehaving audit nodes 132 through the aggregation process, that is, the misbehaving audit nodes 132 provide audit results that are different from most audit nodes 132. This incentive mechanism helps to maintain the fairness and reliability of the blockchain data audit system and ensure the authenticity of the audit results. The audit protocol does not rely on the consensus mechanism of the target blockchain 140, nor does it require the addition of additional intermediate blockchains. Therefore, assuming that the connected blockchain supports smart contracts, the proposed audit protocol can be compatible with different blockchains. This makes the protocol widely applicable and can realize cross-chain data audit functions in different blockchain ecosystems.
[0023] In one embodiment, Figure 2 This is a flowchart of a blockchain data audit method in an embodiment, referring to Figure 2 , provides a blockchain data audit method. This embodiment mainly applies this method to the above Figure 1 Taking the audit blockchain 120 in FIG. 1 as an example, the blockchain data audit method specifically includes the following steps: Step S210, when an audit request sent by the audit client 110 is received, an audit event corresponding to the audit request is generated through the audit contract, wherein the audit request is used to request to obtain the data audit result of the target block data in the target blockchain 140 after audit processing according to a preset audit scheme, and the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each of the committee nodes, and the role type of the committee node is an audit node 132 or an aggregation node 131.
[0024] Specifically, the audit client 110 may be a computing node 130 that has successfully completed registration in the audit blockchain 120, or may be a client that has not completed registration in the audit blockchain 120. The audit blockchain 120 supports responding to audit requests initiated by different clients. The audit request is a unique request generated by the audit client 110 for the target block data in the target block in the target blockchain by calling the audit contract. The audit request is used to request audit processing of the target block data stored in the target block in the target blockchain 140. The audit task is the task of responding to the audit request. The audit request includes the blockchain identifier (ChainIDt) of the target blockchain 140, the block identifier (BlockNumber) of the target block, and the audit reward (Reward) for completing the audit task. The audit reward is used to reward the committee nodes with normal audit behavior and punish the audit nodes 132 with improper behavior, that is, the audit reward includes a gain amount and a penalty amount. The reward value corresponding to the gain amount is a positive number, and the reward value corresponding to the penalty amount is zero or a negative number, which is customized according to the audit task. In this way, more computing nodes 130 are encouraged to actively and honestly participate in the audit work.
[0025] The smart audit contract automatically generates an audit event corresponding to the audit request, so as to allocate the corresponding audit node 132 and aggregation node 131 for the audit process of the target block data. The audit event includes the request identifier corresponding to the audit request, the storage location of the target block data, the committee nodes participating in the audit process, and the role type of each committee node. The storage location includes the blockchain identifier of the target blockchain 140 and the block identifier of the target block. The role type of the committee node is divided into an audit node 132 and an aggregation node 131. There is only one aggregation node 131 among multiple committee nodes, and the others are audit nodes 132. Specifically, all computing nodes can be used as committee nodes, or some computing nodes can be selected as committee nodes. When all computing nodes are selected as committee nodes, aggregation nodes can be selected from all committee nodes through a random algorithm, and other computing nodes can be used as audit nodes. Audit node 132 is used to audit the target block data to obtain node audit results, while aggregation node 131 is used to aggregate multiple node audit results, thereby filtering out node audit results that are different from the audit results of most nodes, so as to obtain node aggregation results that are the same as the audit results of most nodes, thereby ensuring the accuracy of the audit results.
[0026] Step S220, broadcasting the audit event, wherein the audit node 132 is used to pull the target block data from the target blockchain 140 based on the audit event, and audit the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node 131 is used to aggregate the node audit results of multiple audit nodes 132 based on the audit event to obtain a node aggregation result.
[0027] Specifically, the audit blockchain 120 broadcasts audit events to inform each committee node of its role type in this audit task. After the committee node determines its role type through the audit event, it triggers the execution action corresponding to the role type. If the committee node determines that it is the audit node 132, it pulls the target block data from the target blockchain 140 and performs audit processing according to the preset audit plan to generate a node audit result, and sends the node audit result to the aggregation node 131; if the committee node determines that it is its own aggregation node 131, it receives the node audit results sent by multiple audit nodes 132, aggregates the multiple node audit results to generate a node aggregation result, and the audit proof is used to participate in zero-knowledge verification to ensure the correctness of the node aggregation result. The node aggregation result includes the audit proof and the audit parameters generated by the aggregation, and the audit proof is a zero-knowledge proof.
[0028] The audit node 132 can continuously respond to different audit requests, that is, there is no need to wait for the audit result of the current audit request to be verified before responding to the next audit request. As long as the current audit request response is completed, the next audit request can be responded to. Different audit requests can correspond to blockchains with the same structure or different structures. Therefore, a large number of audit nodes can freely choose to participate in responding to audit requests for different blockchains at the same time, making the blockchain data audit system highly concurrency and distributed collaboration.
[0029] Step S230, when receiving the node aggregation result sent by the aggregation node 131, use the audit contract to perform zero-knowledge verification on the audit proof in the node aggregation result to obtain a verification result.
[0030] Specifically, the audit blockchain 120 uses the audit contract to perform zero-knowledge verification on the audit proof. Zero-knowledge verification means that the audit contract verifies the correctness of the audit result corresponding to the target block data without knowing the target block data, that is, the verification result is used to indicate the correctness of the audit result corresponding to the target block data. Zero-knowledge verification of the audit proof can complete the verification without obtaining the audit content, avoiding the leakage of sensitive information, and is suitable for application scenarios with high requirements for data privacy protection.
[0031] Step S240, when the verification result is verification passed, the audit parameters in the node aggregation result are fed back to the audit client 110 as the data audit result.
[0032] Specifically, when the verification result is verification passed, it means that the node audit result corresponding to the target block data is correct, then the node aggregation result can be fed back to the audit client 110 as the data audit result, thereby completing the audit task corresponding to the audit request.
[0033] Based on the above method, the audit blockchain 120 generates corresponding audit events for the audit request through the smart audit contract, so as to allocate multiple audit nodes 132 and an aggregation node 131 that respond to the audit request to the audit client 110, and each audit node 132 audits the same target block data to obtain a node audit result. The aggregation node 131 aggregates the node audit results provided by multiple audit nodes 132 to obtain a node aggregation result. The audit blockchain 120 performs zero-knowledge verification on the audit proof, which can prevent the audit blockchain 120 from knowing the audit content, thereby avoiding the exposure of sensitive information to meet the application scenarios with high requirements for data privacy protection, and by aggregating the node audit results of multiple audit nodes 132 through the aggregation node 131, malicious audit nodes 132 can be filtered to prevent malicious nodes from tampering with the audit results or providing false audit results, thereby improving the accuracy of the audit results, so as to solve the problem that the existing blockchain data audit method cannot meet the application scenarios with high requirements for data privacy protection and cannot ensure the accuracy of the audit results.
[0034] In one embodiment, when receiving the audit request sent by the audit client 110, generating an audit event corresponding to the audit request through the audit contract includes: Upon receiving the audit request sent by the audit client 110, Obtaining account information of each computing node 130 from a preset storage unit, wherein the account information includes a balance of equity; Filter out a first preset number of the computing nodes 130 as the committee nodes in descending order of equity balance; Determine the role type and role reward of each of the committee nodes; The audit event corresponding to the audit request is generated according to the block number of the target block data, the request identifier, the role type and role reward of each committee node.
[0035] Specifically, the audit blockchain 120 uses the audit contract to assign a unique request ID (RequestID) to the audit request. The preset storage unit can be any tool or appliance with storage function, such as Merkle Tree, hash chain, compressed prefix tree (Patrecia Tree), Interstellar File System (IPFS), etc. In this embodiment, Merkle Tree is used as the preset storage unit. The audit contract uses Merkle Tree to store the account information of the registered computing node 130, and the account information includes address, index, public key and equity balance. There are two major advantages of using Merkle Tree. First, it can efficiently verify the integrity and membership of data. Second, the audit contract does not store the original account data, but only stores summary information such as hash value, which protects the privacy of the computing node 130. At the same time, the Merkle root can be updated to apply state changes. Compared with directly storing and updating a large amount of original data, this method saves a lot of costs.
[0036] The computing nodes 130 are sorted in descending order according to the equity balance, and a first preset number of computing nodes 130 are selected as committee nodes in descending order. The first preset number is less than the total number of computing nodes, that is, some computing nodes are selected as committee nodes based on the equity held by the computing nodes 130. The higher the equity held by the computing node 130, the higher the probability of being selected to participate in the audit, thereby incentivizing the computing node 130 to hold more equity. If an attacker wants to control a large number of computing nodes 130, he needs to have enough equity, resulting in a higher cost. Therefore, the blockchain data audit system can improve its resistance to Sybil attacks.
[0037] The audit contract determines the aggregation node 131 from multiple committee nodes based on a random function. Among the multiple committee nodes, all nodes except the aggregation node 131 are audit nodes 132, so as to determine the role type of each committee node, and determine the role rewards corresponding to different role types based on the audit rewards in the audit request, that is, the audit rewards include gain amounts and penalty amounts, and the gain amounts include role rewards for different role types. For example, the audit node 132 corresponds to the first role reward, and the aggregation node 131 corresponds to the second role reward. The reward value corresponding to the second role reward is greater than the reward value corresponding to the first role reward. When the node audit result provided by the audit node 132 provides an effective contribution to the final data audit result, the equity balance of the audit node 132 is increased according to the first role reward. Similarly, when the audit proof provided by the aggregation node 131 is verified, the equity balance of the aggregation node 131 is increased according to the second role reward, so as to achieve equity rewards for different role types.
[0038] The audit event is composed according to the storage location of the target block data (including the blockchain identifier of the target blockchain 140 and the block identifier of the target difference), the request identifier, the role type and role reward of each committee node, and is used to inform each committee node of its role and reward in the audit process, so that each committee node can complete its corresponding audit actions in an orderly manner.
[0039] In one embodiment, the selecting a first preset number of computing nodes 130 as the committee nodes in descending order of equity balances includes: Filtering a first preset number of the computing nodes 130 as selected nodes in descending order of equity balance, wherein the computing nodes 130 other than the selected nodes are unselected nodes; Upon receiving a gain request sent by an unselected node, increasing the equity balance corresponding to the unselected node according to the gain request; Reselecting a first preset number of computing nodes 130 as selected nodes in descending order of equity balance; When no gain request is received from the unselected nodes within a preset time period, the selected nodes are selected as the committee nodes.
[0040] Specifically, a first preset number of computing nodes 130 are selected in descending order of equity balances, and the computing nodes 130 that are not selected are unselected nodes. If the unselected nodes want to replace the selected nodes to participate in the audit process, they can apply to join the audit process by increasing their equity. Therefore, when the audit blockchain 120 receives a gain request sent by an unselected node after selecting the selected nodes, the equity balance of the corresponding unselected node is increased according to the gain request. The gain request includes the public key of the unselected node, the equity to be increased, and the storage certificate. The equity to be increased is used to make the equity balance of the unselected node after the gain greater than the equity balance of any selected node. The storage certificate is a certificate indicating that the account information of the unselected node is stored in the preset storage unit. When the preset storage unit is a Merkle tree, the storage certificate is the Merkle certificate. Since the update of the equity balance corresponding to the unselected node causes the descending order of the equity balance to be updated, a selected node is replaced, and the first preset number of computing nodes 130 are screened out as selected nodes in descending order of the equity balance. If no gain request is received from the unselected node within the preset time, the screened selected node will be used as the committee node participating in the audit process. This method ensures that the node committee is always composed of computing nodes 130 with the highest equity. Since nodes with high equity are usually more motivated to maintain the normal operation of the system to protect their own equity, the security and reliability of the audit system can be improved.
[0041] The audit blockchain 120 is also used to process the exit of the computing node 130, including: When receiving the exit request sent by the target computing node 130, the legal status of the target computing node 130 is determined according to the account information of the target computing node 130 and the corresponding Merkle proof. When the legal status of the target computing node 130 is determined to be legal according to the account information of the target computing node 130 and the corresponding Merkle proof, the delayed exit time corresponding to the target computing node 130 is calculated, and the delayed exit time is later than the specified time of the current time; when the delayed exit time corresponding to the target computing node 130 is reached, the equity balance corresponding to the target computing node 130 is transferred according to the exit request, and the account information corresponding to the target computing node 130 in the preset storage unit is replaced with an empty account. Since the committee usually selects members according to the equity ratio, the frequent replacement of high-equity users will cause low-equity nodes to be repeatedly squeezed out, and eventually the committee is monopolized by a few high-equity users. Therefore, the delayed exit time is set to prevent users with sufficiently high equity from repeatedly removing other committee nodes with lower equity from the audit task by replacing nodes and immediately leaving the system to replace other nodes.
[0042] In one embodiment, when the verification result is verification passed, the method further includes: The storage information of the preset storage unit is updated according to the public input data in the node aggregation result, wherein the public input data is the data allowed to be disclosed in the witness data calculated and generated by the aggregation node 131 based on the audit results of each of the nodes, and the storage information includes the account information of each of the committee nodes and the state root of the preset storage unit.
[0043] Specifically, the aggregation node 131 is used to calculate the witness data according to the audit results of multiple nodes. The witness data is used to generate an audit proof by adding it to the constraint circuit program corresponding to the zero-knowledge verification. The witness data includes public input data and private input data. The public input data is the data that can be made public, and the private input data is the privacy data that is not allowed to be made public. The public input data includes the initial state root (PreStateRoot) corresponding to the preset storage unit before executing the audit task, the end state root (PostStateRoot) corresponding to the preset storage unit after executing the audit task, the block hash (BlockHash) of the target block, the request identifier (RequestID) and the calculated bit vector (AuditorBits).
[0044] Updating the storage information of the preset storage unit according to the public input data specifically includes: determining the valid audit node 132 that provides effective contribution to the data audit result and the invalid audit node 132 that does not provide effective contribution to the data audit result according to the calculated bit vector in the public input data, that is, the node audit result provided by the valid audit node 132 is the same as and correct as the majority of the node audit results, while the node audit result provided by the invalid audit node 132 is different from the majority of the node audit results; increasing the equity balances of the valid audit node 132 and the gathering node according to the role rewards corresponding to different role types, and updating the equity balance of the invalid audit node 132 according to the penalty amount; when the equity balances corresponding to each committee node are updated, the state root of the preset storage unit is updated using the updated equity balances of each committee node.
[0045] The state root of the preset storage unit refers to the root node hash value finally generated in the Merkle tree structure, which represents the encrypted summary of the entire data set. The core function of the state root is to efficiently verify data integrity and quickly locate data changes. The state root is calculated and generated based on the root node hash value of each computing node 130, and the root node hash value of each computing node 130 is a hash value generated based on the account information of the computing node 130. Therefore, when the equity balance of the computing node 130 changes, the root node hash value of the computing node 130 will change, which will in turn cause the state root of the preset storage unit to change. However, the storage information in the preset storage unit will only be substantially changed if the audit contract determines that the audit proof verification has passed. Although the account information of the committee node will be changed in the process of calculating and generating the audit proof by the aggregation node 131, the changed account information is only recorded separately and calculated using the changed account information, and no actual change is caused to the account information in the preset storage unit, thereby ensuring the accuracy of the change of the storage information of the preset storage unit.
[0046] In one embodiment, a blockchain data audit method is provided, referring to Figure 3 , applied to the computing node 130, the method comprises: Step S310, when monitoring the audit event released by the audit blockchain 120, calling the audit contract in the audit blockchain 120 to determine the role type of the computing node 130, wherein the audit event includes the block number of the target block data in the target blockchain 140, the committee node that responds to the audit request, and the role type of each of the committee nodes, the committee node is the computing node 130 participating in the audit process, and the role type of the committee node is an audit node 132 or an aggregation node 131.
[0047] Specifically, the committee node is the computing node 130 related to the audit event. The computing node 130 refers to the client that has successfully completed the registration in the audit blockchain 120. The computing node 130 monitors the audit event and parses the audit event by calling the query aggregation (GetAggregator) function in the audit contract to determine its own role type. If it is determined through the audit contract that no role type is assigned to the computing node 130, that is, the role type of the computing node 130 is empty, it means that the computing node 130 does not participate in the audit process; if the role type of the computing node 130 is determined by the audit contract to be an audit node 132 or an aggregation node 131, then the computing node 130 will be used as a committee node participating in the audit process.
[0048] Step S320, when the role type of the computing node 130 is the audit node 132, the target block data is pulled from the target blockchain 140 according to the audit event, and the target block data is audited according to the preset audit scheme to obtain a node audit result; or, Step S330, when the role type of the computing node 130 is the aggregation node 131, the node audit results of the multiple audit nodes 132 are aggregated to obtain a node aggregation result, and the node aggregation result and the audit proof are sent to the audit blockchain 120, wherein the audit blockchain 120 is used to feed back the node aggregation result as a data audit result to the audit client 110 corresponding to the audit request after the audit of the audit proof is passed.
[0049] Specifically, different audit actions are performed for computing nodes 130 of different role types. Audit node 132 needs to perform audit calculations. Therefore, according to the audit event, the target block data is pulled from the target block in the target blockchain 140 and audited according to the preset audit scheme. The preset audit scheme is the audit scheme or audit rule corresponding to the audit request. Different audit requests correspond to different audit schemes. For example, the audit request is a request to check whether the transaction address is in the blacklist, and the preset audit scheme is used to audit whether the transaction address is in the blacklist; the audit request is a request to verify whether the transaction data is correct, and the preset audit scheme is used to audit whether the transaction data is correct. After the audit processing according to the preset audit scheme, the node audit result is obtained.
[0050] For the aggregation node 131, it is necessary to aggregate the node audit results of each audit node 132 to generate a node aggregation result and an audit certificate, and then send the node aggregation result and the audit certificate to the audit blockchain 120 for zero-knowledge verification. After the audit blockchain 120 verifies the audit certificate using the audit contract, the node aggregation result is fed back to the audit client 110 as a data audit result to complete the audit task.
[0051] In one embodiment, when the role type of the computing node 130 is the audit node 132, the target block data is pulled from the target blockchain 140 according to the audit event, and the target block data is audited according to the preset audit scheme to obtain a node audit result, including: When the role type of the computing node 130 is the audit node 132, the target block data is pulled from the target blockchain 140 according to the audit event, and the target block data is audited according to the preset audit scheme to obtain a node vote; The node vote is signed to obtain the node audit result.
[0052] Specifically, the audit node 132 performs an audit process on the target block data according to a preset audit scheme, thereby generating a node vote. The node vote includes the node identifier (AuditorID) of the audit node 132, the request identifier (RequestID) corresponding to the audit request, the audit field (Illegal), and the block hash value (BlockHash) of the target block. The audit field is used to indicate the audit result of the audit node 132 for the target block data. For example, if the audit request is a request to check whether the transaction address is in the blacklist, the audit field is used to indicate whether the transaction address is in the blacklist or not. The node vote is signed to generate a node audit result with a signature. The audit node 132 cannot forge an invalid vote. A direct channel (SendAuditedVotes) is established between the audit node 132 and the aggregation node 131, through which the node audit result with a signature is sent to the audit node 132. The security and integrity of the node audit result during transmission are ensured by the signature.
[0053] In one embodiment, when the role type of the computing node 130 is the aggregation node 131, the node audit results of the multiple audit nodes 132 are aggregated to obtain a node aggregation result, and the node aggregation result and the audit proof are sent to the audit blockchain 120, including: When the role type of the computing node 130 is an aggregation node 131, a second preset number of node audit results are received in the order of the receiving timestamps corresponding to the audit results of each node, and the received node audit results are used as data to be aggregated, and the audit nodes corresponding to the data to be aggregated are used as participating audit nodes, and the second preset number is less than or equal to the first preset number; Perform signature verification processing on each of the data to be aggregated to obtain the signature verification results corresponding to each of the audit participating nodes 132; The votes of the nodes whose signature verification results show that the signature is valid are stored in the memory pool; Calculate the votes of each node in the memory pool using a preset algorithm corresponding to the preset audit scheme to obtain witness data; Input the witness data into the constraint circuit program corresponding to the preset audit scheme, and execute the constraint circuit program to aggregate the votes of the plurality of nodes in the memory pool to obtain a node aggregation result; The node aggregation result and the audit proof are sent to the audit blockchain 120.
[0054] Specifically, the aggregation node receives a second preset number of node audit results according to the response speed of each audit node, that is, the second preset number of node audit results is received in the order of the reception timestamps of the node audit results. The second preset number is less than the first preset number previously screened according to the equity balance, and the node audit results after the second preset number are no longer received, so as to ensure that the aggregation node gives priority to receiving the node audit results sent by the audit nodes with higher response speeds, and only uses the received node audit results as the data to be aggregated for subsequent aggregation processing, and uses the audit nodes corresponding to the data to be aggregated as participating audit nodes, and the audit nodes that have generated node audit results but have not been successfully received by the aggregation node are regarded as filtering nodes that have not successfully participated in the audit, and no equity rewards will be given to the filtering nodes.
[0055] Aggregation node 131 first verifies the signature of each data to be aggregated to determine whether the signature of the data to be aggregated is valid, stores the node votes with valid signatures in the memory pool, and generates witness data based on the node votes with valid signatures and the preset algorithm corresponding to the preset audit scheme, that is, the witness data includes public input data and private input data. The public input data is the data that can be made public, and the private input data is the privacy data that is not allowed to be made public. The public input data includes the initial state root (PreStateRoot) corresponding to the preset storage unit before executing the audit task, the end state root (PostStateRoot) corresponding to the preset storage unit after executing the audit task, the block hash (BlockHash) of the target block, the request identifier (RequestID) and the calculated bit vector (AuditorBits). The private input data includes the account information of the audit node 132 (Auditors), the account information of the aggregation node 131 (Aggregator), and the signature of the audit node 132. The preset algorithm corresponding to the preset audit scheme is the same as the calculation logic in the preset audit scheme, but the preset audit scheme is implemented using a constraint circuit program, that is, the calculation logic of the witness data is the same as the calculation logic of the corresponding parameters in the process of generating the audit proof, but the same calculation tools are not used to calculate and generate the witness data and the audit proof.
[0056] The constraint circuit program is a program constructed by zk-SNARK, which is used to indicate the zero-knowledge verification circuit. The witness data is input into the constraint circuit program, and the constraint circuit program is executed to generate the node aggregation result and the audit proof (Proof). The audit proof is a zero-knowledge proof, which is used to prove that the witness data meets the constraint conditions corresponding to the constraint circuit program, but will not disclose the specific content of the witness data, thereby ensuring the privacy and security of the private input data. Afterwards, the node aggregation result and the audit proof are sent to the audit blockchain 120 for on-chain verification.
[0057] In one embodiment, the witness data is input into a constraint circuit program corresponding to the preset audit scheme, and the constraint circuit program is executed to aggregate the audit results of the multiple nodes in the memory pool to obtain a node aggregation result, including: Inputting the witness data into the constraint circuit program corresponding to the preset audit scheme, and executing the constraint circuit program to obtain the witness value and the node aggregation result; The audit proof is generated according to the witness value and the proof key corresponding to the constrained circuit program.
[0058] Specifically, the witness data is substituted into the constraint circuit program, and the witness value (Witness) and the node aggregation result are obtained by executing the constraint circuit program. Then, the audit proof Proof is generated based on the proof key (Proving Key, PK) stored locally in the aggregation node 131 and the calculated witness value through the proof method (groth16.Prove) in the zero-knowledge proof library (gnark).
[0059] In one embodiment, executing the constraint circuit program to obtain the witness value and the node aggregation result includes: Determine the current number of votes of each of the audit nodes 132 for the audit request; Determine a first root matching result between a pre-aggregation state root corresponding to a preset storage unit and an initial state root in the witness data; Aggregate the audit results of the multiple nodes to obtain a second aggregation result, where the second aggregation result is used to indicate the voting result of the node with the largest number of votes; when the second aggregation result successfully matches the first aggregation result in the witness data, use the first aggregation result or the second aggregation result as the node aggregation result, and increase the equity balance of the aggregation node 131 according to the first preset reward to obtain the first reward balance of the aggregation node 131; update the intermediate state root corresponding to the preset storage unit based on the first reward balance of the aggregation node 131 to obtain the first state root; Traversing the account information of each of the audit nodes 132, and verifying the legal status of each of the audit nodes 132 according to the account information of each of the audit nodes 132; taking the audit nodes 132 whose legal status is legal as nodes to be rewarded, increasing the equity balance of the nodes to be rewarded according to the second preset reward, and obtaining the second reward balance of the nodes to be rewarded; updating the node bit vector and the first state root according to the second reward balance of the nodes to be rewarded, and obtaining the intermediate bit vector and the second state root; at the end of traversing the audit results of all the nodes, determining the bit vector matching result between the intermediate bit vector finally obtained and the calculated bit vector in the witness data, and the second root matching result between the second state root finally obtained and the calculated state root in the witness data; A witness value is determined based on a bit vector matching result between the final intermediate bit vector and the calculated bit vector in the witness data, and a second root matching result between the final second state root and the calculated state root in the witness data.
[0060] Specifically, during the execution of the constraint circuit program, the witness data is verified, and the verification content includes any of the following: 1. Determine whether the current number of votes for the audit request by each audit node 132 is one, that is, determine whether the number of node audit results initiated by the same audit node 132 for the same audit request is one, to ensure that the same audit node 132 does not vote multiple times for the same audit request. For each audit request, each audit node 132 has only one voting opportunity, so the aggregation node 131 needs to iterate the node audit results submitted by all audit nodes 132 to ensure that each audit node 132 has only initiated one vote.
[0061] 2. Call the verifyMerkleProof tool to verify whether the initial state root calculated by the aggregation node 131 is consistent with the pre-aggregation state root (preStateRoot) corresponding to the preset storage unit, that is, obtain the first root matching result, ensure that the pre-aggregation state root is consistent with the initial state root calculated by the aggregation node 131, so as to check whether the preset storage unit contains the account information of the aggregation node 131 and ensure the legitimacy of the aggregation node 131.
[0062] 3. Perform traversal statistics on all node audit results, and take most of the same node audit results as the second aggregation result, that is, the second aggregation result is the same as the majority of node audit results, and count the first node number (Illegal) and the second node number (Legal) according to the clustering results of each node audit result. The first node number is used to indicate the number of audit nodes 132 whose node audit results are different from the majority of node audit results, and the number of audit nodes 132 with misbehaving. The second node number is used to indicate the number of audit nodes 132 whose node audit results are the same as the majority of node audit results, and the number of audit nodes 132 with honest behavior. The first aggregation result in the witness data is matched with the second aggregation result. If the match is successful, it means that the first aggregation result in the witness data is successfully verified. Then the first aggregation result or the second aggregation result is used as the node aggregation result. If the first aggregation result is successfully verified, it is necessary to reward the aggregation node 131 with equity. Therefore, the equity balance of the aggregation node 131 is increased according to the first preset reward in the audit reward to obtain the first reward balance of the aggregation node 131. At this time, the first reward balance is a record value, and it does not generate an actual reward for the equity balance of the aggregation node 131, that is, at this time, the equity balance of the aggregation node 131 in the preset storage unit does not change substantially. Based on the recorded first reward balance, the intermediate state root corresponding to the preset storage unit is updated to obtain the first state root. Similarly, the first state root is a record value, not a state root that actually changes the preset storage unit, in preparation for subsequent verification.
[0063] 4. Traverse the account information of each audit node 132 again, verify the Merkle proof (verifyMerkleProof), message hash (verifyHash) and signature (verifySignature) of each audit node 132, so as to determine the legal status of each audit node 132, and use the audit nodes 132 with legal status as legal as the nodes to be rewarded. According to the second reward balance in the audit reward, the equity balance of each node to be rewarded is increased to obtain the second reward balance. The second reward balance is also a record value, which does not generate a substantial reward for the equity balance of each audit node 132 in the preset storage unit. The second reward balance is used to update the computing node 130 bit vector and the first state root. The node bit vector is a binary identifier, which records the index and voting results of the audit nodes 132 participating in the audit. This can be used in zero-knowledge proof to efficiently verify the membership of a set without storing a complete list, thereby reducing computing and storage overhead. When the bit value in the node bit vector is 1, it means that the audit node 132 with the corresponding index provides an effective contribution to the node aggregation result, that is, the audit node 132 is determined to be a computing node 130 with honest behavior. When the bit value is 0, it means that the audit node 132 with the corresponding index does not provide an effective contribution to the node aggregation result.
[0064] For example, when only the first audit node 132 makes a valid contribution, the corresponding index of the first audit node 132 is validator.Index=0, then 2^0=1, and the node bit vector updated based on the first audit node 132 is 0001. When only the second audit node 132 makes a valid contribution, the corresponding index of the second audit node 132 is validator.Index=2, then 2^2=4, and the node bit vector updated based on the first audit node 132 is 0100. If both the first audit node 132 and the second audit node 132 make valid contributions, validatorBits=0+2^0+2^2=1+4=5, which is converted to binary as 0101, indicating that the audit nodes 132 with indexes 0 and 2 both provide valid contributions to the audit results. Audit nodes 132 that do not provide valid contributions will not be recorded in the node bit vector.
[0065] The intermediate bit vector calculated based on the constraint circuit program is compared with the calculated bit vector in the witness data to obtain a bit vector matching result, and the second state root calculated based on the constraint circuit program is compared with the calculated state root in the witness data to obtain a second root matching result, thereby verifying the calculated bit vector and the calculated state root in the witness data.
[0066] The verification order of the above four verification contents is not limited. After the verification of the above verification contents is completed, the verification value is output. The verification value is used to reflect the verification results of the verification contents involved in the verification and to indicate the correctness of the witness data. The witness value is determined based on the bit vector matching result between the final intermediate bit vector and the calculated bit vector in the witness data, and the second root matching result between the final second state root and the calculated state root in the witness data.
[0067] In a specific embodiment, referring to Figure 4 The audit request is to check whether the transaction address is in the blacklist. The audit process is as follows: Step 1: The audit client 110 sends an audit request to the audit blockchain 120 by calling the request function (AuditRequest) in the audit contract. The audit request provides a request identifier (RequestID), a blockchain identifier (ChainIDt) of the requested target blockchain 140, a block number (BlockNumber) of the target block, and an audit reward (Reward) of the audit node 132 that executes the request.
[0068] Step 2: The audit contract assigns aggregation node 131 (AggregatorID) and audit node 132 (AuditorID) to the audit request, and triggers an audit event (AuditRequestEvent) (the audit event includes the request ID, the block number of the target block, the blockchain ID, and the audit reward) to notify the committee node.
[0069] Step 3: After the committee node monitors the audit event, it determines the current role type of each by calling the query aggregation function of the audit contract.
[0070] Step 4: Audit node 132 obtains the parameters (request identifier, blockchain identifier, block number) in the audit event, retrieves the block corresponding to the block number of the specified target blockchain 140 according to the blockchain identifier, obtains all transaction addresses in the block, then checks locally whether the transaction address is in the blacklist, and creates a node vote consisting of the audit node 132 identifier (AuditorID), request identifier (RequestID), the address in the blacklist (Illegal audit field) and the hash value of the retrieved block (BlockHash). Afterwards, audit node 132 signs the node vote to obtain the node audit result, so the auditor cannot forge an invalid vote.
[0071] Step 5: The audit node 132 establishes a direct channel with the aggregation node 131, and sends the node audit result with the corresponding signature to the aggregation node 131 through the channel (i.e., implements SendAuditedVotes).
[0072] Step 6: Aggregation node 131 performs signature verification after receiving the node audit result from audit node 132. If the signature verification determines that the signature is valid, aggregation node 131 considers that the node vote is valid and stores the node audit result in the memory pool of aggregation node 131. After receiving the majority of valid votes with the same result for the audit request, aggregation node 131 starts to aggregate node 131 audit results. During this process, aggregation node 131 aggregates the audit voting results locally and generates an audit proof Proof. Proof is used to prove that the submitted aggregation results and the changes in the account information of the audit node 132 participating in the audit are correct, that is, it is used to prove that the witness data calculated by aggregation node 131 is correct.
[0073] Step 7: Aggregation node 131 feeds back the node aggregation result to the audit contract. The node aggregation result includes public input data and audit proof (Proof). The public input data includes request identifier (RequestID), block hash (BlockHash), audit field (Illegal) used to indicate whether the specified block contains illegal transaction addresses, calculation bit vector (AuditorBits) and calculation state root (PostStateRoot). The correctness of the witness data is verified by verifying Proof.
[0074] Step 8: After verification, a contract event is triggered, that is, the audit parameters in the public input data are fed back to the audit client 110 as data audit results. The audit parameters include the request identifier (RequestID), the block hash (BlockHash), and the audit field (Illegal) used to indicate whether the specified block contains an illegal transaction address, so as to notify the administrator of the final audit result.
[0075] Figures 2 to 4 FIG. 1 is a flowchart of a blockchain data audit method in one embodiment. It should be understood that although Figures 2 to 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 2 to 4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0076] like Figure 5 As shown, an embodiment of the present application provides a computer device, including a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714; Memory 713, used for storing computer programs; The processor 711 is used to implement the blockchain data auditing method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 713.
[0077] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0078] In one embodiment, the blockchain data audit system provided by the present application can be implemented in the form of a computer program, which can be used in Figure 5 The computer device shown in the figure is run. The memory of the computer device can store various program modules that constitute the blockchain data audit system, and the computer program composed of each program module enables the processor to execute the blockchain data audit method of each embodiment of the present application described in this specification.
[0079] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the blockchain data audit method provided in any of the aforementioned method embodiments is implemented.
[0080] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0082] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative may be used.
[0083] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A blockchain data audit method, characterized in that: Applied to auditing blockchain, the method includes: Upon receiving an audit request sent by at least one audit client, an audit event corresponding to the audit request is generated through an audit contract, wherein the audit request is used to request to obtain the data audit result of the target block data in the target blockchain after the audit processing is performed according to a preset audit scheme, and the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each of the committee nodes, the role type of the committee node is an audit node or an aggregation node, and the target blockchain is a blockchain of any structure; Broadcasting the audit event, wherein the audit node is used to pull the target block data from the target blockchain based on the audit event, and perform audit processing on the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node is used to aggregate the node audit results of multiple audit nodes based on the audit event to obtain a node aggregation result; Upon receiving the node aggregation result sent by the aggregation node, using the audit contract to perform zero-knowledge verification on the audit proof in the node aggregation result to obtain a verification result; When the verification result is that the verification is passed, the audit parameters in the node aggregation result are fed back to the audit client as the data audit result.
2. The method according to claim 1, characterized in that: When receiving an audit request sent by the audit client, generating an audit event corresponding to the audit request through the audit contract includes: Upon receiving an audit request sent by an audit client, obtaining account information of each computing node from a preset storage unit, wherein the account information includes a balance of equity; Selecting a first preset number of computing nodes as the committee nodes in descending order of equity balance; Determine the role type and role reward of each of the committee nodes; The audit event corresponding to the audit request is generated according to the storage location of the target block data, the request identifier, the role type and the role reward of each committee node.
3. The method according to claim 2, characterized in that The step of selecting a first preset number of computing nodes as the committee nodes in descending order of equity balances includes: Filtering a first preset number of computing nodes as selected nodes in descending order of equity balance, wherein the computing nodes other than the selected nodes are unselected nodes; Upon receiving a gain request sent by an unselected node, increasing the equity balance corresponding to the unselected node according to the gain request; Reselecting a first preset number of computing nodes as selected nodes in descending order of equity balance; When no gain request is received from the unselected nodes within a preset time period, the selected nodes are selected as the committee nodes.
4. The method according to claim 1, characterized in that: When the verification result is verification passed, the method further includes: The storage information of the preset storage unit is updated according to the public input data in the node aggregation result, wherein the public input data is the data allowed to be disclosed in the witness data calculated and generated by the aggregation node based on the audit results of each of the nodes, and the storage information includes the account information of each of the committee nodes and the state root of the preset storage unit.
5. A blockchain data audit method, characterized in that: Applied to a computing node, the method comprises: When an audit event published by an audit blockchain is monitored, the audit contract in the audit blockchain is called to determine the role type of the computing node, wherein the audit event includes the storage location of the target block data in the target blockchain, the committee node that responds to the audit request, and the role type of each of the committee nodes, the committee node is a computing node participating in the audit process, and the role type of the committee node is an audit node or an aggregation node; When the role type of the computing node is an audit node, the target block data is pulled from the target blockchain according to the audit event, and the target block data is audited according to a preset audit scheme to obtain a node audit result; or, When the role type of the computing node is an aggregation node, the node audit results of multiple audit nodes are aggregated to obtain a node aggregation result, and the node aggregation result and the audit proof are sent to the audit blockchain, wherein the audit blockchain is used to verify the audit proof and then feed back the node aggregation result as a data audit result to the audit client corresponding to the audit request.
6. The method according to claim 5, characterized in that When the role type of the computing node is an audit node, the target block data is pulled from the target blockchain according to the audit event, and the target block data is audited according to the preset audit scheme to obtain a node audit result, including: When the role type of the computing node is an audit node, the target block data is pulled from the target blockchain according to the audit event, and the target block data is audited according to the preset audit scheme to obtain a node vote; The node vote is signed to obtain the node audit result.
7. The method according to claim 6, characterized in that When the role type of the computing node is an aggregation node, the node audit results of the multiple audit nodes are aggregated to obtain a node aggregation result, and the node aggregation result and the audit certificate are sent to the audit blockchain, including: When the role type of the computing node is an aggregation node, a second preset number of node audit results are received in the order of the receiving timestamps corresponding to the audit results of each node, and the received node audit results are used as data to be aggregated, and the audit nodes corresponding to the data to be aggregated are used as participating audit nodes, and the second preset number is less than or equal to the first preset number; Performing signature verification processing on each of the data to be aggregated to obtain the signature verification results corresponding to each of the audit participating nodes; The votes of the nodes whose signature verification results show that the signature is valid are stored in the memory pool; Calculate the votes of each node in the memory pool using a preset algorithm corresponding to the preset audit scheme to obtain witness data; Input the witness data into the constraint circuit program corresponding to the preset audit scheme, and execute the constraint circuit program to aggregate the votes of the plurality of nodes in the memory pool to obtain a node aggregation result; The node aggregation results and audit proof are sent to the audit blockchain.
8. The method according to claim 7, characterized in that Inputting the witness data into the constraint circuit program corresponding to the preset audit scheme, and executing the constraint circuit program to aggregate the audit results of the multiple nodes in the memory pool to obtain a node aggregation result, including: Inputting the witness data into the constraint circuit program corresponding to the preset audit scheme, and executing the constraint circuit program to obtain the witness value and the node aggregation result; The audit proof is generated according to the witness value and the proof key corresponding to the constrained circuit program.
9. The method according to claim 8, characterized in that Executing the constraint circuit program to obtain a witness value and the node aggregation result includes: Aggregate the audit results of the multiple nodes to obtain a second aggregate result, where the second aggregate result is used to indicate the voting result of the node with the largest number of votes; when the second aggregate result successfully matches the first aggregate result in the witness data, use the first aggregate result or the second aggregate result as the node aggregate result, and increase the equity balance of the aggregate node according to the first preset reward to obtain the first reward balance of the aggregate node; update the intermediate state root corresponding to the preset storage unit based on the first reward balance of the aggregate node to obtain the first state root; Traversing the account information of each of the audit nodes, and verifying the legal status of each of the audit nodes according to the account information of each of the audit nodes; taking the audit nodes whose legal status is legal as nodes to be rewarded, increasing the equity balance of the nodes to be rewarded according to the second preset reward, and obtaining the second reward balance of the nodes to be rewarded; updating the node bit vector and the first state root according to the second reward balance of the nodes to be rewarded, and obtaining the intermediate bit vector and the second state root; at the end of traversing the audit results of all the nodes, determining the bit vector matching result between the intermediate bit vector finally obtained and the calculated bit vector in the witness data, and the second root matching result between the second state root finally obtained and the calculated state root in the witness data; A witness value is determined based on a bit vector matching result between the final intermediate bit vector and the calculated bit vector in the witness data, and a second root matching result between the final second state root and the calculated state root in the witness data.
10. A blockchain data audit system, characterized in that: The system comprises: An audit client, used to initiate an audit request, wherein the audit request is used to request to obtain the data audit result after the target block data in the target blockchain is audited according to a preset audit scheme; An audit blockchain, used to generate an audit event corresponding to the audit request through an audit contract, wherein the audit event includes the storage location of the target block data, the committee node that responds to the audit request, and the role type of each committee node, wherein the role type of the committee node is an audit node or an aggregation node; broadcasting the audit event, wherein the audit node is used to pull the target block data from the target blockchain based on the audit event, and perform audit processing on the target block data according to the preset audit scheme to obtain a node audit result, and the aggregation node is used to aggregate the node audit results of multiple audit nodes based on the audit event to obtain a node aggregation result; upon receiving the node aggregation result sent by the aggregation node, using the audit contract to perform zero-knowledge verification on the audit proof in the node aggregation result to obtain a verification result; when the verification result is a passed verification, the audit parameters in the node aggregation result are fed back to the audit client as the data audit result; The target blockchain is used to provide the audit node with the target block data to be audited, and the target blockchain is any blockchain to be audited.
11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Safety auditing method and system based on block chain and storage medium
CN111625870A
Auditing method and system based on blockchain
CN112800487A
Distributed node collaboration method based on blockchain
CN114095240A
Consensus method and device based on smart contract security audit, and readable medium
CN117459238A
Auditing knowledge mapping system based on digital auditing platform
CN117932074A