Cross-chain transaction method and system of block chain system

By adopting core chain and application chain architecture and cross-chain management contracts in the blockchain system, the cumbersome problems of cross-chain transaction permission management and verification are solved, and convenient permission management and efficient cross-chain transactions are achieved.

CN120124040APending Publication Date: 2025-06-10CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311688677.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing blockchain system is complicated in the management and verification of cross-chain transaction permissions, resulting in difficulty in frequent changes and maintenance.

Method used

Using an architecture of one core chain and multiple application chains, the core chain deploys cross-chain management contracts, which include verification engine modules and permission management modules. The verification engine module performs signature verification and permission verification on cross-chain transaction requests, and checks whether there is corresponding cross-chain transaction permissions in the permission management module. If there is, cross-chain transactions will be executed and the result will be returned.

Benefits of technology

It realizes convenient cross-chain transaction permission management and verification, avoids the problem of frequent changes in the core chain, and improves the security and efficiency of cross-chain transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124040A_ABST
    Figure CN120124040A_ABST
Patent Text Reader

Abstract

The invention provides a cross-chain transaction method and system of a block chain system, the block chain system comprises at least one core chain and a plurality of application chains, and a cross-chain management contract deployed by the core chain comprises a verification engine module and an authority management module; the method comprises the steps that a core link receives a cross-chain transaction request sent by a source application chain; the verification engine module queries whether a corresponding cross-chain transaction permission exists in a permission management module or not according to the cross-chain transaction request; if the cross-chain transaction authority does not exist, the core chain sends an authority verification failure notification to the source application chain; and if the cross-chain transaction permission exists, the core chain sends a permission verification success notification to the source application chain, and sends a cross-chain transaction request to the target application chain, so that the target application chain executes a cross-chain transaction by calling a target application chain contract according to the cross-chain transaction request, returns an execution result and sends the execution result to the source application chain. The method provided by the invention is used for conveniently managing and verifying the cross-chain transaction authority and executing the cross-chain transaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to blockchain technology, and in particular to a cross-chain transaction method and system of a blockchain system. Background Art

[0002] Blockchain is a chain data structure that combines data blocks in a sequential manner in chronological order. It is a distributed ledger that is tamper-proof and non-forgeable, with the participation of multiple parties and decentralized storage, and is cryptographically guaranteed. With the development of blockchain technology, various blockchains have become information islands, and the demand for cross-chain technology that interconnects various chains is becoming more and more urgent. Cross-chain refers to the bridge between platforms that connect the underlying architecture, data structure, network link and technical interface of different blockchains, which enables data on different platforms to be interoperable and solves key problems such as the inability of blockchains to be interconnected due to the underlying architecture, data structure, link network, interface technology, etc.

[0003] In the prior art, cross-chain transactions in blockchain systems involve the source chain directly sending cross-chain transaction requests to the target chain. The target chain verifies the cross-chain transaction authority based on the cross-chain transaction request and executes the cross-chain transaction after the verification is passed.

[0004] In the above scheme, each blockchain needs to store the cross-chain transaction permissions related to the chain and verify the cross-chain transaction permissions during the cross-chain transaction process. However, as the update of cross-chain transaction permissions will cause frequent changes in the blockchain itself, the verification and maintenance of cross-chain transaction permissions is very cumbersome. Summary of the invention

[0005] The present application provides a cross-chain transaction method and system for a blockchain system, which are used to conveniently manage and verify cross-chain transaction permissions and execute cross-chain transactions.

[0006] On the one hand, the present application provides a cross-chain transaction method of a blockchain system, wherein the blockchain system includes multiple blockchains, wherein the multiple blockchains include at least one core chain and multiple application chains, wherein the core chain is deployed with a cross-chain management contract for processing cross-chain transaction requests, wherein the cross-chain management contract includes a verification engine module and a permission management module, and wherein the method includes:

[0007] The core link receives a cross-chain transaction request sent by a source application chain, wherein the cross-chain transaction request requests execution of a cross-chain transaction from the source application chain to the target application chain;

[0008] The verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the permission management module stores multiple cross-chain transaction permissions; each cross-chain transaction permission corresponds to two application chains, which is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains.

[0009] If there is no cross-chain transaction permission, the core chain sends a permission verification failure notice to the source application chain; if there is a cross-chain transaction permission, the core chain sends a permission verification success notice to the source application chain, and sends the cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction by calling the target application chain contract according to the cross-chain transaction request and returns the execution result, and sends the execution result to the source application chain.

[0010] Optionally, before the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, it further includes:

[0011] The verification engine module performs signature verification on the cross-chain transaction request.

[0012] The verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including: if the verification passes, the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request.

[0013] After the verification engine module performs signature verification on the cross-chain transaction request, it further includes: if the verification fails, the core chain sends a signature verification failure notice to the source application chain.

[0014] Optionally, the cross-chain transaction request includes the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain; the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including:

[0015] According to the cross-chain transaction request, query whether there is a first cross-chain transaction permission in the permission management module; wherein, the identifiers of the two application chains in the first cross-chain transaction permission are respectively the identifier of the source application chain and the identifier of the target application chain in the cross-chain transaction request, and the contract names of the two application chains in the first cross-chain transaction permission are respectively the contract name of the source application chain and the contract name of the target application chain in the cross-chain transaction request.

