Cross-chain methods, systems, devices and storage media based on centralized off-chain components

By processing and merging cross-chain transactions in off-chain components, generating transaction requests and verifying them on the destination chain, the problem of high cross-chain transaction costs is solved, and the effects of cost reduction and efficiency improvement are achieved.

CN118096148BActive Publication Date: 2024-08-23HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410517920.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2024-08-23
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

In the existing centralized cross-chain technology, cross-chain transactions require payment of handling fees on two blockchains, resulting in high costs and a lack of effective solutions.

Method used

By obtaining cross-chain transactions in off-chain components, generate user transaction lists and project party pumping lists, perform batch processing and merging, generate transaction requests and verify them on the destination chain, determine transaction fees, and avoid multiple transactions on third-party exchanges. Asset access operations.

Benefits of technology

It reduces the cost of cross-chain transactions and improves the efficiency of cross-chain transactions. By conducting transaction pumping off the chain, the pumping operation of on-chain contracts and the additional costs of third-party exchanges are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118096148B
    Figure CN118096148B
Patent Text Reader

Abstract

The present application relates to a cross-chain method, system, device and storage medium based on a centralized off-chain component, wherein the cross-chain method based on a centralized off-chain component includes: performing a pumping operation on the obtained cross-chain transaction to obtain the corresponding user transaction list and the project party pumping list; generating a corresponding transaction request based on the user transaction list and the project party pumping list; determining the destination chain corresponding to the cross-chain transaction, and sending the transaction request to the destination chain for verification; further, after the verification is passed, executing the transaction operation according to the user transaction list, and determining the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list. Through this application, the problem of high cost of cross-chain transactions is solved, the cost of cross-chain transactions is reduced, and the efficiency of cross-chain transactions is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to cross-chain methods, systems, devices and storage media based on centralized off-chain components. Background Art

[0002] Centralized cross-chain technology is used to transfer assets and data between different blockchain networks. It uses various centralized exchanges for cross-chain. Specifically, users use the relevant applications of third-party exchanges to extract assets from the current blockchain to the exchange, and then send the assets of the exchange to the destination chain.

[0003] However, in the above method, users are required to perform asset deposit and withdrawal operations on centralized exchanges, and each time assets cross-chain, they need to pay handling fees on both chains, resulting in higher costs for cross-chain transactions.

[0004] There is currently no effective solution to the problem of high costs of cross-chain transactions in related technologies. Summary of the invention

[0005] In this embodiment, a cross-chain method, system, device and storage medium based on centralized off-chain components are provided to solve the problem of high cost of cross-chain transactions in related technologies.

[0006] In the first aspect, a cross-chain method based on a centralized off-chain component is provided in this embodiment, and the method includes:

[0007] Perform pumping operations on cross-chain transactions obtained by off-chain components to obtain the corresponding user transaction list and project party pumping list;

[0008] Generate a corresponding transaction request based on the user transaction list and the project party's pumping list;

[0009] Determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification;

[0010] After the verification is passed, the transaction operation is performed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list are determined.

[0011] In some of the embodiments, before performing a pumping operation on the cross-chain transaction obtained by the off-chain component to obtain the corresponding user transaction list and project party pumping list, it also includes:

[0012] Based on a preset time interval threshold and / or transaction quantity threshold, batch processing is performed on the cross-chain transactions acquired by the off-chain component.

[0013] In some of the embodiments, after batch processing of the cross-chain transactions acquired by the off-chain component, the process further includes:

[0014] From the cross-chain transactions processed in batches, multiple cross-chain transactions with the same attributes are selected for merging; the attributes include the destination chain and transaction asset type corresponding to the cross-chain transaction.

[0015] In some of the embodiments, generating a corresponding transaction request based on the user transaction list and the project party's pumping list includes:

[0016] According to the array length of the user transaction list, predict the corresponding transaction workload;

[0017] The transaction request is generated based on the user transaction list, the project party's pumping list and the transaction workload.

