Data processing method and device of blockchain system and blockchain system

By setting up a multi-layer verification node set in the first-layer blockchain system, the state hash data of the second-layer blockchain is quickly verified, and the problems of complexity and voluntary dependence of the traditional fault proof method are solved, and efficient fault proof of the blockchain system is achieved.

CN119363315BActive Publication Date: 2025-04-29CHINA ACADEMY OF INFORMATION & COMM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411884262.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-29
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The traditional fault proof method is more complex in layer 2 blockchain networks, and the challenge is based on the principle of voluntary nodes, resulting in a lower chance of failure detection.

Method used

By setting up a first verification node set and a second verification node set in the first layer blockchain system, the target state hash data submitted by the second layer blockchain user is successively verified to quickly verify whether there are errors in the data, and a transaction block is built for uplink and fallback.

Benefits of technology

A rapid proof of failure of blockchain systems including first-layer blockchain and second-layer blockchain is achieved, reducing the risk of verification complexity and relying on the voluntary principle of nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363315B_ABST
    Figure CN119363315B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a data processing method, device and blockchain system of a blockchain system, wherein the method comprises: in response to a first-layer blockchain receiving a first transaction block, extracting target state hash data from the first transaction block; verifying the target state hash data through a first verification node set to obtain a first verification result; in response to the first verification result indicating that the target state hash data has an error, verifying the target state hash data through a second verification node set to obtain a second verification result; in response to the second verification result indicating that the target state hash data has an error, constructing a second transaction block based on the target state hash data by the second verification node set, uploading the second transaction block to the first-layer blockchain, and rolling back the state hash corresponding to the first transaction block. The disclosed embodiment can quickly verify whether there is an error in the state hash data in the transaction block submitted by the user of the second-layer blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to blockchain technology, and in particular to a data processing method and device for a blockchain system, and a blockchain system. Background Art

[0002] In the second-layer blockchain network, the second-layer blockchain includes the latest block status and block data in a transaction to be submitted to the first-layer blockchain. The transaction calls the second-layer management contract of the first-layer blockchain, and the node network of the first-layer blockchain executes the transaction. Finally, the block data and status of the second-layer blockchain will be saved in the nodes of the first-layer blockchain network, and a query interface will be provided to the outside world, so that any node can download the block data and status of the second-layer blockchain from the first-layer blockchain to verify the correctness of the second-layer blockchain. Since the security of the first-layer blockchain is often higher than that of the second-layer blockchain, the first-layer blockchain can protect the security of the second-layer blockchain. In addition, the second-layer blockchain is an extension of the first-layer blockchain ecosystem, but there is no limit on the burden of adding the first-layer blockchain, which can provide greater scalability for the first-layer blockchain.

[0003] Users of the first-layer blockchain can transfer their assets to the second-layer blockchain. When users of the first-layer blockchain want to retrieve their assets from the second-layer blockchain, the users of the second-layer blockchain need to transfer the assets to the asset destruction contract on the second-layer blockchain to generate an event message. The cross-chain bridge between the first-layer blockchain and the second-layer blockchain builds a transaction on the first-layer blockchain based on the above event message, and then submits the transaction to the first-layer blockchain. The asset unlocking contract on the first layer is called to unlock the assets after the transaction is verified. Since the credibility of the state hash data submitted by the second-layer blockchain to the first-layer blockchain is questionable, a challenge period is set after the second-layer blockchain submits the state hash data. During this challenge period, no node can falsify the state hash data before verification. After verification, users of the first-layer blockchain can retrieve the assets on the second-layer blockchain.

[0004] During the challenge period, if the state hash submitted by the second-layer blockchain is found to be wrong, the verification node can initiate a challenge by calling the interface of the second-layer management contract; if the user of the second-layer blockchain believes that the submitted state hash is correct, the challenge can be answered by calling the interface of the second-layer management contract. After several rounds of challenges and responses, the source of the error can be determined, and the wrong person and the correct person can be punished and rewarded respectively. The process and mechanism of discovering an error and proving it on the first-layer blockchain is called fault proof in the public chain field.

[0005] For example, traditional fault proof methods such as Optimism and Arbitrum are relatively complex, and the challenge relies on the voluntary principle of nodes, which makes it difficult to detect faults. Summary of the invention

[0006] The embodiments of the present disclosure provide a data processing method, device and blockchain system for a blockchain system to solve the above problems.