[0016] Optionally, the cross-chain management contract further includes an application chain management module, and the method further includes:

[0017] The application chain management module receives a registration request sent by an application chain;

[0018] The application chain management module registers the application chain according to the registration request, records the identifier of the application chain, and returns the identifier to the application chain.

[0019] Optionally, the cross-chain management contract further includes a message processing module. When the verification engine module sends the cross-chain transaction request to the target application chain, it includes:

[0020] The message processing module checks whether the format of the cross-chain transaction request matches the target application chain;

[0021] If not, the message processing module converts the format of the cross-chain transaction request into a format that matches the target application chain.

[0022] On the other hand, the present application provides a blockchain system. The blockchain system includes multiple blockchains. The multiple blockchains include at least one core chain and multiple application chains. A cross-chain management contract for processing cross-chain transaction requests is deployed on the core chain. The cross-chain management contract includes a verification engine module and a permission management module;

[0023] The core chain is configured to receive a cross-chain transaction request sent by a source application chain. The cross-chain transaction request requests to execute a cross-chain transaction from the source application chain to a target application chain;

[0024] The verification engine module is configured to query whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the permission management module stores multiple cross-chain transaction permissions; each cross-chain transaction permission corresponds to two application chains and is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains;

[0025] The core chain is further configured to, if there is no cross-chain transaction permission, send a permission verification failure notice to the source application chain; if there is a cross-chain transaction permission, send a permission verification success notice to the source application chain, and send the cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction according to the cross-chain transaction request by calling the target application chain contract and returns the execution result, and sends the execution result to the source application chain.

[0026] Optionally, the verification engine module is further configured to:

[0027] Perform signature verification on the cross-chain transaction request;

[0028] Query whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including: if the verification passes, query whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request;

[0029] The core chain is further configured to send a signature verification failure notice to the source application chain if the verification fails.

[0030] Optionally, the cross-chain transaction request includes the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain; the verification engine module is specifically configured to:

[0031] Query whether there is a first cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the identifiers of the two application chains in the first cross-chain transaction permission are respectively the identifier of the source application chain and the identifier of the target application chain in the cross-chain transaction request, and the contract names of the two application chains in the first cross-chain transaction permission are respectively the contract name of the source application chain and the contract name of the target application chain in the cross-chain transaction request.

[0032] Optionally, the cross-chain management contract further includes an application chain management module for:

[0033] Receive a registration request sent by the application chain;

[0034] Register the application chain according to the registration request, record the identifier of the application chain, and return the identifier to the application chain.

[0035] Optionally, the cross-chain management contract further includes a message processing module for:

[0036] The message processing module checks whether the format of the cross-chain transaction request matches the target application chain;

[0037] If not, convert the format of the cross-chain transaction request to a format that matches the target application chain.

[0038] In the cross-chain transaction method and system of the blockchain system provided by this application, the blockchain system adopts a one-master-chain and multi-sub-chain architecture with one core chain and multiple application chains. The core chain deploys a cross-chain management contract for processing cross-chain transaction requests. The permission management module in the cross-chain management contract stores multiple permitted cross-chain transaction permissions. The verification engine module in the cross-chain management contract performs permission verification on the cross-chain transaction requests sent by the source application chain, queries whether there are corresponding cross-chain transaction permissions in the permission management module. If there are cross-chain transaction permissions, the core chain sends the cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction according to the cross-chain transaction request and returns the execution result. The core chain sends the execution result to the source application chain. By using the cross-chain management contract of the core chain as the processing module for cross-chain transaction requests, it is convenient to uniformly manage cross-chain transactions, and it can flexibly perform cross-chain transaction permission verification and execute cross-chain transactions between application chains. At the same time, the cross-chain management contract realizes the isolation of cross-chain transaction processing data from other data of the core chain, can avoid frequent changes to the core chain itself when cross-chain transaction permissions are updated, and conveniently manages cross-chain transaction permissions. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.

[0040] Figure 1 FIG. shows a schematic flow chart of the cross-chain transaction method of the blockchain system provided in Embodiment 1 of this application;

[0041] Figure 2 FIG. shows a schematic flow chart of the cross-chain transaction method of another blockchain system provided in Embodiment 1 of this application;

[0042] Figure 3 FIG. shows a schematic structural diagram of the blockchain system provided in Embodiment 2 of this application.

[0043] Through the above accompanying drawings, the clear embodiments of this application have been shown, and there will be more detailed descriptions hereinafter. These drawings and the textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of systems and methods consistent with some aspects of the present application as detailed in the appended claims.

[0045] The module in this application refers to a functional module or a logical module. It can be in software form, and its functions are realized by executing program code by a processor; it can also be in hardware form. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0046] Blockchain is a chain data structure that combines data blocks in a sequential manner in chronological order. It is a distributed ledger that is tamper-proof and non-forgeable, with the participation of multiple parties and decentralized storage, and is cryptographically guaranteed. With the development of blockchain technology, various blockchains have become information islands, and the demand for cross-chain technology that interconnects various chains is becoming more and more urgent. Cross-chain refers to the bridge between platforms that connect the underlying architecture, data structure, network link and technical interface of different blockchains, which enables data on different platforms to be interoperable and solves key problems such as the inability of blockchains to be interconnected due to the underlying architecture, data structure, link network, interface technology, etc.