[0018] In some embodiments, sending the transaction request to the destination chain for verification includes:

[0019] When the destination link receives the transaction request, determining whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component;

[0020] When the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain.

[0021] In some of the embodiments, after determining the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list, the process further includes:

[0022] Update the record information on the destination chain according to the transaction sequence number and source chain block height corresponding to the last transaction in the transaction request.

[0023] In some of the embodiments, after sending the transaction request to the destination chain for verification, the process further includes:

[0024] When the verification fails, wait for the off-chain component to submit the next transaction request.

[0025] In the second aspect, a cross-chain system based on a centralized off-chain component is provided in this embodiment, and the system is applicable to the cross-chain method based on a centralized off-chain component described in the first aspect above; the system includes: a source chain, an off-chain component, and a destination chain;

[0026] The source chain is used to initiate cross-chain transactions;

[0027] The off-chain component is used to perform a pumping operation on the obtained cross-chain transaction, obtain a corresponding user transaction list and a project party pumping list, and generate a corresponding transaction request based on the user transaction list and the project party pumping list;

[0028] The off-chain component is further used to determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification;

[0029] The destination chain is used to perform transaction operations according to the user transaction list after verification, and determine the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list.

[0030] In the third aspect, a device is provided in this embodiment, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the cross-chain method based on centralized off-chain components described in the first aspect is implemented.

[0031] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the cross-chain method based on centralized off-chain components described in the first aspect above is implemented.

[0032] Compared with the related art, the cross-chain method, system, device and storage medium based on centralized off-chain components provided in this embodiment obtain the corresponding user transaction list and project party pumping list by performing pumping operations on the cross-chain transactions obtained by the off-chain components; generate corresponding transaction requests based on the user transaction list and the project party pumping list; determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification; further, after the verification is passed, perform transaction operations according to the user transaction list, and determine the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list, which solves the problem of high cost of cross-chain transactions, reduces the cost of cross-chain transactions, and improves the efficiency of cross-chain transactions.

[0033] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0035] Figure 1 This is a hardware structure block diagram of a terminal device of a cross-chain method based on a centralized off-chain component provided in an embodiment of the present application;

[0036] Figure 2 It is a flow chart of a cross-chain method based on centralized off-chain components provided in one embodiment of the present application;

[0037] Figure 3 It is a structural diagram of a cross-chain system based on centralized off-chain components provided in an embodiment of the present application;

[0038] Figure 4 It is a flowchart of a cross-chain method based on centralized off-chain components provided in one embodiment of the present application;

[0039] Figure 5 This is a flowchart of a cross-chain method based on centralized off-chain components provided in a preferred embodiment of the present application.

[0040] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, source chain; 20, off-chain component; 30, destination chain. DETAILED DESCRIPTION

[0041] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0042] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0043] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 This is a hardware structure diagram of the terminal of the cross-chain method based on the centralized off-chain components of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0044] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the cross-chain method based on the centralized off-chain component in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0045] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0046] In this embodiment, a cross-chain method based on centralized off-chain components is provided. Figure 2 This is a flow chart of the cross-chain method based on centralized off-chain components in this embodiment. Figure 2 As shown, the process includes the following steps:

[0047] Step S210, perform a pumping operation on the cross-chain transactions obtained by the off-chain component to obtain the corresponding user transaction list and project party pumping list.

[0048] Specifically, Figure 3 As shown in the figure, according to the actual cross-chain needs, the user submits the cross-chain transaction to the corresponding source chain, and the source chain throws out the relevant events of each cross-chain transaction. Based on the preset time interval threshold and / or transaction quantity threshold, the events thrown by the source chain are captured by the off-chain component, and the cross-chain transaction submitted by the user is obtained according to the captured events. Among them, the cross-chain transaction refers to the extraction of assets from the starting blockchain to the target blockchain. The source chain is the starting blockchain of each cross-chain transaction, and the destination chain is the target blockchain of each cross-chain transaction.