[0007] A first aspect of the embodiments of the present disclosure provides a data processing method for a blockchain system, including:

[0008] In response to the first layer blockchain receiving a first transaction block including target state hash data of a second layer blockchain user, extracting the target state hash data from the first transaction block;

[0009] Verifying the target state hash data through a first verification node set to obtain a first verification result, wherein the first verification node set includes a first node of the first layer blockchain and a second node that does not belong to the first layer blockchain;

[0010] In response to the first verification result indicating that the target state hash data has an error, verifying the target state hash data through a second verification node set to obtain a second verification result, wherein the second verification node set includes multiple nodes of the first layer of blockchain;

[0011] In response to the second verification result indicating that there is an error in the target state hash data, the second verification node set constructs a second transaction block based on the target state hash data, uploads the second transaction block to the first layer blockchain, and rolls back the state hash corresponding to the first transaction block.

[0012] In some embodiments of the present disclosure, in response to the first verification result indicating that the target state hash data has an error, verifying the target state hash data by using a second verification node set includes:

[0013] In response to the verification result of the first verification node set on the target state hash data indicating that there is an error in the target state hash data, the first verification node set constructs a third transaction block based on the target state hash data;

[0014] In response to detecting that the number of signature nodes of the first verification node set for the third transaction block is greater than a preset number threshold, uploading the third transaction block to the first layer blockchain;

[0015] The target state hash data is extracted from the third transaction block, and the target state hash data is verified by the second verification node set.

[0016] In some embodiments of the present disclosure, the second node includes at least one node of the second-layer blockchain.

[0017] In some embodiments of the present disclosure, before extracting the target state hash data from the first transaction block in response to the first layer blockchain receiving the first transaction block including the target state hash data of the second layer blockchain user, the method further includes:

[0018] Obtaining a historical verification record of each node in a first candidate node set for historical state hash data, wherein the first candidate node set includes at least one node of the first layer of blockchain;

[0019] Based on the historical verification record, determining the first node from the first candidate node set;

[0020] Obtaining credit information of each node in a second candidate node set, wherein the second candidate node set includes at least one node of the second-layer blockchain;

[0021] Determine the second node from the second candidate node set based on the credit information of each node;

[0022] Based on the first node and the second node, the first verification node set is constructed.

[0023] In some embodiments of the present disclosure, after extracting the target state hash data from the first transaction block in response to the first layer blockchain receiving the first transaction block including the target state hash data of the second layer blockchain user, the method further includes:

[0024] In response to not verifying that the target state hash data has an error within a preset time after the first layer blockchain receives the first transaction block, confirming that the target state hash data is correct.

[0025] A second aspect of the embodiments of the present disclosure provides a data processing device of a blockchain system, including:

[0026] an extraction module, configured to extract the target state hash data from the first transaction block in response to the first layer blockchain receiving the first transaction block including the target state hash data of the second layer blockchain user;

[0027] A first verification module, configured to verify the target state hash data through a first verification node set to obtain a first verification result, wherein the first verification node set includes a first node of the first layer of blockchain and a second node that does not belong to the first layer of blockchain;

[0028] A second verification module is configured to verify the target state hash data through a second verification node set in response to the first verification result indicating that the target state hash data has an error, to obtain a second verification result, wherein the second verification node set includes multiple nodes of the first layer of blockchain;

[0029] An error handling module is used for, in response to the second verification result indicating that there is an error in the target state hash data, constructing a second transaction block based on the target state hash data by the second verification node set, uploading the second transaction block to the first layer blockchain, and rolling back the state hash corresponding to the first transaction block.

[0030] In some embodiments of the present disclosure, the second verification module is used to:

[0031] In response to the verification result of the first verification node set on the target state hash data indicating that there is an error in the target state hash data, the first verification node set constructs a third transaction block based on the target state hash data;

[0032] In response to detecting that the number of signature nodes of the first verification node set for the third transaction block is greater than a preset number threshold, uploading the third transaction block to the first layer blockchain;

[0033] The target state hash data is extracted from the third transaction block, and the target state hash data is verified by the second verification node set.

[0034] In some embodiments of the present disclosure, the second node includes at least one node of the second-layer blockchain.

[0035] In some embodiments of the present disclosure, the device further includes:

[0036] A historical verification record acquisition module, used to obtain a historical verification record of each node in a first candidate node set for historical state hash data, wherein the first candidate node set includes at least one node of the first layer of blockchain;

