A cross-chain interaction method and related equipment based on blockchain network
By introducing the basic main chain and business sub-chain architecture into the blockchain network, and using cross-chain start and end proof information for cross-chain business confirmation, the problem of unreliable business interaction in the blockchain network is solved, and reliable cross-chain business execution and consistency is achieved.
Patent Information
- Application Number
- CN202111325370.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-11-10
AI Technical Summary
In the blockchain network, various services cannot reliably interact, especially in tax scenarios, when enterprise qualification services and invoice services need to interact, the existing technology cannot achieve reliable cross-chain service execution.
By introducing the basic main chain and business sub-chain architecture into the blockchain network, cross-chain start proof information and cross-chain end proof information confirm cross-chain services on the basic main chain, ensuring the reliability and trustworthiness of cross-chain services.
It realizes reliable business interaction in the blockchain network, improves the trustworthiness and execution efficiency of cross-chain services, and ensures the consistency and security of business execution.
Smart Images

Figure CN116112496B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, in particular to the field of blockchain technology, and specifically to a cross-chain interaction method and related equipment based on a blockchain network. Background Art
[0002] With the rapid development of computer technology, blockchain technology has received widespread attention. More and more business parties are using blockchain networks to execute business to ensure the security and reliability of the business execution process. For example, in tax scenarios, blockchain networks are used to execute various tax businesses such as invoicing and corporate qualifications.
[0003] During the business execution process, there is often a need for business interaction between various businesses. For example, in tax scenarios, when executing invoicing business, qualification certification information provided by the enterprise qualification business is generally required; however, the execution processes of various businesses in the current blockchain network are independent of each other and do not support interaction between businesses; therefore, how to reliably conduct business interaction in the blockchain network has become a current research hotspot. Summary of the Invention
[0004] The embodiments of the present application provide a cross-chain interaction method and related equipment based on a blockchain network, which can reliably perform business interaction in a blockchain network.
[0005] On the one hand, embodiments of the present application provide a cross-chain interaction method based on a blockchain network, wherein the blockchain network includes a core consensus network, wherein a basic main chain and N business subchains derived from the basic main chain run in the core consensus network, where N is an integer and N ≥ 2; the N business subchains are respectively used to manage different businesses, and each business subchain has its own subchain management node; the method is executed by a first subchain management node, and the first subchain management node is used to manage the first business subchain; the method includes:
[0006] If cross-chain business needs to be performed between M business sub-chains among N business sub-chains, the cross-chain start proof information related to the cross-chain business is obtained from the basic main chain; the cross-chain start proof information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after negotiating the cross-chain business. The first business sub-chain is any one of the M business sub-chains, where M is an integer and 2≤M≤N;
[0007] Execute cross-chain business based on cross-chain start proof information;
[0008] After the cross-chain business is completed, the cross-chain completion certificate information related to the cross-chain business is obtained from the basic main chain; the cross-chain completion certificate information is submitted to the basic main chain by the sub-chain management node of the M business sub-chains after determining that the cross-chain business execution is completed; the cross-chain start certificate information and cross-chain completion certificate information in the basic main chain are used to confirm the cross-chain business.
[0009] Accordingly, an embodiment of the present application provides a cross-chain interaction device based on a blockchain network, wherein the blockchain network includes a core consensus network, wherein a basic main chain and N business subchains derived from the basic main chain run in the core consensus network, where N is an integer and N ≥ 2; the N business subchains are respectively used to manage different businesses, and each business subchain has its own subchain management node; the device is set in a first subchain management node, and the first subchain management node is used to manage the first business subchain; the device includes:
[0010] An acquisition unit is configured to acquire cross-chain start proof information related to the cross-chain business from the basic main chain if a cross-chain business needs to be executed between M of the N business sub-chains. The cross-chain start proof information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after negotiating the cross-chain business. The first business sub-chain is any one of the M business sub-chains, where M is an integer and 2≤M≤N.
[0011] A processing unit, configured to execute cross-chain transactions based on cross-chain start proof information;
[0012] The acquisition unit is further used to obtain cross-chain completion certification information related to the cross-chain business from the basic main chain after the cross-chain business is completed; the cross-chain completion certification information is submitted to the basic main chain by the sub-chain management node of the M business sub-chains after determining that the cross-chain business is completed; the cross-chain start certification information and cross-chain completion certification information in the basic main chain are used to confirm the cross-chain business.
[0013] In one implementation, the processing unit is configured to execute the following steps when executing a cross-chain service based on the cross-chain start proof information:
[0014] Verify the cross-chain start proof information; the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain in the M business sub-chains obtain the cross-chain start proof information from the basic main chain, verify the cross-chain start proof information, and send the first verification result obtained to the first sub-chain management node;
[0015] Receive the first verification results sent by the subchain management nodes of M-1 business subchains, and count the first number of first verification results that pass the verification;
[0016] If the first sub-chain management node verifies the cross-chain start proof information and the first number is greater than the first number threshold, the cross-chain business is executed.
[0017] In one implementation, the processing unit, when executing a cross-chain business, is specifically configured to perform the following steps:
[0018] Obtain the cross-chain business smart contract related to the cross-chain business from the first business sub-chain;
[0019] Call cross-chain business smart contracts to execute cross-chain business;
[0020] Upload the cross-chain business execution results to the first business sub-chain.
[0021] In one implementation, the number of cross-chain start proof information is M, and any cross-chain start proof information includes the sub-chain identifiers and cross-chain interaction credentials of the M business sub-chains; the processing unit is configured to verify the cross-chain start proof information by specifically performing the following steps:
[0022] Perform a matching check on the subchain identifiers in the M cross-chain start proofs;
[0023] If the subchain identifiers in the M cross-chain start proofs all match, then the legitimacy of the cross-chain interaction credentials in the M cross-chain start proofs is checked;
[0024] If the cross-chain interaction credentials in the M cross-chain start proof information are all legal, then the verification of the M cross-chain start proof information is determined to be successful.
[0025] In one implementation, the processing unit is configured to perform the following steps when verifying the cross-chain start proof information:
[0026] Send the cross-chain start proof information to other sub-chain management nodes of the first business sub-chain for verification. Other sub-chain management nodes refer to nodes in the core consensus network that manage the first business sub-chain except the first sub-chain management node.
[0027] Receive the second verification results of the cross-chain start proof information from other sub-chain management nodes, and count the second number of the second verification results that pass the verification;
[0028] If the second number is greater than the second number threshold, it is determined that the cross-chain start proof information verification is passed.
[0029] In one implementation, the processing unit is further configured to perform the following steps:
[0030] Submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submit the cross-chain start proof information of the first sub-chain management node to the first business sub-chain;
[0031] A cross-chain business start request is sent to the sub-chain management nodes of M-1 business sub-chains except the first business sub-chain; in response to the cross-chain business start request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain start certification information to the basic main chain, and submit their respective cross-chain start certification information to the M-1 business sub-chains.
[0032] In one implementation, the main chain management node in the core consensus network is used to manage the basic main chain; the processing unit is used to submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, specifically to perform the following steps:
[0033] Send the cross-chain start proof information of the first sub-chain management node to the main chain management node; after the main chain management node reaches a consensus on the cross-chain start proof information of the first sub-chain management node, it uploads the cross-chain start proof information of the first sub-chain management node to the basic main chain.
[0034] In one implementation, the processing unit is further configured to perform the following steps:
[0035] Conduct consistency checks on cross-chain business execution results;
[0036] If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain;
[0037] A cross-chain business termination request is sent to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit cross-chain termination certification information to the basic main chain, and submit cross-chain termination certification information to the business sub-chains they manage.
[0038] In one implementation, the processing unit is further configured to perform the following steps:
[0039] Conduct consistency checks on cross-chain business execution results;
[0040] If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain;
[0041] A cross-chain business termination request is sent to the sub-chain management nodes of the M-1 business sub-chains except the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain termination certification information to the basic main chain, and submit their respective cross-chain termination certification information to the M-1 business sub-chains.
[0042] In one implementation, the processing unit is configured to perform the following steps when performing consistency check on the business execution results of the cross-chain business:
[0043] Obtaining the business execution results in the first business subchain;
[0044] Send a business execution result acquisition request to the subchain management nodes of M-1 business subchains other than the first business subchain; the subchain management nodes of the M-1 business subchains respond to the business execution result acquisition request, obtain the business execution results in the M-1 business subchains, and send the acquired business execution results to the first subchain management node;
[0045] Compare the business execution results in M business sub-chains;
[0046] If the business execution results in the M business subchains are the same, the consistency check is determined to have passed;
[0047] If the business execution results in the M business sub-chains are different, the cross-chain business will be rolled back.
[0048] In one implementation, the acquiring unit is further configured to perform the following steps:
[0049] Receive business execution requests from business nodes in the business network or proxy nodes in the routing proxy network; the business network, routing proxy network, and core consensus network are all subnetworks of the blockchain network. The routing proxy network is used to forward requests from the business network to the core consensus network;
[0050] If the business execution request includes the subchain identifiers of M business subchains, it is determined that cross-chain business needs to be executed between the M business subchains.
[0051] Accordingly, an embodiment of the present application provides a computer device based on a blockchain network, wherein the blockchain network includes a core consensus network, in which a basic main chain and N business sub-chains derived from the basic main chain run, where N is an integer and N≥2; the N business sub-chains are used to manage different businesses, and each business sub-chain has its own sub-chain management node; the computer device is a first sub-chain management node, and the first sub-chain management node is used to manage the first business sub-chain; the device includes a processor and a computer-readable storage medium, wherein the processor is suitable for implementing a computer program, and the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned cross-chain interaction method based on the blockchain network.
[0052] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor of a computer device, the computer device executes the above-mentioned cross-chain interaction method based on the blockchain network.
[0053] Accordingly, embodiments of the present application provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described cross-chain interaction method based on a blockchain network.
[0054] In an embodiment of the present application, the blockchain network includes a core consensus network in which a basic main chain and multiple business sub-chains derived from the basic main chain run. The multiple business sub-chains are used to manage different businesses, and each business sub-chain has its own sub-chain management node; when it is necessary to execute cross-chain business between some of the business sub-chains in the multiple business sub-chains, the sub-chain management nodes of some of the business sub-chains can submit cross-chain start proof information related to the cross-chain business to the basic main chain after negotiating the cross-chain business, and the sub-chain management nodes of any business sub-chain in some of the business sub-chains can obtain the cross-chain business start information from the basic main chain and execute the cross-chain business based on the cross-chain business start information; after determining that the cross-chain business is completed, the sub-chain management nodes of some of the business sub-chains can submit cross-chain end proof information related to the cross-chain business to the basic main chain, and the sub-chain management nodes of any business sub-chain in some of the business sub-chains can obtain the cross-chain business start information from the basic main chain; the cross-chain start proof information and cross-chain end proof information in the basic main chain can be used to confirm the cross-chain business. From the above content, it can be seen that cross-chain business refers to business that needs to interact between businesses managed by different business sub-chains. The embodiment of the present application can realize cross-chain business interaction with the help of the basic main chain, and can confirm the cross-chain business with the help of the cross-chain start proof information and cross-chain start and end information in the basic main chain, so that the cross-chain business is reliable and trustworthy. It can be further seen that the embodiment of the present application can reliably carry out business interaction in the blockchain network. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0056] Figure 1 This is a schematic diagram of the structure of a single-layer blockchain network provided in an embodiment of the present application;
[0057] Figure 2a This is a schematic diagram of the structure of a double-layer blockchain network provided in an embodiment of the present application;
[0058] Figure 2bThis is a structural diagram of a tree-like blockchain structure provided by an embodiment of the present application;
[0059] Figure 2c This is a schematic diagram of a service execution process provided by an embodiment of the present application;
[0060] Figure 3 This is a flowchart of a cross-chain interaction method based on a blockchain network provided in an embodiment of the present application;
[0061] Figure 4 This is a flowchart of another cross-chain interaction method based on a blockchain network provided in an embodiment of the present application;
[0062] Figure 5 This is a schematic diagram of the architecture of a two-tier blockchain system in a tax scenario provided by an embodiment of the present application;
[0063] Figure 6 This is a flowchart of an exemplary cross-chain interaction solution provided in the real-time example of this application;
[0064] Figure 7 This is a schematic diagram of the structure of a cross-chain interaction device based on a blockchain network provided in an embodiment of the present application;
[0065] Figure 8 This is a structural diagram of a computer device based on a blockchain network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0067] The traditional blockchain network, namely the P2P (Peer to Peer) network, is a point-to-point network, where each node in the point-to-point connection is called a peer node. The P2P network is based on a specific network protocol, which means that there is no need for a central node to maintain the network status between peer nodes. Each node maintains the node status of the entire network and the connection status with its neighboring nodes through broadcast interaction with neighboring nodes. The P2P network is a single-layer blockchain network, which can be understood as Figure 1The data sharing system 100 shown is shown. The data sharing system 10 refers to a system for sharing data between nodes. The data sharing system may include multiple nodes 101, which may refer to various clients, terminals, or servers in the data sharing system. Each node 101 can receive input information during normal operation and maintain the shared data within the data sharing system based on the received input information. To ensure information intercommunication within the data sharing system, information connections can exist between each node in the data sharing system, and information can be transmitted between nodes through the above information connections. For example, when any node in the data sharing system receives input information, the other nodes in the data sharing system obtain the input information according to the consensus algorithm and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system are consistent. Each node in the data sharing system has a corresponding node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system so that the generated blocks can be broadcast to other nodes in the data sharing system based on the node identifiers of other nodes. Each node can maintain a node identifier list as shown in Table 1 below, storing the node name and node identifier in the node identifier list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. Table 1 uses the IP address as an example for illustration:
[0068] Table 1
[0069] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0070] The above-mentioned single-layer blockchain network has some problems in actual application scenarios. For example, in the scenario of issuing electronic bills, not all nodes in the blockchain network need to be deployed as nodes for performing electronic certificate issuance tasks. For another example, in the data storage scenario, not all nodes in the blockchain network have sufficient resources and necessity to become nodes participating in the blockchain consensus. In order to solve the problems existing in the single-layer blockchain network, the embodiment of the present application proposes a two-layer blockchain network. The cross-chain interaction solution proposed in the embodiment of the present application is also implemented based on the two-layer blockchain network. The architecture of the two-layer blockchain network is introduced below:
[0071] Two-layer blockchain network Figure 2aAs shown, the two-layer blockchain network 20 may include a core consensus network 201, a business network 202 (also referred to as a witness network 202), and a routing agent network 203. The core consensus network 201 may include one or more blockchain management nodes, which may run a blockchain consensus protocol to perform consensus accounting on the blockchain. The business network 202 may include one or more business nodes, which may be, for example, SPV (Simplified Payment Verification) cation (Simplified Payment Verification) nodes. Business nodes are primarily used for business execution and do not participate in bookkeeping consensus. They obtain block header data and partially authorized block data from the core consensus network through identity authentication. The routing proxy network 203 may include one or more proxy nodes, which can be used to isolate the core consensus network 201 from the business network 202. Communication data between the core consensus network 201 and the business network 202 is forwarded by the proxy nodes in the routing proxy network 203. Generally speaking, the core consensus network 201 and the business network 202 exist in different network environments: the business network 202 is located in a public network, while the core consensus network 201 is located in a private network. Because the core consensus network 201 is located in a relatively secure private network, mutual access between its blockchain management nodes is inherently secure through a consensus mechanism, eliminating the need for additional identity management and network control. However, the business network 202 is located in a public network and may be accessed by other unidentified network terminals. Therefore, the access of the business network 202 and other potential nodes to the core consensus network 201 must be strictly controlled.
[0072] Any blockchain management node, business node or proxy node can be a terminal or a server; the terminal mentioned in the embodiments of the present application can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, car terminal, smart TV, etc., but is not limited to this. The server mentioned in the embodiments of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0073] It is understandable that the dual-layer blockchain network described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. Those skilled in the art will know that with the evolution of the blockchain network architecture and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems. In addition, the number indicated by the multiple mentioned in the embodiment of the present application is two or more, and the number indicated by the multiple is two or more, which is explained here.
[0074] Based on the relevant description of the architecture of the above-mentioned two-layer blockchain network, in order to improve the business execution efficiency of the above-mentioned two-layer blockchain network, a tree-like blockchain structure is proposed in the core consensus network of the two-layer blockchain network. The tree-like blockchain structure can include a basic main chain and multiple business sub-chains. The multiple business sub-chains are derived from the basic main chain, and the multiple business sub-chains each manage different businesses; different businesses here refer to different types of businesses, such as invoicing business, credit investigation business, enterprise qualification business, etc. in tax scenarios are different types of businesses. Figure 2b In the tree-like blockchain structure shown, 2P is the basic main chain, 2Q is the business sub-chain 1 derived from the basic main chain, 2R is the business sub-chain 2 derived from the basic main chain, and 2S is the business sub-chain 3 derived from the basic main chain. Figure 2b The tree-like blockchain structure shown introduces the derivation process of the business sub-chain:
[0075] (1) Deployment of the basic main chain. The blockchain management node with the management authority of the basic main chain in the core consensus network can be called the main chain management node, that is, the main chain management node can be used to manage the basic main chain. The main chain management node managing the basic main chain can specifically mean: the main chain management node can generate blocks based on the data to be uploaded to the basic main chain, and reach consensus on the generated blocks according to the consensus protocol of the basic main chain. After the consensus is successful, the generated blocks are added to the basic main chain to update the basic main chain. The core consensus network can include one or more main chain management nodes. The process of deploying the basic main chain in any main chain management node may include: the main chain management object of the main chain management node (for example, the administrator of the main chain management node) releases the genesis block of the basic main chain to the outside world and deploys the genesis block in the main chain management node. The basic main chain starts to run in the main chain management node. The main chain management object can also submit the basic data and business configuration information of the basic main chain to the basic main chain through the main chain management node. Business configuration information may include attribute information of each business (such as description information of each business, type label of each business, etc.) and node configuration information of each business (such as the number of nodes used to manage each business in the core consensus network). For example, in a tax scenario, the main chain management object may be the staff of the State Administration of Taxation, and the main chain management node may be the terminal used by the staff of the State Administration of Taxation. Business configuration information may include attribute information and node configuration information of businesses such as invoices, credit investigation, loss inflow and outflow, enterprise qualifications, and tax refunds.
[0076] (2) Derived business subchain. The registration smart contract of the derived business subchain is recorded in the basic main chain. When a business subchain of a certain business needs to be derived, the main chain management node can call the registration smart contract to allocate a subchain identifier (i.e., subchain ID) for the business subchain, and call the registration smart contract to allocate a subchain management node for the business subchain according to the number of nodes indicated by the node configuration information. At this point, the business subchain registration is completed. Then, the main chain management node can generate a block record in the basic main chain based on the subchain identifier of the business subchain, the node identifier of the subchain management node of the business subchain, and the attribute information of the business. This block can be used as the genesis block of the business subchain on the basic main chain, and the derivation process of the business subchain is completed. Figure 2bAs shown, the basic main chain derives business subchain 1 under business 1, and the genesis block of business subchain 1 in the basic main chain is A1; the basic main chain derives business subchain 2 under business 2, and the genesis block of business subchain 2 in the basic main chain is A2; the basic main chain derives business subchain 3 under business 3, and the genesis block of business subchain 3 in the basic main chain is A3. Among them, the subchain management node can be used to manage the business subchain. Specifically, the subchain management node can generate blocks based on the data to be uploaded to the business subchain, reach consensus on the generated blocks according to the consensus protocol of the business subchain, and add the generated blocks to the business subchain after successful consensus to update the business subchain.
[0077] Based on the above business sub-chain derivation process, the blockchain management nodes in the core consensus network can be divided into two categories, one is the main chain management node, and the other is the sub-chain management node; from the above content, it can be seen that the main chain management node can be used to manage the basic main chain. In addition to being used to manage the basic main chain, the main chain management node can also be used to manage the business sub-chains derived from the basic main chain. The sub-chain management node can be used to manage the business sub-chain; the same sub-chain management node can manage multiple business sub-chains, and the same business sub-chain can be managed by multiple different sub-chain management nodes; although the sub-chain management node does not participate in the management of the basic main chain, the sub-chain management node can synchronize and store the basic main chain. Figure 2c As shown, each main chain management node in the main chain node cluster 1 can manage the basic main chain (such as Figure 2c 2P shown); Each sub-chain management node in sub-chain node cluster 1 can manage Figure 2b The business sub-chain 1 in the tree-like blockchain structure shown (such as Figure 2c 2Q) and business sub-chain 3 (as shown Figure 2c 2S) shown in the figure, and can also synchronize the basic main chain; each sub-chain management node in the sub-chain node cluster 2 can manage Figure 2b The business sub-chain 2 in the tree-like blockchain structure shown (such as Figure 2c 2R) shown above, you can also synchronize the basic main chain. Figure 2c Introducing the business execution process of the two-layer blockchain network:
[0078] (1) Each business node in the business network can store the correspondence between the business and the business subchain. One business corresponds to one business subchain. For example, the type label of the business is associated with the subchain identifier of the business subchain and stored. The business node can also store the node identifier of the subchain management node of each business subchain. When the business node receives a transaction to be on-chain, the business node can determine the business to which the transaction to be on-chain belongs, and can query the subchain identifier of the business subchain corresponding to the business and the node identifier of the subchain management node of the business subchain corresponding to the business. Then, the transaction to be on-chain and the subchain identifier of the business subchain to which the business belongs can be sent to the subchain management node of the business. Figure 2c As shown, when the business node 2031 determines that the first transaction belongs to business 1, business subchain 1 is used to manage business 1, and the subchain management node of business subchain 1 belongs to subchain node cluster 1, the business node 2031 can send the first transaction and the subchain identifier of business subchain 1 to the subchain management node 2011 in subchain node cluster 1.
[0079] Alternatively, each business node in the business network may store the correspondence between the business and the business sub-chain, where one business corresponds to one business sub-chain, for example, the type label of the business is associated with the sub-chain identifier of the business sub-chain and stored. The proxy node in the routing proxy network may store the node identifier of the sub-chain management node of each business sub-chain. When a business node receives a transaction to be on-chain, the business node can determine the business to which the transaction to be on-chain belongs, and can query the sub-chain identifier of the business sub-chain corresponding to the business to which it belongs, and then can send the transaction to be on-chain and the sub-chain identifier of the business sub-chain to which it belongs to the proxy node in the routing proxy network. The proxy node can query the node identifier of the sub-chain management node of the business sub-chain corresponding to the business to which it belongs, and then the proxy node can forward the transaction to be on-chain and the sub-chain identifier of the business sub-chain to which it belongs to the sub-chain management node of the business sub-chain to which it belongs. As Figure 2c As shown, when the business node 2032 determines that the second transaction belongs to business 2 and the business sub-chain 2 is used to manage business 2, the business node 2032 can send the second transaction and the sub-chain identifier of the business sub-chain 2 to the proxy node 2021; after the proxy node 2021 determines that the sub-chain management node of the business sub-chain 2 belongs to the sub-chain node cluster 2, the proxy node 2021 can forward the second transaction and the sub-chain identifier of the business sub-chain 2 to the sub-chain management node 2012 in the sub-chain node cluster 2.
[0080] (2) When the sub-chain management node receives the transaction to be on-chain and the sub-chain identifier of the business sub-chain, the sub-chain management node can generate a block based on the transaction to be on-chain, and reach a consensus on the generated block based on the consensus protocol of the business sub-chain. After the consensus is successful, the generated block will be added to the business sub-chain corresponding to the business identifier to update the business sub-chain. Figure 2cAs shown, sub-chain management node 2011 can generate block B5 based on the first transaction, and reach consensus on block B5 according to the consensus protocol of business sub-chain 1. After successful consensus, block B5 is added to business sub-chain 1 to update business sub-chain 1. Sub-chain management node 2012 can generate block C7 based on the second transaction, and reach consensus on block C7 according to the consensus protocol of business sub-chain 2. After successful consensus, block C7 is added to business sub-chain 2 to update business sub-chain 2. In addition, in the process of consensus verification of blocks, in order to improve the accuracy of the consensus verification process, in addition to consensus verification of blocks in the business sub-chain, it is necessary to conduct consensus verification from the block to be consensus verified to the genesis block of the business sub-chain in the basic main chain, and finally consensus verification to the genesis block of the basic main chain is the most rigorous.
[0081] It should be noted that if the network configuration information corresponding to the entire blockchain network changes, the blockchain management nodes (including the main chain management nodes and the sub-chain management nodes) in the core consensus network need to suspend operation. Among them, the embodiment of the present application may refer to the network configuration information that has changed as configuration change information. For example, the configuration change information may refer to regulatory rules in the tax field, changes in computing regulations, changes in important blockchain management nodes, rotation of chain certificate issuance nodes, etc. The main chain management node in the core consensus network can generate a configuration change block based on these configuration change information, and then link the configuration change block to the basic main chain in the core consensus network, and synchronize it to all business sub-chains. At this time, other blockchain management nodes in the core consensus network can resume operation. As Figure 2b Block A3 in the basic main chain, block B5 in business sub-chain 1, and block C5 in business sub-chain 2 in the core consensus network shown can all be called configuration change blocks.
[0082] In addition, the main chain management node can also dynamically configure the subchain identifiers of business subchains for business nodes in the business network. Specifically, this can involve registering the business node's identifier (e.g., the IP address of the business node) and the configured subchain identifier of the business subchain on the basic main chain. Registration can be performed by recording the business node's identifier and the configured subchain identifier of the business subchain in a block on the basic main chain. Dynamic configuration can be understood as ensuring that the subchain identifiers of the business subchains configured by the main chain management node for business nodes in the business network are not fixed and can change. In this way, business nodes can participate in the services managed by the business subchains and synchronize block data from the configured business subchains. For example, the main chain management node can configure the subchain identifiers of business subchain 1 and business subchain 2 for a business node, allowing the business node to synchronize block data from both business subchains 1 and 2.
[0083] By deriving business subchains for different businesses based on the basic main chain in a two-layer blockchain network, each business subchain is used to manage different businesses. Different businesses can be effectively distinguished in the blockchain network to maintain the specificity of the information stored in a single business subchain, so that it will not be confused with the data in other business subchains. Whether it is in the process of transaction chaining or in the process of transaction synchronization, the processing flow can be simplified, the amount of data processed can be reduced, and the business execution efficiency of the blockchain network can be improved. In addition, the embodiment of the present application can gradually add different businesses to the blockchain network instead of connecting them all at once. This allows each business subchain to be created when the corresponding business is fully prepared, thereby effectively avoiding problems caused by the asynchrony of the entire blockchain network. Secondly, each business subchain is derived from the basic main chain, which ensures that the basic main chain serves as the trust root of all business subchains. The basic main chain records global information such as the business configuration of each business subchain, which facilitates the supervision and data tracing of each business subchain, avoiding the problem of inconsistent data splitting of each business subchain. Each business subchain independently manages its own business, which can improve the parallel performance of different businesses running simultaneously in the blockchain network and further improve the business execution efficiency of the blockchain network. It is worth mentioning that the embodiment of the present application can also dynamically configure business subchains for business nodes. Business nodes can synchronize data from the configured business subchains and cannot access unconfigured business subchains. This is conducive to security control when the core consensus network accesses the business node, ensuring the safe and reliable process of executing business on the blockchain network.
[0084] Based on the two-layer blockchain network and the tree-like blockchain structure, the embodiment of the present application proposes a cross-chain interaction scheme. The so-called cross-chain interaction, that is, cross-chain business interaction, can be understood as business interaction between businesses managed by different business sub-chains (for example, two or more business sub-chains); in this cross-chain interaction scheme, when cross-chain business interaction is required between different business sub-chains, the sub-chain management nodes of these business sub-chains can submit cross-chain start proof information to the basic main chain. After the sub-chain management nodes of each business sub-chain confirm that each other has submitted cross-chain start proof information to the basic main chain, cross-chain business interaction can be carried out. After the cross-chain business interaction is completed, the sub-chain management nodes of these business sub-chains can submit cross-chain end proof information to the basic main chain. After the sub-chain management nodes of each business sub-chain confirm that each other has submitted cross-chain end proof information to the basic main chain, and the sub-chain management nodes of each business sub-chain confirm that the cross-chain business interaction results are consistent, the cross-chain business interaction can be terminated. The cross-chain interaction solution proposed in the embodiment of the present application can realize cross-chain business interaction in a tree-like blockchain structure, and each participant in the cross-chain interaction submits cross-chain start proof information and cross-chain end proof information to the basic main chain. The cross-chain business interaction can be confirmed through the cross-chain start proof information and cross-chain end proof information in the basic main chain, thereby ensuring that the cross-chain business interaction is reliable.
[0085] The following combination Figures 3 to 6 The illustrated embodiment provides a detailed introduction to the cross-chain interaction solution based on the blockchain network provided by the embodiment of the present application.
[0086] The embodiment of this application proposes a cross-chain interaction method based on a blockchain network. The cross-chain interaction method mainly introduces the overall process of cross-chain interaction. The cross-chain interaction method can be specifically executed by the sub-chain management node (hereinafter referred to as the first sub-chain management node) of any business sub-chain (hereinafter referred to as the first business sub-chain) in the business sub-chain participating in the cross-chain interaction. Figure 3 As shown, the cross-chain interaction method based on the blockchain network may include the following steps S301 to S303:
[0087] S301: If a cross-chain business needs to be performed between M business sub-chains among N business sub-chains, the cross-chain start proof information related to the cross-chain business is obtained from the basic main chain.
[0088] Before introducing step S301, the blockchain network in the embodiment of the present application is first introduced. The blockchain network may include a core consensus network, a business network, and a routing proxy network. The core consensus network, the business network, and the routing proxy network are all subnetworks of the blockchain network. The routing proxy network is used to forward requests in the business network to the core consensus network. The core consensus network can run a basic main chain and N business subchains derived from the basic main chain. The N business subchains are respectively used to manage different businesses. Each business subchain has its own subchain management node, and N is an integer greater than or equal to 2. For example, when N=2, a first business subchain and a second business subchain are derived from the basic main chain. The first subchain management node is used to manage the first business subchain, the first business subchain is used to manage the first business, the second subchain management node is used to manage the second business subchain, and the second business subchain is used to manage the second business, and the first business and the second business are different.
[0089] In step S301, a service execution request sent by a service node in the service network or a proxy node in the routing proxy network may be received. If the service execution request includes the subchain identifiers of M service subchains among N service subchains, it may be determined that cross-chain services need to be executed between the M service subchains among the N service subchains. Cross-chain services refer to services that need to interact between services managed by the M service subchains, where M is an integer greater than or equal to 2 and less than or equal to N. If it is necessary to execute cross-chain business between M business subchains among N business subchains, the subchain management nodes of the M business subchains can negotiate the cross-chain business. After negotiating the cross-chain business, the subchain management nodes of the M business subchains can submit their respective cross-chain start proof information related to the cross-chain business to the basic main chain. The subchain management nodes of the M business subchains can also submit their respective cross-chain start proof information related to the cross-chain business to the business subchains they manage. For example, the first subchain management node submits the cross-chain start proof information of the first subchain management node to the first business subchain, and the second subchain management node submits the cross-chain start proof information of the second subchain management node to the second business subchain, and so on; that is, the cross-chain start proof information related to the cross-chain business is submitted to the basic main chain by the subchain management nodes of the M business subchains after negotiating the cross-chain business, so that the first subchain management node used to manage the first business subchain can obtain the cross-chain start proof information related to the cross-chain business from the basic main chain. The first business subchain is any one of the M business subchains.
[0090] Among them, the process of the sub-chain management nodes of M business sub-chains negotiating cross-chain business can include: when the first sub-chain management node determines that cross-chain business needs to be executed between M business sub-chains, it can submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submit the cross-chain start proof information of the first sub-chain management node to the first business sub-chain; and it can send a cross-chain business start request to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain, and the sub-chain management nodes of the M-1 business sub-chains can respond to the cross-chain business start request, submit their respective cross-chain start proof information to the basic main chain, and submit their respective cross-chain start proof information to the business sub-chains they manage; that is, the first sub-chain management node can negotiate cross-chain business with the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain by sending a request. Alternatively, the process of the sub-chain management nodes of M business sub-chains negotiating cross-chain business may include: when the first sub-chain management node determines that cross-chain business needs to be executed between M business sub-chains, it may submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submit the cross-chain start proof information of the first sub-chain management node to the first business sub-chain; when the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain synchronize to the cross-chain start proof information submitted by the first sub-chain management node from the basic main chain, they may submit their respective cross-chain start proof information to the basic main chain, and submit their respective cross-chain start proof information to the business sub-chains they manage; that is, the first sub-chain management node can negotiate cross-chain business with the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain by sending cross-chain start proof information.
[0091] Cross-chain start proof information refers to a transaction used to prove the start of a cross-chain business (a start transaction). The cross-chain start proof information submitted by the sub-chain management node of any of the M business sub-chains may include, but is not limited to: a cross-chain start tag, the sub-chain identifiers of the M business sub-chains, the cross-chain interaction credentials of the business sub-chain, the electronic resources of the business sub-chain, the execution requirements of the cross-chain business, etc. For example, the cross-chain start proof information submitted by the first sub-chain management node of the first business sub-chain may include, but is not limited to: a cross-chain start tag, the sub-chain identifiers of the M business sub-chains, the cross-chain interaction credentials of the first sub-chain management node, the electronic resources of the first business sub-chain, the execution requirements of the cross-chain business, etc. The cross-chain interaction credentials of the sub-chain management node may specifically refer to the identity certificate of the sub-chain management node. The identity certificate here may refer to the Public Key Infrastructure (PKI). In a certificate system, a certificate is an identity certificate of the owner of a public key and is issued by an authority (CA). Asymmetric encryption and digital signatures of information can be implemented based on the public key certificate system. The public key certificate system here can include public and private key cryptography, x509 certificates, CA certificate issuance centers, etc. The execution requirement information of the cross-chain business can include the business requirement information to be executed by the M business sub-chains. In other words, in addition to the cross-chain related data contained in the cross-chain start proof information (cross-chain start tag, sub-chain identifiers of the M business sub-chains, and cross-chain business execution requirement information), the sub-chain management nodes of the M business sub-chains submit their respective cross-chain interaction credentials and electronic resources to the underlying main chain as proof of the cross-chain interaction behavior and as a deposit.
[0092] It should be noted that the sub-chain management nodes of each of the M business sub-chains submit their respective cross-chain start proof information to the underlying main chain. Essentially, each sub-chain management node sends its own cross-chain start proof information to the main chain management node, which then agrees on the information. Taking the first business sub-chain as an example, the process of the first sub-chain management node submitting its cross-chain start proof information to the underlying main chain may include: sending the first sub-chain management node's cross-chain start proof information to the main chain management node, which manages the underlying main chain; and, after the main chain management node reaches consensus on the first sub-chain management node's cross-chain start proof information, uploading the first sub-chain management node's cross-chain start proof information to the underlying main chain. More specifically, the main chain management node may generate a block based on the first sub-chain management node's cross-chain start proof information and broadcast the generated block to other main chain management nodes in the core consensus network. The other main chain management nodes then perform a consensus check on the generated block and, after the consensus check is complete, add the generated block to the underlying main chain, thereby updating the underlying main chain. Among them, other main chain management nodes can perform consensus verification on the generated blocks through consensus algorithms. Consensus algorithms may include but are not limited to:
[0093] (1) Pow (Proof-of-Work):
[0094] Proof of Work (PoW) refers to a measurement method used by a system (such as the aforementioned data sharing system) to achieve a specific goal. Simply put, it's a certificate used to verify the amount of work performed. Essentially, whoever performs the most work has a greater chance of receiving additional rewards. PoW uses AND / OR operations to calculate a random number that satisfies the rules. This ensures the right to record the data for this round and then issues the data to be recorded. Other nodes in the blockchain network then verify and store the data. This gives PoW the advantages of complete decentralization and free entry and exit of nodes.
[0095] (2) Pos (proof-of-stake):
[0096] Pos Proof of Stake is an upgraded consensus mechanism based on Proof of Work. Specifically, whoever holds electronic resources for a longer period (length of time held = number of electronic resources held * time held), has a greater chance of obtaining the right to record the block. Electronic resources can refer to resources stored in electronic accounts in electronic form and circulated over the Internet. The speed of finding random numbers is accelerated based on the proportion of electronic resources held by each node and the time. Pos Proof of Stake shortens the time it takes to reach consensus to a certain extent.
[0097] (3) DPos (Delegated Proof of Stake) share authorization proof mechanism:
[0098] The DPos Proof of Stake mechanism is similar to board voting. Holders of digital resources vote for a certain number of nodes to perform verification and bookkeeping on their behalf. To encourage more participation in the election, the system generates a small amount of digital resources as a reward. The DPos Proof of Stake mechanism allows every BitShares holder to vote, resulting in 101 representatives. We can think of these as 101 supernodes or mining pools, each with equal power. If elected representatives fail to fulfill their duties (fail to generate a block on their turn), they will be removed from the list and the network will select new supernodes to replace them. This allows the DPos Proof of Stake mechanism to significantly reduce the number of nodes involved in verification and bookkeeping, achieving consensus verification within seconds, but the entire consensus mechanism still relies on digital resources.
[0099] (4) pbft (Practical Byzantine Fault Tolerance):
[0100] The PBFT Byzantine Fault Tolerance (PBFT) algorithm is a consensus algorithm based on message passing. It reaches consensus through three phases, which may be repeated due to failures. Specifically, assuming the total number of nodes is 3f+1, where f represents a Byzantine fault-tolerant node, first, when a node discovers that a leader (such as a representative node, ledger node, or supernode) is acting maliciously, the algorithm elects another replica node as the leader. Next, the leader broadcasts its selected value to the other replica nodes via a pre-prepare message. If the other replica nodes accept the prepared message, they send a prepare message; otherwise, they do not. Once 2f nodes accept the prepare message, they send a commit message. Finally, when 2f+1 nodes accept the commit message, the value is confirmed. The above process enables the PBFT Byzantine Fault Tolerance algorithm to reach a consensus that each node is composed of business participants or regulators, and security and stability are guaranteed by business stakeholders; in addition, the consensus delay is approximately 2 to 5 seconds, which basically meets the requirements of commercial real-time processing, improves consensus efficiency, and can meet the needs of high-frequency trading volume.
[0101] (5) Paxos (a distributed algorithm) algorithm:
[0102] The Paxos algorithm is a two-phase algorithm with three main roles: proposer, acceptor, and learner. The proposer proposes a proposal, which the acceptor either agrees or rejects. The learner then obtains the final value after consensus is reached. The Paxos algorithm consists of two phases: ① Preparation phase: The proposer selects a proposal number n and sends a prepare request to a majority of the acceptors. Upon receiving the prepare request, if the proposal number is greater than all the prepare requests it has already responded to, the acceptor replies to the proposer with the proposal it last accepted and promises not to respond to proposals smaller than n. ② Approval phase: When a proposer receives a response from a majority of acceptors to its prepare request, it enters the approval phase. It sends an accept request to the acceptors that responded to the prepare request, including the number n and the value (if no value has already been accepted, the acceptor is free to choose a value). Upon receiving the accept request, the acceptor accepts the proposal, provided it does not violate its commitments to other proposers.
[0103] The Paxos algorithm is suitable for a simple fault-tolerant model, that is, there can only be failed or faulty nodes in the system, and no malicious nodes. If the number of failed nodes is x (x is a positive integer), then only x+1 nodes are required to maintain the normal operation of the system.
[0104] (6) Raft (a distributed consensus algorithm) algorithm:
[0105] The Raft algorithm includes three roles: follower, candidate, and leader. A node can only be in one of these three states at a given time, and these three roles can transition over time and under changing conditions. All nodes are initially in the follower state. Followers that fail to receive a heartbeat packet after a timeout will become candidates and broadcast a voting request. The node that receives the majority of votes will become the leader. The first node to vote in this round wins, and each node only casts one vote. The leader node periodically sends heartbeat packets to other nodes. The failure of the leader node triggers a new round of voting.
[0106] S302: Execute cross-chain business based on cross-chain start proof information.
[0107] In one implementation, after the subchain management nodes of M business subchains mutually confirm that all parties participating in the cross-chain interaction have submitted cross-chain start proof information, the subchain management nodes of the M business subchains can execute the cross-chain business. As can be seen from the above content, the subchain management nodes can synchronize the basic main chain from the main chain management node. After the first subchain management node obtains (i.e., synchronizes) the M cross-chain start proof information related to the cross-chain business from the basic main chain, it can send a cross-chain interaction start notification to the subchain management nodes of M-1 business subchains other than the first business subchain; similarly, after the subchain management nodes of M-1 business subchains obtain (i.e., synchronize) the M cross-chain start proof information related to the cross-chain business from the basic main chain, they can also send a cross-chain interaction start notification to the subchain management nodes of other business subchains. When the first sub-chain management node receives M-1 cross-chain interaction start notifications, it can start executing cross-chain business; similarly, when the sub-chain management nodes of the M-1 business sub-chains each receive M-1 cross-chain interaction start notifications, they can each start executing cross-chain business.
[0108] In another implementation, after the subchain management nodes of the M business subchains mutually confirm that all parties participating in the cross-chain interaction have submitted cross-chain start proof information and the cross-chain start proof information has been verified, the subchain management nodes of the M business subchains can execute cross-chain business. Specifically, after the first subchain management node obtains (i.e., synchronizes) the M cross-chain start proof information related to the cross-chain business from the basic main chain, it can verify the cross-chain start proof information; similarly, the subchain management nodes of the M-1 business subchains other than the first business subchain in the M business subchains can obtain the cross-chain start proof information from the basic main chain, verify the cross-chain start proof information, and send the first verification result obtained by the verification to the first subchain management node. The first subchain management node receives the first verification results sent by the subchain management nodes of the M-1 business subchains, and counts the first number of the first verification results that have passed the verification; if the first subchain management node verifies the cross-chain start proof information and the first number is greater than the first number threshold, the first subchain management node executes the cross-chain business.
[0109] It should be noted that during the execution of cross-chain transactions, the M business sub-chains will continue to manage their respective businesses and upload transactions under their respective managed businesses to the chain, and the cross-chain transactions will not affect them. For example, when N = 2, the first business sub-chain and the second business sub-chain are derived from the basic main chain. During the execution of cross-chain transactions on the first and second business sub-chains, when there are transactions of the first business that need to be uploaded to the chain, the first sub-chain management node will upload the transactions of the first business that need to be uploaded to the chain to the first business sub-chain. When there are transactions of the second business that need to be uploaded to the chain, the second sub-chain management node will upload the transactions of the second business that need to be uploaded to the second business sub-chain.
[0110] S303: After the cross-chain business is completed, the cross-chain end proof information related to the cross-chain business is obtained from the basic main chain. The cross-chain start proof information and cross-chain end proof information in the basic main chain are used to confirm the cross-chain business.
[0111] After the cross-chain business is completed, the first sub-chain management node can perform a consistency check on the business execution results of the cross-chain business under each business sub-chain. If the consistency check passes, the first sub-chain management node can submit the cross-chain termination proof information of the first sub-chain management node to the basic main chain, submit the cross-chain termination proof information of the first sub-chain management node to the first business sub-chain, and can send a cross-chain business termination request to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain termination proof information to the basic main chain, and submit their respective cross-chain termination proof information to the business sub-chains they manage, so that the first sub-chain management node can obtain the cross-chain termination proof information related to the cross-chain business from the basic main chain. That is to say, the cross-chain termination proof information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after confirming that the cross-chain business execution is completed; after the consistency check of the business execution results of the cross-chain business under each business sub-chain is passed, the first sub-chain management node can notify the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain to terminate the cross-chain business by sending a request.
[0112] Alternatively, after the cross-chain business is completed, the first sub-chain management node may perform a consistency check on the business execution results of the cross-chain business under each business sub-chain. If the consistency check passes, the first sub-chain management node may submit the cross-chain termination proof information of the first sub-chain management node to the basic main chain, and submit the cross-chain termination proof information of the first sub-chain management node to the first business sub-chain; when the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain synchronize to the cross-chain termination proof information submitted by the first sub-chain management node from the basic main chain, they may submit their respective cross-chain termination proof information to the basic main chain, and submit their respective cross-chain termination proof information to the business sub-chains they manage, so that the first sub-chain management node can obtain the cross-chain termination proof information related to the cross-chain business from the basic main chain; that is, the first sub-chain management node may notify the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain to terminate the cross-chain business by sending the cross-chain termination proof information.
[0113] Cross-chain end proof information refers to the transaction (end transaction) used to prove the end of a cross-chain transaction. The cross-chain end proof information submitted by the sub-chain management node of any of the M business sub-chains may include, but is not limited to: a cross-chain end tag, the sub-chain identifiers of the M business sub-chains, the cross-chain interaction credentials of the business sub-chain, etc. For example, the cross-chain start proof information submitted by the first sub-chain management node of the first business sub-chain may include, but is not limited to: a cross-chain end tag, the sub-chain identifiers of the M business sub-chains, the cross-chain interaction credentials of the first sub-chain management node, etc. In other words, in addition to the cross-chain-related data (cross-chain end tag, sub-chain identifiers of the M business sub-chains) contained in the cross-chain end transaction information, the sub-chain management nodes of the M business sub-chains submit their respective cross-chain interaction credentials to the underlying main chain as proof of the cross-chain interaction behavior.
[0114] It should be noted that after the cross-chain business is completed, the M business sub-chains will continue to manage their respective businesses and upload transactions under their respective managed businesses to the chain. For example, when N=2, the first business sub-chain and the second business sub-chain are derived from the basic main chain. After the cross-chain business is completed, when there are transactions of the first business that need to be uploaded to the chain, the first sub-chain management node will upload the transactions of the first business that need to be uploaded to the first business sub-chain. When there are transactions of the second business that need to be uploaded to the chain, the second sub-chain management node will upload the transactions of the second business that need to be uploaded to the second business sub-chain.
[0115] In the embodiment of the present application, cross-chain business interaction between multiple business sub-chains can be realized with the help of the basic main chain. The basic main chain is a trustworthy genesis basic chain. The multiple parties participating in the cross-chain business interaction can confirm the cross-chain business by submitting cross-chain start proof information and cross-chain start and end information to the basic main chain, making the cross-chain business very reliable; in addition, by querying the cross-chain start proof information and cross-chain end proof information on the basic main chain, the cross-chain business can be retroactively checked. For example, after querying the timestamps of the submission of the cross-chain start proof information and the cross-chain end proof information on the basic main chain, the business data between the timestamps of the submission of the cross-chain start proof information and the cross-chain end proof information can be obtained from each business sub-chain. These business data contain the business execution results of the cross-chain business, which improves the traceability and checkability of the cross-chain business. In addition, the basic main chain only needs to record the cross-chain start proof information and cross-chain end proof information submitted by each business sub-chain to confirm the cross-chain business, which occupies less resources of the basic main chain. Each business sub-chain can continue to manage its own business while executing cross-chain business, and the execution of cross-chain business will basically have no impact on the performance of the business sub-chain.
[0116] The embodiment of the present application proposes a cross-chain interaction method based on a blockchain network. The cross-chain interaction method mainly introduces the verification method of the cross-chain start proof information, the execution process of the cross-chain business, and the consistency check process of the execution result of the cross-chain business. The cross-chain interaction method can be specifically executed by the sub-chain management node of any business sub-chain in the business sub-chain participating in the cross-chain interaction (hereinafter referred to as the first sub-chain management node of the first business sub-chain). Figure 4 As shown, the cross-chain interaction method based on the blockchain network may include the following steps S401 to S405:
[0117] S401: If a cross-chain business needs to be performed between M business sub-chains among N business sub-chains, the cross-chain start proof information related to the cross-chain business is obtained from the basic main chain.
[0118] The execution process of step S401 in the embodiment of the present application is the same as Figure 3 The execution process of step S301 in the embodiment shown is the same. For the specific execution process, please refer to Figure 3 The description of step S301 in the illustrated embodiment will not be repeated here.
[0119] S402, verify the cross-chain start proof information.
[0120] After the first sub-chain management node obtains the cross-chain start proof information related to the cross-chain business from the basic main chain, it can verify the cross-chain start proof information; the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain in the M business sub-chains can all obtain the cross-chain start proof information from the basic main chain, verify the cross-chain start proof information, and send the first verification result obtained by the verification to the first sub-chain management node; that is, after the sub-chain management nodes of the M business sub-chains participating in the cross-chain business obtain the cross-chain start proof information from the basic main chain, they can all verify the obtained cross-chain start proof information, and the verification method of the sub-chain management nodes of the M-1 business sub-chains for the cross-chain start proof information is the same as the verification method of the first sub-chain management node for the cross-chain start proof information.
[0121] As can be seen from the foregoing, the first business sub-chain can have one or more sub-chain management nodes. When the number of sub-chain management nodes of the first business sub-chain is one (that is, the sub-chain management node of the first business sub-chain is the first sub-chain management node), the first sub-chain management node verifies the cross-chain start proof information, which means that the first sub-chain management node itself verifies the cross-chain start proof information. When the number of sub-chain management nodes of the first business sub-chain is multiple (that is, the sub-chain management nodes of the first business sub-chain include the first sub-chain management node and other sub-chain management nodes of the first business sub-chain), the first sub-chain management node can send the cross-chain start proof information to the other sub-chain management nodes for verification. The other sub-chain management nodes refer to the nodes in the core consensus network other than the first sub-chain management node used to manage the first business sub-chain. That is to say, all sub-chain management nodes of the first business sub-chain are required to verify the cross-chain start proof information; the first sub-chain management node can receive the second verification results of the cross-chain start proof information from other sub-chain management nodes, and count the second number of the second verification results that passed the verification; if the second number is greater than the second number threshold, the first sub-chain management node can determine that the verification of the cross-chain start proof information has passed. It should be noted that the verification process of the cross-chain start proof information by any of the other sub-chain management nodes is the same as the verification process of the cross-chain start proof information by the first sub-chain management node; the second quantity threshold may refer to the product of the number of all sub-chain management nodes of the first business sub-chain and a specified ratio (for example, two-thirds, four-fifths, etc.).
[0122] Among them, the process of the first subchain management node verifying the cross-chain start proof information submitted by the M business subchains obtained from the basic main chain may include: performing a matching check on the subchain identifiers in the M cross-chain start proof information, that is, checking whether the M cross-chain start proof information all contain the subchain identifiers of the M business subchains, and whether the subchain identifiers of the included M business subchains are completely consistent; if the subchain identifiers in the M cross-chain start proof information all match (that is, the M cross-chain start proof information all contain the subchain identifiers of the M business subchains, and the subchain identifiers of the included M business subchains are completely consistent), If the cross-chain interaction credentials in the M cross-chain start proof information are all legal, then the verification of the cross-chain start proof information is determined to be passed; if the sub-chain identifiers in the M cross-chain start proof information do not match (for example, some of the cross-chain start proof information does not completely contain the sub-chain identifiers of the M business sub-chains, or the sub-chain identifiers contained in the M cross-chain start proof information are not completely consistent, etc.), then the verification of the cross-chain start proof information is determined to have failed.
[0123] Taking the cross-chain interaction credential as a CA certificate as an example, the CA certificate may include the public key, signature information, certificate validity period, certificate information and other contents. The signature information is obtained by encrypting the public key and certificate information with the private key. The process of checking the legitimacy of the cross-chain interaction credential in any cross-chain start proof information may include: using the public key to decrypt the signature information to obtain the public key and certificate information; if the public key used for decryption and the public key obtained by decryption are the same, and the CA certificate is currently within the validity period, it can be determined that the CA certificate is legal; if it includes at least one of the following situations: the public key used for decryption and the public key obtained by decryption are not the same, and the CA certificate is currently expired, it can be determined that the CA certificate is illegal.
[0124] S403: Receive first verification results sent by the sub-chain management nodes of M-1 business sub-chains, and count the first number of first verification results that pass the verification.
[0125] S404: If the first sub-chain management node verifies the cross-chain start proof information and the first number is greater than the first number threshold, the cross-chain business is executed.
[0126] If the first sub-chain management node passes the verification of the cross-chain start proof information and the first number is greater than the first number threshold, the first sub-chain management node can execute the cross-chain business. The first number can refer to the product of the number of M business sub-chains and the target ratio (for example, it can be two-thirds, four-fifths, etc.).
[0127] Cross-chain services may include on-chain cross-chain services and off-chain cross-chain services. The first sub-chain management node executing on-chain cross-chain services may include: obtaining a cross-chain business smart contract related to the cross-chain business from the first business sub-chain, invoking the cross-chain business smart contract to execute the cross-chain business, and uploading the business execution results of the cross-chain business to the first business sub-chain; similarly, the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain may also obtain a cross-chain business smart contract related to the cross-chain business from the business sub-chains they manage, invoking the cross-chain business smart contract to execute the cross-chain business, and uploading the business execution results of the cross-chain business to their respective business sub-chains. The first subchain management node executing off-chain cross-chain business may include: the first subchain management node performing business interaction with the subchain management nodes of M-1 business subchains based on the off-chain cross-chain business interaction logic, for example, the first subchain management node sends data to be calculated to the second subchain management node to request the second subchain management node to perform calculation, or the first subchain management node sends data to be confirmed to the third subchain management node to request the third subchain management node to confirm; similarly, the subchain management nodes of the M business subchains can perform business interaction based on the off-chain cross-chain business interaction logic.
[0128] S405: After the cross-chain business is completed, the cross-chain end proof information related to the cross-chain business is obtained from the basic main chain. The cross-chain start proof information and cross-chain end proof information in the basic main chain are used to confirm the cross-chain business.
[0129] As can be seen from the foregoing, the first subchain management node can perform a consistency check on the execution results of the cross-chain business under each business subchain. If the consistency check passes, the first subchain management node can submit its cross-chain termination certificate information to the base main chain and the first business subchain. The subchain management nodes of the M-1 business subchains other than the first business subchain can also perform a consistency check on the execution results of the cross-chain business under each business subchain. After the consistency check passes, they submit the cross-chain termination certificate information to the base main chain and submit their respective cross-chain termination certificates to the business subchains they manage. The process for the subchain management nodes of the M business subchains to perform consistency checks on the execution results of the cross-chain business under each business subchain is the same. The consistency check process of the first subchain management node is used as an example below. The consistency check process of other subchain management nodes can refer to the consistency check process of the first subchain management node.
[0130] The process of the first subchain management node performing a consistency check on the business execution results of the cross-chain business under each business subchain may include: first, obtaining the business execution results in the first business subchain and sending a business execution result acquisition request to the subchain management nodes of M-1 business subchains other than the first business subchain. The subchain management nodes of the M-1 business subchains respond to the business execution result acquisition request, obtain the business execution results in the business subchains they manage, and send the acquired business execution results to the first subchain management node; then, the business execution results in the M business subchains may be compared; if the business execution results in the M business subchains are the same, it is determined that the consistency check has passed. Only after the consistency check has passed can the cross-chain business be terminated, thereby ensuring that the cross-chain business recorded in each business subchain remains consistent; if the business execution results in the M business subchains are different, the cross-chain business is rolled back. Rolling back the cross-chain business means restoring the data recorded in each business subchain to the data before the cross-chain business was executed. The rollback can ensure that the different business execution results in the M business subchains do not affect other data in the business subchains.
[0131] For example, the first sub-chain management node requests the second sub-chain management node to calculate the data to be calculated. After the second sub-chain management node calculates the data to be calculated, it can upload the calculated data to the second business sub-chain, or send the calculated data to the first sub-chain management node. The first sub-chain management node can also upload the calculated data to the first business sub-chain. During the consistency check, the calculated data recorded in the first business sub-chain can be compared with the calculated data recorded in the second business sub-chain to see if they are the same. If they are the same, the consistency check passes. If they are not the same, a rollback is performed.
[0132] In the embodiments of the present application, all parties involved in the cross-chain business can only execute the cross-chain business after verifying the cross-chain start proof information. This ensures that all parties executing the cross-chain business are trustworthy and that the cross-chain business can be executed safely and efficiently. In addition, the cross-chain business can only be terminated after confirming that all parties involved in the cross-chain business have the same execution results for the cross-chain business. This ensures that the cross-chain business is consistent across all business sub-chains. If the business execution results of the cross-chain business are inconsistent across all business sub-chains, a rollback is performed, allowing each business sub-chain involved in the cross-chain business to restore the correct data state before the cross-chain business execution.
[0133] The following combination Figure 5 and Figure 6 Introduce cross-chain interaction solutions in tax scenarios. Figure 5 The architecture of a two-tier blockchain system in a tax scenario is shown. Figure 5As shown, a two-tiered blockchain system for tax scenarios can include: a business layer, a routing proxy layer, and a core consensus layer. These three layers constitute a complete blockchain business system for tax scenarios. Specifically, ① the business layer resides within the business network and includes at least one business node. This business node can be equipment used by local tax bureaus, invoicing servers, reimbursement servers, etc. Business nodes can connect to clients such as consumers, businesses, and electronic tax bureaus. ② The core consensus layer resides within the core consensus network and can include X node clusters, such as the main chain node cluster and various subchain node clusters described above. The main chain management nodes within a main chain node cluster manage the underlying main chain. Subchain management nodes within the same subchain management cluster manage the same business subchains. The main chain management nodes and subchain management nodes can be equipment used by the State Administration of Taxation. For example, Core Chain 1 managed by Node Cluster 1 is the underlying main chain, Core Chain 2 managed by Node Cluster 2 is the business subchain for invoicing, and Core Chain X managed by Node Cluster X is the business subchain for enterprise qualification. ③ The routing proxy layer includes at least one proxy node, which can provide routing services, authentication services, certificate caching services, peer-to-peer (P2P) services, etc. The business layer and the core consensus layer exchange information through the routing proxy layer, so the routing proxy layer plays a role in isolating the business layer and the core consensus network layer.
[0134] based on Figure 5 The two-layer blockchain system structure under the tax scenario is shown in the figure. The cross-chain business interaction solution under the tax scenario can be found in Figure 6 , Figure 6 Business sub-chain 1 (such as business sub-chain 1) to manage business 1 (such as billing business) Figure 6 2Q shown) and business sub-chain 2 (such as business qualification business) of management business 2 (such as business qualification business) Figure 6 The cross-chain interaction scheme between the 2Rs shown in the figure is introduced as an example, and the specific description is as follows:
[0135] (1) When cross-chain business needs to be executed between business sub-chain 1 and business sub-chain 2, after the first sub-chain management node that manages business sub-chain 1 and the second sub-chain management node that manages business sub-chain 2 negotiate the cross-chain business, the first sub-chain management node can submit the cross-chain start proof information (1_start transaction) of the first sub-chain management node to the basic main chain and business sub-chain 1, and the second sub-chain management node can submit the cross-chain start proof information (2_start transaction) of the second sub-chain management node to the basic main chain and business sub-chain 2. The cross-chain start proof information (1_start transaction) of the first sub-chain management node is recorded in block A4 of the basic main chain and block B6 of business sub-chain 1, and the cross-chain start proof information (2_start transaction) of the second sub-chain management node is recorded in block A4 of the basic main chain and block C7 of business sub-chain 2.
[0136] (2) After the first subchain management node and the second subchain management node confirm that the other party has submitted the cross-chain start proof information on the basic main chain, the first subchain management node and the second subchain management node can perform cross-chain business interactions (which may include the on-chain cross-chain business and off-chain cross-chain business mentioned above); for example, the second subchain management node provides the first subchain management node with enterprise qualification proof information, and the first subchain management node issues an electronic invoice based on the enterprise qualification proof information. The first subchain management node can upload the business execution results of the cross-chain business to the business subchain 1, for example, recording them in blocks B7 and B8 of the business subchain 1; the second subchain management node can upload the business execution results of the cross-chain business to the business subchain 2, for example, recording them in blocks C8-C11 of the business subchain 2.
[0137] (3) After the cross-chain business is completed, the first sub-chain management node and the second sub-chain management node can perform a consistency check on the business execution results of the cross-chain business. After the consistency check is passed, the first sub-chain management node can submit the cross-chain end proof information (1_end transaction) of the first sub-chain management node to the basic main chain and business sub-chain 1, and the second sub-chain management node can submit the cross-chain end proof information (2_end transaction) of the second sub-chain management node to the basic main chain and business sub-chain 2. The cross-chain end proof information (1_end transaction) of the first sub-chain management node is recorded in block A5 of the basic main chain and block B9 of business sub-chain 1, and the cross-chain bundle proof information (2_end transaction) of the second sub-chain management node is recorded in block A5 of the basic main chain and block C12 of business sub-chain 2. After the cross-chain business is completed, business sub-chain 1 and business sub-chain 2 continue to manage their respective businesses.
[0138] The above describes in detail the method of the embodiment of the present application. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0139] See Figure 7 , Figure 7: This is a structural diagram of a cross-chain interaction device based on a blockchain network provided in an embodiment of the present application. The blockchain network includes a core consensus network. A basic main chain and N business sub-chains derived from the basic main chain are running in the core consensus network. N is an integer and N ≥ 2; the N business sub-chains are used to manage different businesses, and each business sub-chain has its own sub-chain management node; the cross-chain interaction device can be set in the first sub-chain management node provided in the embodiment of the present application. The first sub-chain management node is used to manage the first business sub-chain. The first sub-chain management node can be the terminal or server mentioned in the above method embodiment; in some embodiments, the cross-chain interaction device can be a computer program (including program code) running in the first sub-chain management node. The cross-chain interaction device can be used to execute Figure 3 or Figure 4 The corresponding steps in the method embodiment shown in FIG. Figure 7 , the cross-chain interaction device may include the following units:
[0140] An acquisition unit 701 is configured to acquire cross-chain start proof information related to a cross-chain business from the base main chain if a cross-chain business needs to be executed between M of the N business sub-chains. The cross-chain start proof information is submitted to the base main chain by the sub-chain management nodes of the M business sub-chains after negotiating the cross-chain business. The first business sub-chain is any one of the M business sub-chains, where M is an integer and 2≤M≤N.
[0141] Processing unit 702, configured to execute cross-chain services based on cross-chain start proof information;
[0142] The acquisition unit 701 is further used to obtain cross-chain completion certification information related to the cross-chain business from the basic main chain after the cross-chain business is completed; the cross-chain completion certification information is submitted to the basic main chain by the sub-chain management node of the M business sub-chains after determining that the cross-chain business is completed; the cross-chain start certification information and cross-chain completion certification information in the basic main chain are used to confirm the cross-chain business.
[0143] In one implementation, the processing unit 702 is configured to execute the following steps when executing a cross-chain transaction based on the cross-chain start proof information:
[0144] Verify the cross-chain start proof information; the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain in the M business sub-chains obtain the cross-chain start proof information from the basic main chain, verify the cross-chain start proof information, and send the first verification result obtained to the first sub-chain management node;
[0145] Receive the first verification results sent by the subchain management nodes of M-1 business subchains, and count the first number of first verification results that pass the verification;
[0146] If the first sub-chain management node verifies the cross-chain start proof information and the first number is greater than the first number threshold, the cross-chain business is executed.
[0147] In one implementation, the processing unit 702 is configured to execute the following steps when executing a cross-chain transaction:
[0148] Obtain the cross-chain business smart contract related to the cross-chain business from the first business sub-chain;
[0149] Call cross-chain business smart contracts to execute cross-chain business;
[0150] Upload the cross-chain business execution results to the first business sub-chain.
[0151] In one implementation, the number of cross-chain start proof information is M, and any cross-chain start proof information includes the sub-chain identifiers and cross-chain interaction credentials of the M business sub-chains; the processing unit 702 is used to verify the cross-chain start proof information, specifically to perform the following steps:
[0152] Perform a matching check on the subchain identifiers in the M cross-chain start proofs;
[0153] If the subchain identifiers in the M cross-chain start proofs all match, then the legitimacy of the cross-chain interaction credentials in the M cross-chain start proofs is checked;
[0154] If the cross-chain interaction credentials in the M cross-chain start proof information are all legal, then the verification of the M cross-chain start proof information is determined to be successful.
[0155] In one implementation, the processing unit 702 is configured to perform the following steps when verifying the cross-chain start proof information:
[0156] Send the cross-chain start proof information to other sub-chain management nodes of the first business sub-chain for verification. Other sub-chain management nodes refer to nodes in the core consensus network that manage the first business sub-chain except the first sub-chain management node.
[0157] Receive the second verification results of the cross-chain start proof information from other sub-chain management nodes, and count the second number of the second verification results that pass the verification;
[0158] If the second number is greater than the second number threshold, it is determined that the cross-chain start proof information verification is passed.
[0159] In one implementation, the processing unit 702 is further configured to perform the following steps:
[0160] Submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submit the cross-chain start proof information of the first sub-chain management node to the first business sub-chain;
[0161] A cross-chain business start request is sent to the sub-chain management nodes of M-1 business sub-chains except the first business sub-chain; in response to the cross-chain business start request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain start certification information to the basic main chain, and submit their respective cross-chain start certification information to the M-1 business sub-chains.
[0162] In one implementation, the main chain management node in the core consensus network is used to manage the basic main chain; the processing unit 702 is used to submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, specifically to perform the following steps:
[0163] Send the cross-chain start proof information of the first sub-chain management node to the main chain management node; after the main chain management node reaches a consensus on the cross-chain start proof information of the first sub-chain management node, it uploads the cross-chain start proof information of the first sub-chain management node to the basic main chain.
[0164] In one implementation, the processing unit 702 is further configured to perform the following steps:
[0165] Conduct consistency checks on cross-chain business execution results;
[0166] If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain;
[0167] A cross-chain business termination request is sent to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit cross-chain termination certification information to the basic main chain, and submit cross-chain termination certification information to the business sub-chains they manage.
[0168] In one implementation, the processing unit 702 is further configured to perform the following steps:
[0169] Conduct consistency checks on cross-chain business execution results;
[0170] If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain;
[0171] A cross-chain business termination request is sent to the sub-chain management nodes of the M-1 business sub-chains except the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain termination certification information to the basic main chain, and submit their respective cross-chain termination certification information to the M-1 business sub-chains.
[0172] In one implementation, the processing unit 702 is configured to perform the following steps when performing a consistency check on the business execution results of the cross-chain business:
[0173] Obtaining the business execution results in the first business subchain;
[0174] Send a business execution result acquisition request to the subchain management nodes of M-1 business subchains other than the first business subchain; the subchain management nodes of the M-1 business subchains respond to the business execution result acquisition request, obtain the business execution results in the M-1 business subchains, and send the acquired business execution results to the first subchain management node;
[0175] Compare the business execution results in M business sub-chains;
[0176] If the business execution results in the M business subchains are the same, the consistency check is determined to have passed;
[0177] If the business execution results in the M business sub-chains are different, the cross-chain business will be rolled back.
[0178] In one implementation, the acquiring unit 701 is further configured to perform the following steps:
[0179] Receive business execution requests from business nodes in the business network or proxy nodes in the routing proxy network; the business network, routing proxy network, and core consensus network are all subnetworks of the blockchain network. The routing proxy network is used to forward requests from the business network to the core consensus network;
[0180] If the business execution request includes the subchain identifiers of M business subchains, it is determined that cross-chain business needs to be executed between the M business subchains.
[0181] According to one embodiment of the present application, Figure 3 or Figure 4 The various steps involved in the method shown can be performed by Figure 7 The cross-chain interaction device shown is executed by each unit. For example, Figure 3 Steps S301 and S303 shown in FIG. Figure 7 The acquisition unit 701 shown is used to execute, Figure 3 Step S302 shown can be performed by Figure 7 The processing unit 702 shown is executed. For example, Figure 4 Step S401 shown can be performed by Figure 7 The acquisition unit 701 shown is used to execute, Figure 4 Steps S402 to S404 shown can be performed by Figure 7 The processing unit 702 shown is used to execute, Figure 4Step S405 shown can be performed by Figure 7 The acquisition unit 701 shown is used for execution.
[0182] According to another embodiment of the present application, Figure 7 The various units in the cross-chain interaction device shown can be individually or all combined into one or several other units to constitute, or one (or some) of the units can be further divided into multiple smaller functional units to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the cross-chain interaction device may also include other units. In actual applications, these functions can also be implemented with the assistance of other units and can be implemented by collaboration of multiple units.
[0183] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM) and other processing elements and storage elements. Figure 3 or Figure 4 A computer program (including program code) for each step of the corresponding method shown in FIG. Figure 7 The cross-chain interaction device shown in the embodiment of the present application is implemented by the cross-chain interaction method. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.
[0184] In an embodiment of the present application, the blockchain network includes a core consensus network in which a basic main chain and multiple business sub-chains derived from the basic main chain run. The multiple business sub-chains are used to manage different businesses, and each business sub-chain has its own sub-chain management node; when it is necessary to execute cross-chain business between some of the business sub-chains in the multiple business sub-chains, the sub-chain management nodes of some of the business sub-chains can submit cross-chain start proof information related to the cross-chain business to the basic main chain after negotiating the cross-chain business, and the sub-chain management nodes of any business sub-chain in some of the business sub-chains can obtain the cross-chain business start information from the basic main chain and execute the cross-chain business based on the cross-chain business start information; after determining that the cross-chain business is completed, the sub-chain management nodes of some of the business sub-chains can submit cross-chain end proof information related to the cross-chain business to the basic main chain, and the sub-chain management nodes of any business sub-chain in some of the business sub-chains can obtain the cross-chain business start information from the basic main chain; the cross-chain start proof information and cross-chain end proof information in the basic main chain can be used to confirm the cross-chain business. From the above content, it can be seen that cross-chain business refers to business that needs to interact between businesses managed by different business sub-chains. The embodiment of the present application can realize cross-chain business interaction with the help of the basic main chain, and can confirm the cross-chain business with the help of the cross-chain start proof information and cross-chain start and end information in the basic main chain, so that the cross-chain business is reliable and trustworthy. It can be further seen that the embodiment of the present application can reliably carry out business interaction in the blockchain network.
[0185] Based on the above method and device embodiments, the present application provides a computer device based on a blockchain network, which can be the first sub-chain management node mentioned above. The blockchain network includes a core consensus network, in which a basic main chain and N business sub-chains derived from the basic main chain run. N is an integer and N ≥ 2. The N business sub-chains are used to manage different businesses, and each business sub-chain has its own sub-chain management node. The first sub-chain management node is used to manage the first business sub-chain. Figure 8 , Figure 8 This is a structural diagram of a computer device based on a blockchain network provided in an embodiment of the present application. Figure 8 The computer device shown includes at least a processor 801, an input interface 802, an output interface 803, and a computer-readable storage medium 804. The processor 801, the input interface 802, the output interface 803, and the computer-readable storage medium 804 may be connected via a bus or other means.
[0186] The input interface 802 can be used to obtain cross-chain start proof information related to the cross-chain business from the basic main chain, obtain cross-chain end proof information related to the cross-chain business from the basic main chain, etc.; the output interface 803 can be used to send a cross-chain business start request to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain, send a cross-chain business end request to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain, etc.
[0187] Computer-readable storage medium 804 may be stored in a memory of a computer device. Computer-readable storage medium 804 is used to store a computer program, which includes computer instructions. Processor 801 is used to execute the program instructions stored in computer-readable storage medium 804. Processor 801 (also known as CPU (Central Processing Unit)) is the computing core and control core of the computer device. It is suitable for implementing one or more computer instructions, and is specifically suitable for loading and executing one or more computer instructions to implement a corresponding method flow or corresponding function.
[0188] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. In addition, one or more computer instructions suitable for being loaded and executed by the processor are also stored in the storage space. These computer instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0189] In one implementation, the processor 801 may load and execute one or more computer instructions stored in the computer-readable storage medium 804 to implement the above-mentioned Figure 3 or Figure 4 The corresponding steps of the cross-chain interaction method shown in FIG. In a specific implementation, the computer instructions in the computer-readable storage medium 804 are loaded by the processor 801 and execute the following steps:
[0190] If cross-chain business needs to be performed between M business sub-chains among N business sub-chains, the cross-chain start proof information related to the cross-chain business is obtained from the basic main chain; the cross-chain start proof information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after negotiating the cross-chain business. The first business sub-chain is any one of the M business sub-chains, where M is an integer and 2≤M≤N;
[0191] Execute cross-chain business based on cross-chain start proof information;
[0192] After the cross-chain business is completed, the cross-chain completion certificate information related to the cross-chain business is obtained from the basic main chain; the cross-chain completion certificate information is submitted to the basic main chain by the sub-chain management node of the M business sub-chains after determining that the cross-chain business execution is completed; the cross-chain start certificate information and cross-chain completion certificate information in the basic main chain are used to confirm the cross-chain business.
[0193] In one implementation, when the computer instructions in the computer-readable storage medium 804 are loaded and executed by the processor 801 to perform a cross-chain transaction based on the cross-chain start proof information, the computer instructions are specifically used to perform the following steps:
[0194] Verify the cross-chain start proof information; the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain in the M business sub-chains obtain the cross-chain start proof information from the basic main chain, verify the cross-chain start proof information, and send the first verification result obtained to the first sub-chain management node;
[0195] Receive the first verification results sent by the subchain management nodes of M-1 business subchains, and count the first number of first verification results that pass the verification;
[0196] If the first sub-chain management node verifies the cross-chain start proof information and the first number is greater than the first number threshold, the cross-chain business is executed.
[0197] In one implementation, when the computer instructions in the computer-readable storage medium 804 are loaded by the processor 801 and execute the cross-chain business, they are specifically used to perform the following steps:
[0198] Obtain the cross-chain business smart contract related to the cross-chain business from the first business sub-chain;
[0199] Call cross-chain business smart contracts to execute cross-chain business;
[0200] Upload the cross-chain business execution results to the first business sub-chain.
[0201] In one implementation, the number of cross-chain start proof information is M, and any cross-chain start proof information includes the sub-chain identifiers and cross-chain interaction credentials of the M business sub-chains; when the computer instructions in the computer-readable storage medium 804 are loaded and executed by the processor 801 to verify the cross-chain start proof information, they are specifically used to perform the following steps:
[0202] Perform a matching check on the subchain identifiers in the M cross-chain start proofs;
[0203] If the subchain identifiers in the M cross-chain start proofs all match, then the legitimacy of the cross-chain interaction credentials in the M cross-chain start proofs is checked;
[0204] If the cross-chain interaction credentials in the M cross-chain start proof information are all legal, then the verification of the M cross-chain start proof information is determined to be successful.
[0205] In one implementation, when the computer instructions in the computer-readable storage medium 804 are loaded and executed by the processor 801 to verify the cross-chain start proof information, they are specifically used to perform the following steps:
[0206] Send the cross-chain start proof information to other sub-chain management nodes of the first business sub-chain for verification. Other sub-chain management nodes refer to nodes in the core consensus network that manage the first business sub-chain except the first sub-chain management node.
[0207] Receive the second verification results of the cross-chain start proof information from other sub-chain management nodes, and count the second number of the second verification results that pass the verification;
[0208] If the second number is greater than the second number threshold, it is determined that the cross-chain start proof information verification is passed.
[0209] In one implementation, the computer instructions in the computer-readable storage medium 804 are loaded by the processor 801 and are further used to perform the following steps:
[0210] Submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submit the cross-chain start proof information of the first sub-chain management node to the first business sub-chain;
[0211] A cross-chain business start request is sent to the sub-chain management nodes of M-1 business sub-chains except the first business sub-chain; in response to the cross-chain business start request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain start certification information to the basic main chain, and submit their respective cross-chain start certification information to the M-1 business sub-chains.
[0212] In one implementation, the main chain management node in the core consensus network is used to manage the basic main chain; when the computer instructions in the computer-readable storage medium 804 are loaded and executed by the processor 801 to submit the cross-chain start proof information of the first sub-chain management node to the basic main chain, the computer instructions are specifically used to perform the following steps:
[0213] Send the cross-chain start proof information of the first sub-chain management node to the main chain management node; after the main chain management node reaches a consensus on the cross-chain start proof information of the first sub-chain management node, it uploads the cross-chain start proof information of the first sub-chain management node to the basic main chain.
[0214] In one implementation, the computer instructions in the computer-readable storage medium 804 are loaded by the processor 801 and are further used to perform the following steps:
[0215] Conduct consistency checks on cross-chain business execution results;
[0216] If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain;
[0217] A cross-chain business termination request is sent to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit cross-chain termination certification information to the basic main chain, and submit cross-chain termination certification information to the business sub-chains they manage.
[0218] In one implementation, the computer instructions in the computer-readable storage medium 804 are loaded by the processor 801 and are further used to perform the following steps:
[0219] Conduct consistency checks on cross-chain business execution results;
[0220] If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain;
[0221] A cross-chain business termination request is sent to the sub-chain management nodes of the M-1 business sub-chains except the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain termination certification information to the basic main chain, and submit their respective cross-chain termination certification information to the M-1 business sub-chains.
[0222] In one implementation, when the computer instructions in the computer-readable storage medium 804 are loaded and executed by the processor 801 to perform a consistency check on the business execution results of the cross-chain business, the computer instructions are specifically used to perform the following steps:
[0223] Obtaining the business execution results in the first business subchain;
[0224] Send a business execution result acquisition request to the subchain management nodes of M-1 business subchains other than the first business subchain; the subchain management nodes of the M-1 business subchains respond to the business execution result acquisition request, obtain the business execution results in the M-1 business subchains, and send the acquired business execution results to the first subchain management node;
[0225] Compare the business execution results in M business sub-chains;
[0226] If the business execution results in the M business subchains are the same, the consistency check is determined to have passed;
[0227] If the business execution results in the M business sub-chains are different, the cross-chain business will be rolled back.
[0228] In one implementation, the computer instructions in the computer-readable storage medium 804 are loaded by the processor 801 and are further used to perform the following steps:
[0229] Receive business execution requests from business nodes in the business network or proxy nodes in the routing proxy network; the business network, routing proxy network, and core consensus network are all subnetworks of the blockchain network. The routing proxy network is used to forward requests from the business network to the core consensus network;
[0230] If the business execution request includes the subchain identifiers of M business subchains, it is determined that cross-chain business needs to be executed between the M business subchains.
[0231] In an embodiment of the present application, the blockchain network includes a core consensus network in which a basic main chain and multiple business sub-chains derived from the basic main chain run. The multiple business sub-chains are used to manage different businesses, and each business sub-chain has its own sub-chain management node; when it is necessary to execute cross-chain business between some of the business sub-chains in the multiple business sub-chains, the sub-chain management nodes of some of the business sub-chains can submit cross-chain start proof information related to the cross-chain business to the basic main chain after negotiating the cross-chain business, and the sub-chain management nodes of any business sub-chain in some of the business sub-chains can obtain the cross-chain business start information from the basic main chain and execute the cross-chain business based on the cross-chain business start information; after determining that the cross-chain business is completed, the sub-chain management nodes of some of the business sub-chains can submit cross-chain end proof information related to the cross-chain business to the basic main chain, and the sub-chain management nodes of any business sub-chain in some of the business sub-chains can obtain the cross-chain business start information from the basic main chain; the cross-chain start proof information and cross-chain end proof information in the basic main chain can be used to confirm the cross-chain business. From the above content, it can be seen that cross-chain business refers to business that needs to interact between businesses managed by different business sub-chains. The embodiment of the present application can realize cross-chain business interaction with the help of the basic main chain, and can confirm the cross-chain business with the help of the cross-chain start proof information and cross-chain start and end information in the basic main chain, so that the cross-chain business is reliable and trustworthy. It can be further seen that the embodiment of the present application can reliably carry out business interaction in the blockchain network.
[0232] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the cross-chain interaction method based on a blockchain network provided in any of the above-described optional embodiments.
[0233] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A cross-chain interaction method based on a blockchain network, characterized in that: The blockchain network includes a core consensus network, in which a basic main chain and N business subchains derived from the basic main chain run, where N is an integer and N≥2; the N business subchains are respectively used to manage different businesses, and each business subchain has its own subchain management node; the method is executed by a first subchain management node, which is used to manage a first business subchain; the method includes: If a cross-chain business needs to be performed between M of the N business sub-chains, cross-chain start proof information related to the cross-chain business is obtained from the basic main chain. The cross-chain start proof information refers to the transaction used to prove the start of the cross-chain business. The cross-chain start proof information at least includes a cross-chain start tag and the sub-chain identifiers of the M business sub-chains; the cross-chain start proof information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after negotiating the cross-chain business. The first business sub-chain is any one of the M business sub-chains, M is an integer and 2≤M≤N; wherein, The process of the sub-chain management nodes of the M business sub-chains negotiating the cross-chain business includes: submitting the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submitting the cross-chain start proof information of the first sub-chain management node to the first business sub-chain; sending a cross-chain business start request to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; the sub-chain management nodes of the M-1 business sub-chains submitting their respective cross-chain start proof information to the basic main chain in response to the cross-chain business start request, and submitting their respective cross-chain start proof information to the M-1 business sub-chains; Executing the cross-chain business based on the cross-chain start proof information; After the cross-chain business is completed, cross-chain completion certification information related to the cross-chain business is obtained from the basic main chain. The cross-chain completion certification information refers to the transaction used to certify the completion of the cross-chain business. The cross-chain completion certification information at least includes a cross-chain completion tag and the sub-chain identifiers of the M business sub-chains. The cross-chain completion certification information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after determining that the cross-chain business is completed. The cross-chain start certification information and cross-chain completion certification information in the basic main chain are used to confirm the cross-chain business.
2. The method according to claim 1, wherein The executing the cross-chain business based on the cross-chain start proof information includes: Verify the cross-chain start proof information; the sub-chain management nodes of the M-1 business sub-chains other than the first business sub-chain among the M business sub-chains obtain the cross-chain start proof information from the basic main chain, verify the cross-chain start proof information, and send the first verification result obtained by verification to the first sub-chain management node; Receive the first verification results sent by the sub-chain management nodes of the M-1 business sub-chains, and count the first number of first verification results that pass the verification; If the first sub-chain management node verifies the cross-chain start proof information and the first number is greater than the first number threshold, the cross-chain business is executed.
3. The method according to claim 2, wherein The executing of the cross-chain business includes: Obtaining a cross-chain business smart contract related to the cross-chain business from the first business sub-chain; Calling the cross-chain business smart contract to execute the cross-chain business; Upload the business execution results of the cross-chain business to the first business sub-chain.
4. The method according to claim 2, wherein The number of cross-chain start proof information is M, and any cross-chain start proof information includes the sub-chain identifiers and cross-chain interaction credentials of the M business sub-chains; the verification of the cross-chain start proof information includes: Perform a matching check on the subchain identifiers in the M cross-chain start proofs; If the subchain identifiers in the M cross-chain start proofs all match, then the legitimacy of the cross-chain interaction credentials in the M cross-chain start proofs is checked; If the cross-chain interaction credentials in the M cross-chain start proof information are all legal, it is determined that the verification of the M cross-chain start proof information is passed.
5. The method according to claim 2, wherein The verifying of the cross-chain start proof information includes: Send the cross-chain start proof information to other sub-chain management nodes of the first business sub-chain for verification. The other sub-chain management nodes refer to nodes in the core consensus network other than the first sub-chain management node that are used to manage the first business sub-chain; Receive a second verification result of the other sub-chain management node on the cross-chain start proof information, and count a second number of the second verification results that pass the verification; If the second number is greater than a second number threshold, it is determined that the verification of the cross-chain start proof information is passed.
6. The method according to claim 1, wherein The main chain management node in the core consensus network is used to manage the basic main chain; submitting the cross-chain start proof information of the first sub-chain management node to the basic main chain includes: Send the cross-chain start proof information of the first sub-chain management node to the main chain management node; after the main chain management node reaches a consensus on the cross-chain start proof information of the first sub-chain management node, upload the cross-chain start proof information of the first sub-chain management node to the basic main chain.
7. The method according to claim 1, wherein The method further comprises: Perform consistency checks on the execution results of the cross-chain business; If the consistency check passes, the cross-chain completion certification information of the first sub-chain management node is submitted to the basic main chain, and the cross-chain completion certification information of the first sub-chain management node is submitted to the first business sub-chain; A cross-chain business termination request is sent to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; in response to the cross-chain business termination request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain termination certification information to the basic main chain, and submit their respective cross-chain termination certification information to the M-1 business sub-chains.
8. The method according to claim 7, wherein The consistency check on the business execution results of the cross-chain business includes: Obtaining the service execution results in the first service subchain; Send a service execution result acquisition request to the subchain management nodes of M-1 business subchains other than the first business subchain; the subchain management nodes of the M-1 business subchains respond to the service execution result acquisition request, acquire the service execution results in the M-1 business subchains, and send the acquired service execution results to the first subchain management node; Comparing the business execution results in the M business sub-chains; If the service execution results in the M service subchains are the same, it is determined that the consistency check has passed; If the business execution results in the M business sub-chains are different, the cross-chain business will be rolled back.
9. The method according to claim 1, wherein The method further comprises: Receiving a service execution request sent by a service node in a service network or a proxy node in a routing proxy network; the service network, the routing proxy network, and the core consensus network are all subnetworks of the blockchain network, and the routing proxy network is used to forward the request in the service network to the core consensus network; If the business execution request includes the subchain identifiers of the M business subchains, it is determined that cross-chain business needs to be executed between the M business subchains.
10. A cross-chain interaction device based on a blockchain network, characterized in that: The blockchain network includes a core consensus network, in which a basic main chain and N business subchains derived from the basic main chain run, where N is an integer and N≥2; the N business subchains are respectively used to manage different businesses, and each business subchain has its own subchain management node; the cross-chain interaction device is set in the first subchain management node, and the first subchain management node is used to manage the first business subchain; the cross-chain interaction device includes: an acquisition unit, configured to acquire cross-chain start proof information related to the cross-chain business from the basic main chain if a cross-chain business needs to be executed between M business subchains among the N business subchains, wherein the cross-chain start proof information refers to a transaction used to prove the start of the cross-chain business, and the cross-chain start proof information at least includes a cross-chain start tag and the subchain identifiers of the M business subchains; the cross-chain start proof information is submitted to the basic main chain by the subchain management nodes of the M business subchains after negotiating the cross-chain business, the first business subchain is any one of the M business subchains, M is an integer and 2≤M≤N; In the process of negotiating the cross-chain business by the sub-chain management nodes of the M business sub-chains, the process includes: submitting the cross-chain start proof information of the first sub-chain management node to the basic main chain, and submitting the cross-chain start proof information of the first sub-chain management node to the first business sub-chain; sending a cross-chain business start request to the sub-chain management nodes of M-1 business sub-chains other than the first business sub-chain; in response to the cross-chain business start request, the sub-chain management nodes of the M-1 business sub-chains submit their respective cross-chain start proof information to the basic main chain, and submitting their respective cross-chain start proof information to the M-1 business sub-chains; A processing unit, configured to execute the cross-chain business based on the cross-chain start proof information; The acquisition unit is further configured to obtain, after the cross-chain business is completed, cross-chain completion certification information related to the cross-chain business from the basic main chain, wherein the cross-chain completion certification information refers to a transaction used to certify the completion of the cross-chain business, and the cross-chain completion certification information at least includes a cross-chain completion tag and the sub-chain identifiers of the M business sub-chains; the cross-chain completion certification information is submitted to the basic main chain by the sub-chain management nodes of the M business sub-chains after determining that the execution of the cross-chain business is completed; the cross-chain start certification information and cross-chain completion certification information in the basic main chain are used to confirm the cross-chain business.
11. A computer device based on a blockchain network, characterized in that: The blockchain network includes a core consensus network, which runs a basic main chain and N business sub-chains derived from the basic main chain, where N is an integer and N ≥ 2; the N business sub-chains are respectively used to manage different businesses, and each business sub-chain has its own sub-chain management node; The computer device is a first sub-chain management node, which is used to manage the first business sub-chain; the computer device includes: a processor suitable for implementing a computer program; A computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by the processor and executing the cross-chain interaction method based on the blockchain network according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded by a processor and executing the cross-chain interaction method based on a blockchain network as described in any one of claims 1 to 9.
13. A computer program product, characterized in that The computer program product includes computer instructions, which, when executed by a processor, implement the cross-chain interaction method based on a blockchain network as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Power service cross-domain credible authentication system and method based on blockchain
CN111654465A
Business processing method and device for block chain, computer equipment and storage medium
CN113422733A