[0047] In the prior art, cross-chain transactions in blockchain systems involve the source chain directly sending cross-chain transaction requests to the target chain. The target chain verifies the cross-chain transaction authority based on the cross-chain transaction request and executes the cross-chain transaction after the verification is passed.

[0048] In the above scheme, each blockchain needs to store the cross-chain transaction permissions related to the chain and verify the cross-chain transaction permissions during the cross-chain transaction process. However, as the update of cross-chain transaction permissions will cause frequent changes in the blockchain itself, the verification and maintenance of cross-chain transaction permissions is very cumbersome.

[0049] The cross-chain transaction method and system of the blockchain system provided in this application are intended to solve the above-mentioned technical problems.

[0050] In the cross-chain transaction method and system of the blockchain system provided by this application, the blockchain system adopts a one-master-chain and multi-sub-chain architecture with one core chain and multiple application chains. The core chain deploys a cross-chain management contract for processing cross-chain transaction requests. The permission management module in the cross-chain management contract stores multiple permitted cross-chain transaction permissions. The verification engine module in the cross-chain management contract performs permission verification on the cross-chain transaction requests sent by the source application chain, queries whether there are corresponding cross-chain transaction permissions in the permission management module. If there are cross-chain transaction permissions, the core chain sends a cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction according to the cross-chain transaction request and returns the execution result, and the core chain sends the execution result to the source application chain. By using the core chain cross-chain management contract as the processing module for cross-chain transaction requests, it is convenient to uniformly manage cross-chain transactions, and it can flexibly perform cross-chain transaction permission verification between application chains and execute cross-chain transactions. At the same time, the cross-chain management contract realizes the isolation of the data for cross-chain transaction processing from other data of the core chain, can avoid frequent changes to the core chain itself when cross-chain transaction permissions are updated, and conveniently manages cross-chain transaction permissions.

[0051] The following uses specific embodiments to exemplify the technical solutions of this application. These several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0052] Embodiment 1

[0053] This embodiment provides a cross-chain transaction method for a blockchain system. The blockchain system includes multiple blockchains, and the multiple blockchains include at least one core chain and multiple application chains. The core chain deploys a cross-chain management contract for processing cross-chain transaction requests. The cross-chain management contract includes a verification engine module and a permission management module. The method includes:

[0054] Figure 1 It is a schematic flowchart of the cross-chain transaction method for the blockchain system provided in an embodiment of this application. As Figure 1 shown, the cross-chain transaction method for the blockchain system provided in this embodiment may include:

[0055] S101, the core chain receives a cross-chain transaction request sent by the source application chain. The cross-chain transaction request requests to execute a cross-chain transaction from the source application chain to the target application chain;

[0056] S102, the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request. Among them, the permission management module stores multiple cross-chain transaction permissions; each cross-chain transaction permission corresponds to two application chains, and is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains;

[0057] S103. If there is no cross-chain transaction permission, the core chain sends a permission verification failure notice to the source application chain. If there is cross-chain transaction permission, the core chain sends a permission verification success notice to the source application chain and sends a cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction by calling the target application chain contract according to the cross-chain transaction request and returns the execution result, and sends the execution result to the source application chain.

[0058] In practical applications, the execution subject of this embodiment can be a blockchain system, which can be implemented by a computer program, such as application software, etc.; or, it can also be implemented as a medium storing relevant computer programs, such as a USB flash drive, a cloud disk, etc.; or, it can also be implemented by an entity device integrated or installed with relevant computer programs, such as a chip, a server, etc.

[0059] Specifically, the core chain acts as a relay chain, enabling cross-chain interconnection between application chains. When the source application chain requests a cross-chain transaction with the target application chain, it needs to use the core chain as a cross-chain gateway. The core chain receives the cross-chain transaction request sent by the source application chain and queries whether there is a corresponding cross-chain transaction permission in the permission management module for the source application chain to request a cross-chain transaction with the target application chain. Among them, the permission management module stores multiple cross-chain transaction permissions, and each cross-chain transaction permission corresponds to two application chains, which is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains. Exemplarily, if there is no cross-chain transaction permission, the core chain sends a permission verification failure notice to the source application chain; if there is cross-chain transaction permission, the core chain forwards the cross-chain transaction request to the target application chain, so that after the target application chain receives the cross-chain transaction request, it calls the contract on the corresponding target application chain to execute the cross-chain transaction and returns the execution result; the core chain sends the execution result to the source application chain.

[0060] In this example, the permission management module in the cross-chain management contract deployed on the core chain stores multiple permitted cross-chain transaction permissions. The verification engine module in the cross-chain management contract verifies the permission of the cross-chain transaction request sent by the source application chain and queries whether there is a corresponding cross-chain transaction permission in the permission management module. If there is cross-chain transaction permission, the core chain sends a cross-chain transaction request to the target application chain. By using the cross-chain management contract of the core chain as the processing module for cross-chain transaction requests, it is convenient to uniformly manage cross-chain transactions, and it can flexibly verify cross-chain transaction permissions between application chains and execute cross-chain transactions; at the same time, the cross-chain management contract realizes the isolation of cross-chain transaction processing data from other data of the core chain, and can avoid frequent changes to the core chain itself when cross-chain transaction permissions are updated, and conveniently manage cross-chain transaction permissions.

[0061] Further, in order to improve the security of cross-chain transactions, in one example, before the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, it further includes:

[0062] The verification engine module performs signature verification on the cross-chain transaction request;

[0063] The verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including: if the verification is passed, the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request;

[0064] After the verification engine module performs signature verification on the cross-chain transaction request, it further includes: if the verification fails, the core chain sends a signature verification failure notice to the source application chain.

[0065] Specifically, before the verification engine module performs permission verification on the cross-chain transaction request, it needs to first perform signature verification on the cross-chain transaction request. If the verification is passed, the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module; if the verification fails, the core chain sends a signature verification failure notice to the source application chain.

[0066] There are various ways of signature verification. Exemplarily, assume that the source application chain is application chain a, the target application chain is application chain b, the identifier of the application chain is chainid, the chainid of application chain a is A, the chainid of application chain b is B, and a cross-chain management contract fabric_verify.wasm is deployed on the core chain to manage cross-chain transactions between application chain a and application chain b. The message structure of the cross-chain transaction request Message from application chain a to application chain b can be:

[0067] Message{

[0068] from:A,

[0069] to:B,

[0070] signed_data:data,

[0071] …

[0072] }

[0073] The core chain receives the cross-chain transaction request Message sent by application chain a, calls the fabric_verify smart contract, and parses the signed_data in the cross-chain transaction request Message into the following structure:

[0074] pub struct SignedData{

[0075] pub data: String,

[0076] pub identity: String,

[0077] pub signature: String,

[0078] }

[0079] The verification engine module uses a signature verification function to verify the parsed structure. The signature verification function is as follows:

[0080] pub fn query_verify_fabric_signature(

[0081] data: String,

[0082] identity: String,

[0083] signature: String,

[0084] ) -> Result<bool, StdError> {

[0085] …

[0086] }

[0087] After the signature verification is completed, the core chain returns a bool value to the source application chain to indicate whether the signature verification is successful or failed.

[0088] In this example, the verification engine module performs signature verification on the cross-chain transaction request. After the signature verification passes, it queries whether there is a corresponding permission for the cross-chain transaction, effectively improving the security of cross-chain transactions.

[0089] In actual applications, there can be multiple ways to query whether there is a corresponding cross-chain transaction permission in the permission management module. In one example, the cross-chain transaction request includes the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain; the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including:

[0090] According to the cross-chain transaction request, query whether there is a first cross-chain transaction permission in the permission management module; among them, the identifiers of the two application chains in the first cross-chain transaction permission are respectively the identifier of the source application chain and the identifier of the target application chain in the cross-chain transaction request, and the contract names of the two application chains in the first cross-chain transaction permission are respectively the contract name of the source application chain and the contract name of the target application chain in the cross-chain transaction request.

[0091] Specifically, the permission management module stores cross-chain transaction permissions. Each cross-chain transaction permission may include a quadruple. For example, assume that a cross-chain transaction permission includes a quadruple of a first application chain identifier, a specified contract name on the first application chain, a second application chain identifier, and a specified contract name on the second application chain. Then, this cross-chain transaction permission indicates that the specified contract on the first application chain has the permission to execute cross-chain the specified contract on the second application chain. After receiving a cross-chain transaction request sent by the source application chain, the core chain queries whether there is a corresponding first cross-chain transaction permission in the permission management module based on the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain in the cross-chain transaction request. The first cross-chain transaction permission includes a quadruple of the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain.

[0092] For example, assume that the source application chain is application chain a, the target application chain is fabric application chain b, the identifier of the application chain is chainid, the chainid of application chain a is A, and the chainid of application chain b is B. A cross-chain management contract fabric_verify.wasm is deployed on the core chain to manage cross-chain transactions between application chain a and application chain b. The application chain management module in the smart contract will record two application chains with chainid A and chainid B.

[0093] Assume that the smart contract contractA deployed on application chain a has the permission to make a cross-chain call to the smart contract contractB on application chain b. In the fabric_verify contract, the permission management module will store the following rule for a cross-chain permission:

[0094] CrossChain{

[0095] from_chainid:A,

[0096] from_contract:contractA,

[0097] to_chainid:B,

[0098] to_contract:contractB,

[0099] }

[0100] Functions such as add_permission, delete_permission, query_permission, and change_permission are used in the permission management module to add, delete, query, and modify cross-chain transaction permissions.

[0101] The verification engine module queries in the permission management module whether there is a corresponding cross-chain transaction permission. The permission verification function in the verification engine module is as follows:

[0102] pub fn query_verify_fabric_permission(

[0103] from:String,

[0104] to:String,

[0105] data:String,

[0106] identity:String,

[0107] signature:String,

[0108] )->Result<bool,StdError>{

[0109] …

[0110] }

[0111] The cross-chain transaction permission is as follows:

[0112] CrossChain{

[0113] from_chainid:A,

[0114] from_contract:contractA,

[0115] to_chainid:B,

[0116] to_contract:contractB,

[0117] }

[0118] The verification engine module queries whether this cross-chain transaction permission exists. After the query is completed, the core chain returns a bool value to the source application chain indicating whether the permission verification is successful or not. If the verification is successful, the core chain sends the cross-chain transaction request to the target application chain. Based on the cross-chain transaction request, Application Chain B calls the contractB smart contract on Application Chain B and sends the execution result as a receipt to the core chain. After receiving the execution result, the core chain forwards it to Application Chain A.