[0037] A first node determination module, configured to determine the first node from the first candidate node set based on the historical verification record;

[0038] A node credit information acquisition module, used to obtain credit information of each node in a second candidate node set, wherein the second candidate node set includes at least one node of the second-layer blockchain;

[0039] A second node determination module, configured to determine the second node from the second candidate node set based on the credit information of each node;

[0040] A construction module is used to construct the first verification node set based on the first node and the second node.

[0041] In some embodiments of the present disclosure, the device further includes:

[0042] A confirmation module is used to confirm that the target state hash data is correct in response to not verifying that the target state hash data has an error within a preset time after the first layer blockchain receives the first transaction block.

[0043] A third aspect of the embodiments of the present disclosure provides a blockchain system, including:

[0044] The second-layer blockchain is used to execute blockchain transactions and generate corresponding block data;

[0045] A layer 1 blockchain, wherein the layer 1 blockchain is connected to the layer 2 blockchain via a cross-chain bridge;

[0046] The apparatus of the second aspect is used to execute the method of the first aspect.

[0047] The data processing method, device and blockchain system of the blockchain system of the disclosed embodiments are relatively complicated because the traditional fault proof method requires multiple challenges and multiple responses to the state hash data of the block within the challenge period, and the probability of discovering the fault is low because the challenge is dependent on the voluntary principle of nodes. Therefore, after the first-layer blockchain receives the first transaction block of the second-layer blockchain, the target state hash data is verified in turn by the first verification node set and the second verification node set, which can quickly verify whether there is an error in the target state hash data, thereby realizing fault proof for the blockchain system including the first-layer blockchain and the second-layer blockchain.

[0048] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0050] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0051] Figure 1 A flowchart of a data processing method of a blockchain system in some embodiments of the present disclosure;

[0052] Figure 2 is a flowchart of step S3 in some embodiments of the present disclosure;

[0053] Figure 3 is a flowchart of step S0 in some embodiments of the present disclosure;

[0054] Figure 4 It is a structural block diagram of a data processing device of a blockchain system in some embodiments of the present disclosure;

[0055] Figure 5 It is a structural block diagram of a data processing device of a blockchain system in some other embodiments of the present disclosure;

[0056] Figure 6 The structure block diagram of an electronic device in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0057] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0058] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0059] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0060] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0061] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0062] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0063] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0064] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0065] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0066] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0067] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0068] Figure 1 The following is a flow chart of a data processing method of a blockchain system in one embodiment of the present disclosure. Figure 1 As shown, the data processing method of the blockchain system includes the following steps:

[0069] S1: In response to the first layer blockchain receiving a first transaction block including target state hash data of a second layer blockchain user, extracting the target state hash data from the first transaction block.

[0070] When a second-layer blockchain user wants to transfer assets to a first-layer blockchain, the second-layer blockchain user transfers the assets to be transferred to the asset destruction contract on the second-layer blockchain, generating an event message. The asset destruction contract is a smart contract on the second-layer blockchain, which is used to destroy the assets (such as digital assets) of the second-layer blockchain user. ‌Blockchain asset destruction‌ refers to the permanent removal of digital assets from the blockchain network, making them unusable or tradeable again. In this embodiment, the asset destruction contract can destroy the designated assets of the second-layer blockchain user, and then transfer the designated assets to the designated users of the first-layer blockchain. The event message generated by the asset destruction contract may include information such as the asset destruction account, destruction time, and destruction amount.

[0071] The cross-chain bridge located between the first-layer blockchain and the second-layer blockchain builds the first transaction block according to the event message. Among them, the cross-chain bridge is used to perform cross-chain operations between the first-layer blockchain and the second-layer blockchain. The first transaction block includes the target state hash data of the second-layer blockchain user. The target state hash data can represent the state hash assets of the second-layer blockchain user on the second-layer blockchain. State hash assets refer to mapping asset information in the real world to the blockchain, generating a unique identifier through a hash algorithm, and ensuring the uniqueness and security of the asset on the blockchain. Through state hash assets, the confirmation, circulation and transaction of assets can be realized, and the transparency and security of asset management can be improved.

