Block chain cross-chain method, medium and equipment
By deploying relay chains and cross-chain nodes in the blockchain system, the problems of heterogeneous chain identity authentication and access control and contract atomic calls are solved, cross-chain data interoperability and trust are realized, and high security and scalability are achieved.
Patent Information
- Application Number
- CN202411893046.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing cross-chain technologies are difficult to effectively solve the problems of identity authentication and access control between different heterogeneous chains, as well as the atomicity of cross-chain contract calls.
By deploying relay chains and cross-chain nodes, cross-chain identity management and contract atomic calls are realized. Specific steps include deploying the application chain, registering cross-chain identity, applying for cross-chain certificates and licenses, registering and forwarding cross-chain requests, verification and execution of cross-chain operations, confirming the final status, etc.
Identity and permission management in the cross-chain process is realized, the consistency of data state and atomic calls of contracts are ensured, and high security and scalability are achieved.
Smart Images

Figure CN119766415A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain cross-chain method, medium and device. Background Art
[0002] Cross-chain technology aims to connect homogeneous or heterogeneous blockchains and realize interaction between different chains. It is an important means to open up information channels in different blockchain systems, realize information sharing between blockchains, maximize the integration and utilization of blockchain resources, and increase the scalability of blockchain technology. It is a key technology to further promote the construction of the blockchain system ecology, accelerate the implementation of more applications, and promote the development of the digital economy.
[0003] At present, existing cross-chain technologies are difficult to effectively solve the identity authentication and access control problems between different heterogeneous chains, as well as the atomicity problems of cross-chain contract calls.
[0004] Therefore, a cross-chain architecture integration solution is needed that is easy to deploy, supervision-friendly, safe and controllable, can realize the identity and authority management of application chain administrator nodes and application chain users, and achieve data status consistency and atomic contract calls between the two parties during the cross-chain process, and has a certain degree of scalability. Summary of the invention
[0005] The present invention provides a blockchain cross-chain method, medium and device, which can break the barriers between chains without changing the original application chain structure, realize data interoperability and trust issues between different application chains, and ensure the atomicity of contract calls.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present application provides a blockchain cross-chain method, the method comprising:
[0008] S1, deploy the first application chain, the second application chain and the relay chain;
[0009] S2, the administrator nodes of the first application chain and the second application chain respectively register the cross-chain business of the chain with the relay chain, and respectively deploy the business management contract of the cross-chain business;
[0010] S3, the on-chain nodes of the first application chain and the second application chain each register a cross-chain identity with the relay chain, become a cross-chain node, apply for a cross-chain certificate and cross-chain permission, and register a cross-chain route;
[0011] S4: The source application chain user of one of the first application chain and the second application chain initiates a cross-chain request to the business management contract of the current chain. The source application chain cross-chain node registers the cross-chain request with the relay chain. After confirmation by the relay chain, the cross-chain request is forwarded to the destination application chain. The destination application chain is the application chain of the first application chain and the second application chain that is different from the source application chain.
[0012] S5, the destination application chain cross-chain node verifies the cross-chain permission of the source application chain cross-chain node according to the cross-chain request, and executes the cross-chain operation after it is correct to obtain the cross-chain operation result;
[0013] S6, the destination application chain signs the cross-chain operation result and submits the cross-chain operation result and signature to the relay chain, so that the relay chain can send the cross-chain operation result and signature to the source application chain cross-chain node according to the cross-chain routing of the source application chain and the destination application chain cross-chain node;
[0014] S7, the cross-chain node of the source application chain verifies the legitimacy of the signature and confirms the result of the cross-chain operation after it is correct;
[0015] S8, the relay chain administrator completes the final status confirmation of the cross-chain operation based on the confirmation results of the cross-chain nodes of the source application chain and the destination application chain, or notifies the cross-chain nodes of the source application chain and the destination application chain to perform compensation operations when the cross-chain request times out or the communication fails.
[0016] In one implementation, in S2, it includes:
[0017] Deploy the first application chain and the second application chain through containerization technology, and deploy an additional blockchain that is the same as the first application chain as the relay chain;
[0018] The first and second application chain administrator nodes access the relay chain cross-chain management service interface, apply for the unique chain ID of the chain, and register the cross-chain business on their respective application chains, including business description, business contract address, business interface and parameter requirements, and bind them with the unique chain ID;
[0019] The first and second application chain administrator nodes deploy business management contracts on the application chain.
[0020] In one implementation, the first application chain is the Fabric blockchain, and the second application chain is the FiscoBCOS blockchain.
[0021] In one implementation, the S3 includes:
[0022] The first and second application chain nodes interact with the relay chain certificate authority and provide their own identity information on the application chain for registration. The relay chain certificate authority divides the application chain nodes into different levels according to the identity information provided by the application chain nodes and uses the root certificate to issue hierarchical cross-chain certificates on the relay chain.
[0023] The first and second application chain nodes interact with the relay chain certificate authority and use the hierarchical cross-chain certificate to apply for a time-effective cross-chain license. The relay chain certificate authority signs the application chain node identity and the license expiration time, and issues it to the application chain node as a cross-chain license.
[0024] The first and second application chain nodes access the relay chain cross-chain management service interface, register their own cross-chain routes, including IP addresses and port numbers, and bind them to the registered cross-chain identities;
[0025] Any application chain node monitors the events generated by the business management contract to respond to user cross-chain requests.
[0026] In one implementation, the S4 specifically includes:
[0027] The source application chain user accesses the relay chain cross-chain management service interface to query the unique chain ID of the destination application chain and the cross-chain business information provided;
[0028] The source application chain user initiates a cross-chain request to the business management contract;
[0029] The source application chain cross-chain node monitors the business management contract events, obtains the cross-chain request submitted by the user and parses it. Check whether the content is legal. If not, mark the cross-chain request as failed in the business management contract.
[0030] The source application chain cross-chain node checks whether the cross-chain license has expired. If it has expired, it re-applies for a new cross-chain license for renewal;
[0031] The source application chain cross-chain node accesses the relay chain cross-chain management service interface based on the parsed destination application chain ID, queries the cross-chain routes registered by the destination application chain, and randomly selects one of the available routes as the cross-chain destination route;
[0032] The source application chain cross-chain node merges its own cross-chain route, destination cross-chain route, cross-chain identity, cross-chain permission and the parsed cross-chain request content to obtain a complete cross-chain request, signs the complete cross-chain request, packages the signature with the complete cross-chain request, and accesses the relay chain cross-chain management service interface for registration;
[0033] The relay chain cross-chain management service verifies whether the submitted complete cross-chain request is legal, and verifies whether the cross-chain identity of the source application chain cross-chain node complies with the access control rules. It confirms the legal cross-chain request and the cross-chain identity that complies with the rules, and informs the corresponding source application chain cross-chain node; if the relay chain confirmation fails, the source application chain cross-chain node directly marks the cross-chain request as failed in the business management contract; if the relay chain confirmation succeeds, the complete cross-chain request is forwarded according to the cross-chain route.
[0034] In one implementation, the S5 includes:
[0035] After receiving the complete cross-chain request, the destination application chain cross-chain node parses and obtains the destination cross-chain route corresponding to the cross-chain request, the cross-chain identity of the source application chain cross-chain node, the cross-chain permission and the signature;
[0036] The destination application chain cross-chain node first verifies whether the cross-chain destination route corresponding to the request is itself, then verifies whether the cross-chain identity of the source chain cross-chain node is legal and whether the cross-chain license is within the validity period through the relay chain root certificate, and finally verifies whether the signature data is correct. If any of the above three verifications has a problem, an error message will be returned to the source application chain cross-chain node;
[0037] According to the specific information of the cross-chain request obtained through analysis, the business management contract is called to register the cross-chain request, and the business management contract completes the cross-chain operation and feeds back the cross-chain execution result to the cross-chain node of the destination application chain.
[0038] In one implementation, the S6 specifically includes:
[0039] The cross-chain node of the target application chain signs the cross-chain result using the hierarchical cross-chain certificate, packages the signature and the result, and accesses the cross-chain management service interface of the relay chain to submit the cross-chain result;
[0040] The destination application chain cross-chain node returns the packaging result to the source application chain cross-chain node according to the cross-chain source routing.
[0041] In one implementation, the S7 specifically includes:
[0042] The source application chain cross-chain node parses the received cross-chain result and verifies the signature of the destination application chain cross-chain node through the relay chain root certificate;
[0043] If the signature verification is successful, the source application chain cross-chain node will record the cross-chain result in the business management contract, and use the hierarchical cross-chain certificate to sign the cross-chain result through the ECDSA algorithm, package the signature and the result, and access the relay chain cross-chain management service interface to submit the cross-chain result;
[0044] If the signature verification fails, an error message will be returned to the target application chain cross-chain node, and the signature verification failure information will beIt is recorded in the business management contract. At the same time, the hierarchical cross-chain certificate is used to sign the cross-chain result and signature verification failure information through the ECDSA algorithm, and the relay chain cross-chain management service interface is accessed to submit the cross-chain result.
[0045] In one implementation, the S8 specifically includes:
[0046] The relay chain administrator queries all unfinished cross-chain requests recorded on the current relay chain;
[0047] The relay chain administrator checks for each cross-chain request that is queried whether the result upload and signature information of the cross-chain nodes of both parties have been obtained. If so, the cross-chain identity certificates of the cross-chain nodes of both parties are used to verify the signatures of both parties. If either party fails to upload the cross-chain result and signature or the signature verification of either party fails, the request will not be processed;
[0048] For cross-chain requests with successful signature verification by both parties, the relay chain will make a final confirmation of the result and check whether both parties have reached an agreement on the cross-chain result. If they agree, the cross-chain request is considered to have been executed successfully. Otherwise, the cross-chain request is considered to have failed. The relay chain administrator uses the root certificate to sign the cross-chain result using the ECDSA algorithm to record the result on the relay chain and mark the cross-chain request as completed.
[0049] For cross-chain requests that have exceeded the time limit, the relay chain administrator marks them as timed out and considers that the cross-chain request has failed.
[0050] In a second aspect, the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the device where the processor is located implements the blockchain cross-chain method of the first aspect.
[0051] The technical solution of the present invention and the proposed method have the following advantages:
[0052] 1. The present invention adopts a cross-chain architecture design based on relay chains and cross-chain nodes. It can manage the identity information of each application chain node and record cross-chain requests with the help of relay chains to achieve supervision of the cross-chain process. At the same time, the architecture of the present invention does not require modification of the application chain, has low intrusiveness and high versatility, and can adapt to cross-chain scenarios of multiple application chains.
[0053] 2. The present invention realizes the identity and authority management of application chain administrator nodes and application chain users through the dual identity management mode of cross-chain permission and cross-chain certificate, and verifies them in the cross-chain process to realize trust transfer between different application chains, with strong security and reliability.
[0054] 3. The present invention participates in the final confirmation of cross-chain requests through the relay chain, establishes an interactive protocol between the relay chain and the cross-chain nodes of the application chain, and judges the final status of the cross-chain call based on the results and signatures submitted by both parties of the cross-chain, which can effectively ensure the consistency of the data status of both parties in the cross-chain process and the atomicity of the contract call.
[0055] In summary, the present invention can be widely used in the cross-chain field of blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of step 1) of a method provided by an embodiment of the present invention;
[0057] Figure 2 is a flow chart of step 2) of the method provided by one embodiment of the present invention;
[0058] Figure 3 is a flow chart of step 3) of the method provided by one embodiment of the present invention;
[0059] Figure 4 is a flow chart of step 4) of the method provided by one embodiment of the present invention;
[0060] Figure 5 is a flow chart of step 5) of the method provided by one embodiment of the present invention;
[0061] Figure 6 is a flow chart of step 6) of the method provided by one embodiment of the present invention;
[0062] Figure 7 is a flow chart of step 7) of a method provided by an embodiment of the present invention;
[0063] Figure 8 It is a schematic diagram of the system architecture provided by Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0065] In view of the defects and problems of the prior art, the present application provides a blockchain cross-chain method, the method comprising:
[0066] S1, deploy the first application chain, the second application chain and the relay chain;
[0067] S2, the administrator nodes of the first application chain and the second application chain respectively register the cross-chain business of the chain with the relay chain, and respectively deploy the business management contract of the cross-chain business;
[0068] S3, the on-chain nodes of the first application chain and the second application chain each register a cross-chain identity with the relay chain, become a cross-chain node, apply for a cross-chain certificate and cross-chain permission, and register a cross-chain route;
[0069] S4: The source application chain user of one of the first application chain and the second application chain initiates a cross-chain request to the business management contract of the current chain. The source application chain cross-chain node registers the cross-chain request with the relay chain. After confirmation by the relay chain, the cross-chain request is forwarded to the destination application chain. The destination application chain is the application chain of the first application chain and the second application chain that is different from the source application chain.
[0070] S5, the destination application chain cross-chain node verifies the cross-chain permission of the source application chain cross-chain node according to the cross-chain request, and executes the cross-chain operation after it is correct to obtain the cross-chain operation result;
[0071] S6, the destination application chain signs the cross-chain operation result and submits the cross-chain operation result and signature to the relay chain, so that the relay chain can send the cross-chain operation result and signature to the source application chain cross-chain node according to the cross-chain routing of the source application chain and the destination application chain cross-chain node;
[0072] S7, the cross-chain node of the source application chain verifies the legitimacy of the signature and confirms the result of the cross-chain operation after it is correct;
[0073] S8, the relay chain administrator completes the final status confirmation of the cross-chain operation based on the confirmation results of the cross-chain nodes of the source application chain and the destination application chain, or notifies the cross-chain nodes of the source application chain and the destination application chain to perform compensation operations when the cross-chain request times out or the communication fails.
[0074] The process of the method of the present application is specifically described below in a more detailed embodiment in conjunction with the drawings of the present application.
[0075] In a more detailed embodiment of the present application, the first application chain is the Fabric blockchain, and the second application Chain for Fisco BCOS, the relay chain is an example of Fabric.
[0076] like Figure 1 As shown, this embodiment provides a cross-chain method between Fabric and Fisco BCOS blockchain, including the following steps:
[0077] 1) Deploy two application chains, Fabric and Fisco BCOS, and deploy an additional Fabric as a relay chain to provide cross-chain management services, including cross-chain request management and identity authority management; the application chain administrator nodes each register the cross-chain services provided by the chain on the relay chain, and each deploys a business management contract, specifically:
[0078] 1.1) Deploy two application chains, Fabric and Fisco BCOS, through containerization technology, and deploy an additional Fabric as a relay chain, and provide cross-chain management services on the relay chain.
[0079] For example: deploy the Fabric blockchain through a Docker container, deploy a cross-chain management service in the form of chain code, and expose the corresponding service interface to the outside, including but not limited to cross-chain request result registration, cross-chain request confirmation, identity authority verification and other functional interfaces.
[0080] 1.2) The application chain administrator node accesses the relay chain cross-chain management service interface, applies for the unique chain ID of the application chain, and registers the cross-chain business on the application chain, including business description, business contract address, business interface and parameter requirements, and binds it to the chain ID.
[0081] For example: the administrator of the Fisco BCOS application chain accesses the relay chain cross-chain management service interface, applies for the chain ID FiscoBCOS-960-1693978451193541354-402b6ba1-e352-4885-b5a2-2831b3571832, and registers the bill cross-chain business. Its business contract address is 0x481D3A1dcD72cD618Ea768b3FbF69D78B46995b0. One of the business interfaces is IssueBill, and the receiving parameters are 3 string variables and 1 integer variable.
[0082] 1.3) The application chain administrator node deploys a business management contract on the application chain. The business management contract can record the cross-chain requests initiated by users and generate corresponding events. The application chain administrator node registers the chain ID applied in step 1.2) in the business management contract as the unique identifier of the application chain.
[0083] 2) The node on the application chain registers its cross-chain identity with the relay chain, becomes a cross-chain node, and applies for a hierarchical cross-chain certificate and cross-chain license issued by the relay chain certificate authority, registers its own cross-chain route and enables cross-chain services, specifically;
[0084] 2.1) The application chain node interacts with the relay chain certificate authority and provides its own identity information on the application chain for registration. The relay chain certificate authority divides the application chain node level according to the identity information provided by the application chain node and uses the root certificate to issue hierarchical cross-chain certificates on the relay chain.
[0085] Specifically, the root certificate of the relay chain certificate authority can issue a first-level cross-chain certificate, and the first-level cross-chain certificate can issue other levels of cross-chain certificates, and the complete issuance relationship can be obtained through certificate chain verification.
[0086] For example: Fisco BCOS application chain node accesses the relay chain Fabric CA and provides its address and identity description on the Fisco BCOS application chain, including but not limited to country, region, organization and other information. The relay chain Fabric CA issues its first-level cross-chain certificate based on the above content. The format is X.509, which identifies the identity of the node on the relay chain. This node passes through the first Cross-chain certificate, issue secondary cross-chain certificates to other nodes on the Fisco BCOS application chain, and hold The node of the secondary certificate can verify the validity of the secondary cross-chain certificate through the relay chain Fabric CA.
[0087] 2.2) The application chain node interacts with the relay chain certificate authority and uses the hierarchical cross-chain certificate in step 2.1) to apply for a time-effective cross-chain license. The relay chain certificate authority signs the application chain node identity and the license expiration time, and issues it to the application chain node as a cross-chain license.
[0088] For example: Fisco BCOS application chain node accesses the relay chain Fabric CA, provides its own X.509 format hierarchical cross-chain certificate, and applies for cross-chain permission. The relay chain Fabric CA uses the ECDSA algorithm to sign the hierarchical cross-chain certificate summary and expiration time of the root certificate, and returns the signature as a license to the Fisco BCOS application chain node. Among them, the elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7, and this elliptic curve parameter is called the Secp256k1 standard. This is an example, not limited to this.
[0089] 2.3) The application chain node accesses the relay chain cross-chain management service interface, registers its own cross-chain route, including the IP address and port number, and binds it to the cross-chain identity registered in step 2.1).
[0090] 2.4) The application chain node monitors the events generated by the business management contract and responds to user cross-chain requests at any time.
[0091] 3) The source application chain user initiates a cross-chain request to the business management contract. After receiving the request, the source application chain cross-chain node requests the cross-chain routing information of the destination application chain from the relay chain, adds its own routing information and identity information, and registers the cross-chain request with the relay chain. After the relay chain confirms that it is correct, it forwards the cross-chain request to the destination application chain. Specifically:
[0092] 3.1) The source application chain user accesses the relay chain cross-chain management service interface to query the chain ID of the destination application chain, the cross-chain services provided, and other related information.
[0093] 3.2) The source application chain user initiates a cross-chain request to the business management contract, submitting information including user address, cross-chain request ID, cross-chain request type, cross-chain source chain ID, cross-chain destination chain ID, cross-chain contract address, timestamp, cross-chain operation, and cross-chain operation parameter list.
[0094] 3.3) The source application chain cross-chain node monitors the business management contract events, obtains the cross-chain request submitted by the user in step 3.2) and parses it, checks whether its content is legal, and if not, directly marks the cross-chain request as failed in the business management contract.
[0095] For example, if a Fabric application chain cross-chain node monitors a Fabric user and initiates a cross-chain request with empty parameters, the cross-chain node will consider the request illegal and mark the request as failed in the business management contract.
[0096] 3.4) The source application chain cross-chain node checks whether the cross-chain license applied for in step 2.2) has expired. If it has expired, repeat step 2.2) and apply for a new cross-chain license for update.
[0097] 3.5) The source application chain cross-chain node accesses the relay chain cross-chain management service interface according to the destination application chain ID parsed in step 3.3), queries the cross-chain routes registered by the destination application chain, and randomly selects one of the available routes as the cross-chain destination route.
[0098] 3.6) The source application chain cross-chain node will route its own cross-chain route, the destination cross-chain route selected in step 3.5), The cross-chain identity registered in step 2.1), the cross-chain permission registered in step 2.2) and the cross-chain identity parsed in step 3.3) The cross-chain request contents are merged to obtain a complete cross-chain request, and the complete cross-chain request is signed. The signature is packaged with the complete cross-chain request, and the relay chain cross-chain management service interface is accessed for registration.
[0099] For example: Fabric application chain cross-chain nodes use the ECSDA algorithm to sign the complete cross-chain request, and register the signature and the complete cross-chain request together on the relay chain. Among them, the elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7, and this elliptic curve parameter is called the Secp256k1 standard. This is an example, but not limited to this.
[0100] 3.7) The relay chain cross-chain management service verifies whether the complete cross-chain request submitted in step 3.6) is legal, and verifies whether the cross-chain identity of the source application chain cross-chain node complies with the access control rules, confirms the legal cross-chain request and the cross-chain identity that complies with the rules, and informs the corresponding source application chain cross-chain node. If the relay chain fails to confirm, the source application chain cross-chain node directly marks the cross-chain request as failed in the business management contract; if the relay chain confirms successfully, the complete cross-chain request is forwarded according to the cross-chain route selected in step 3.5).
[0101] For example: The access control rule configured by the relay chain cross-chain management service is that only the first-level cross-chain nodes can perform cross-chain operations for bill business. A second-level Fabric cross-chain node submits a legal and complete cross-chain request. Although the content of the request passes the verification, due to its insufficient permissions and violation of the access control rules, the relay chain cross-chain management service will reject the registration request of the node.
[0102] 4) After receiving the complete cross-chain request, the cross-chain node of the destination application chain verifies the cross-chain permission of the cross-chain node of the source application chain. After it is correct, it registers the cross-chain request with the business management contract of the destination application chain, performs the corresponding cross-chain operation, and returns the cross-chain result, which is as follows:
[0103] 4.1) After receiving the complete cross-chain request, the destination application chain cross-chain node parses the destination cross-chain route corresponding to the cross-chain request, the cross-chain identity of the source application chain cross-chain node, the cross-chain permission and the signature.
[0104] 4.2) The destination application chain cross-chain node first verifies whether the cross-chain destination route corresponding to the request is itself, and then verifies whether the cross-chain identity of the source chain cross-chain node is legal and whether the cross-chain license is within the validity period through the relay chain root certificate. Finally, it verifies whether the signature data is correct. If any of the above three verifications has a problem, an error message will be returned to the source application chain cross-chain node.
[0105] 4.3) According to the specific information of the cross-chain request obtained in step 4.1), the business management contract is called to register this cross-chain request, and the business management contract completes the cross-chain operation and feeds back the cross-chain execution result to the cross-chain node of the destination application chain.
[0106] 5) The cross-chain node of the target application chain uses its own cross-chain identity to sign the cross-chain execution result, submits the execution result and signature of this cross-chain request to the relay chain, and returns the cross-chain result according to the cross-chain route, specifically:
[0107] 5.1) The target application chain cross-chain node uses the hierarchical cross-chain certificate in step 2.1) to sign the cross-chain result, package the signature and the result, and access the relay chain cross-chain management service interface to submit the cross-chain result;
[0108] For example, the Fabric cross-chain node uses its own X.509 hierarchical cross-chain certificate to sign the binary form of the cross-chain result through the ECDSA algorithm. The elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7. This ellipse The curve parameters are called the Secp256k1 standard, which is taken as an example but is not limited to this.
[0109] 5.2) The destination application chain cross-chain node returns the packaging result in step 5.1) to the source application chain cross-chain node according to the cross-chain source routing.
[0110] 6) After receiving the feedback result, the source application chain cross-chain node verifies whether the signature of the destination application chain cross-chain node is legal, confirms the execution result of this cross-chain request, and uploads it to the business management contract and relay chain after the signature verification is correct. Specifically:
[0111] 6.1) The source application chain cross-chain node parses the received cross-chain result and verifies the signature of the destination application chain cross-chain node in step 5.1) through the relay chain root certificate.
[0112] 6.2) If the signature verification in step 6.1) is successful, the source application chain cross-chain node records the cross-chain result in the business management contract, and uses the hierarchical cross-chain certificate in step 2.1) to sign the cross-chain result through the ECDSA algorithm, packages the signature and the result, and accesses the relay chain cross-chain management service interface to submit the cross-chain result.
[0113] For example: Fabric cross-chain nodes use their own X.509 hierarchical cross-chain certificates to sign the binary form of cross-chain results through the ECDSA algorithm, where the elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7. This elliptic curve parameter is called the Secp256k1 standard. This is an example, but not limited to this.
[0114] 6.3) If the signature verification fails in step 6.1), an error message is returned to the cross-chain node of the destination application chain, and the signature verification failure information is recorded in the business management contract. At the same time, the hierarchical cross-chain certificate in step 2.1) is used to sign the cross-chain result and signature verification failure information through the ECDSA algorithm, and the cross-chain management service interface of the relay chain is accessed to submit the cross-chain result;
[0115] For example: Fabric cross-chain nodes use their own X.509 hierarchical cross-chain certificates to sign the binary form of the cross-chain results and the verification error information string through the ECDSA algorithm. The elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7. This elliptic curve parameter is called the Secp256k1 standard. This is an example, but not limited to this.
[0116] 7) The relay chain administrator receives the confirmation of the cross-chain request from both parties, completes the final status confirmation of the cross-chain request based on the confirmation results of both parties, marks the cross-chain request as completed, and notifies both parties of the cross-chain to make compensation when the cross-chain request times out or fails, to ensure the atomicity of the cross-chain call, specifically:
[0117] 7.1) The relay chain administrator queries all unfinished cross-chain requests recorded on the current relay chain.
[0118] 7.2) The relay chain administrator checks for each cross-chain request queried in step 7.1) whether it has obtained the result upload and signature information of the cross-chain nodes of both parties. If so, the cross-chain identity certificates of both parties’ cross-chain nodes are used to verify the signatures of both parties. If either party fails to upload the cross-chain result and signature or the signature verification of either party fails, the request will not be processed.
[0119] 7.3) For cross-chain requests where the signatures of both parties are successfully verified, the relay chain will make a final confirmation of the result and check whether both parties have reached an agreement on the cross-chain result. If they agree, the cross-chain request is considered to have been executed successfully, otherwise, the cross-chain request is considered to have failed. The relay chain administrator uses the root certificate to check whether the cross-chain result is consistent through the ECDSA algorithm. Sign it. Recorded on the relay chain, and the cross-chain request is marked as completed.
[0120] For example: the relay chain administrator verifies the signature of a cross-chain request that has been successfully completed by both parties. After the signatures of both parties are valid, the root certificate is used to sign the cross-chain request ID and the binary form of the cross-chain result through the ECDSA algorithm, and recorded on the chain through the relay chain cross-chain management service interface. Among them, the elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7, and this elliptic curve parameter is called the Secp256k1 standard. This is an example, but not limited to this.
[0121] 7.4) For the cross-chain request that has exceeded the time limit in step 7.1), the relay chain administrator marks it as timed out and considers that the cross-chain request has failed to execute. The relay chain administrator traverses the timeout failure and the cross-chain request that failed to execute in step 7.3), and notifies the source application chain and the destination application chain of the cross-chain routing recorded by each cross-chain request to perform corresponding compensation processing to ensure the atomicity of the cross-chain call.
[0122] For example: the relay chain administrator obtains the current system timestamp and compares it with the timestamp in the cross-chain request. If the results of both parties in the cross-chain are not uploaded and signed within 10 minutes, the cross-chain request is considered to have timed out. The root certificate is used to sign the cross-chain request ID and timeout information through the ECDSA algorithm, and recorded on the chain through the relay chain cross-chain management service interface. After that, the cross-chain nodes of both parties are notified through the cross-chain route recorded in the cross-chain request that the cross-chain operation corresponding to the cross-chain request ID needs to be compensated, such as transaction rollback. Among them, the elliptic curve equation used by the ECDSA algorithm is y^2=x^3+7, and this elliptic curve parameter is called the Secp256k1 standard. This is an example, but not limited to this.
[0123] In another embodiment of the present application, a cross-chain system is also provided, including:
[0124] The cross-chain business module is used to complete the cross-chain business interaction between the hyperledger, Fisco BCOS, and the relay chain, and can connect other modules of the system. In terms of specific cross-chain business, the cross-chain business module includes the processing capabilities of cross-chain business, can interact with business contracts, and complete the addition, deletion, modification, and query of data. In terms of cross-chain identity management, the cross-chain business module can interact with the certificate service module to obtain root certificates, hierarchical cross-chain certificates, and cross-chain licenses. In terms of cross-chain data transmission, the cross-chain business module can interact with the communication processing module to complete the transmission of cross-chain requests and cross-chain results, promptly send the cross-chain requests to be forwarded on the cross-chain source chain, and record the results of the executed cross-chain requests to the cross-chain source chain, cross-chain destination chain, and relay chain.
[0125] The communication processing module is used to transmit data with the communication processing modules of other cross-chain nodes on the application chain, and transmit the complete cross-chain request and the cross-chain operation execution results returned by the other party. The communication processing module builds a basic network communication service, such as HTTPS communication service; it includes basic cryptographic functions, such as X.509 certificate parsing, ECDSA algorithm encryption and decryption, and can verify the signature in the cross-chain request, so as to interact with the cross-chain business module.
[0126] The certificate service module is used to provide a basis for identity authentication and hierarchical permission control in cross-chain scenarios. The certificate service module provides two aspects of identity management: on the one hand, it provides the cross-chain license required for cross-chain services, and on the other hand, it provides hierarchical cross-chain certificates to identify identities.
[0127] Cross-chain permission is a necessary qualification for cross-chain nodes in the system to provide cross-chain services and perform cross-chain operations. The cross-chain license is issued by the relay management module, bound to the hierarchical cross-chain certificate that identifies the identity, and set to expire. During the validity period of the cross-chain license, the cross-chain node holding the cross-chain license can perform corresponding cross-chain operations, and after the validity period expires, it is necessary to reapply.
[0128] Hierarchical certificates record more detailed identity information and are managed as cross-chain identity identifiers in the software. Multiple cross-chain nodes can be divided into different levels according to management needs. Based on hierarchical certificates, different levels of identity authentication can be provided to achieve complex permission control in cross-chain scenarios.
[0129] The relay management module is used to provide a trust source for identity authentication and hierarchical permission control in cross-chain scenarios, and interacts with the cross-chain source chain and destination chain on behalf of the relay chain. The relay management module holds the cross-chain root certificate, which is used by the relay chain administrator to issue cross-chain first-level cross-chain certificates and cross-chain permissions. At the same time, the module continuously polls the cross-chain requests and their results recorded on the relay chain, and confirms the final status of the cross-chain requests that have been executed by both parties of the cross-chain.
[0130] On the other hand, a computer-readable storage medium is also provided, which carries computer-readable program instructions for executing the blockchain cross-chain method.
[0131] In the several embodiments provided by the present invention, it should be understood that the disclosed method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0132] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the above-mentioned method of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0133] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A blockchain cross-chain method, characterized in that: The method comprises: S1, deploy the first application chain, the second application chain and the relay chain; S2, the administrator nodes of the first application chain and the second application chain respectively register the cross-chain business of the chain with the relay chain, and respectively deploy the business management contract of the cross-chain business; S3, the on-chain nodes of the first application chain and the second application chain each register a cross-chain identity with the relay chain, become a cross-chain node, apply for a cross-chain certificate and cross-chain permission, and register a cross-chain route; S4: The source application chain user of one of the first application chain and the second application chain initiates a cross-chain request to the business management contract of the current chain. The source application chain cross-chain node registers the cross-chain request with the relay chain. After confirmation by the relay chain, the cross-chain request is forwarded to the destination application chain. The destination application chain is the application chain of the first application chain and the second application chain that is different from the source application chain. S5, the destination application chain cross-chain node verifies the cross-chain permission of the source application chain cross-chain node according to the cross-chain request, and executes the cross-chain operation after it is correct to obtain the cross-chain operation result; S6, the destination application chain signs the cross-chain operation result and submits the cross-chain operation result and signature to the relay chain, so that the relay chain can send the cross-chain operation result and signature to the source application chain cross-chain node according to the cross-chain routing of the source application chain and the destination application chain cross-chain node; S7, the cross-chain node of the source application chain verifies the legitimacy of the signature and confirms the result of the cross-chain operation after it is correct; S8, the relay chain administrator completes the final status confirmation of the cross-chain operation based on the confirmation results of the cross-chain nodes of the source application chain and the destination application chain, or notifies the cross-chain nodes of the source application chain and the destination application chain to perform compensation operations when the cross-chain request times out or the communication fails.
2. The blockchain cross-chain method according to claim 1, characterized in that: In said S2, it includes: Deploy the first application chain and the second application chain through containerization technology, and deploy an additional blockchain that is the same as the first application chain as the relay chain; The first and second application chain administrator nodes access the relay chain cross-chain management service interface, apply for the unique chain ID of the chain, and register the cross-chain business on their respective application chains, including business description, business contract address, business interface and parameter requirements, and bind them with the unique chain ID; The first and second application chain administrator nodes deploy business management contracts on the application chain.
3. The blockchain cross-chain method according to claim 2, characterized in that: The first application chain is the Fabric blockchain, and the second application chain is the Fisco BCOS blockchain.
4. The blockchain cross-chain method according to claim 2, characterized in that: The S3 includes: The first and second application chain nodes interact with the relay chain certificate authority and provide their own identity information on the application chain for registration. The relay chain certificate authority divides the application chain nodes into different levels according to the identity information provided by the application chain nodes and uses the root certificate to issue hierarchical cross-chain certificates on the relay chain. The first and second application chain nodes interact with the relay chain certificate authority and use the hierarchical cross-chain certificate to apply for a time-effective cross-chain license. The relay chain certificate authority signs the application chain node identity and the license expiration time, and issues it to the application chain node as a cross-chain license. The first and second application chain nodes access the relay chain cross-chain management service interface, register their own cross-chain routes, including IP addresses and port numbers, and bind them to the registered cross-chain identities; Any application chain node monitors the events generated by the business management contract to respond to user cross-chain requests.
5. The blockchain cross-chain method according to claim 4, characterized in that: The S4 specifically includes: The source application chain user accesses the relay chain cross-chain management service interface to query the unique chain ID of the destination application chain and the cross-chain business information provided; The source application chain user initiates a cross-chain request to the business management contract; The source application chain cross-chain node listens to the business management contract events, obtains the cross-chain request submitted by the user and parses it, checks whether its content is legal, and directly marks the cross-chain request as failed in the business management contract if it is illegal; The source application chain cross-chain node checks whether the cross-chain license has expired. If it has expired, it re-applies for a new cross-chain license for renewal; The source application chain cross-chain node accesses the relay chain cross-chain management service interface based on the parsed destination application chain ID, queries the cross-chain routes registered by the destination application chain, and randomly selects one of the available routes as the cross-chain destination route; The source application chain cross-chain node merges its own cross-chain route, destination cross-chain route, cross-chain identity, cross-chain permission and the parsed cross-chain request content to obtain a complete cross-chain request, signs the complete cross-chain request, packages the signature with the complete cross-chain request, and accesses the relay chain cross-chain management service interface for registration; The relay chain cross-chain management service verifies whether the submitted complete cross-chain request is legal, and verifies whether the cross-chain identity of the source application chain cross-chain node complies with the access control rules. It confirms the legal cross-chain request and the cross-chain identity that complies with the rules, and informs the corresponding source application chain cross-chain node; if the relay chain confirmation fails, the source application chain cross-chain node directly marks the cross-chain request as failed in the business management contract; if the relay chain confirmation succeeds, the complete cross-chain request is forwarded according to the cross-chain route.
6. The blockchain cross-chain method according to claim 5, characterized in that: The S5 comprises: After receiving the complete cross-chain request, the destination application chain cross-chain node parses and obtains the destination cross-chain route corresponding to the cross-chain request, the cross-chain identity of the source application chain cross-chain node, the cross-chain permission and the signature; The destination application chain cross-chain node first verifies whether the cross-chain destination route corresponding to the request is itself, then verifies whether the cross-chain identity of the source chain cross-chain node is legal and whether the cross-chain license is within the validity period through the relay chain root certificate, and finally verifies whether the signature data is correct. If any of the above three verifications has a problem, an error message will be returned to the source application chain cross-chain node; According to the specific information of the cross-chain request obtained through analysis, the business management contract is called to register the cross-chain request, and the business management contract completes the cross-chain operation and feeds back the cross-chain execution result to the cross-chain node of the destination application chain.
7. The blockchain cross-chain method according to claim 6, characterized in that: The S6 specifically includes: The cross-chain node of the target application chain signs the cross-chain result using the hierarchical cross-chain certificate, packages the signature and the result, and accesses the cross-chain management service interface of the relay chain to submit the cross-chain result; The destination application chain cross-chain node returns the packaging result to the source application chain cross-chain node according to the cross-chain source routing.
8. The blockchain cross-chain method according to claim 7, characterized in that: The S7 specifically includes: The source application chain cross-chain node parses the received cross-chain result and verifies the signature of the destination application chain cross-chain node through the relay chain root certificate; If the signature verification is successful, the source application chain cross-chain node will record the cross-chain result in the business management contract, and use the hierarchical cross-chain certificate to sign the cross-chain result through the ECDSA algorithm, package the signature and the result, and access the relay chain cross-chain management service interface to submit the cross-chain result; If the signature verification fails, an error message will be returned to the cross-chain node of the destination application chain, and the signature verification failure information will be recorded in the business management contract. At the same time, the hierarchical cross-chain certificate will be used to sign the cross-chain result and signature verification failure information through the ECDSA algorithm, and the relay chain cross-chain management service interface will be accessed to submit the cross-chain result.
9. The blockchain cross-chain method according to claim 8, characterized in that: The S8 specifically includes: The relay chain administrator queries all unfinished cross-chain requests recorded on the current relay chain; The relay chain administrator checks for each cross-chain request that is queried whether the result upload and signature information of the cross-chain nodes of both parties have been obtained. If so, the cross-chain identity certificates of the cross-chain nodes of both parties are used to verify the signatures of both parties. If either party fails to upload the cross-chain result and signature or the signature verification of either party fails, the request will not be processed; For cross-chain requests with successful signature verification by both parties, the relay chain will make a final confirmation of the result and check whether both parties have reached an agreement on the cross-chain result. If they agree, the cross-chain request is considered to have been executed successfully. Otherwise, the cross-chain request is considered to have failed. The relay chain administrator uses the root certificate to sign the cross-chain result using the ECDSA algorithm to record the result on the relay chain and mark the cross-chain request as completed. For cross-chain requests that have exceeded the time limit, the relay chain administrator marks them as timed out and considers that the cross-chain request has failed.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the device where the processor is located implements the blockchain cross-chain method of any one of claims 1 to 9.
Citation Information
Patent Citations
Hybrid chain construction method based on CSCP
CN112583917A
Supervisable privacy protection cross-block chain system based on CP-ABE
CN113595735A
Alliance chain cross-chain-oriented identity authentication method
CN117335958A
Cross-blockchain method, device, and readable storage medium
WO2023088136A1