[0119] In this example, based on the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain, it accurately queries in the permission management module whether there is a corresponding cross-chain transaction permission, effectively improving the security of cross-chain transactions.

[0120] Based on the above example, the application chain can be registered on the core chain to obtain an identifier that uniquely identifies the application chain. In one example, the cross-chain management contract further includes an application chain management module, and the method further includes:

[0121] The application chain management module receives a registration request sent by the application chain;

[0122] The application chain management module registers the application chain according to the registration request, records the identifier of the application chain, and returns the identifier to the application chain.

[0123] Specifically, the application chain management module of the core chain accepts the registration request sent by the application chain, registers the application chain based on the registration request, records the identifier of the application chain, and returns the identifier to the application chain. The application chain management module maintains and records the identifiers of the registered application chains, and can add new application chains (i.e., register application chains) or cancel application chains according to actual needs. For example, the application chain management module can use functions such as register_chain and delete_chain to add or delete registered application chains.

[0124] In this example, by registering the application chain through the application chain management module of the core chain and returning the identifier to the application chain, each application chain can be accurately determined according to the identifier, and it is convenient for unified management.

[0125] In a blockchain system architecture with one main chain and multiple sub-chains, the core chain as the main chain and the application chain as the sub-chain are often isomorphic chains, and the core chain can directly forward the cross-chain transaction request of the source application chain to the target application chain. However, in actual applications, in order to achieve unified control of blockchain services, the core chain can also access heterogeneous chains as application chains. In order to achieve adaptation to heterogeneous chains, in one example, the cross-chain management contract further includes a message processing module, and the verification engine module sends a cross-chain transaction request to the target application chain, including:

[0126] The message processing module checks whether the format of the cross-chain transaction request matches the target application chain;

[0127] If not, the message processing module converts the format of the cross-chain transaction request into a format that matches the target application chain.

[0128] Specifically, Figure 2 It is a schematic flowchart of a cross-chain transaction method for another blockchain system provided by an embodiment of the present application, as Figure 2As shown in the figure, when the source application chain requests a cross-chain transaction from the target application chain, the source application chain sends a cross-chain transaction request to the core chain. The core chain verifies the signature of the cross-chain transaction request through the deployed cross-chain management contract. If the signature verification fails, it returns a signature verification failure notice to the source application chain as a transaction receipt; if the signature verification passes, it verifies the permissions of the cross-chain transaction request. If the permission verification fails, it returns a permission verification failure notice to the source application chain as a transaction receipt; after the permission verification passes, it sends a cross-chain transaction request to the target application chain. Since application chains with different structures will adopt different message formats for contract calls, for example, when the Hyperledger Fabric application chain makes a contract call, the message format for executing the contract is {"Args":["contract name":"function name"]}. If the source application chain or the target application chain is a heterogeneous chain, the message parameters for executing the contract call in the cross-chain transaction request received by the target application chain will not match. Therefore, after the cross-chain transaction request passes the verification of the verification engine module, the message processing module checks whether the cross-chain contract call format in the cross-chain transaction request is acceptable to the target application chain. If the format does not match, it converts the cross-chain contract call format into a contract call form that the target application chain can execute. The core chain sends the converted cross-chain transaction request to the target application chain. The target application chain calls the specified contract according to the cross-chain transaction request to execute the cross-chain transaction and returns the execution result to the core chain as a transaction receipt. The core chain sends the transaction receipt to the source application chain. The smart contract can be upgraded and updated, such as adding or canceling application chains, changing cross-chain permissions, updating verification rules, updating message conversion formats, etc., according to actual needs, without changing the core chain itself, maintaining the flexibility of cross-chain processing.

[0129] In this example, by converting the cross-chain transaction request into a format matching the target application chain through the message processing module, it is possible to achieve the adaptation of heterogeneous chains and ensure the correct execution of cross-chain transactions.

[0130] In the cross-chain transaction method of the blockchain system provided in this embodiment, the blockchain system adopts a one-master and multi-subchain architecture with a core chain and multiple application chains. The core chain is deployed with a cross-chain management contract for processing cross-chain transaction requests. The permission management module in the cross-chain management contract stores multiple permitted cross-chain transaction permissions. The verification engine module in the cross-chain management contract performs permission verification on the cross-chain transaction request sent by the source application chain, queries whether there is a corresponding cross-chain transaction permission in the permission management module. If there is a cross-chain transaction permission, the core chain sends a cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction according to the cross-chain transaction request and returns the execution result, and the core chain sends the execution result to the source application chain. By using the cross-chain management contract of the core chain as the processing module for cross-chain transaction requests, it is convenient to uniformly manage cross-chain transactions, and it can flexibly perform cross-chain transaction permission verification between application chains and execute cross-chain transactions. At the same time, the cross-chain management contract realizes the isolation of cross-chain transaction processing data from other data of the core chain, can avoid frequent changes to the core chain itself when cross-chain transaction permissions are updated, and conveniently manages cross-chain transaction permissions.

[0131] Embodiment 2

[0132] Figure 3 It is a schematic structural diagram of a blockchain system provided in an embodiment of the present application. As Figure 3 shown, this embodiment provides a blockchain system. The blockchain system includes multiple blockchains, and the multiple blockchains include at least one core chain 300 and multiple application chains. The core chain 300 is deployed with a cross-chain management contract for processing cross-chain transaction requests. The cross-chain management contract includes a verification engine module 33 and a permission management module 32;

