Cross-chain transaction method, cross-chain system construction method and related device
By deploying cross-chain components in the blockchain network, forming cross-chain nodes, and achieving trusted interactions between multiple chains, the problem of relying on third-party endorsement or relay chains in the existing technology is solved, and the efficiency and reliability of cross-chain transactions are improved.
Patent Information
- Application Number
- PCT/CN2024/109772
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-31
- Filing Date
- 2024-08-05
- Publication Date
- 2025-06-12
AI Technical Summary
Existing cross-chain technology relies on endorsement from trusted third parties or requires relay chains from third parties, resulting in transactions being restricted by third parties and it is difficult to meet business needs.
By deploying cross-chain components on existing blockchain networks, cross-chain nodes are formed to achieve trusted interactions between multiple chains. Cross-chain nodes can listen to cross-chain transaction requests and synchronize cross-chain transaction transaction information through the blockchain network's own data to avoid dependence on third parties.
It realizes trusted interactions between multiple chains, avoids transactions being restricted by third parties, can meet business needs, and improves the efficiency and reliability of cross-chain transactions.
Smart Images

Figure CN2024109772_12062025_PF_FP_ABST
Abstract
Description
A cross-chain transaction method, a cross-chain system construction method, and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 4, 2023, with application number 202311648476.1, entitled “A cross-chain interaction method and related equipment”, and claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 31, 2024, with application number 202410137678.8, entitled “A cross-chain transaction method, cross-chain system construction method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of blockchain technology, and in particular to a cross-chain transaction method, a cross-chain system construction method, a cross-chain system, a cross-chain management system, a computing device cluster, a computer-readable storage medium, and a computer program product. Background Art
[0003] A blockchain network is a peer-to-peer network system that uses cryptography and consensus mechanisms to build and store massive chains of transaction data. Currently, there are thousands of publicly available blockchain networks, but these networks vary in security and privacy, transaction throughput, and scalability. This has led to disconnections between blockchain networks, creating data and value silos. The inter-chain barriers and trust gaps created by these silos have significantly constrained the large-scale development of blockchain applications and hindered interoperability and liquidity within the blockchain ecosystem.
[0004] To this end, the industry has proposed cross-chain technology to promote the flow of value and transaction interaction between blockchain ecosystems, thereby maximizing the application value of blockchain networks. Currently, related cross-chain technologies rely on the endorsement of trusted third parties or require third-party relay chains to achieve cross-chain capabilities, resulting in transactions being restricted by third parties and making it difficult to meet business needs.
[0005] Summary of the Invention
[0006] The present application provides a cross-chain transaction method. This method deploys cross-chain components based on an existing blockchain to form a cross-chain node. The cross-chain node can monitor cross-chain transaction requests from the blockchain network that initiates the cross-chain transaction, and synchronize the transaction information of the cross-chain transaction to the blockchain network that executes the cross-chain transaction through the blockchain network's own data synchronization, such as ledger synchronization. This allows trusted interaction between multiple chains through the cross-chain node, without relying on the endorsement of a trusted third party or requiring a third-party relay chain to achieve cross-chain capabilities, thus avoiding transactions being restricted by third parties and meeting business needs. The present application also provides a cross-chain system construction method, a cross-chain system for executing the cross-chain transaction method, a cross-chain management system for executing the cross-chain system construction method, a computing device cluster, a computer-readable storage medium, and a computer program product.
[0007] In a first aspect, this application provides a cross-chain transaction method. This method can be applied to a cross-chain system. The cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network. The first blockchain network includes a first cross-chain node and a second cross-chain node. The cross-chain nodes are deployed with cross-chain components. The second blockchain network includes the first blockchain node, and the third blockchain network includes the second blockchain node.
[0008] Specifically, the cross-chain component of the first cross-chain node listens for cross-chain transaction requests, which are used to request the execution of a cross-chain transaction from the second blockchain network to the third blockchain network. For example, this is a cross-chain transaction initiated by the organization corresponding to the first blockchain node in the second blockchain network and between the organization corresponding to the second blockchain node in the third blockchain network. The cross-chain transaction request is synchronized to the first cross-chain node after the first blockchain node writes the first transaction information of the cross-chain transaction into the ledger of the second blockchain network. The cross-chain component of the first cross-chain node calls the cross-chain contract to query the transaction route. If the transaction route indicates that it is reachable, the first transaction information of the cross-chain transaction is written to the ledger of the first cross-chain node in the first blockchain network. The cross-chain component of the second cross-chain node listens for cross-chain transaction requests synchronized by the first cross-chain node via the first blockchain network and writes the first transaction information of the cross-chain transaction into the ledger of the third blockchain network. The cross-chain component of the second cross-chain node monitors the node of the third blockchain network to execute the cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the ledger of the second cross-chain node in the first blockchain network. The cross-chain component of the first cross-chain node monitors the second transaction information of the cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the ledger of the second blockchain network.
[0009] This method can deploy cross-chain components on the existing blockchain network, and synchronize the transaction information of cross-chain transactions between the ledgers of different blockchain networks based on the cross-chain components, thereby building trusted cross-chain capabilities and realizing trusted interaction between multiple chains without relying on the endorsement of a trusted third party, avoiding transactions from being restricted by a third party, and meeting business needs.
[0010] In some possible implementations, the first, second, and third blockchain networks can be isomorphic blockchain networks. Isomorphic blockchain networks can also be referred to as isomorphic chains. This concept contrasts with heterogeneous chains (heterogeneous blockchain networks). Isomorphic chains typically share the same security mechanisms, consensus algorithms, network topologies, and block generation and verification logic. Because the block generation and verification logic is consistent across isomorphic chains, cross-chain nodes can quickly generate blocks from one blockchain network based on blocks from another, synchronizing cross-chain transaction information across the ledgers of different blockchain networks.
[0011] In some possible implementations, the first cross-chain node is a shared node between the first and second blockchain networks, and the second cross-chain node is a shared node between the first and third blockchain networks. Under this architecture, cross-chain routes can be generated between blockchain networks through self-discovery. Specifically, because the first cross-chain node is shared by the first and second blockchain networks, cross-chain transactions initiated by the second blockchain network can be directly monitored by the first cross-chain node. Furthermore, the first cross-chain node can synchronize these transactions to the second cross-chain node through inter-node synchronization within the first blockchain network. Since the second cross-chain node is shared by the first and third blockchain networks, the second cross-chain node can directly synchronize cross-chain transactions within the third blockchain network and record them in the third blockchain network's ledger. This improves the efficiency of cross-chain transactions while reducing synchronization overhead.
[0012] In some possible implementations, the first, second, and third blockchain networks have no shared nodes. The first blockchain network is configured as a relay chain for the second and third blockchain networks. Accordingly, the cross-chain component of the first cross-chain node may also receive a first registration request sent by the first blockchain node, the first registration request including information about the organization corresponding to the first blockchain node, and store the information about the organization corresponding to the first blockchain node. The cross-chain component of the second cross-chain node may receive a second registration request sent by the second blockchain node, the second registration request including information about the organization corresponding to the second blockchain node, and store the information about the organization corresponding to the second blockchain node.
[0013] In this way, cross-chain routes can be generated through the registration and discovery mechanism, laying the foundation for synchronizing transaction information of cross-chain transactions between different blockchain networks.
[0014] In some possible implementations, a cross-chain transaction request includes both the source and destination addresses, which is suitable for scenarios where both parties know the addresses of the other party. Alternatively, a cross-chain transaction request can include both the source and destination identities. These identities can be decentralized identifiers (DIDs). Users can use DIDs to conduct cross-chain transactions across different blockchain networks, for example, to transfer assets between chains.
[0015] In some possible implementations, a cross-chain transaction request includes multiple destination addresses. When a cross-chain transaction is conducted through the same relay chain, the source address in the cross-chain transaction request is configured with the relay chain's identifier and channel. When a cross-chain transaction is conducted through different relay chains, the multiple destination addresses in the cross-chain transaction request are configured with the relay chain's identifier and channel. This allows cross-chain routing based on a specific relay chain and channel to meet specific business needs.
[0016] In some possible implementations, the cross-chain component of the first cross-chain node may further check whether the first cross-chain node has a multi-chain configuration. The multi-chain configuration includes configuration information for multiple blockchain networks that the first cross-chain node has joined. If the first cross-chain node has a multi-chain configuration, the cross-chain component of the first cross-chain node writes the multi-chain configuration into the cross-chain contracts of the multiple blockchain networks corresponding to the multi-chain configuration. By writing the multi-chain configuration into the cross-chain contract, this method facilitates the cross-chain node to query the multi-chain configuration, providing a reference for cross-chain transactions.
[0017] In some possible implementations, the cross-chain component of the first cross-chain node may further check whether the ledger of the first blockchain network includes a multi-chain configuration. If the ledger of the first blockchain network includes a multi-chain configuration and the routing table does not include the configuration information of the first blockchain network, the cross-chain component of the first cross-chain node updates the routing table in the ledger of the first blockchain network.
[0018] This method checks the multi-chain configuration in the ledger and updates the routing table based on it, enabling cross-chain nodes to query cross-chain routes, check the routing accessibility of cross-chain transactions, and provide assistance for the routing of transaction information of cross-chain transactions.
[0019] In some possible implementations, the cross-chain component of the first cross-chain node checks whether the multi-chain configuration is locked. If not, it locks the multi-chain configuration. This allows the first cross-chain node to update the routing table, avoiding conflicts caused by simultaneous updates from different nodes.
[0020] In some possible implementations, the first transaction information in the second blockchain network's ledger is locked by the first blockchain node. Accordingly, the first cross-chain node's cross-chain component can also notify the first blockchain node of the cross-chain transaction status. The cross-chain transaction status instructs the first blockchain node to unlock the first transaction information when the cross-chain transaction is successful. This ensures the atomicity and consistency of cross-chain transactions.
[0021] In a second aspect, this application provides a method for constructing a cross-chain system. This method is applied to a cross-chain management system. The cross-chain management system is used to construct a cross-chain system. The cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network.
[0022] Specifically, the cross-chain management system can deploy a first blockchain network, a second blockchain network, and a third blockchain network. The cross-chain management system then deploys a cross-chain component on at least one blockchain node in the first blockchain network to form a first cross-chain node and a second cross-chain node. The first cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the second blockchain network, and the second cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the third blockchain network.
[0023] This approach deploys cross-chain components across a blockchain network to form a cross-chain system. Data synchronization between different blockchain networks in a cross-chain system can be achieved through inter-chain ledger synchronization, thereby building trusted cross-chain capabilities and enabling trusted multi-chain interactions.
[0024] In some possible implementations, the first blockchain network and the second blockchain network include a first shared node. The first blockchain network and the third blockchain network include a second shared node. The cross-chain management system deploys a cross-chain component on the first shared node to form a first cross-chain node, and deploys a cross-chain component on the second shared node to form a second cross-chain node.
[0025] Based on shared nodes across different blockchain networks, cross-chain routes can be generated between them through self-discovery. The first cross-chain node is shared by both the first and second blockchain networks. Therefore, cross-chain transactions initiated by the second blockchain network can be directly monitored by the first cross-chain node. Furthermore, the first cross-chain node can synchronize these transactions to the second cross-chain node through inter-node synchronization within the first blockchain network. The second cross-chain node is shared by both the first and third blockchain networks. Therefore, the second cross-chain node can directly synchronize cross-chain transactions within the third blockchain network and record them in the third blockchain network's ledger. This improves the efficiency of cross-chain transactions while reducing synchronization overhead.
[0026] In some possible implementations, the first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes. Accordingly, the cross-chain management system may also receive relay chain configuration information, which is used to configure the first blockchain network as a relay chain for the second blockchain network and the third blockchain network.
[0027] In this way, data relay can be achieved through the first blockchain network without shared nodes, thereby realizing cross-chain transactions with high availability.
[0028] In some possible implementations, the cross-chain management system can also call on blockchain creation services, such as blockchain as a service (BaaS), to deploy the first blockchain network, the second blockchain network, and the third blockchain network. By establishing a service foundation with blockchains, it is possible to build a fast cross-chain system and capabilities.
[0029] In a third aspect, the present application provides a cross-chain system. The cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network, wherein the first blockchain network includes a first cross-chain node and a second cross-chain node, each cross-chain node being deployed with a cross-chain component, the second blockchain network includes the first blockchain node, and the third blockchain network includes the second blockchain node;
[0030] The first cross-chain node is configured to monitor cross-chain transaction requests through a cross-chain component, wherein the cross-chain transaction request is used to request execution of a cross-chain transaction from the second blockchain network to the third blockchain network, and the cross-chain transaction request is synchronized to the first cross-chain node by the first blockchain node after writing the first transaction information of the cross-chain transaction into the ledger of the second blockchain network;
[0031] The first cross-chain node is further configured to query a transaction route by calling a cross-chain contract through a cross-chain component, and when the transaction route is represented as reachable, write the first transaction information of the cross-chain transaction into the ledger of the first cross-chain node in the first blockchain network;
[0032] The second cross-chain node is configured to monitor, through a cross-chain component, the cross-chain transaction request synchronized by the first cross-chain node through the first blockchain network, and write the first transaction information of the cross-chain transaction into the ledger of the third blockchain network;
[0033] The second cross-chain node is further configured to monitor, through the cross-chain component, the node of the third blockchain network to execute the cross-chain transaction, and write the second transaction information of the cross-chain transaction into the ledger of the second cross-chain node on the first blockchain network;
[0034] The first cross-chain node is further configured to monitor, through a cross-chain component, second transaction information of the cross-chain transaction, and write the second transaction information of the cross-chain transaction into the ledger of the second blockchain network.
[0035] In some possible implementations, the first cross-chain node is a shared node between the first blockchain network and the second blockchain network, and the second cross-chain node is a shared node between the first blockchain network and the third blockchain network.
[0036] In some possible implementations, the first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the first blockchain network is configured as a relay chain for the second blockchain network and the third blockchain network;
[0037] The first cross-chain node is further configured to receive, through the cross-chain component, a first registration request sent by the first blockchain node, the first registration request including information about the organization corresponding to the first blockchain node, and store the information about the organization corresponding to the first blockchain node;
[0038] The second cross-chain node is further used to receive a second registration request sent by the second blockchain node through the cross-chain component, where the second registration request includes information about the organization corresponding to the second blockchain node, and stores the information about the organization corresponding to the second blockchain node.
[0039] In some possible implementations, the cross-chain transaction request includes a source address and a destination address, or the cross-chain transaction request includes a source identity and a destination address.
[0040] In some possible implementations, the cross-chain transaction request includes multiple destination addresses. When the cross-chain transaction is implemented through the same relay chain, the source address in the cross-chain transaction request is configured with the identifier and channel of the relay chain; when the cross-chain transaction is implemented through different relay chains, the multiple destination addresses in the cross-chain transaction request are respectively configured with the identifiers and channels of their corresponding relay chains.
[0041] In some possible implementations, the first cross-chain node is further configured to:
[0042] Checking, through a cross-chain component, whether the first cross-chain node has a multi-chain configuration, where the multi-chain configuration includes configuration information of multiple blockchain networks joined by the first cross-chain node;
[0043] When the first cross-chain node has a multi-chain configuration, the multi-chain configuration is written into the cross-chain contracts of multiple blockchain networks corresponding to the multi-chain configuration through the cross-chain component.
[0044] In some possible implementations, the first cross-chain node is further configured to:
[0045] Checking, by a cross-chain component, whether the ledger of the first blockchain network includes a multi-chain configuration;
[0046] When the ledger of the first blockchain network includes a multi-chain configuration and the routing table does not include configuration information of the first blockchain network, the routing table is updated in the ledger of the first blockchain network through the cross-chain component.
[0047] In some possible implementations, the first cross-chain node is further configured to:
[0048] The cross-chain component checks whether the multi-chain configuration is locked, and if not, locks the multi-chain configuration.
[0049] In some possible implementations, the first transaction information in the ledger of the second blockchain network is locked by the first blockchain node, and the first cross-chain node is further configured to:
[0050] The status of the cross-chain transaction is notified to the first blockchain node through the cross-chain component, where the status of the cross-chain transaction is used to instruct the first blockchain node to unlock the first transaction information when the status of the cross-chain transaction is successful.
[0051] In a fourth aspect, the present application provides a cross-chain management system. The cross-chain management system is used to build a cross-chain system, which includes a first blockchain network, a second blockchain network, and a third blockchain network; the cross-chain management system includes:
[0052] A networking module, used to deploy the first blockchain network, the second blockchain network, and the third blockchain network;
[0053] A component deployment module is used to deploy a cross-chain component on at least one blockchain node of the first blockchain network to form a first cross-chain node and a second cross-chain node, wherein the first cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the second blockchain network, and the second cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the third blockchain network.
[0054] In some possible implementations, the first blockchain network and the second blockchain network include a first shared node, and the first blockchain network and the third blockchain network include a second shared node;
[0055] The component deployment module is specifically used to:
[0056] A cross-chain component is deployed on the first shared node to form a first cross-chain node, and a cross-chain component is deployed on the second shared node to form a second cross-chain node.
[0057] In some possible implementations, the first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the system further includes:
[0058] A configuration module is used to receive configuration information of the relay chain, where the configuration information is used to configure the first blockchain network as a relay chain for the second blockchain network and the third blockchain network.
[0059] In some possible implementations, the networking module is specifically configured to:
[0060] Call the blockchain creation service to deploy the first blockchain network, the second blockchain network, and the third blockchain network.
[0061] In a fifth aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, wherein the at least one computing device includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is configured to execute instructions stored in the at least one memory, so that the computing device or computing device cluster performs the method described in any implementation of the first or second aspect.
[0062] In a sixth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct a computing device or a computing device cluster to execute the method described in any implementation of the first or second aspect above.
[0063] In a seventh aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device or a computing device cluster, enables the computing device or the computing device cluster to execute the method described in any one of the implementations of the first or second aspect above.
[0064] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical methods of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments.
[0066] FIG1 is an example diagram of a system architecture in a smart city scenario provided by this application;
[0067] FIG2 is a schematic diagram of deploying a cross-chain component on a node to form a cross-chain node provided by the present application;
[0068] FIG3 is a schematic diagram of the architecture of a cross-chain system provided by this application;
[0069] FIG4 is a schematic diagram of a general architecture of a cross-chain system provided by this application;
[0070] FIG5 is a schematic diagram of the general architecture of another cross-chain system provided by this application;
[0071] Figure 6 is a flow chart of a cross-chain transaction method provided by this application;
[0072] FIG7 is a schematic diagram of a one-to-many cross-chain transaction provided by this application;
[0073] FIG8 is a flow chart of a cross-chain system construction method provided by this application;
[0074] FIG9 is a schematic diagram of a process for initializing a cross-chain component provided by this application;
[0075] FIG10 is a schematic diagram of an application scenario of a cross-chain transaction method provided by this application;
[0076] FIG11 is a schematic diagram of the structure of a cross-chain management system provided by this application;
[0077] FIG12 is a schematic diagram of the structure of a computing device provided by the present application;
[0078] FIG13 is a schematic diagram of the structure of a computing device provided by the present application;
[0079] FIG14 is a schematic diagram of the structure of a computing device cluster provided by this application;
[0080] FIG15 is a schematic diagram of the structure of a computing device cluster provided by the present application;
[0081] FIG16 is a schematic diagram of the structure of a computing device cluster provided by this application;
[0082] FIG17 is a schematic diagram of the structure of a computing device cluster provided in this application. DETAILED DESCRIPTION
[0083] The terms "first" and "second" in the embodiments of this application are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0084] First, some technical terms involved in the embodiments of this application are introduced.
[0085] A blockchain network, also referred to as a blockchain, refers to a peer-to-peer (P2P) network built on blockchain technology. A blockchain network includes multiple blockchain nodes, each of which is a peer node (for ease of description, this application may also refer to blockchain nodes as nodes). In a blockchain network, multiple blockchain nodes jointly maintain a continuously growing blockchain ledger constructed from ordered data blocks. Each blockchain node stores a copy of the blockchain ledger and maintains consistency between the copies. Therefore, the blockchain ledger is the public ledger of the blockchain network. This public ledger is a distributed ledger, so the blockchain network can essentially be considered a distributed ledger system.
[0086] A distributed ledger system is a special type of distributed database system that only performs append operations and is suitable for use in untrusted environments. Specifically, in a distributed ledger system, new data can be appended to each node's local copy through transactions. A certain encryption mechanism is used to ensure that the data in the ledger cannot be arbitrarily deleted or altered. It is important to note that distributed ledger systems tolerate Byzantine faults, including but not limited to those caused by node crashes, inaccessibility, network latency, or malicious node behavior. Byzantine faults, also known as the Byzantine problem, refer to the problem of reaching consensus in scenarios where a small number of nodes may act maliciously (messages may be forged). To achieve data consistency across all nodes in a distributed ledger system, each system utilizes a consensus mechanism.
[0087] Consensus is an algorithm used by different nodes in a distributed ledger system to agree on the current valid state of the ledger. Due to the trade-offs between consensus, security, and consistency in distributed systems, consensus can be achieved either through eventual consistency or probabilistic eventual consistency. If all nodes successfully finalize a block and store the same copy of the ledger, the distributed ledger system has achieved eventual consistency.
[0088] Based on permissions, blockchain networks can be categorized as public and consortium. In some cases, these can be further divided into public, consortium, and private chains. In public chains, anyone can join the distributed ledger system and have read and write access to the distributed ledger. In contrast, the distributed ledger design of consortium chains excludes nodes from operations (such as transaction validation and joining the distributed ledger). Instead, operations such as joining and accessing the distributed ledger are performed using a permission or permission model. To enhance usability and performance in consortium chains, trade-offs are made between the characteristics of distributed systems. This means that the permission model strongly influences the applicability of the consensus mechanism. For example, public chain designs primarily employ consensus mechanisms that achieve only probabilistic eventual consistency, while most consortium chain designs require full eventual consistency, resulting in only a limited number of nodes being included in consensus discovery.
[0089] Distributed ledgers are designed to support the deployment and execution of custom programs (such as software programs, often referred to as "software" or "programs"), known as smart contracts. Smart contracts allow transactions to be triggered by defining standardized expressions within program code. Smart contracts can not only unlock assets stored on the distributed ledger (for example, using hash locks, time locks, and multi-signatures), but also store assets and trigger transactions once the conditions specified in the smart contract are met. These conditions can be related to data stored in the unified distributed ledger as well as external data (such as off-chain data).
[0090] Different distributed ledgers (e.g., homogeneous and heterogeneous) can communicate through smart contracts, enabling operations between them (e.g., interoperability between distributed ledgers). Interoperability between different distributed ledgers is referred to as cross-chain. For a blockchain network (distributed ledger system), cross-chain capabilities include the ability to retrieve data from or exchange data with external systems. Cross-chain systems facilitate interoperability by enabling data exchange between different distributed ledgers and external systems. Data exchange with external systems can increase the flexibility of distributed ledgers, overcome performance issues caused by inherent limitations, and enhance the security of distributed ledgers.
[0091] Cross-chain systems can be implemented through notary mechanisms or third-party relay chains. The notary mechanism is a simple cross-chain mechanism widely used in digital currency exchanges. In essence, the notary mechanism is an intermediary method. Assuming that blockchains A and B cannot directly interoperate, a mutually trusted third party can be introduced as an intermediary to verify and forward cross-chain transactions. The relay chain, also known as a relay, aims to construct a third-party public chain that connects other chains in the blockchain network through a cross-chain messaging protocol. In specific implementation, a channel can be added between the two blockchain networks. A specific data structure is created within the channel, allowing the two chains to exchange cross-chain data through the data structure within the channel. This newly added channel is called the relay chain.
[0092] Notaries act as transaction confirmers and conflict arbitrators during transactions, replacing technical credit guarantees with centralized institutions. While this model offers fast transaction processing, strong compatibility, and a simple technical architecture, the security of central nodes has become a key bottleneck to system stability. The relay chain, a combination of sidechains and notary mechanisms, can be considered a decentralized notary mechanism. Currently, many cross-chain projects utilize a multi-chain architecture based on the relay chain. However, cross-chain interactions within this multi-chain architecture rely on the security of the relay component.
[0093] To address the problem that cross-chain technology relies on the endorsement of a trusted third party or requires a third-party relay chain to achieve cross-chain capabilities, resulting in transactions being subject to third-party constraints and difficulty meeting business needs, this application provides a cross-chain transaction method. This method can be executed by a cross-chain system. The cross-chain system of this application includes a first blockchain network, a second sub-blockchain network, and a third blockchain network. The first blockchain network includes a first cross-chain node and a second cross-chain node. The cross-chain nodes are deployed with a cross-chain component. The cross-chain component is used to provide cross-chain capabilities to nodes in the blockchain network, forming a cross-chain node and thereby enabling cross-chain transactions. The cross-chain component can be software, for example, software that encapsulates the methods and data required for cross-chain transactions. The cross-chain software is deployed on the blockchain network, which runs the cross-chain software to execute the cross-chain transaction method. In some examples, the cross-chain component can also be hardware that, when running, can execute the cross-chain transaction method. It should be noted that when executing the cross-chain transaction method, the cross-chain components deployed on different blockchain nodes collaborate to complete the cross-chain transaction method. The second blockchain network includes the first blockchain node, and the third blockchain network includes the second blockchain node.
[0094] Specifically, the cross-chain component of the first cross-chain node listens for a cross-chain transaction request, which is used to request the execution of a cross-chain transaction from the second blockchain network to the third blockchain network. The cross-chain transaction request is synchronized to the first cross-chain node after the first blockchain node writes the first transaction information of the cross-chain transaction in the ledger of the second blockchain network. Then, the cross-chain component of the first cross-chain node calls the cross-chain contract to query the transaction route. When the transaction route representation is reachable, the first transaction information of the cross-chain transaction is written into the ledger of the first cross-chain node in the first blockchain network.
[0095] The cross-chain component of the second cross-chain node monitors the cross-chain transaction request synchronized by the first cross-chain node through the first blockchain network, and writes the first transaction information of the cross-chain transaction into the ledger of the third blockchain network. The cross-chain component of the second cross-chain node monitors the node of the third blockchain network (e.g., the second blockchain node or the second cross-chain node) executing the cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the ledger of the second cross-chain node on the first blockchain network. The cross-chain component of the first cross-chain node monitors the second transaction information of the cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the ledger of the second blockchain network.
[0096] This method deploys cross-chain components based on the existing blockchain to form cross-chain nodes. The cross-chain nodes can monitor cross-chain transaction requests from other blockchain networks and synchronize the transaction information of cross-chain transactions to the blockchain network that executes the cross-chain transaction through the blockchain network's own data synchronization. In this way, trusted interaction between multiple chains can be achieved through cross-chain nodes without relying on the endorsement of a trusted third party or requiring a third-party relay chain to achieve cross-chain capabilities, avoiding transactions from being restricted by a third party and meeting business needs.
[0097] This application can be applied to scenarios where data interaction between multiple chains is required within blockchain (e.g., consortium chains and public chains). This data interaction between multiple chains can include cross-chain transactions, which require multi-chain data consistency processing to achieve data consistency across multiple chains. It should be noted that the cross-chain transaction method of this application can be applied to cross-chain transactions between homogeneous blockchain networks (referred to as homogeneous chains) or between heterogeneous blockchain networks (referred to as heterogeneous chains). A homogeneous chain refers to a blockchain network with consistent security mechanisms, consensus algorithms, network topologies, and block generation and verification logic; a heterogeneous chain refers to a blockchain network with at least one of these inconsistencies. For ease of description, the following example uses a homogeneous blockchain network as an example.
[0098] For example, this method can be applied to the management of multiple blockchain-based application services on a multi-chain management platform in a smart city scenario, and can help stakeholders of the multi-chain management platform, such as managers, designers, and blockchain solution providers of smart city multi-business systems, to build, apply, and audit the blockchain management platform.
[0099] For ease of understanding, the system architecture of this application is illustrated below using a smart city scenario as an example.
[0100] As shown in Figure 1, in a smart city scenario, urban blockchain applications can include a variety of blockchain-based application services, such as public services, public safety services, urban governance services, and business environment management services. Public services provide electronic certificates and receipts. Public safety services enable hazardous material traceability and emergency response capabilities. Urban governance services provide smart transportation services, judicial evidence storage services, and public finance services. Business environment management services enable data sharing, government approvals, and government disclosures.
[0101] City blockchain applications can be built on a unified blockchain as a service (uBaaS). Accordingly, these applications can be integrated with the unified blockchain infrastructure to achieve their desired functionality. The unified blockchain infrastructure can be logically divided into a business layer, an adaptation layer, and a chain data layer. The functions of these three layers are described below.
[0102] The business layer can be divided into the tenant plane and the management plane. The tenant plane can provide at least one of the following: chain management capabilities, smart contract management capabilities, application ecosystem and integration capabilities, data asset and configuration management capabilities, or operations and maintenance monitoring capabilities. It should be noted that the chain management and operations and maintenance monitoring capabilities of the tenant plane can be global capabilities, for example, supporting the management of different blockchains. The management plane provides at least one of the following: resource governance and operations monitoring capabilities, identity and process management capabilities, or business ecosystem management capabilities. Resources can be hardware and software resources, including but not limited to computing power, storage resources, and network resources.
[0103] The adaptation layer includes authentication services, certificate management services, heterogeneous access services, and cross-chain services. The authentication service is used to manage tenants or users. Furthermore, the authentication service also supports permission management, such as assigning permissions to tenants or users. The authentication service can also connect to third-party authentication services and use them for authentication. Certificate management services can include certificate issuance, certificate renewal, and certificate revocation (such as certificate deletion or destruction). Heterogeneous access services are used to provide basic blockchain as a service (BaaS) access and basic BaaS adaptation.
[0104] Cross-chain services support homogeneous cross-chain transactions, which refers to transactions between homogeneous blockchain networks, such as those built on the same BaaS. Furthermore, cross-chain services also include heterogeneous cross-chain transactions, specifically transactions between heterogeneous blockchain networks. It should be noted that cross-chain services also provide an oracle mechanism. Oracles write external information (off-chain and off-chain data) into the blockchain, enabling data exchange between the blockchain and the real world. Oracles allow deterministic smart contracts to react to the uncertain external world. They serve as a means for smart contracts to exchange data with the outside world and as an interface for data exchange between the blockchain and the real world.
[0105] The chain data layer includes the chain management platform. This platform provides the underlying blockchain technology, blockchain management, and operations and monitoring capabilities. Unlike the tenant-level chain management and operations monitoring capabilities of the business layer, the chain management platform's blockchain management and operations monitoring capabilities are localized, encompassing, for example, the platform's management and operations monitoring of the blockchain. The chain data layer is also compatible with other standardized blockchains. Furthermore, it provides standardized interfaces to mask differences between different blockchain interfaces (such as the service interface in Figure 1).
[0106] The cross-chain system of the present application can be constructed using the cross-chain service shown in Figure 1. The cross-chain service can deploy a cross-chain component on at least one node in a blockchain network based on user (e.g., administrator) configuration, forming a cross-chain node (CC Node). As shown in Figure 2, the node is deployed with a smart contract and maintains a distributed ledger. When conducting a transaction, the node can, based on a consensus algorithm, reach consensus with other participating nodes in the blockchain network and then record the transaction in the form of a block in the distributed ledger. The node can process the transaction using cryptographic mechanisms and record it in the distributed ledger to ensure security. The cross-chain component is used to provide cross-chain management capabilities, such as enabling cross-chain transactions. It also provides cross-chain identity management and cross-chain permission management. Cross-chain identity management includes managing the identity information (chain information) of registered blockchain networks, and cross-chain permission management includes managing the cross-chain access permission information of registered blockchain networks. The cross-chain component can execute cross-chain transactions when cross-chain identity authentication and / or cross-chain permission verification are passed. For example, if the cross-chain transaction type is a query, the cross-chain component can forward the cross-chain transaction request to execute the cross-chain transaction. Another example is a cross-chain write transaction, such as adding data across the chain, where the cross-chain component can record the transaction information in the distributed ledger. This transaction information can include the source and destination addresses, and further, the transaction object, such as digital assets or data.
[0107] In some possible implementations, the cross-chain component may also include an agent. This agent is primarily used to monitor cross-chain transaction requests and is therefore also referred to as a cross-chain agent (cc agent). This method decouples the monitoring of cross-chain transaction requests from other functions. When a cross-chain transaction request is monitored, other functional modules are awakened, which can reduce the overall power consumption (or resource consumption) of the cross-chain component and improve its usability.
[0108] Specifically, the cross-chain components of a cross-chain node can generate cross-chain routes in a self-discovery manner through address-based inter-chain identification and discovery capabilities. Alternatively, the cross-chain components of a cross-chain node can discover other cross-chain nodes based on a registration discovery mechanism, and then collaborate with these other cross-chain nodes to complete cross-chain transactions. The registration discovery mechanism can include registration and discovery. Registration involves registering the chain information of a blockchain network providing a service, such as at least one of a blockchain address or certificate, with a public component. For ease of description, this application may refer to the blockchain network where the public components are deployed as the main blockchain network, referred to as the main chain, and the blockchain networks registered with the main chain as sub-blockchain networks, referred to as sub-chains. Public components can be cross-chain components of the main blockchain network. Discovery involves ensuring that sub-blockchain networks (or cross-chain nodes of sub-blockchain networks) registered with the main blockchain network can be discovered by other callers in a timely manner. It should be noted that discovery can include discovering when nodes (such as cross-chain nodes) of a sub-blockchain network have come online, or discovering when nodes (such as cross-chain nodes) of a sub-blockchain network have gone offline.
[0109] In order to make the technical solution of this application clearer and easier to understand, the cross-chain system of this application is introduced below with reference to the accompanying drawings.
[0110] Figure 3 shows a schematic diagram of the architecture of a cross-chain system, which includes a first blockchain network, a second blockchain network, and a third blockchain network. In the example shown in Figure 3, the first, second, and third blockchain networks are isomorphic chains, and the security mechanisms, consensus algorithms, network topologies, and block generation and verification logic of these chains are generally consistent.
[0111] The first blockchain network can be the primary blockchain network, hereinafter referred to as the primary chain, and the second and third blockchain networks can be sub-blockchain networks, hereinafter referred to as sub-chains. It should be noted that a cross-chain system can include two or more sub-chains. Figure 3 illustrates a cross-chain system including three sub-chains.
[0112] The nodes of the main chain and subchains are homogeneous. Cross-chain components are deployed on nodes used for cross-chain operations, forming cross-chain nodes. In practical applications, cross-chain components can be deployed on each node to enhance the node's ability to build rich nodes and provide cross-chain capabilities. Each node can enable cross-chain capabilities to support homogeneous cross-chain operations.
[0113] In the example of Figure 3, the main chain and subchains have shared nodes (or shared nodes). For example, the main chain and subchain 1 have shared nodes, and the main chain and subchain 2 have shared nodes. Cross-chain transactions between subchains 1 and 2 can be carried out through these shared nodes. In some possible implementations, subchains can also have shared nodes. For example, subchain 3 and subchain 1 have shared nodes, and subchain 3 and subchain 2 have shared nodes. Subchain 3 can carry out cross-chain transactions with subchain 2 through shared nodes with subchain 1, shared nodes between subchain 1 and the main chain, and shared nodes between the main chain and subchain 2. Similarly, subchain 3 can carry out cross-chain transactions with subchain 1 through shared nodes with subchain 2, shared nodes between subchain 2 and the main chain, and shared nodes between the main chain and subchain 1. Data synchronization is achieved through inter-chain ledger synchronization, with shared nodes serving as data synchronization nodes.
[0114] In the above cross-chain system, each node can load cross-chain contracts during runtime, support hash locking of current cross-chain transactions, and mark any cross-chain transaction as a cross-chain type. The cross-chain component is used to monitor cross-chain transaction types to trigger cross-chain transaction synchronization.
[0115] The following describes the architecture of the cross-chain system, combined with application scenarios. A general architecture of a cross-chain system is shown in Figure 4. Figure 4 illustrates this using a smart city application. The cross-chain system includes multiple business chains for different businesses, each of which can be a consortium chain managed by a different organization. In this example, the public security business chain includes nodes managed by Enterprise A, Enterprise C, and the public security organization. The finance and taxation business chain includes nodes managed by Enterprise B, Enterprise D, and the finance and taxation organizations. In addition to the public security and finance and taxation business chains, another business chain (such as the market supervision business chain) can serve as the main chain for the public security and finance and taxation business chains. The main chain can also include nodes managed by other organizations, such as the market supervision organization.
[0116] The aforementioned business chains can be connected to business applications. For example, the public security business chain can be connected to public security system applications. These business applications can be developed based on the corresponding business chain's software development kit (SDK) or application programming interface (API). The business chain is deployed with business contracts, specifically business-related smart contracts, also known as synchronization contracts. At least one node in the business chain is deployed with cross-chain components and cross-chain contracts. The cross-chain components include agents, such as cross-chain proxies, for communicating with cross-chain components deployed on nodes in other business chains.
[0117] After the business chain's nodes deploy cross-chain components and cross-chain contracts, the main chain can use a self-discovery mechanism to obtain routing information and perform permission management. Routing information can include the business chain's routing path or routing address. As shown in Figure 4, the main chain can perform routing management and permission control through routing contracts and permission contracts.
[0118] In Figure 4, the main chain and the business chains acting as subchains share nodes. For example, a node managed by a financial organization belongs to both the central main chain and the subchain on the right. Different subchains can conduct cross-chain transactions through these shared nodes with the main chain. The following describes the cross-chain transaction process.
[0119] Among them, cross-chain transactions can include the following steps: 1. The business application of the public security business chain calls the cross-chain contract to initiate a cross-chain transaction. Each node of the blockchain network can start monitoring; 2. The cross-chain component of the cross-chain node monitors the cross-chain event (such as a cross-chain transaction request), and after authentication, synchronizes the first transaction information of the cross-chain transaction to the main chain (such as the market supervision business chain). This process is also called main chain block drop; 3. The cross-chain node that shares a node with another sub-chain (such as the finance and taxation business chain) monitors the cross-chain event, and after authentication, synchronizes the first transaction information of the cross-chain transaction to the above-mentioned other sub-chain to realize the sub-chain block drop; 4. The client of enterprise B in the finance and taxation business chain monitors 5. The cross-chain node that shares a node with the finance and taxation business chain listens to the cross-chain event, and after authentication, synchronizes the second transaction information of the cross-chain transaction to the main chain to achieve the main chain block drop; 6. The cross-chain node that shares a node with the public security business chain listens to the cross-chain event, and after authentication, synchronizes the second transaction information of the cross-chain transaction to the public security business chain to achieve the sub-chain block drop; 7. The business application listens to the cross-chain transaction of the other end, executes the next stage of the cross-chain / or ends the cross-chain process.
[0120] Figure 4 illustrates an example of a cross-chain system with shared nodes. Another scenario involves no shared nodes between business chains, making self-discovery impossible. Since the business chains are homogeneous, subsequent synchronization can be achieved through registration and discovery. The following diagram illustrates the architecture of a cross-chain system without shared nodes.
[0121] Figure 5 illustrates a general architecture for a cross-chain system. Using a smart city application as an example, Figure 5 illustrates a cross-chain system consisting of multiple business chains for different businesses, each of which can be a consortium chain managed by a different organization. In this example, the public security business chain includes nodes managed by Enterprise A, Enterprise C, and the public security organization. The tax business chain includes nodes managed by Enterprise B, Enterprise D, and the tax organization. In addition to the public security and tax business chains, another business chain (such as the market supervision business chain) can serve as a relay chain for the public security and tax business chains. The relay chain can include nodes managed by other organizations, such as market supervision and finance.
[0122] These business chains can be connected to business applications. For example, the public security business chain can be connected to public security system applications. These business applications can be developed based on the corresponding business chain's SDK or API. Business chains deploy business contracts, specifically business-related smart contracts, also known as synchronization contracts. At least one node in the business chain deploys cross-chain components and cross-chain contracts. Cross-chain components include proxies, such as cross-chain proxies, for communicating with cross-chain components deployed on nodes in other business chains.
[0123] After deploying cross-chain components and cross-chain contracts, nodes on the business chain can register the chain information and cross-chain access rights of the business chain on the main chain. The main chain can maintain registration information (such as the chain information and cross-chain access rights) and routing information, and perform permission management. Routing information can include the routing path or routing address of the business chain.
[0124] It should be noted that when cross-chain components or agents interact with each other, they can also forward messages through routers. In addition, routers can also be connected to the management plane to facilitate the management of the cross-chain system.
[0125] Based on the above cross-chain system, this application also provides a cross-chain transaction method. The cross-chain transaction method of this application is introduced below with reference to the accompanying drawings.
[0126] Referring to the flowchart of a cross-chain transaction method shown in FIG6 , the method is applied to a cross-chain system, the cross-chain system including a first blockchain network, a second blockchain network, and a third blockchain network of isomorphic structure, the first blockchain network including a first cross-chain node and a second cross-chain node, the cross-chain nodes being deployed with a cross-chain component, the second blockchain network including the first blockchain node, and the third blockchain network including the second blockchain node. The method includes the following steps:
[0127] S602: The cross-chain component of the first cross-chain node monitors cross-chain transaction requests.
[0128] Cross-chain transactions refer to transactions between different blockchain networks. For example, a cross-chain transaction might involve transferring a first amount of digital assets from a banking business chain and a second amount of digital assets to a live streaming business chain. A cross-chain transaction request is used to request a cross-chain transaction, such as a cross-chain transaction from a second blockchain network to a third blockchain network. A cross-chain transaction request can be generated by a blockchain application (such as a business application using a blockchain network as a backend) calling a cross-chain contract.
[0129] In practice, cross-chain transactions can be based on self-discovered cross-chain routes, which can be implemented in a variety of ways, as follows:
[0130] In the first implementation, a cross-chain transaction request uses an address to define the initiator and the receiver. The initiator is indicated by the From field, and the receiver is indicated by the To field. This cross-chain transaction request can be applied to scenarios where both parties in the cross-chain need to know the address of the other party, and can indicate that the on-chain resources of the receiver requested by the initiator match the permission management. For example, the receiver is configured with the read permission, write permission of the contract, and read permission and write permission of the ledger through the management interface. The cross-chain transaction request can indicate that the initiator has access rights to the on-chain resources of the receiver it requests. This application also provides an example for illustration, as shown below:
[0131] -from="relay135:chain0:0x3f9d18f7c3a6e5e4c0b877fe3e688ab08840b991"
[0132] -to="relay135:chain1:0x3f9d18f7c3a6e5e4c0b877fe3e688ab08840b992"
[0133] The address defining the initiator or the recipient may include three segments: the first segment is used to indicate the relay chain; the second segment is used to indicate the blockchain network of the initiator or the recipient; and the third segment is used to indicate the on-chain address, such as the address formed by the unique identifier generated by the initialization of the on-chain node, such as the address obtained by hashing the unique identifier. It should be noted that the information indicating the relay chain can also be empty or indicated by a wildcard such as "*". When this information is empty or a wildcard, the cross-chain component of the first cross-chain node can query the routing table for routing. When this information is not empty and is not a wildcard, the cross-chain component of the first cross-chain node can perform cross-chain according to the indicated relay chain.
[0134] In the second implementation, when generating a cross-chain transaction request, the receiving end uses an address definition, while the initiating end uses an identifier (ID), such as a distributed ID. The initiating end can be indicated by the sender field, while the receiving end can use a receiver or a path. This cross-chain transaction request is suitable for scenarios where the same user transfers assets between different blockchain networks. This application also provides an example for illustration, as shown below:
[0135] -sender:terra
[0136] -path / receiver:cosmosXXX”|transfer / channel:osmoXXX
[0137] Among them, "cosmosXXX" indicates the relay chain, transfer indicates the method, and channel indicates the blockchain network of the receiving end, such as the destination chain.
[0138] It should be noted that this application also supports one-to-many cross-chain transaction scenarios, where one-to-many refers to a single initiator initiating a cross-chain transaction to multiple recipients. For one-to-many cross-chain transactions, the same relay chain or different relay chains can be used for cross-chain transactions. When cross-chain transactions are conducted through the same relay chain, the source address in the cross-chain transaction request is configured with the relay chain's identifier and channel. When cross-chain transactions are conducted through different relay chains, the destination addresses in the cross-chain transaction request are configured with the respective relay chain's identifier and channel.
[0139] As shown in Figure 7, when agent1, agent2, and agent3 conduct one-to-many cross-chain transactions, they can all use relay0 for relaying. The cross-chain transaction request can be expressed as:
[0140] { / / Through the same relay chain
[0141] from:"Relay0 / channel / chainA / org / tcsexample"
[0142] to:["Relay0 / channel / chainB / org / tcsexample","Relay0 / channel / chainC / org / tcsexample"]
[0143] args:[["id1","content","content"],["id2","x","x"]]
[0144] }
[0145] The from field also configures the relay chain identifier and channel, such as relay0 and channel.
[0146] When agent1, agent2, and agent3 conduct one-to-many cross-chain transactions, they can also use different relay chains and different channels for relaying. The cross-chain transaction request can be expressed as:
[0147] { / / Use different relay chains and different channels
[0148] from:". / . / chainA / org / tcsexample"
[0149] to:["Relay0 / channel0 / chainB / org / tcsexample","Relay1 / channel1 / chainC / org / tcsexample"]
[0150] args:[["id1","content","content"],["id2","x","x"]]
[0151] }
[0152] It should be noted that, regardless of the scenario, the from field can also be indicated by specifying a path. For example, the from field is written in the form of . / . / chain / org / resource. Accordingly, the cross-chain transaction request can be expressed as:
[0153] { / / Regardless of the scenario, from is written as . / . / chain / org / resource, specifying the path
[0154] from:". / . / chainA / org / tcsexample"
[0155] to:["Relay0 / channel0|chainB / org / tcsexample","Relay1 / channel1|chainC / org / tcsexample"]
[0156] args:[["id1","content","content"],["id2","x","x"]]
[0157] }
[0158] Or refer to the definition of sender receiver. Correspondingly, the cross-chain transaction request can be expressed as:
[0159] A cross-chain transaction request can be synchronized to the first cross-chain node after the first blockchain node writes the first transaction information of the cross-chain transaction into the ledger of the second blockchain network. The first transaction information can be the transaction information on the second blockchain network. Continuing with the example of a digital asset transfer, the first transaction information can be a digital asset transfer out. For example, the first transaction information can be a transfer of a first quantity of a first type of digital asset from account A by a user of organization 1.
[0160] In some possible implementations, the first blockchain node can also lock the first transaction information, for example, by hash-locking the first transaction information through a cross-chain contract. Hash locking refers to a mechanism in which a user makes a payment by guessing the original value of a hash value within a specified time period. Specifically, based on a smart contract, both parties first lock their assets. If both parties enter the correct original hash value within a limited time, the transaction is completed. In this application, the first transaction information can be stored using a key-value (KV) pair, and the first blockchain node can lock the key of the first transaction information to ensure the atomicity and consistency of cross-chain transactions.
[0161] In a specific implementation, the first cross-chain node can be a shared node between the first and second blockchain networks, or organizations on the second blockchain network can register on the first blockchain network. Based on this, the cross-chain component of the first cross-chain node can obtain transaction information for all transactions synchronized on the second blockchain network. By identifying this information, it can identify cross-chain transaction requests. During runtime, the cross-chain node can load a cross-chain contract. This cross-chain contract supports hash locking of the current cross-chain transaction and marks any cross-chain transaction as a cross-chain type. Based on this, the cross-chain component of the first cross-chain node can identify cross-chain transaction requests based on the cross-chain contract. Cross-chain transaction requests are generated by calling the cross-chain contract. The cross-chain component of the second blockchain network can identify cross-chain transaction requests by monitoring the contract information in the cross-chain transaction request. Alternatively, the cross-chain component of the second blockchain network can monitor the cross-chain contract call interface for cross-chain transaction requests.
[0162] S604: The cross-chain component of the first cross-chain node calls the cross-chain contract to query the transaction route. When the transaction route representation is reachable, the first transaction information of the cross-chain transaction is written into the ledger of the first cross-chain node in the first blockchain network.
[0163] The cross-chain component of the first cross-chain node can parse the cross-chain transaction request and query the routing table based on the source and destination information in the transaction request to obtain the transaction route. The source information can be a source address, and the destination information can be a destination address. In some examples, the source information can be a source identifier, and the destination information can be a destination address. When a relay chain and channel are configured in the cross-chain transaction request, the relay chain and channel can also be combined to determine the transaction route.
[0164] When the transaction route is reachable, indicating that the first cross-chain node has a link to the receiving end (destination end), the cross-chain component of the first cross-chain node may write the first transaction information of the cross-chain transaction into the ledger of the first cross-chain node on the first blockchain network. The cross-chain component of the first cross-chain node may write the first transaction information of the cross-chain transaction into the ledger of the first cross-chain node on the first blockchain network when the nodes of the first blockchain network reach a consensus on the cross-chain transaction.
[0165] S606. The cross-chain component of the second cross-chain node monitors the cross-chain transaction request synchronized by the first cross-chain node through the first blockchain network, and writes the first transaction information of the cross-chain transaction into the ledger of the third blockchain network.
[0166] The second cross-chain node and the first cross-chain node are nodes of the first blockchain network. The second cross-chain node can obtain cross-chain transaction requests through inter-node synchronization on the first blockchain network. Similar to the first cross-chain node, the second cross-chain node can be a shared node between the first blockchain network and the third blockchain network, or an organization on the third blockchain network can be registered on the first blockchain network. Based on this, the cross-chain component of the second cross-chain node can write the first transaction information of the cross-chain transaction to the ledger of the third blockchain network.
[0167] When the second cross-chain node is a shared node of the first blockchain network and the third blockchain network, the second cross-chain node can initiate consensus in the third blockchain network after receiving the cross-chain transaction request. When the nodes in the third blockchain network reach a consensus on the cross-chain transaction, the second cross-chain node can write the first transaction information of the cross-chain transaction into the ledger of the third blockchain network.
[0168] When an organization on a third blockchain network registers on the first blockchain network, the second cross-chain node can first synchronize a cross-chain transaction request to the third blockchain network. Nodes within the third blockchain network initiate consensus based on the cross-chain transaction request. Once consensus is reached on the cross-chain transaction, the first transaction information can be written to the third blockchain network's ledger.
[0169] S608. The cross-chain component of the second cross-chain node monitors that the second blockchain node of the third blockchain network executes a cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the ledger of the second cross-chain node in the first blockchain network.
[0170] Because the second cross-chain node is a shared node between the first and third blockchain networks, or because the organization on the third blockchain network is registered on the first blockchain network, information on the third blockchain network can be monitored by the second cross-chain node. For example, the cross-chain component of the second cross-chain node can monitor cross-chain transactions on the third blockchain network. Upon monitoring the execution of a cross-chain transaction by the second blockchain node on the third blockchain network, the second transaction information of the cross-chain transaction can be written to the second cross-chain node's ledger on the first blockchain network.
[0171] The second transaction information of the cross-chain transaction can be the transaction information of the cross-chain transaction on the third blockchain network (the receiving end). Still using the digital asset transfer scenario as an example, the second transaction information can be the digital asset transfer information. For example, the second transaction information can be the transfer of a second amount of the second type of digital asset from Account B of a user in Organization 3.
[0172] S610: The cross-chain component of the first cross-chain node monitors the second transaction information of the cross-chain transaction and writes the second transaction information of the cross-chain transaction into the ledger of the second blockchain network.
[0173] The first cross-chain node and the second cross-chain node can determine the execution status of the cross-chain transaction based on data synchronization on the first blockchain network. If the execution is successful, the cross-chain component of the first cross-chain node can write the second transaction information of the cross-chain transaction to the ledger of the second blockchain network. The implementation method for writing the second transaction information to the ledger of the second blockchain network by the first cross-chain node varies depending on the type of the first cross-chain node. The specific implementation method can be referred to as the second cross-chain node writing the first transaction information to the ledger of the third blockchain network, and will not be further described here.
[0174] Furthermore, the cross-chain component of the first cross-chain node can also notify the first blockchain node of the status of the cross-chain transaction. The status of the cross-chain transaction is used to instruct the first blockchain node to unlock the first transaction information when the cross-chain transaction status is successful. This ensures the atomicity and consistency of the cross-chain transaction.
[0175] Based on the above description, it can be seen that the cross-chain transaction method of the present application forms a cross-chain node by deploying a cross-chain component based on an existing blockchain. The cross-chain node can monitor cross-chain transaction requests from other blockchain networks and synchronize the transaction information of the cross-chain transaction to the blockchain network that executes the cross-chain transaction through the blockchain network's own data synchronization. In this way, trusted interaction between multiple chains is achieved through cross-chain nodes, without relying on the endorsement of a trusted third party, or requiring a third-party relay chain to achieve cross-chain capabilities, thereby avoiding transactions being restricted by a third party and meeting business needs.
[0176] The above embodiments primarily illustrate the first and second cross-chain nodes as shared nodes. However, in practice, the first and second cross-chain nodes can also be non-shared nodes. For example, if the first, second, and third blockchain networks have no shared nodes, to enable cross-chain transactions between the second and third blockchain networks, the first blockchain network can be configured as a relay chain for the second and third blockchain networks.
[0177] Organizations in the second and third blockchain networks that require cross-chain transactions can also register on the relay chain. Specifically, the cross-chain component of the first cross-chain node can also receive a first registration request from the first blockchain node, which includes information about the organization corresponding to the first blockchain node, and then store the information about the organization corresponding to the first blockchain node. The cross-chain component of the second cross-chain node can receive a second registration request from the second blockchain node, which includes information about the organization corresponding to the second blockchain node, and then store the information about the organization corresponding to the second blockchain node.
[0178] The organization's information can include its identifier (such as its name), public key, the identifier of the blockchain network where the organization resides (such as the chain name), and the number of nodes managed by the organization. When the cross-chain component stores the organization's information, it can upload the organization's information to the chain to complete the registration.
[0179] In some possible implementations, the cross-chain component of the first cross-chain node may further check whether the first cross-chain node has a multi-chain configuration, for example, by periodically checking whether the first cross-chain node has a multi-chain configuration. The multi-chain configuration includes configuration information for multiple blockchain networks that the first cross-chain node has joined. If the first cross-chain node has a multi-chain configuration, the cross-chain component of the first cross-chain node may write the multi-chain configuration into the cross-chain contracts of the multiple blockchain networks corresponding to the multi-chain configuration.
[0180] Furthermore, the cross-chain component of the first cross-chain node can also check whether the ledger of the first blockchain network includes a multi-chain configuration. If the ledger of the first blockchain network includes a multi-chain configuration and the routing table does not include the configuration information of the first blockchain network, the cross-chain component of the first cross-chain node can update the routing table in the ledger of the first blockchain network. This can facilitate querying transaction routes. The cross-chain component of the first cross-chain node can also check whether the multi-chain configuration is locked. If not, it can lock the multi-chain configuration. This allows the first cross-chain node to update the routing table, avoiding conflicts caused by simultaneous updates from different nodes.
[0181] The above describes the cross-chain transaction method. The cross-chain transaction method of this application relies on the cross-chain system. The following describes the method for building the cross-chain system.
[0182] 8 shows a flow chart of a method for constructing a cross-chain system. This method can be executed by a cross-chain management system, which is used to construct a cross-chain system. The cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network that are isomorphic. The method specifically includes the following steps:
[0183] S802. The cross-chain management system deploys the first blockchain network, the second blockchain network, and the third blockchain network.
[0184] Specifically, the cross-chain management system can provide a management surface component, through which users (such as administrators) can configure node cluster information. The cross-chain management system can schedule k8s or docker clusters to deploy the first blockchain network, the second blockchain network, and the third blockchain network based on the node cluster information configured by the user.
[0185] It should be noted that the cross-chain management system can integrate blockchain creation services, such as BaaS. In this way, the cross-chain management system can quickly create a homogeneous blockchain network through BaaS, thereby building a fast cross-chain system and capabilities.
[0186] S804. The cross-chain management system deploys a cross-chain component on at least one blockchain node of the first blockchain network to form a first cross-chain node and a second cross-chain node.
[0187] The cross-chain management system can configure a cross-chain component for at least one blockchain node of the first blockchain network based on the cross-chain component configuration information configured by the user in the management-side component, thereby forming a first cross-chain node and a second cross-chain node. After configuring the cross-chain component, the cross-chain management system can also enable the cross-chain component to enable cross-chain capabilities. It should be noted that the cross-chain management system can also issue a cross-chain contract and configure it for each cross-chain node to ensure the execution of cross-chain transactions based on the cross-chain contract.
[0188] In some possible implementations, the first blockchain network and the second blockchain network include a first shared node, and the first blockchain network and the third blockchain network include a second shared node. The cross-chain management system can deploy a cross-chain component on the first shared node to form a first cross-chain node, and deploy a cross-chain component on the second shared node to form a second cross-chain node.
[0189] In other possible implementations, the first, second, and third blockchain networks lack shared nodes. Instead, the cross-chain management system can deploy cross-chain components on at least one blockchain node in the first blockchain network, as well as at least one blockchain node in the second and third blockchain networks, to form cross-chain nodes. The cross-chain management system can also receive relay chain configuration information, which is used to configure the first blockchain network as a relay chain for the second and third blockchain networks. This allows the second and third blockchain networks to register with the first blockchain network, enabling subsequent discovery of these networks through a registration discovery mechanism, thereby enabling cross-chain transactions between these networks.
[0190] The above describes the deployment process on the management side. The following describes the initialization process on the chain organization side.
[0191] Referring to FIG9 , a schematic diagram of a cross-chain system initialization process is shown, which specifically includes the following steps:
[0192] S902: Initialize the cross-chain component of the first cross-chain node.
[0193] S904. The cross-chain component of the first cross-chain node schedules the cross-chain contract and stores the chain name.
[0194] After the cross-chain component of the first cross-chain node is asynchronously deployed, the chain name in the cross-chain contract of the current node can be queried. If it is empty, the chain name can be initialized and stored on the chain. When deploying cross-chain components subsequently, if the chain name is found to exist, the chain name configuration process can be skipped.
[0195] S906: The cross-chain component of the first cross-chain node checks whether the first cross-chain node has a multi-chain configuration. If the first cross-chain node has a multi-chain configuration, execute S908.
[0196] S908. The cross-chain component of the first cross-chain node writes the multi-chain configuration into the cross-chain contracts of the multiple blockchain networks corresponding to the multi-chain configuration.
[0197] The multi-chain configuration includes the configuration information of multiple blockchain networks that the first cross-chain node joins. The cross-chain component of the first cross-chain node can periodically (e.g., periodically) check whether the current node has a multi-chain configuration, read the multi-chain configuration, and write it into the cross-chain contracts of the other chains. For example, the cross-chain component of the first cross-chain node can synchronize information such as the chain name, organization name, number of nodes, and public key to the cross-chain contracts of the other chains, storing it on the chain to complete the chain registration.
[0198] S910: The cross-chain component of the first cross-chain node checks whether the ledger of the first blockchain network includes a multi-chain configuration. If the ledger of the first blockchain network includes a multi-chain configuration and the routing table does not include the configuration information of the first blockchain network, execute S912.
[0199] S912. The cross-chain component of the first cross-chain node updates the routing table in the ledger of the first blockchain network.
[0200] In some possible implementations, the cross-chain component of the first cross-chain node can also check whether the multi-chain configuration is locked. If not, it can lock the multi-chain configuration. In specific implementations, the cross-chain component of the first cross-chain node can periodically check the current ledger. If it is detected that the current ledger contains a multi-chain configuration and an unlocked field, and there is no configuration information for the current chain in the routing table, the cross-chain component of the first cross-chain node can lock it and generate or complete the routing table to the ledger.
[0201] It should be noted that the embodiment of Figure 9 above is an example of the first cross-chain node. The cross-chain component initialization process of other cross-chain nodes can refer to Figure 9 and will not be repeated here.
[0202] In some possible implementations, organizations within a blockchain network can invoke cross-chain capabilities through interfaces and write data to cross-chain contracts. Cross-chain components can synchronize with cross-chain organizations based on cross-chain contracts. Furthermore, cross-chain components can apply for cross-chain permissions, and when the other party agrees, they can initiate cross-chain transactions.
[0203] In order to make the technical solution of this application clearer, the cross-chain transaction method of this application is described in detail below in conjunction with a specific application scenario.
[0204] Referring to Figure 10, which shows an application scenario of a cross-chain transaction method, a cross-chain system may include a main chain and sub-chains A and B. The main chain and sub-chain A share nodes, and the main chain and sub-chain B also share nodes. The execution process of a cross-chain transaction between sub-chains A and B is as follows:
[0205] (1) Users organized in subchain A initiate cross-chain transactions through SDK, or call cross-chain components to initiate cross-chain transactions.
[0206] (2) After all blockchain nodes in sub-chain A reach consensus, the cross-chain transaction is written into the ledger of sub-chain A.
[0207] (3) The shared nodes of subchain A and the main chain monitor the cross-chain transaction and query the transaction route.
[0208] (4) The shared node of subchain A and the main chain checks the accessibility of the transaction route. If it is reachable, the cross-chain transaction is written into the main chain ledger.
[0209] Among them, the shared nodes of subchain A and the main chain can query the local cross-chain route, check the chain information of the local node, and write it into the local main chain ledger after checking the route reachability.
[0210] (5) After the main chain is synchronized through consensus, the shared nodes of the main chain and sub-chain B monitor the cross-chain transaction, complete the routing and reachability verification, and write it into the ledger of sub-chain B.
[0211] After completing the above process, the cross-chain transaction can be queried in Subchain B. The blockchain node in Subchain B can execute the contract. If the execution is successful, the cross-chain transaction is written, the block is finalized, and the cross-chain transaction status is changed to a successful state. The data is then transmitted back to Subchain A, unlocking the key and completing the key update. If the write to Subchain B fails, no state is changed, and the failure status is transmitted back to Subchain A. The unlocking does not change any key values.
[0212] Based on the aforementioned cross-chain transaction method and cross-chain system construction method, this application provides a cross-chain system and a cross-chain management system. The following, combined with the accompanying drawings, introduces the cross-chain system and cross-chain management system of the embodiments of this application from the perspective of functional modularization.
[0213] Referring to the schematic diagram of the cross-chain system architecture shown in Figure 3, the cross-chain system includes a first blockchain network (e.g., the main chain in Figure 3), a second sub-blockchain network (e.g., sub-chain 2 in Figure 3), and a third blockchain network (e.g., sub-chain 1 in Figure 3). The first blockchain network includes a first cross-chain node and a second cross-chain node, each of which is equipped with a cross-chain component. The second blockchain network includes the first blockchain node, and the third blockchain network includes the second blockchain node.
[0214] A first cross-chain node is configured to monitor cross-chain transaction requests through a cross-chain component. The cross-chain transaction request is used to request execution of a cross-chain transaction from the second blockchain network to the third blockchain network. The cross-chain transaction request is synchronized to the first cross-chain node by the first blockchain node after writing the first transaction information of the cross-chain transaction into the ledger of the second blockchain network;
[0215] The first cross-chain node is further configured to query a transaction route by calling a cross-chain contract through a cross-chain component, and when the transaction route is represented as reachable, write the first transaction information of the cross-chain transaction into the ledger of the first cross-chain node in the first blockchain network;
[0216] The second cross-chain node is configured to monitor, through a cross-chain component, the cross-chain transaction request synchronized by the first cross-chain node through the first blockchain network, and write the first transaction information of the cross-chain transaction into the ledger of the third blockchain network;
[0217] The second cross-chain node is further configured to monitor, through the cross-chain component, the node of the third blockchain network to execute a cross-chain transaction, and write the second transaction information of the cross-chain transaction into the ledger of the second cross-chain node on the first blockchain network;
[0218] The first cross-chain node is further configured to monitor the second transaction information of the cross-chain transaction through the cross-chain component, and write the second transaction information of the cross-chain transaction into the ledger of the second blockchain network.
[0219] In some possible implementations, the first cross-chain node is a shared node between the first blockchain network and the second blockchain network, and the second cross-chain node is a shared node between the first blockchain network and the third blockchain network.
[0220] In some possible implementations, the first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the first blockchain network is configured as a relay chain for the second blockchain network and the third blockchain network;
[0221] The first cross-chain node is further configured to receive, through the cross-chain component, a first registration request sent by the first blockchain node, the first registration request including information about the organization corresponding to the first blockchain node, and store the information about the organization corresponding to the first blockchain node;
[0222] The second cross-chain node is further used to receive a second registration request sent by the second blockchain node through the cross-chain component, where the second registration request includes information about the organization corresponding to the second blockchain node, and stores the information about the organization corresponding to the second blockchain node.
[0223] In some possible implementations, the cross-chain transaction request includes a source address and a destination address, or the cross-chain transaction request includes a source identity and a destination address.
[0224] In some possible implementations, the cross-chain transaction request includes multiple destination addresses. When the cross-chain transaction is implemented through the same relay chain, the source address in the cross-chain transaction request is configured with the identifier and channel of the relay chain; when the cross-chain transaction is implemented through different relay chains, the multiple destination addresses in the cross-chain transaction request are respectively configured with the identifiers and channels of their corresponding relay chains.
[0225] In some possible implementations, the first cross-chain node is further configured to:
[0226] Checking, through a cross-chain component, whether the first cross-chain node has a multi-chain configuration, where the multi-chain configuration includes configuration information of multiple blockchain networks joined by the first cross-chain node;
[0227] When the first cross-chain node has a multi-chain configuration, the multi-chain configuration is written into the cross-chain contracts of multiple blockchain networks corresponding to the multi-chain configuration through the cross-chain component.
[0228] In some possible implementations, the first cross-chain node is further configured to:
[0229] Checking, by a cross-chain component, whether the ledger of the first blockchain network includes a multi-chain configuration;
[0230] When the ledger of the first blockchain network includes a multi-chain configuration and the routing table does not include configuration information of the first blockchain network, the routing table is updated in the ledger of the first blockchain network through the cross-chain component.
[0231] In some possible implementations, the first cross-chain node is further configured to:
[0232] The cross-chain component checks whether the multi-chain configuration is locked, and if not, locks the multi-chain configuration.
[0233] In some possible implementations, the first transaction information in the ledger of the second blockchain network is locked by the first blockchain node, and the first cross-chain node is further configured to:
[0234] The status of the cross-chain transaction is notified to the first blockchain node through the cross-chain component, where the status of the cross-chain transaction is used to instruct the first blockchain node to unlock the first transaction information when the status of the cross-chain transaction is successful.
[0235] Next, referring to the schematic diagram of the structure of a cross-chain management system shown in FIG11 , the cross-chain management system 1100 is used to build a cross-chain system. The cross-chain system includes a first blockchain network, a second sub-blockchain network, and a third sub-blockchain network. The cross-chain management system 1100 includes:
[0236] Networking module 1102, configured to deploy a first blockchain network, a second blockchain network, and a third blockchain network;
[0237] The component deployment module 1104 is used to deploy a cross-chain component on at least one blockchain node of the first blockchain network to form a first cross-chain node and a second cross-chain node. The first cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the second blockchain network, and the second cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the third blockchain network.
[0238] Exemplarily, the networking module 1102 and the component deployment module 1104 may be implemented by hardware or software.
[0239] When implemented via software, the networking module 1102 and component deployment module 1104 are applications running on a computing device, such as a computing engine. Applications can be provided in the form of virtualization services. Virtualization services can include virtual machine (VM) services, bare metal server (BMS) services, and container services. VM services can be services that use virtualization technology to create a virtual machine resource pool on multiple physical hosts to provide users with VMs on demand. BMS services are services that create a virtual BMS resource pool on multiple physical hosts to provide users with BMSs on demand. Container services are services that create a virtual container resource pool on multiple physical hosts to provide users with containers on demand. A VM is a simulated virtual computer, or logically a single computer. BMS is a scalable, high-performance computing service with computing performance comparable to traditional physical machines and secure physical isolation. Containers are a kernel virtualization technology that provides lightweight virtualization to isolate user space, processes, and resources. It should be understood that the VM service, BMS service and container service in the above-mentioned virtualization services are only specific examples. In actual applications, virtualization services can also be other lightweight or heavyweight virtualization services, which are not specifically limited here.
[0240] When implemented through hardware, the networking module 1102 and the component deployment module 1104 may include at least one computing device, such as a server. Alternatively, the networking module 1102 and the component deployment module 1104 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0241] In some possible implementations, the first blockchain network and the second blockchain network include a first shared node, and the first blockchain network and the third blockchain network include a second shared node. The component deployment module 1104 is specifically configured to:
[0242] A cross-chain component is deployed on the first shared node to form a first cross-chain node, and a cross-chain component is deployed on the second shared node to form a second cross-chain node.
[0243] In some possible implementations, the first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the cross-chain management system 1100 further includes:
[0244] Configuration module 1106 is used to receive configuration information of the relay chain, where the configuration information is used to configure the first blockchain network as the relay chain of the second blockchain network and the third blockchain network.
[0245] Similar to networking module 1102 and component deployment module 1104, configuration module 1106 can be implemented in hardware or software. When implemented in software, configuration module 1106 is an application running on a computing device, which can be provided as a virtualized service. For example, configuration module 1106 can be a VM service, BMS service, or container service running on a computing device. When implemented in hardware, configuration module 1106 can include at least one computing device, such as a server. Alternatively, configuration module 1106 can be implemented using an ASIC or a PLD.
[0246] In some possible implementations, the networking module 1102 is specifically configured to:
[0247] Call the blockchain creation service to deploy the first blockchain network, the second blockchain network, and the third blockchain network.
[0248] This application also provides a computing device 1200. As shown in Figure 12, computing device 1200 includes a bus 1202, a processor 1204, a memory 1206, and a communication interface 1208. Processor 1204, memory 1206, and communication interface 1208 communicate with each other via bus 1202. Computing device 1200 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1200.
[0249] Bus 1202 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG12 shows a single bus line, but this does not imply a single bus or type of bus. Bus 1202 may include a path for transmitting information between various components of computing device 1200 (e.g., memory 1206, processor 1204, and communication interface 1208).
[0250] The processor 1204 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0251] The memory 1206 may include volatile memory, such as random access memory (RAM). The memory 1206 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0252] The memory 1206 stores executable program code, and the processor 1204 executes the executable program code to implement the aforementioned cross-chain transaction method. Specifically, the memory 1206 stores instructions for the cross-chain system to execute the cross-chain transaction method. For example, the memory 1206 may store instructions for the cross-chain component of the first blockchain network in the cross-chain system to execute the cross-chain transaction method, such as instructions for the cross-chain component of the first cross-chain node to execute the cross-chain transaction method, and / or instructions for the cross-chain component of the second cross-chain node to execute the cross-chain transaction method.
[0253] The communication interface 1208 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1200 and other devices or a communication network.
[0254] This application also provides another computing device. As shown in Figure 13, the difference between this computing device and the one in Figure 12 lies in the memory. The memory 1206 of the computing device in Figure 13 can also store instructions for the cross-chain management system to execute the cross-chain system construction method, such as the instructions of the networking module 1102 and the component deployment module 1104. Furthermore, the memory 1206 can also store instructions of the configuration module 1106.
[0255] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0256] As shown in Figure 14, the computing device cluster includes multiple computing devices 1200. The memory 1206 of the computing devices 1200 in the computing device cluster can store the same cross-chain system instructions for executing the cross-chain transaction method. Among them, at least one computing device stores the instructions for executing the cross-chain transaction method of the cross-chain system to implement the function of a first cross-chain node, and at least one computing device stores the instructions for executing the cross-chain transaction method of the cross-chain system to implement the function of a second cross-chain node.
[0257] In some possible implementations, one or more computing devices 1200 in the computing device cluster can also be used to execute some of the instructions of the cross-chain system for executing the cross-chain transaction method. In other words, the combination of one or more computing devices 1200 can jointly execute the instructions of the cross-chain system for executing the cross-chain transaction method.
[0258] As shown in Figure 15, the computing device cluster includes multiple computing devices 1200. The memory 1206 in the computing device 1200 in the computing device cluster may store the same cross-chain management system 1100 for executing instructions of the cross-chain system construction method.
[0259] It should be noted that the memory 1206 in different computing devices 1200 in the computing device cluster can store different instructions for executing part of the functions of the cross-chain management system 1100.
[0260] Figure 16 illustrates a possible implementation. As shown in Figure 16, two computing devices 1200A and 1200B are connected via a communication interface 1208. The memory in computing device 1200A stores instructions for executing the functions of networking module 1102. The memory in computing device 1200B stores instructions for executing the functions of component deployment module 1104. In other words, the memories 1206 of computing devices 1200A and 1200B jointly store instructions for the cross-chain management system 1100 to execute the cross-chain system construction method. Furthermore, computing device 1200A may also store instructions for the functions of configuration module 1106.
[0261] The connection method between the computing device clusters shown in Figure 16 can be considered to take into account that the cross-chain system construction method provided in this application requires the deployment of cross-chain components for a large number of nodes. Therefore, it is considered to delegate the functions implemented by the component deployment module 1104 to a separate computing device.
[0262] It should be understood that the functionality of the computing device 1200A shown in FIG16 may also be implemented by multiple computing devices 1200. Similarly, the functionality of the computing device 1200B may also be implemented by multiple computing devices 1200.
[0263] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. FIG17 shows a possible implementation. As shown in FIG17 , two computing devices 1200C and 1200D are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1206 in the computing device 1200C stores instructions for executing the functions of the networking module 1102. At the same time, the memory 1206 in the computing device 1200D stores instructions for executing the functions of the component deployment module 1104. Furthermore, the computing device 1200A may also store instructions for the functions of the configuration module 1106.
[0264] It should be understood that the functionality of the computing device 1200C shown in FIG17 may also be implemented by multiple computing devices 1200. Similarly, the functionality of the computing device 1200D may also be implemented by multiple computing devices 1200.
[0265] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for executing a cross-chain transaction in a cross-chain system. The embodiment of the present application also provides another computer-readable storage medium. The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for executing a cross-chain system construction in a cross-chain management system.
[0266] The present application also provides a computer program product containing instructions. This computer program product can be software or a program product containing instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute the cross-chain transaction method described above. The present application also provides a computer program product containing instructions. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute the cross-chain system construction method described above.
[0267] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A cross-chain transaction method, characterized in that: Applied to a cross-chain system, the cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network, the first blockchain network includes a first cross-chain node and a second cross-chain node, the cross-chain node is deployed with a cross-chain component, the second blockchain network includes a first blockchain node, and the third blockchain network includes a second blockchain node, the method includes: The cross-chain component of the first cross-chain node monitors a cross-chain transaction request, where the cross-chain transaction request is used to request execution of a cross-chain transaction from the second blockchain network to the third blockchain network, and the cross-chain transaction request is synchronized to the first cross-chain node by the first blockchain node after writing the first transaction information of the cross-chain transaction into the account book of the second blockchain network; The cross-chain component of the first cross-chain node calls the cross-chain contract to query the transaction route, and when the transaction route representation is reachable, writes the first transaction information of the cross-chain transaction into the account book of the first cross-chain node in the first blockchain network; The cross-chain component of the second cross-chain node monitors the cross-chain transaction request synchronized by the first cross-chain node through the first blockchain network, and writes the first transaction information of the cross-chain transaction into the account book of the third blockchain network; The cross-chain component of the second cross-chain node monitors that the node of the third blockchain network executes the cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the account book of the second cross-chain node in the first blockchain network; The cross-chain component of the first cross-chain node monitors the second transaction information of the cross-chain transaction, and writes the second transaction information of the cross-chain transaction into the account book of the second blockchain network.
2. The method according to claim 1, characterized in that The first cross-chain node is a shared node of the first blockchain network and the second blockchain network, and the second cross-chain node is a shared node of the first blockchain network and the third blockchain network.
3. The method according to claim 1, characterized in that The first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, the first blockchain network is configured as a relay chain for the second blockchain network and the third blockchain network, and the method further includes: The cross-chain component of the first cross-chain node receives a first registration request sent by the first blockchain node, where the first registration request includes information about an organization corresponding to the first blockchain node, and stores the information about the organization corresponding to the first blockchain node; The cross-chain component of the second cross-chain node receives a second registration request sent by the second blockchain node, where the second registration request includes information about the organization corresponding to the second blockchain node, and stores the information about the organization corresponding to the second blockchain node.
4. The method according to any one of claims 1 to 3, characterized in that: The cross-chain transaction request includes a source address and a destination address, or the cross-chain transaction request includes a source end identity and a destination address.
5. The method according to any one of claims 1 to 4, characterized in that: The cross-chain transaction request includes multiple destination addresses. When the cross-chain transaction is implemented through the same relay chain, the source address in the cross-chain transaction request is configured with the identifier and channel of the relay chain; when the cross-chain transaction is implemented through different relay chains, the multiple destination addresses in the cross-chain transaction request are respectively configured with the identifiers and channels of their corresponding relay chains.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The cross-chain component of the first cross-chain node checks whether the first cross-chain node has a multi-chain configuration, where the multi-chain configuration includes configuration information of multiple blockchain networks joined by the first cross-chain node; When the first cross-chain node has a multi-chain configuration, the cross-chain component of the first cross-chain node writes the multi-chain configuration into the cross-chain contracts of multiple blockchain networks corresponding to the multi-chain configuration.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The cross-chain component of the first cross-chain node checks whether the ledger of the first blockchain network includes a multi-chain configuration; When the ledger of the first blockchain network includes a multi-chain configuration and the routing table does not include configuration information of the first blockchain network, the cross-chain component of the first cross-chain node updates the routing table in the ledger of the first blockchain network.
8. The method according to claim 7, characterized in that The method further comprises: The cross-chain component of the first cross-chain node checks whether the multi-chain configuration is locked, and if not, locks the multi-chain configuration.
9. The method according to any one of claims 1 to 8, characterized in that: The first transaction information in the account book of the second blockchain network is locked by the first blockchain node, and the method further includes: The cross-chain component of the first cross-chain node notifies the first blockchain node of the status of the cross-chain transaction. The status is used to indicate that the first blockchain node unlocks the first transaction information when the status of the cross-chain transaction is successful.
10. A method for constructing a cross-chain system, characterized in that: Applied to a cross-chain management system, the cross-chain management system is used to build a cross-chain system, the cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network, the method includes: The cross-chain management system deploys the first blockchain network, the second blockchain network, and the third blockchain network; The cross-chain management system deploys a cross-chain component on at least one blockchain node of the first blockchain network to form a first cross-chain node and a second cross-chain node, the first cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the second blockchain network, and the second cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the third blockchain network.
11. The method according to claim 10, characterized in that The first blockchain network and the second blockchain network include a first shared node, and the first blockchain network and the third blockchain network include a second shared node; The cross-chain management system deploys a cross-chain component on the first shared node to form a first cross-chain node, and deploys a cross-chain component on the second shared node to form a second cross-chain node.
12. The method according to claim 10, characterized in that The first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the method further includes: The cross-chain management system receives configuration information of the relay chain, and the configuration information is used to configure the first blockchain network as the relay chain of the second blockchain network and the third blockchain network.
13. The method according to any one of claims 10 to 12, characterized in that: The cross-chain management system deploys the first blockchain network, the second blockchain network, and the third blockchain network, including: The cross-chain management system calls the blockchain creation service to deploy the first blockchain network, the second blockchain network, and the third blockchain network.
14. A cross-chain system, characterized in that: The cross-chain system includes a first blockchain network, a second blockchain network, and a third blockchain network, wherein the first blockchain network includes a first cross-chain node and a second cross-chain node, wherein the cross-chain node is deployed with a cross-chain component, the second blockchain network includes a first blockchain node, and the third blockchain network includes a second blockchain node; The first cross-chain node is used to monitor the cross-chain transaction request through the cross-chain component, and the cross-chain transaction request is used to request to execute the cross-chain transaction from the second blockchain network to the third blockchain network. The cross-chain transaction request is synchronized to the first cross-chain node by the first blockchain node after writing the first transaction information of the cross-chain transaction into the account book of the second blockchain network; The first cross-chain node is further used to call the cross-chain contract to query the transaction route through the cross-chain component, and when the transaction route representation is reachable, write the first transaction information of the cross-chain transaction into the account book of the first cross-chain node in the first blockchain network; The second cross-chain node is used to monitor the cross-chain transaction request synchronized by the first cross-chain node through the first blockchain network through a cross-chain component, and write the first transaction information of the cross-chain transaction into the account book of the third blockchain network; The second cross-chain node is further configured to monitor the node of the third blockchain network through the cross-chain component to execute the cross-chain transaction, and write the second transaction information of the cross-chain transaction into the account book of the second cross-chain node in the first blockchain network; The first cross-chain node is further used to monitor the second transaction information of the cross-chain transaction through the cross-chain component, and write the second transaction information of the cross-chain transaction into the account book of the second blockchain network.
15. The system according to claim 14, characterized in that The first cross-chain node is a shared node of the first blockchain network and the second blockchain network, and the second cross-chain node is a shared node of the first blockchain network and the third blockchain network.
16. The system according to claim 14 or 15, characterized in that The first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the first blockchain network is configured as a relay chain for the second blockchain network and the third blockchain network; The first cross-chain node is further used to receive, through the cross-chain component, a first registration request sent by the first blockchain node, the first registration request including information of an organization corresponding to the first blockchain node, and store the information of the organization corresponding to the first blockchain node; The second cross-chain node is also used to receive a second registration request sent by the second blockchain node through the cross-chain component, the second registration request includes information of the organization corresponding to the second blockchain node, and stores the information of the organization corresponding to the second blockchain node.
17. The system according to any one of claims 14 to 16, characterized in that: The cross-chain transaction request includes a source address and a destination address, or the cross-chain transaction request includes a source end identity and a destination address.
18. The system according to any one of claims 14 to 17, characterized in that The cross-chain transaction request includes multiple destination addresses. When the cross-chain transaction is implemented through the same relay chain, the source address in the cross-chain transaction request is configured with the identifier and channel of the relay chain; when the cross-chain transaction is implemented through different relay chains, the multiple destination addresses in the cross-chain transaction request are respectively configured with the identifiers and channels of their corresponding relay chains.
19. The system according to any one of claims 14 to 18, characterized in that The first cross-chain node is also used for: Checking, through a cross-chain component, whether the first cross-chain node has a multi-chain configuration, where the multi-chain configuration includes configuration information of multiple blockchain networks joined by the first cross-chain node; When the first cross-chain node has a multi-chain configuration, the multi-chain configuration is written into the cross-chain contracts of multiple blockchain networks corresponding to the multi-chain configuration through the cross-chain component.
20. The system according to any one of claims 14 to 19, characterized in that The first cross-chain node is also used for: Checking, by a cross-chain component, whether the ledger of the first blockchain network includes a multi-chain configuration; When the account book of the first blockchain network includes a multi-chain configuration and the routing table does not include the configuration information of the first blockchain network, the routing table is updated in the account book of the first blockchain network through the cross-chain component.
21. The system according to claim 20, characterized in that The first cross-chain node is also used for: The cross-chain component checks whether the multi-chain configuration is locked, and if not, locks the multi-chain configuration.
22. The system according to any one of claims 14 to 21, characterized in that The first transaction information in the account book of the second blockchain network is locked by the first blockchain node, and the first cross-chain node is further used to: The first blockchain node is notified of the status of the cross-chain transaction through a cross-chain component, and the status of the cross-chain transaction is used to indicate that the first blockchain node unlocks the first transaction information when the status of the cross-chain transaction is successful.
23. A cross-chain management system, characterized in that: The cross-chain management system is used to build a cross-chain system, which includes a first blockchain network, a second blockchain network, and a third blockchain network; the cross-chain management system includes: A networking module, used to deploy the first blockchain network, the second blockchain network, and the third blockchain network; A component deployment module is used to deploy a cross-chain component on at least one blockchain node of the first blockchain network to form a first cross-chain node and a second cross-chain node, wherein the first cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the second blockchain network, and the second cross-chain node is used to synchronize the ledger of the first blockchain network with the ledger of the third blockchain network.
24. The system according to claim 23, characterized in that The first blockchain network and the second blockchain network include a first shared node, and the first blockchain network and the third blockchain network include a second shared node; The component deployment module is specifically used for: A cross-chain component is deployed on the first shared node to form a first cross-chain node, and a cross-chain component is deployed on the second shared node to form a second cross-chain node.
25. The system according to claim 23, characterized in that The first blockchain network, the second blockchain network, and the third blockchain network have no shared nodes, and the system further includes: A configuration module is used to receive configuration information of a relay chain, where the configuration information is used to configure the first blockchain network as a relay chain for the second blockchain network and the third blockchain network.
26. The system according to any one of claims 23 to 25, characterized in that The networking module is specifically used for: Call the blockchain creation service to deploy the first blockchain network, the second blockchain network, and the third blockchain network.
27. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method as described in any one of claims 1 to 13.
28. A computer-readable storage medium, characterized in that: The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 13.
29. A computer program product, characterized in that The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Cross-blockchain communication method and device, cross-chain service system and cross-chain transaction system
CN111181968A
Blockchain multi-chain cross-chain system and implementation mechanism thereof
CN112287029A
Cross-chain interaction method and device
CN113259453A
Internet of Things system cross-chain interaction method based on block chain
CN114363352A
Blockchain implementing cross-chain transactions
WO2019211225A1
Cited By
E-commerce multi-platform data interaction system and method based on block chain
CN120707250A
Block chain data storage-based frozen cattle semen traceability management method
CN121864811A