[0049] Furthermore, the cross-chain transactions captured by the off-chain components are pumped to obtain the user transaction list and the project party pumping list. It should be noted that the user transaction list includes the asset type corresponding to each cross-chain transaction, the amount to be traded after pumping, and the destination chain address, while the project party pumping list includes the asset type corresponding to each cross-chain transaction, the project party pumping fee, and the project party treasury address.

[0050] Step S220, based on the user transaction list and the project party's pumping list, generate a corresponding transaction request.

[0051] Specifically, the corresponding transaction request is generated according to the user transaction list, the project party's pumping list, and the estimated transaction workload (Gas) corresponding to each transaction in the user transaction list. In addition, the transaction request may include information such as the first and last transaction sequence numbers and the source chain block height of the last transaction to ensure the uniqueness and order of subsequent transactions.

[0052] Step S230, determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification.

[0053] Specifically, the destination chain corresponding to each cross-chain transaction is determined through the off-chain component, and the transaction request is sent to the destination chain for verification. First, it is determined whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component. If the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, it is further verified whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain.

[0054] Step S240, after the verification is passed, the transaction operation is performed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list are determined.

[0055] Specifically, when it is detected that the above starting transaction number is the next number of the current transaction number on the destination chain, it indicates that the verification is passed, and the exchange rate of the supported currency is obtained through the oracle. Based on the currency exchange rate information, the transaction operation is performed according to the transaction information contained in the user transaction list, and the transaction fee corresponding to the user transaction list is calculated at the same time, and the calculated transaction fee is added to the project party treasury.

[0056] It should be noted that, based on the actual application situation, the corresponding payment standards are used to calculate the transaction fees.

[0057] Furthermore, the corresponding pumping fee is calculated according to the project party's pumping list, and the pumping fee is added to the project party's treasury based on the project party's treasury address in the project party's pumping list.

[0058] In the existing cross-chain methods, users are required to perform asset deposit and withdrawal operations on centralized exchanges. Each time an asset crosses the chain, it is necessary to pay a handling fee on both chains, resulting in a high cost for cross-chain transactions.

[0059] Compared with the prior art, the present application performs a pumping operation on the cross-chain transactions obtained by the off-chain components to obtain the corresponding user transaction list and the project party pumping list; based on the user transaction list and the project party pumping list, a corresponding transaction request is generated; the destination chain corresponding to the cross-chain transaction is determined, and the transaction request is sent to the destination chain for verification; further, after the verification is passed, the transaction operation is performed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list are determined. Based on this, by pumping transactions off-chain, the on-chain contract does not need to perform a pumping operation, avoiding additional fees for multiple asset deposits and withdrawals on third-party exchanges, thereby solving the problem of high cross-chain transaction costs, reducing cross-chain transaction costs, and improving the efficiency of cross-chain transactions.

[0060] In some of the embodiments, before performing a pumping operation on the cross-chain transactions obtained by the off-chain component to obtain the corresponding user transaction list and project party pumping list, the following steps are also included:

[0061] Step S201, based on a preset time interval threshold and / or transaction quantity threshold, batch processing is performed on the cross-chain transactions obtained by the off-chain component.

[0062] Specifically, in the process of the off-chain component obtaining cross-chain transactions, multiple cross-chain transactions are aggregated. The aggregation operation includes batch processing of the cross-chain transactions obtained by the off-chain component based on a preset time interval threshold and / or transaction quantity threshold to reduce the cost of submitting transactions.

[0063] Among them, when the number of captured cross-chain transactions reaches the preset transaction number threshold, batch processing is initiated based on the multiple cross-chain transactions currently obtained; or, when the duration of capturing cross-chain transactions reaches the preset time interval threshold, batch processing is initiated for multiple cross-chain transactions obtained within the time interval threshold; in addition, the interval of batch processing can be determined based on the number of transactions and the time interval. When the number of cross-chain transactions captured by the off-chain component reaches the preset transaction number threshold in advance, or the duration of capturing cross-chain transactions reaches the preset time interval threshold in advance, batch processing can be initiated.