[0072] The cross-chain bridge sends the first transaction block to the second-layer management contract in the first-layer blockchain for managing the second-layer blockchain. After receiving the first transaction block, the second-layer management contract extracts the target state hash data from the first transaction block. Among them, the second-layer management contract is a smart contract set in the first-layer blockchain for managing the second-layer blockchain. Among them, the second-layer management contract includes multiple contract interfaces, which may specifically include: an interface for submitting the state hash of the second-layer blockchain, an interface for submitting the block data of the second-layer blockchain, an interface for submitting the multi-signature transaction of the first verification set, and an interface for submitting the multi-signature transaction of the second verification set, etc.

[0073] S2: Verify the target state hash data through the first verification node set to obtain a first verification result.

[0074] The second-layer management contract sends the target state hash data to all verification nodes in the first verification node set. The first verification node set includes a first node of the first-layer blockchain and a second node that does not belong to the first-layer blockchain. The first node may include at least one consensus node in the first-layer blockchain. The second node is located at least one node of the second-layer blockchain. The second node may also include at least one node of a blockchain that is independent of the blockchain system composed of the first-layer blockchain and the second-layer blockchain. For example, the second node may include a credible enterprise node in a blockchain of the blockchain system.

[0075] The first node and the second node verify the target state hash data respectively. The process of verifying the target state hash data includes: performing hash calculation according to the first transaction block to obtain a state hash value. If the calculated state hash value is consistent with the state hash value in the target state hash data, the target state hash data is determined to be correct; if the calculated state hash value is inconsistent with the state hash value in the target state hash data, it is determined that there is an error in the target state hash data. Regardless of whether the target state hash data is correct or there is an error, a first verification result is generated. The first verification result may indicate that the target state hash data is correct or there is an error. For example, the first verification result may include a parameter value indicating whether the target state hash data is correct. The parameter value of 0 indicates that the target state hash data is correct, and the parameter value of 1 indicates that there is an error in the target state hash data.

[0076] S3: In response to the first verification result indicating that there is an error in the target state hash data, the target state hash data is verified by a second verification node set to obtain a second verification result.

[0077] If the first verification result indicates that there is an error in the target state hash data, the second-layer management contract informs all verification nodes in the second verification node set to verify the target state hash data to obtain a second verification result. The second verification node set includes multiple nodes of the first-layer blockchain, for example, the second verification node set includes multiple consensus nodes of the first-layer blockchain. The consensus nodes in the first-layer blockchain can reach a consensus on the generation blocks of the first-layer blockchain, and can submit blocks and retrograde consensus on the second-layer blockchain to the first-layer blockchain.

[0078] The second verification node set verifies the target state hash data in a manner similar to the first verification node set verifies the target state hash data. The second verification result may indicate that the target state hash data is correct or has an error. For example, the second verification result may include a parameter value indicating whether the target state hash data is correct. The parameter value of 0 indicates that the target state hash data is correct, and the parameter value of 1 indicates that the target state hash data has an error.

[0079] S4: In response to the second verification result indicating that there is an error in the target state hash data, a second set of verification nodes constructs a second transaction block based on the target state hash data, uploads the second transaction block to a layer of blockchain, and rolls back the state hash corresponding to the first transaction block.

[0080] If the second verification result indicates that there is an error in the target state hash data, the second verification node set jointly signs a transaction to generate a second transaction block, and the second transaction block is chained on the first layer of the blockchain.

[0081] The fact that the second transaction block is on the first-layer blockchain indicates that the verification node of the second verification set believes that there is an error in the target state hash data, and at this time, the state hash corresponding to the first transaction block is rolled back. Among them, the specific method of rolling back the state hash corresponding to the first transaction block may include: the second-layer management contract updates the second-layer latest state contained therein, for example, setting the current second-layer latest state hash to the state hash before the wrong state hash. At the same time, the second-layer management contract updates the second-layer block data contained therein, and rolls back the block corresponding to the wrong state hash and the blocks behind it.

[0082] In this embodiment, since the traditional fault proof method requires multiple challenges and multiple responses to the state hash data of the block within the challenge period, the traditional fault proof method is relatively complicated, and the challenge is dependent on the voluntary principle of nodes, resulting in a low probability of discovering faults. Therefore, after the first-layer blockchain receives the first transaction block of the second-layer blockchain, the target state hash data is verified in turn by the first verification node set and the second verification node set, which can quickly verify whether there are errors in the target state hash data, thereby realizing fault proof of the blockchain system including the first-layer blockchain and the second-layer blockchain.

[0083] Figure 2 FIG. 1 is a flow chart of step S3 in some embodiments of the present disclosure. Figure 2 As shown, step S3 may include the following steps:

[0084] S3-1: In response to the verification result of the target state hash data by the first verification node set indicating that there is an error in the target state hash data, the first verification node set constructs a third transaction block based on the target state hash data.

[0085] When the verification result of the first verification node set on the target state hash data indicates that there is an error in the target state hash data, the first verification node set calls the first interface of the second-layer management contract to construct a third transaction block based on the target state hash data and the multi-signature data. Among them, the first interface is only allowed to be called when the transaction block is constructed by the first verification set. The multi-signature data in the third transaction block is used to verify whether it is signed by the nodes of the first verification set when the third transaction block is executed, and whether the number of signature nodes reaches the preset number threshold.

[0086] It should be noted that the first verification node set verifies that there is an error in the target state hash data. This is the calculation result of the verification nodes of the first verification node set and has nothing to do with the transaction execution and consensus block generation on the blockchain. Therefore, the first layer of the blockchain can still generate blocks normally.

[0087] S3-2: In response to detecting that the number of signature nodes of the first verification node set for the third transaction block is greater than a preset threshold, the third transaction block is uploaded to the first layer of the blockchain.

[0088] The second-layer management contract can detect the number of signature nodes of the third transaction block based on the multi-signature data in the third transaction block. If it is detected that the number of signature nodes of the first verification node set for the third transaction block is greater than a preset threshold, the second-layer management contract determines that the third transaction block meets the chain conditions and puts the third transaction block on the first-layer blockchain.

[0089] S3-3: Extract target state hash data from the third transaction block, and verify the target state hash data through the second verification node set.

[0090] Each verification node of the second verification node set can obtain the third transaction block from the first layer of blockchain, extract the target state hash data and the multi-signature data from the third transaction block, and then verify the target state hash data in the third transaction block and verify the multi-signature data in the third transaction block.

[0091] If the verification result of the multi-signature data in the third transaction block indicates that the third transaction block is constructed by the first verification node set, and the verification result of the target state hash data indicates that there is an error in the target state hash data, the second verification node set can call the second interface of the second-layer management contract to construct the second transaction block according to the target state hash data and the multi-signature data. Among them, the second interface is only allowed to be called when the transaction block is constructed by the second verification set. The multi-signature data in the second transaction block is used to verify whether it is signed by the nodes of the second verification set when the second transaction block is executed, and whether the number of signature nodes reaches the preset number threshold.

[0092] In this embodiment, since the premise for the second verification node set to verify the target state hash data is that the first verification node set has verified the target state hash data, and the first verification node set has verified that there is an error in the target state hash data, when the first verification node set verifies that there is an error in the target state hash data, the first verification node set constructs a third transaction block, and the second verification node set verifies based on the third transaction block that it can be known that the first verification node set has verified the target state hash data, and the first verification node set has verified that there is an error in the target state hash data, and then the second verification node set verifies the target state hash data, so as to accurately confirm whether there is a problem with the target state hash data.

[0093] In some embodiments of the present disclosure, the second node includes at least one node of the second-layer blockchain. That is, some nodes in the first verification node set can be selected from the second-layer blockchain, thereby reflecting the second-layer blockchain's recognition of the state hash data verification result.

[0094] Before step S1, the following steps may also be included:

[0095] S0: Build the first verification node set.

[0096] Figure 3 is a flow chart of step S0 in some embodiments of the present disclosure. Figure 3 As shown, step S0 may include the following steps:

[0097] S0-1: Obtain the historical verification record of each node in the first candidate node set for the historical state hash data.

[0098] The first candidate node set includes at least one node of a layer of blockchain. For example, some consensus nodes can be selected from a layer of blockchain to construct the first candidate node set.

[0099] A traditional fault proof method may be used to prove faults for the first candidate node set, and a historical verification record of each candidate node in the first candidate node set using the traditional fault proof method for proving faults may be recorded. The historical verification record may include: the number of times each candidate node in the first candidate node set initiates a challenge, and information on whether each candidate node verifies that there is a fault in the historical state hash data.

[0100] S0-2: Determine a first node from a first candidate node set based on historical verification records.

[0101] The second-layer management contract can determine the first node from the first candidate node set based on the historical verification record. For example, the second-layer management contract can select the node that meets the candidate node screening condition from the first candidate node set as the first node based on the preset candidate node screening condition. The preset candidate node screening condition may include: the number of challenges initiated by each candidate node, and the condition that each candidate node verifies whether there is a fault in the historical state hash data.