[0133] The core chain 300 is used to receive a cross-chain transaction request sent by the source application chain. The cross-chain transaction request requests to execute a cross-chain transaction from the source application chain to the target application chain;

[0134] The verification engine module 33 is used to query whether there is a corresponding cross-chain transaction permission in the permission management module 32 according to the cross-chain transaction request. Among them, the permission management module 32 stores multiple cross-chain transaction permissions; each cross-chain transaction permission corresponds to two application chains, and is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains;

[0135] The core chain 300 is further used to send a permission verification failure notice to the source application chain if there is no cross-chain transaction permission; if there is a cross-chain transaction permission, it sends a permission verification success notice to the source application chain and sends a cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction according to the cross-chain transaction request by calling the target application chain contract and returns the execution result, and sends the execution result to the source application chain.

[0136] In practical applications, the blockchain system can be implemented through computer programs, such as application software, etc.; or, it can also be implemented as a medium storing relevant computer programs, such as USB flash drives, cloud disks, etc.; or, it can also be implemented through an entity device integrated or installed with relevant computer programs, such as chips, servers, etc.

[0137] Specifically, the core chain 300 acts as a relay chain, enabling cross-chain interconnection of each application chain. When the source application chain requests a cross-chain transaction with the target application chain, it needs to use the core chain 300 as a cross-chain gateway. The core chain 300 receives the cross-chain transaction request sent by the source application chain and queries whether there is a corresponding cross-chain transaction permission in the permission management module 32 for the source application chain to request a cross-chain transaction with the target application chain; among them, the permission management module 32 stores multiple cross-chain transaction permissions, and each cross-chain transaction permission corresponds to two application chains, which is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains. Exemplarily, if there is no cross-chain transaction permission, the core chain 300 sends a permission verification failure notice to the source application chain; if there is a cross-chain transaction permission, the core chain 300 forwards the cross-chain transaction request to the target application chain, so that after the target application chain receives the cross-chain transaction request, it calls the corresponding contract on the target application chain to execute the cross-chain transaction and returns the execution result; the core chain 300 sends the execution result to the source application chain.

[0138] In this example, the permission management module in the cross-chain management contract deployed on the core chain stores multiple allowed cross-chain transaction permissions. The verification engine module in the cross-chain management contract verifies the permission of the cross-chain transaction request sent by the source application chain and queries whether there is a corresponding cross-chain transaction permission in the permission management module. If there is a cross-chain transaction permission, the core chain 300 sends a cross-chain transaction request to the target application chain. By using the cross-chain management contract of the core chain as a processing module for cross-chain transaction requests, it is convenient to uniformly manage cross-chain transactions, and it can flexibly verify cross-chain transaction permissions between application chains and execute cross-chain transactions; at the same time, the cross-chain management contract realizes the isolation of cross-chain transaction processing data from other data of the core chain, and can avoid frequent changes to the core chain itself when cross-chain transaction permissions are updated, and conveniently manage cross-chain transaction permissions.

[0139] Furthermore, in order to improve the security of cross-chain transactions, in one example, the verification engine module 33 can also be used for:

[0140] Performing signature verification on the cross-chain transaction request;

[0141] According to the cross-chain transaction request, query whether there is a corresponding cross-chain transaction permission in the permission management module 32, including: if the verification passes, query whether there is a corresponding cross-chain transaction permission in the permission management module 32 according to the cross-chain transaction request;

[0142] The core chain 300 is further configured to send a signature verification failure notice to the source application chain if the verification fails.

[0143] Specifically, before the verification engine module 33 performs permission verification on the cross-chain transaction request, it is necessary to first perform signature verification on the cross-chain transaction request. If the verification passes, the verification engine module 33 queries whether there is a corresponding cross-chain transaction permission in the permission management module 32; if the verification fails, the core chain 300 sends a signature verification failure notice to the source application chain.

[0144] In this example, the verification engine module performs signature verification on the cross-chain transaction request, and queries whether there is a corresponding permission for the cross-chain transaction after the signature verification passes, effectively improving the security of the cross-chain transaction.

[0145] In practical applications, there can be multiple ways to query whether there is a corresponding cross-chain transaction permission in the permission management module 32. In one example, the cross-chain transaction request includes the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain; the verification engine module 33 can specifically be used for:

[0146] According to the cross-chain transaction request, query whether there is a first cross-chain transaction permission in the permission management module 32; wherein, the identifiers of the two application chains in the first cross-chain transaction permission are respectively the identifier of the source application chain and the identifier of the target application chain in the cross-chain transaction request, and the contract names of the two application chains in the first cross-chain transaction permission are respectively the contract name of the source application chain and the contract name of the target application chain in the cross-chain transaction request.

[0147] Specifically, the permission management module 32 stores cross-chain transaction permissions. Each cross-chain transaction permission can include a quadruple. For example, assume that a certain cross-chain transaction permission includes a quadruple of a first application chain identifier, a specified contract name on the first application chain, a second application chain identifier, and a specified contract name on the second application chain. Then this cross-chain transaction permission represents that the specified contract on the first application chain has the permission to execute the specified contract on the second application chain across the chain. After receiving the cross-chain transaction request sent by the source application chain, the core chain 300 queries whether there is a corresponding first cross-chain transaction permission in the permission management module 32 based on the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain in the cross-chain transaction request, where the first cross-chain transaction permission includes a quadruple of a source application chain identifier, a source application chain contract name, a target application chain identifier, and a target application chain contract name.