[0064] Exemplarily, when the batch processing interval is determined based on the number of transactions and the time interval, the preset time interval threshold is 2 hours and the transaction number threshold is 50 transactions. The states in which batch processing can be initiated include the off-chain component capturing 50 cross-chain transactions within 2 hours, or the number of cross-chain transactions does not reach 50 transactions but the capture time reaches 2 hours.

[0065] Through this embodiment, based on the preset time interval threshold and / or transaction quantity threshold, the cross-chain transactions obtained by the off-chain component are batch processed, so as to reduce the number of transactions, thereby reducing the transaction cost and improving the efficiency of cross-chain transactions.

[0066] In some of the embodiments, after batch processing of the cross-chain transactions obtained by the off-chain component, the following steps are also included:

[0067] Step S202: Select multiple cross-chain transactions with the same attributes from the batch processed cross-chain transactions for merging; the attributes include the destination chain and transaction asset type corresponding to the cross-chain transaction.

[0068] In this embodiment, cross-chain transactions are captured by off-chain components, and multiple cross-chain transactions are aggregated. The aggregation operation includes merging multiple cross-chain transactions with the same attributes in the process of batch processing transactions to achieve batch matching, thereby reducing transaction fees on the destination chain.

[0069] Specifically, from the batch-processed cross-chain transactions, cross-chain transactions with assets to be extracted to the same destination chain and the same transaction asset type are selected for merge processing, thereby reducing the number of transactions processed by the destination chain. It should be noted that the transaction asset type indicates the currency category of the asset transferred to the destination chain in each cross-chain transaction.

[0070] Through this embodiment, multiple cross-chain transactions with the same attributes are selected from batch-processed cross-chain transactions for merging, wherein the attributes of the cross-chain transactions include the destination chain and transaction asset type corresponding to the cross-chain transactions, thereby reducing the number of transactions, reducing transaction costs, and improving the efficiency of cross-chain transactions.

[0071] In some embodiments, generating a corresponding transaction request based on the user transaction list and the project party's pumping list in step S220 includes the following steps:

[0072] Step S221, predicting the corresponding transaction workload according to the array length of the user transaction list;

[0073] Step S222, generating a transaction request based on the user transaction list, the project party's pumping list and the transaction workload.

[0074] Specifically, the user transaction list includes the asset type corresponding to each cross-chain transaction, the amount to be traded after pumping, and the destination chain address, while the project party’s pumping list includes the asset type corresponding to each cross-chain transaction, the project party’s pumping fee, and the project party’s treasury address, etc.

[0075] Furthermore, based on the array length of the user transaction list, the amount of Gas corresponding to each transaction in the user transaction list is estimated, and based on the parameters generated by the off-chain components such as the user transaction list, the project party's pumping list, and the estimated amount of Gas, a transaction request is generated. It should be noted that in order to prevent the loss of Gas fees due to an underestimation of the amount of Gas, a larger amount of Gas can be estimated within a reasonable range.

[0076] Through this embodiment, the corresponding transaction workload is predicted according to the array length of the user transaction list, so that a transaction request can be generated based on the user transaction list, the project party's pumping list and the transaction workload, and the off-chain transaction pumping and Gas estimation can be realized to ensure the subsequent accurate calculation of transaction fees and pumping fees.

[0077] In some embodiments, sending the transaction request to the destination chain for verification in step S230 includes the following steps:

[0078] Step S231, when the destination link receives a transaction request, it is determined whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component;

[0079] Step S232, when the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain.

[0080] Specifically, when the destination link receives a transaction request submitted by an off-chain component, it determines whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component. If the submitter address corresponding to the transaction request is different from the submitter address of the off-chain component, it indicates that the verification has failed. At this point, the destination chain cannot process each cross-chain transaction according to the request content.