[0102] S0-3: Obtain the credit information of each node in the second candidate node set.

[0103] The second candidate node set includes at least one node of the second-layer blockchain. For example, some nodes can be selected from the second-layer blockchain to construct the second candidate node set.

[0104] For each node in the second candidate node set that wants to apply to join the first verification node set, the second-layer management contract obtains the credit information of each node in the second candidate node set. The credit information of each node can be obtained through credit evaluation of the first-layer blockchain and the second-layer blockchain. Among them, the credit information of each node can be related to the number of historical blocks and the number of historical error blocks of each node.

[0105] S0-4: Determine a second node from the second candidate node set based on the credit information of each node.

[0106] The second-layer management contract can select some nodes from the second candidate node set as the second nodes according to the credit information of each node in the second candidate node set. For example, a preset number of nodes can be selected from the second candidate node set in descending order of credit as the second nodes.

[0107] S0-5: Based on the first node and the second node, construct a first verification node set.

[0108] The second-layer management contract constructs a first verification node set based on the first node and the second node.

[0109] In this embodiment, since the first verification node set needs to verify the state hash submitted by the second-layer blockchain user, and in order to ensure that the nodes in the first verification node set can actively and impartially perform state hash verification, some nodes can be selected from the first-layer blockchain as the first nodes based on the historical verification records of the historical state hash data of each node in the first candidate node set, and some nodes can be selected from outside the first-layer blockchain as the second nodes based on the credit information of each node in the second candidate node set, and then the first verification node set is formed according to the first node and the second node, which helps to quickly and accurately verify whether there are errors in the state hash data submitted by the second-layer blockchain user through the first verification node set.

[0110] In some embodiments of the present disclosure, after step S1, the following steps may also be included: in response to not verifying that there is an error in the target state hash data within a preset time after the first layer blockchain receives the first transaction block, confirming that the target state hash data is correct.

[0111] The preset time after the first transaction block is received by the first layer blockchain can be used as a challenge period for the target state hash data in the first transaction block. The challenge period can be set to N days, where N is an integer greater than 1.

[0112] During the challenge period, the first verification node set and the second node verification set can verify the target state hash data in the first transaction block. If no error is found in the target state hash data after the challenge period, the target state hash data is confirmed to be correct.

[0113] In this embodiment, a preset time after a layer of blockchain receives the first transaction block is used as a challenge period. If the target state hash data cannot be verified to be wrong after the challenge period ends, the target state hash data is confirmed to be correct. By setting a preset time as the challenge period, it is possible to avoid the first verification node set and the second node verification set spending a lot of time on hash state verification.

[0114] Figure 4 1 is a block diagram of a data processing device of a blockchain system in some embodiments of the present disclosure. Figure 4 As shown, the data processing device of the blockchain system includes:

[0115] An extraction module 100 is configured to extract the target state hash data from the first transaction block in response to the first layer blockchain receiving the first transaction block including the target state hash data of the second layer blockchain user;

[0116] A first verification module 200, configured to verify the target state hash data through a first verification node set to obtain a first verification result, wherein the first verification node set includes a first node of a layer of blockchain and a second node that does not belong to a layer of blockchain;

[0117] A second verification module 300 is used to verify the target state hash data through a second verification node set in response to the first verification result indicating that the target state hash data has an error, and obtain a second verification result, wherein the second verification node set includes multiple nodes of a layer of blockchain;

[0118] The error handling module 400 is used to respond to the second verification result indicating that there is an error in the target state hash data, and the second verification node set constructs a second transaction block based on the target state hash data, links the second transaction block to the first layer of blockchain, and rolls back the state hash corresponding to the first transaction block.

[0119] In some embodiments of the present disclosure, the second verification module 300 is used to:

[0120] In response to the verification result of the first verification node set on the target state hash data indicating that there is an error in the target state hash data, the first verification node set constructs a third transaction block based on the target state hash data;

[0121] In response to detecting that the number of signature nodes of the first verification node set for the third transaction block is greater than a preset number threshold, uploading the third transaction block to a layer of blockchain;

[0122] The target state hash data is extracted from the third transaction block, and the target state hash data is verified by the second verification node set.

[0123] In some embodiments of the present disclosure, the second node includes at least one node of a layer 2 blockchain.

[0124] Figure 5 1 is a structural block diagram of a data processing device of a blockchain system in some other embodiments of the present disclosure. Figure 5 As shown, the data processing device of the blockchain system also includes:

[0125] A historical verification record acquisition module 500 is used to obtain a historical verification record of each node in a first candidate node set for historical state hash data, wherein the first candidate node set includes at least one node of a layer of blockchain;

[0126] A first node determination module 600, configured to determine a first node from a first candidate node set based on historical verification records;

[0127] A node credit information acquisition module 700, used to acquire credit information of each node in the second candidate node set, wherein the second candidate node set includes at least one node of the second-layer blockchain;

[0128] A second node determination module 800, configured to determine a second node from a second candidate node set based on the credit information of each node;

[0129] The construction module 900 is used to construct a first verification node set based on the first node and the second node.

[0130] In some embodiments of the present disclosure, the data processing device of the blockchain system further includes:

[0131] The confirmation module 1000 is used to confirm that the target state hash data is correct in response to failure to verify that the target state hash data has an error within a preset time after the first transaction block is received in the first layer blockchain.

[0132] It should be noted that the specific implementation of the data processing device of the blockchain system of the embodiment of the present disclosure is similar to the specific implementation of the data processing method of the blockchain system of the embodiment of the present disclosure, and the technical effect of the data processing device of the blockchain system of the embodiment of the present disclosure is similar to the technical effect of the data processing method of the blockchain system of the embodiment of the present disclosure. Please refer to the description of the data processing method of the blockchain system for details. In order to reduce redundancy, it is not repeated here.

[0133] The present disclosure also provides a blockchain system, including:

[0134] The second-layer blockchain is used to execute blockchain transactions and generate corresponding block data;

[0135] A layer of blockchain, where the layer 1 blockchain is connected to the layer 2 blockchain via a cross-chain bridge;

[0136] The data processing device of the above-mentioned blockchain system is used for the data processing method of the above-mentioned blockchain system.

[0137] In addition, an embodiment of the present disclosure further provides an electronic device, including:

[0138] Memory for storing computer programs;

[0139] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the data processing method of the blockchain system described in any one of the above embodiments of the present disclosure is implemented.

[0140] Below, reference Figure 6 To describe the electronic device according to the embodiment of the present disclosure. Figure 6 As shown, the electronic device includes one or more processors and memory.

[0141] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0142] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor may run the computer program product to implement the data processing method of the blockchain system of each embodiment of the present disclosure described above and / or other desired functions.

[0143] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0144] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.

[0145] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0146] Of course, to simplify, Figure 6 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.

[0147] In addition to the above-mentioned method and device, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to perform the steps in the data processing method of the blockchain system according to various embodiments of the present disclosure described in the above part of this specification.

[0148] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0149] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the data processing method of the blockchain system according to various embodiments of the present disclosure described in the above part of this specification.

[0150] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0151] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0152] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0153] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0154] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0155] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0156] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0157] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A data processing method for a blockchain system, characterized in that: include: In response to the first layer blockchain receiving a first transaction block including target state hash data of a second layer blockchain user, extracting the target state hash data from the first transaction block, wherein the target state hash data represents a state hash asset of the second layer blockchain user on the second layer blockchain; Verifying the target state hash data through a first verification node set to obtain a first verification result, wherein the first verification node set includes a first node of the first layer blockchain and a second node that does not belong to the first layer blockchain; In response to the first verification result indicating that the target state hash data has an error, verifying the target state hash data through a second verification node set to obtain a second verification result, wherein the second verification node set includes multiple nodes of the first layer of blockchain; In response to the second verification result indicating that there is an error in the target state hash data, the second verification node set constructs a second transaction block based on the target state hash data, uploads the second transaction block to the first layer blockchain, and rolls back the state hash corresponding to the first transaction block, wherein the rolling back of the state hash corresponding to the first transaction block includes: setting the current state hash of the second layer blockchain to the state hash before the first transaction block.

2. The method according to claim 1, characterized in that In response to the first verification result indicating that the target state hash data has an error, verifying the target state hash data through a second verification node set includes: In response to the verification result of the first verification node set on the target state hash data indicating that there is an error in the target state hash data, the first verification node set constructs a third transaction block based on the target state hash data, wherein the multi-signature data in the third transaction block is used to verify whether it is signed by the nodes of the first verification node set and whether the number of signature nodes reaches a preset number threshold when the third transaction block is executed; In response to detecting that the number of signature nodes of the first verification node set for the third transaction block is greater than the preset number threshold, uploading the third transaction block to the first layer blockchain; The target state hash data is extracted from the third transaction block, and the target state hash data is verified by the second verification node set.