[0148] In this example, based on the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain, the permission management module accurately queries whether there is a corresponding cross-chain transaction permission, effectively improving the security of cross-chain transactions.

[0149] Based on the above example, the application chain can be registered on the core chain 300 to obtain an identifier that uniquely identifies the application chain. In one example, the cross-chain management contract further includes an application chain management module 31 for:

[0150] Receiving a registration request sent by the application chain;

[0151] Registering the application chain according to the registration request, recording the identifier of the application chain, and returning the identifier to the application chain.

[0152] Specifically, the application chain management module 31 receives the registration request sent by the application chain, registers the application chain based on the registration request, records the identifier of the application chain, and returns the identifier to the application chain. The application chain management module 31 maintains and records the identifiers of the registered application chains, and can add new application chains (i.e., register application chains) or cancel application chains according to actual needs.

[0153] In this example, by registering the application chain through the application chain management module and returning the identifier to the application chain, each application chain can be accurately determined according to the identifier, and it is convenient for unified management.

[0154] In a blockchain system architecture with one main chain and multiple sub-chains, the core chain 300 as the main chain and the application chains as the sub-chains are often isomorphic chains. The core chain 300 can directly forward the cross-chain transaction request of the source application chain to the target application chain. However, in actual applications, in order to achieve unified control of blockchain services, the core chain 300 can also connect to heterogeneous chains as application chains. In order to achieve adaptation to heterogeneous chains, in one example, the cross-chain management contract further includes a message processing module 34 for:

[0155] Checking whether the format of the cross-chain transaction request matches the target application chain;

[0156] If not, converting the format of the cross-chain transaction request into a format that matches the target application chain.

[0157] Specifically, when the source application chain requests a cross-chain transaction from the target application chain, the source application chain sends a cross-chain transaction request to the core chain 300. The core chain 300 performs signature verification on the cross-chain transaction request through the deployed cross-chain management contract. If the signature verification fails, it returns a signature verification failure notice to the source application chain as a transaction receipt; if the signature verification passes, it performs permission verification on the cross-chain transaction request. If the permission verification fails, it returns a permission verification failure notice to the source application chain as a transaction receipt; after the permission verification passes, it sends a cross-chain transaction request to the target application chain. Since application chains with different structures will adopt different message formats for contract calls, for example, when the Hyperledger Fabric application chain performs a contract call, the message format for executing the contract is {"Args":["contract name":"function name"]}. If the source application chain or the target application chain is a heterogeneous chain, the message parameters for executing the contract call in the cross-chain transaction request received by the target application chain will not match. Therefore, after the cross-chain transaction request passes the verification of the verification engine module 33, the message processing module 34 checks whether the cross-chain contract call format in the cross-chain transaction request is acceptable to the target application chain. If the format does not match, it converts the cross-chain contract call format into a contract call form that the target application chain can execute. The core chain 300 sends the completed cross-chain transaction request to the target application chain. The target application chain calls the specified contract according to the cross-chain transaction request to execute the cross-chain transaction, and returns the execution result to the core chain 300 as a transaction receipt. The core chain 300 sends the transaction receipt to the source application chain.

[0158] Still as Figure 3 shown, in the blockchain system, different application chains can perform cross-chain transactions through the core chain 300. The core chain 300 deploys a cross-chain management contract for processing cross-chain transaction requests. The cross-chain management contract includes four major modules: the application chain management module 31, the permission management module 32, the verification engine module 33, and the message processing module 34. The application chain management module 31 is responsible for maintaining and recording the identifiers of each application chain registered on the core chain 300; the permission management module 32 stores the permitted cross-chain rules; the verification engine module 33 includes two parts: signature verification and permission verification. Signature verification is to perform cryptographic verification on the signature in the cross-chain request sent by the source application chain. After passing the signature verification, cross-chain permission verification is performed. Cross-chain permission verification is to query whether there is a corresponding cross-chain transaction permission in the permission management module 32. If it exists, the cross-chain permission verification passes. If the signature verification or the permission verification fails, the core chain 300 returns a verification failure error receipt to the source application chain; the message processing module 34 is used for message format conversion when cross-chain transactions occur between chains with different structures. The smart contract can be upgraded and updated, such as adding or canceling application chains, changing cross-chain permissions, updating verification rules, updating message conversion formats, etc., according to actual needs, without changing the core chain 300 itself, maintaining the flexibility of cross-chain processing.

[0159] In this example, the cross-chain transaction request is converted into a format matching the target application chain by the message processing module, enabling the adaptation to heterogeneous chains and ensuring the correct execution of cross-chain transactions.

[0160] In the blockchain system provided in this embodiment, the blockchain system adopts a one-master-and-many-sub-chains architecture of one core chain and multiple application chains. The core chain is deployed with a cross-chain management contract for processing cross-chain transaction requests. The permission management module in the cross-chain management contract stores multiple permitted cross-chain transaction permissions. The verification engine module in the cross-chain management contract performs permission verification on the cross-chain transaction request sent by the source application chain, queries whether there is a corresponding cross-chain transaction permission in the permission management module. If there is a cross-chain transaction permission, the core chain sends the cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction according to the cross-chain transaction request and returns the execution result, and the core chain sends the execution result to the source application chain. By using the core chain cross-chain management contract as the processing module for cross-chain transaction requests, it is convenient to uniformly manage cross-chain transactions, and it can flexibly perform cross-chain transaction permission verification between application chains and execute cross-chain transactions. At the same time, the cross-chain management contract realizes the isolation of cross-chain transaction processing data from other data of the core chain, can avoid frequent changes to the core chain itself when cross-chain transaction permissions are updated, and conveniently manages cross-chain transaction permissions.