[0081] Furthermore, if the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, then verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain. When it is detected that the starting transaction sequence number is the next sequence number of the current transaction sequence number on the destination chain, it indicates that the verification is successful, and the destination chain can process each cross-chain transaction according to the request content.

[0082] Through this embodiment, when the destination link receives a transaction request, it is determined whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, and when the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, it is verified whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain, so that each cross-chain transaction can be processed if the verification is passed, to ensure the uniqueness and sequence of the transaction, and avoid erroneous transactions.

[0083] In some of the embodiments, after determining the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list, the following steps are also included:

[0084] Step S251, update the record information on the destination chain according to the transaction sequence number and source chain block height corresponding to the last transaction in the transaction request.

[0085] It should be noted that the transaction request generated by the off-chain component includes information such as the user transaction list, the project party's pumping list, the estimated Gas amount corresponding to each transaction in the user transaction list, the first and last transaction sequence numbers, and the source chain block height of the last transaction.

[0086] Specifically, after adding the transaction fees corresponding to the user's transaction list and the pumping fees corresponding to the project's pumping list to the project's treasury, the transaction number and source chain block height corresponding to the last transaction in the transaction request are used.

[0087] Through this embodiment, the record information on the destination chain is updated according to the transaction sequence number and the source chain block height corresponding to the last transaction in the transaction request to ensure the order of subsequent transactions and avoid erroneous transactions.

[0088] In some of the embodiments, after sending the transaction request to the destination chain for verification, the following steps are also included:

[0089] When the verification fails, wait for the off-chain component to submit the next transaction request.

[0090] Specifically, when the submitter address corresponding to the transaction request is different from the submitter address of the off-chain component, or it is detected that the starting transaction sequence number in the transaction request is not the next sequence number of the current transaction sequence number on the destination chain, it indicates that the verification fails.

[0091] Furthermore, when the verification fails, the destination chain executes a transaction rollback (Revert) and waits for the off-chain component to submit the next transaction request to avoid incorrect status and invalid transactions being confirmed and executed.

[0092] Through this embodiment, when the transaction request verification fails, the next transaction request is submitted by the off-chain component to ensure the correctness and security of the transaction.

[0093] Figure 4 This is a flow chart of the cross-chain method based on centralized off-chain components in this embodiment. Figure 4 As shown, the cross-chain method based on centralized off-chain components includes the following steps:

[0094] According to the actual cross-chain needs, the user submits the cross-chain transaction to the corresponding source chain S410, and the source chain throws out the relevant events of each cross-chain transaction. Based on the preset time interval threshold and / or transaction quantity threshold, the off-chain component captures the events thrown by the source chain, and obtains the cross-chain transaction submitted by the user based on the captured events S420.

[0095] Furthermore, a pumping operation is performed on the cross-chain transactions captured by the off-chain component to obtain a user transaction list and a project party pumping list, and a corresponding transaction request S430 is generated according to the estimated transaction workload corresponding to each transaction in the user transaction list, the project party pumping list, and the user transaction list.

[0096] Determine the destination chain corresponding to each cross-chain transaction through the off-chain component, and send the transaction request to the destination chain for verification S430. Specifically, determine whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component in the destination chain. If the submitter address corresponding to the transaction request is different from the submitter address of the off-chain component, the verification fails and waits for the next transaction request S450; if the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, further verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain.

[0097] When it is detected that the starting transaction number in the transaction request is not the next number of the current transaction number on the destination chain, it indicates that the verification has not passed and the next transaction request is waiting S450; when it is detected that the starting transaction number is the next number of the current transaction number on the destination chain, it indicates that the verification has passed, and the exchange rate of the supported currency is obtained through the oracle. Based on the currency exchange rate information, the transaction operation is performed according to the transaction information contained in the user transaction list, and the transaction fee corresponding to the user transaction list is calculated at the same time S460, and the calculated transaction fee is added to the project party treasury. After that, the project party's pumping fee is determined, the calculated pumping fee is added to the project party treasury, and the record information on the destination chain is updated S470 according to the transaction number corresponding to the last transaction in the transaction request and the source chain block height.