3. The method according to claim 1 or 2, characterized in that: The second node includes at least one node of the second-layer blockchain.

4. The method according to claim 3, characterized in that In response to the first layer blockchain receiving a first transaction block including the target state hash data of the second layer blockchain user, before extracting the target state hash data from the first transaction block, the method further includes: Obtaining a historical verification record of each node in a first candidate node set for historical state hash data, wherein the first candidate node set includes at least one node of the first layer of blockchain; Based on the historical verification record, determining the first node from the first candidate node set; Obtaining credit information of each node in a second candidate node set, wherein the second candidate node set includes at least one node of the second-layer blockchain; Determine the second node from the second candidate node set based on the credit information of each node; Based on the first node and the second node, the first verification node set is constructed.

5. The method according to claim 1 or 2, characterized in that: After the first transaction block including the target state hash data of the second-layer blockchain user is received in response to the first-layer blockchain, the target state hash data is extracted from the first transaction block, further comprising: In response to not verifying that the target state hash data has an error within a preset time after the first layer blockchain receives the first transaction block, confirming that the target state hash data is correct.

6. A data processing device for a blockchain system, characterized in that: include: an extraction module, configured to extract the target state hash data from the first transaction block in response to the first layer blockchain receiving the target state hash data of the second layer blockchain user, wherein the target state hash data represents the state hash asset of the second layer blockchain user on the second layer blockchain; A first verification module, configured to verify the target state hash data through a first verification node set to obtain a first verification result, wherein the first verification node set includes a first node of the first layer of blockchain and a second node that does not belong to the first layer of blockchain; A second verification module is configured to verify the target state hash data through a second verification node set to obtain a second verification result in response to the first verification result indicating that the target state hash data has an error, wherein the second verification node set includes multiple nodes of the first layer of blockchain; An error handling module is used for, in response to the second verification result indicating that there is an error in the target state hash data, constructing a second transaction block based on the target state hash data by the second verification node set, uploading the second transaction block to the first layer blockchain, and rolling back the state hash corresponding to the first transaction block, wherein rolling back the state hash corresponding to the first transaction block includes: setting the current state hash of the second layer blockchain to the state hash before the first transaction block.

7. The device according to claim 6, characterized in that The second verification module is used to: In response to the verification result of the first verification node set on the target state hash data indicating that there is an error in the target state hash data, the first verification node set constructs a third transaction block based on the target state hash data, wherein the multi-signature data in the third transaction block is used to verify whether it is signed by the nodes of the first verification node set and whether the number of signature nodes reaches a preset number threshold when the third transaction block is executed; In response to detecting that the number of signature nodes of the first verification node set for the third transaction block is greater than a preset number threshold, uploading the third transaction block to the first layer blockchain; The target state hash data is extracted from the third transaction block, and the target state hash data is verified by the second verification node set.

8. The device according to claim 6 or 7, characterized in that The second node includes at least one node of the second-layer blockchain.

9. The device according to claim 8, characterized in that Also includes: A historical verification record acquisition module, used to obtain a historical verification record of each node in a first candidate node set for historical state hash data, wherein the first candidate node set includes at least one node of the first layer of blockchain; A first node determination module, configured to determine the first node from the first candidate node set based on the historical verification record; A node credit information acquisition module, used to obtain credit information of each node in a second candidate node set, wherein the second candidate node set includes at least one node of the second-layer blockchain; A second node determination module, configured to determine the second node from the second candidate node set based on the credit information of each node; A construction module is used to construct the first verification node set based on the first node and the second node.

10. The device according to claim 6 or 7, characterized in that Also includes: A confirmation module is used to confirm that the target state hash data is correct in response to not verifying that the target state hash data has an error within a preset time after the first layer blockchain receives the first transaction block.

11. A blockchain system, characterized in that: include: The second-layer blockchain is used to execute blockchain transactions and generate corresponding block data; A layer 1 blockchain, wherein the layer 1 blockchain is connected to the layer 2 blockchain via a cross-chain bridge; The device according to any one of claims 6 to 10 is used to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Two-layer data verification method and device based on zero-knowledge proof and storage medium

    CN116488829A

  • Method and device for quitting to one layer based on two-layer network assets and storage medium

    CN116743389A