[0161] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and examples are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.

[0162] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A cross-chain transaction method for a blockchain system, characterized in that, the blockchain system includes multiple blockchains, the multiple blockchains include at least one core chain and multiple application chains, a cross-chain management contract for processing cross-chain transaction requests is deployed on the core chain, and the cross-chain management contract includes a verification engine module and a permission management module; the method includes: the core chain receives a cross-chain transaction request sent by a source application chain, and the cross-chain transaction request requests to execute a cross-chain transaction from the source application chain to a target application chain; the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the permission management module stores multiple cross-chain transaction permissions; each cross-chain transaction permission corresponds to two application chains and is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains; if there is no cross-chain transaction permission, the core chain sends a permission verification failure notice to the source application chain; if there is a cross-chain transaction permission, the core chain sends a permission verification success notice to the source application chain, and sends the cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction by calling the target application chain contract according to the cross-chain transaction request and returns the execution result, and sends the execution result to the source application chain.

2. The method according to claim 1, characterized in that, before the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, it further includes: the verification engine module performs signature verification on the cross-chain transaction request; the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including: if the verification passes, the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request; after the verification engine module performs signature verification on the cross-chain transaction request, it further includes: if the verification fails, the core chain sends a signature verification failure notice to the source application chain.

3. The method according to claim 1, characterized in that, the cross-chain transaction request includes the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain; the verification engine module queries whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request, including: querying whether there is a first cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the identifiers of the two application chains in the first cross-chain transaction permission are respectively the identifier of the source application chain and the identifier of the target application chain in the cross-chain transaction request, and the contract names of the two application chains in the first cross-chain transaction permission are respectively the contract name of the source application chain and the contract name of the target application chain in the cross-chain transaction request.

4. The method according to claim 1, characterized in that, The cross-chain management contract further includes an application chain management module, and the method further includes: The application chain management module receives a registration request sent by an application chain; The application chain management module registers the application chain according to the registration request, records the identifier of the application chain, and returns the identifier to the application chain.

5. The method according to any one of claims 1-4, wherein, The cross-chain management contract further includes a message processing module, and the verification engine module sends the cross-chain transaction request to the target application chain, including: The message processing module checks whether the format of the cross-chain transaction request matches the target application chain; If not, the message processing module converts the format of the cross-chain transaction request into a format that matches the target application chain.

6. A blockchain system, wherein, The blockchain system includes multiple blockchains, and the multiple blockchains include at least one core chain and multiple application chains. The core chain deploys a cross-chain management contract for processing cross-chain transaction requests, and the cross-chain management contract includes a verification engine module and a permission management module; The core chain is configured to receive a cross-chain transaction request sent by a source application chain, and the cross-chain transaction request requests to execute a cross-chain transaction from the source application chain to a target application chain; The verification engine module is configured to query whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the permission management module stores multiple cross-chain transaction permissions; each cross-chain transaction permission corresponds to two application chains and is used to represent the permission to execute transactions between the two application chains; the cross-chain transaction permission includes the identifiers and contract names of the corresponding two application chains; The core chain is further configured to send a permission verification failure notice to the source application chain if there is no cross-chain transaction permission; if there is a cross-chain transaction permission, send a permission verification success notice to the source application chain, and send the cross-chain transaction request to the target application chain, so that the target application chain executes the cross-chain transaction by calling the target application chain contract according to the cross-chain transaction request and returns the execution result, and sends the execution result to the source application chain.

7. The system according to claim 6, wherein, The verification engine module is further configured to: Perform signature verification on the cross-chain transaction request; The querying whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request includes: if the verification passes, querying whether there is a corresponding cross-chain transaction permission in the permission management module according to the cross-chain transaction request; The core chain is further configured to send a signature verification failure notice to the source application chain if the verification fails.

8. The system according to claim 6, wherein, The cross-chain transaction request includes the identifier of the source application chain, the contract name of the source application chain, the identifier of the target application chain, and the contract name of the target application chain; the verification engine module is specifically configured to: Query whether there is a first cross-chain transaction permission in the permission management module according to the cross-chain transaction request; wherein, the identifiers of the two application chains in the first cross-chain transaction permission are respectively the identifier of the source application chain and the identifier of the target application chain in the cross-chain transaction request, and the contract names of the two application chains in the first cross-chain transaction permission are respectively the contract name of the source application chain and the contract name of the target application chain in the cross-chain transaction request.

9. The system according to claim 6, characterized in that the cross-chain management contract further includes an application chain management module for: receiving a registration request sent by an application chain; registering the application chain according to the registration request, recording the identifier of the application chain, and returning the identifier to the application chain.

10. The system according to any one of claims 6-9, characterized in that the cross-chain management contract further includes a message processing module for: checking whether the format of the cross-chain transaction request matches the target application chain; if not, converting the format of the cross-chain transaction request into a format that matches the target application chain.