[0098] The present embodiment is described and illustrated below through preferred embodiments.

[0099] Figure 5 This is a flow chart of the cross-chain method based on the centralized off-chain components of this preferred embodiment. Figure 5 As shown, the cross-chain method based on centralized off-chain components includes the following steps:

[0100] Step S510, based on a preset time interval threshold and / or transaction quantity threshold, performing an aggregation operation on the cross-chain transactions acquired by the off-chain component; the aggregation operation includes batch processing and batch matching;

[0101] Step S520, perform a pumping operation on the cross-chain transactions obtained by the off-chain component to obtain the corresponding user transaction list and project party pumping list;

[0102] Step S530, predicting the corresponding transaction workload according to the array length of the user transaction list;

[0103] Step S540, generating a transaction request based on the user transaction list, the project party's pumping list and the transaction workload;

[0104] Step S550, when the destination link receives a transaction request, it is determined whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component;

[0105] Step S560, when the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain;

[0106] Step S570, after the verification is passed, the transaction operation is performed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list are determined.

[0107] Through this embodiment, based on the preset time interval threshold and / or transaction quantity threshold, the cross-chain transactions obtained by the off-chain component are batch processed and batch matched, so as to reduce the number of times the destination chain processes transactions. Afterwards, the cross-chain transactions obtained by the off-chain component are pumped to obtain the corresponding user transaction list and project party pumping list. According to the array length of the user transaction list, the corresponding transaction workload is predicted, and based on the user transaction list, the project party pumping list and the transaction workload, a transaction request is generated to realize the off-chain transaction pumping and transaction workload estimation, so that the on-chain contract does not need to perform a pumping operation.

[0108] Furthermore, when the destination link receives a transaction request, it determines whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component. If the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, it verifies whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain. After the verification is passed, the transaction operation is performed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list are determined, which solves the problem of high cross-chain transaction costs, reduces cross-chain transaction costs, and improves the efficiency of cross-chain transactions.

[0109] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0110] In this embodiment, a cross-chain system based on centralized off-chain components is also provided. The system is used to implement the above embodiments and preferred implementation modes, and those that have been explained will not be repeated here. Figure 3 This is a schematic diagram of the structure of a cross-chain system based on centralized off-chain components provided in an embodiment of the present application. Figure 3 As shown, the system includes: a source chain 10, a chain component 20 and a destination chain 30;

[0111] Source chain 10, used to initiate cross-chain transactions;

[0112] The off-chain component 20 is used to perform a pumping operation on the obtained cross-chain transaction, obtain the corresponding user transaction list and project party pumping list, and generate a corresponding transaction request based on the user transaction list and the project party pumping list;

[0113] The off-chain component 20 is also used to determine the destination chain corresponding to the cross-chain transaction and send the transaction request to the destination chain for verification;

[0114] The destination chain 30 is used to perform transaction operations according to the user transaction list after verification, and determine the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list.

[0115] Through the system provided by this embodiment, a pumping operation is performed on the obtained cross-chain transactions to obtain the corresponding user transaction list and the project party pumping list; based on the user transaction list and the project party pumping list, a corresponding transaction request is generated; the destination chain corresponding to the cross-chain transaction is determined, and the transaction request is sent to the destination chain for verification; further, after the verification is passed, the transaction operation is performed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list are determined, which solves the problem of high cost of cross-chain transactions, reduces the cost of cross-chain transactions, and improves the efficiency of cross-chain transactions.

[0116] In some of the embodiments, the off-chain component 20 is also used to batch process the obtained cross-chain transactions based on a preset time interval threshold and / or transaction quantity threshold.

[0117] In some of the embodiments, the off-chain component 20 is also used to select multiple cross-chain transactions with the same attributes from the batch-processed cross-chain transactions for merging; the attributes include the destination chain and transaction asset type corresponding to the cross-chain transaction.

[0118] In some of the embodiments, the off-chain component 20 is also used to perform pumping operations on the cross-chain transactions obtained by the off-chain component to obtain the corresponding user transaction list and project party pumping list; predict the corresponding transaction workload based on the array length of the user transaction list; and generate a transaction request based on the user transaction list, the project party pumping list and the transaction workload.

[0119] In some of the embodiments, the destination chain 30 is also used to determine whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component when the destination link receives a transaction request; when the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain.

[0120] In some of the embodiments, the destination chain 30 is also used to update the record information on the chain according to the transaction sequence number corresponding to the last transaction in the transaction request and the source chain block height.

[0121] In some of the embodiments, the destination chain 30 is also used to wait for the off-chain component to submit the next transaction request when the verification fails.

[0122] This embodiment also provides a device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0123] Optionally, the above-mentioned device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above-mentioned processor, and the input / output device is connected to the above-mentioned processor.

[0124] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0125] S1, perform pumping operations on the obtained cross-chain transactions to obtain the corresponding user transaction list and project party pumping list;

[0126] S2, based on the user transaction list and the project party's pumping list, generates the corresponding transaction request;

[0127] S3, determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification;

[0128] S4, after the verification is passed, the transaction operation is executed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list are determined.

[0129] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0130] In addition, in combination with the cross-chain method based on the centralized off-chain component provided in the above embodiment, a storage medium can also be provided in this embodiment to implement. The storage medium stores a computer program; when the computer program is executed by the processor, any cross-chain method based on the centralized off-chain component in the above embodiment is implemented.

[0131] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0132] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0133] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0134] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A cross-chain method based on centralized off-chain components, characterized in that: The method comprises: Based on the preset time interval threshold and / or transaction quantity threshold, the off-chain component captures the events thrown by the source chain, and obtains the cross-chain transactions submitted by the user according to the captured events; Perform pumping operations on the cross-chain transactions obtained by the off-chain components to obtain the corresponding user transaction list and project party pumping list; the user transaction list includes the asset type corresponding to each cross-chain transaction, the amount to be traded after pumping, and the destination chain address; the project party pumping list includes the asset type corresponding to each cross-chain transaction, the project party pumping fee, and the project party treasury address; Based on the user transaction list and the project party's pumping list, a corresponding transaction request is generated, including: generating the corresponding transaction request according to the user transaction list, the project party's pumping list, and the estimated transaction workload corresponding to each transaction in the user transaction list; the transaction request includes the first and last transaction sequence numbers and the source chain block height of the last transaction; Determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification; After the verification is passed, the transaction operation is executed according to the user transaction list, and the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list are determined, including: when it is detected that the starting transaction sequence number is the next sequence number of the current transaction sequence number on the destination chain, it indicates that the verification is passed, and the exchange rate of the supported currency is obtained through the oracle; based on the currency exchange rate information, the transaction operation is executed according to the transaction information contained in the user transaction list, the transaction fee corresponding to the user transaction list is calculated, and the transaction fee is added to the project party's treasury; the corresponding pumping fee is calculated according to the project party's pumping list, and based on the project party's treasury address in the project party's pumping list, the pumping fee is added to the project party's treasury.

2. The cross-chain method based on centralized off-chain components according to claim 1 is characterized in that: Before performing the pumping operation on the cross-chain transactions obtained by the off-chain component to obtain the corresponding user transaction list and project party pumping list, it also includes: Based on a preset time interval threshold and / or transaction quantity threshold, batch processing is performed on the cross-chain transactions acquired by the off-chain component.

3. The cross-chain method based on centralized off-chain components according to claim 2 is characterized in that: After batch processing of the cross-chain transactions acquired by the off-chain component, the method further includes: From the cross-chain transactions processed in batches, multiple cross-chain transactions with the same attributes are selected for merging; the attributes include the destination chain and transaction asset type corresponding to the cross-chain transaction.

4. The cross-chain method based on centralized off-chain components according to claim 1 is characterized in that: The generating a corresponding transaction request based on the user transaction list and the project party's pumping list includes: According to the array length of the user transaction list, predict the corresponding transaction workload; The transaction request is generated based on the user transaction list, the project party's pumping list and the transaction workload.

5. The cross-chain method based on centralized off-chain components according to claim 1 is characterized in that: The sending the transaction request to the destination chain for verification includes: When the destination link receives the transaction request, determining whether the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component; When the submitter address corresponding to the transaction request is the same as the submitter address of the off-chain component, verify whether the starting transaction sequence number in the transaction request is the next sequence number of the current transaction sequence number on the destination chain.

6. The cross-chain method based on centralized off-chain components according to claim 1 is characterized in that: After determining the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party pumping list, it also includes: Update the record information on the destination chain according to the transaction sequence number and source chain block height corresponding to the last transaction in the transaction request.

7. The cross-chain method based on centralized off-chain components according to claim 1 is characterized in that: After sending the transaction request to the destination chain for verification, the method further includes: When the verification fails, wait for the off-chain component to submit the next transaction request.

8. A cross-chain system based on centralized off-chain components, characterized in that: The system is applicable to the cross-chain method based on centralized off-chain components described in any one of claims 1 to 7; the system comprises: a source chain, an off-chain component, and a destination chain; The source chain is used to initiate cross-chain transactions; The off-chain component is used to capture events thrown by the source chain based on a preset time interval threshold and / or transaction quantity threshold, and obtain the cross-chain transaction submitted by the user according to the captured events; The off-chain component is used to perform a pumping operation on the obtained cross-chain transaction, obtain a corresponding user transaction list and a project party pumping list, and generate a corresponding transaction request based on the user transaction list and the project party pumping list; the user transaction list includes the asset type corresponding to each cross-chain transaction, the amount to be traded after pumping, and the destination chain address, and the project party pumping list includes the asset type corresponding to each cross-chain transaction, the project party pumping fee, and the project party treasury address; The off-chain component is further used to generate the corresponding transaction request according to the user transaction list, the project party's pumping list, and the estimated transaction workload corresponding to each transaction in the user transaction list; the transaction request includes the first and last transaction sequence numbers and the source chain block height of the last transaction; The off-chain component is further used to determine the destination chain corresponding to the cross-chain transaction, and send the transaction request to the destination chain for verification; The destination chain is used to perform transaction operations according to the user transaction list after verification, and determine the transaction fee corresponding to the user transaction list and the pumping fee corresponding to the project party's pumping list; The destination chain is also used to indicate that the verification is passed when it is detected that the starting transaction number is the next number of the current transaction number on the destination chain, and obtain the exchange rate of the supported currency through the oracle; based on the currency exchange rate information, the transaction operation is performed according to the transaction information contained in the user transaction list, the transaction fee corresponding to the user transaction list is calculated, and the transaction fee is added to the project party treasury; the corresponding pumping fee is calculated according to the project party pumping list, and based on the project party treasury address in the project party pumping list, the pumping fee is added to the project party treasury.

9. A device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the cross-chain method based on centralized off-chain components as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the cross-chain method based on centralized off-chain components described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Cross-chain exchange method and system based on credible oracle machine and medium

    CN111145023A

  • Digital asset cross-chain transaction method and system

    CN113469809A

  • Block chain under-chain transaction method and device, equipment and storage medium

    CN114329550A

  • Transaction management device, transaction management method and transaction management program

    JP2020042671A

  • Method, apparatus and device for verifying block chain cross-link transaction, and block chain system

    WO2021036522A1