CN113409145A - Cross-block-chain transaction synchronization method and device - Google Patents

Cross-block-chain transaction synchronization method and device Download PDF

Info

Publication number
CN113409145A
CN113409145A CN202110680483.4A CN202110680483A CN113409145A CN 113409145 A CN113409145 A CN 113409145A CN 202110680483 A CN202110680483 A CN 202110680483A CN 113409145 A CN113409145 A CN 113409145A
Authority
CN
China
Prior art keywords
transaction
transfer
result
freezing
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110680483.4A
Other languages
Chinese (zh)
Other versions
CN113409145B (en
Inventor
韩喆
陈聪明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Ant Chuangjiang Information Technology Co ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110680483.4A priority Critical patent/CN113409145B/en
Publication of CN113409145A publication Critical patent/CN113409145A/en
Application granted granted Critical
Publication of CN113409145B publication Critical patent/CN113409145B/en
Priority to PCT/CN2022/093512 priority patent/WO2022262510A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Databases & Information Systems (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Development Economics (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The specification discloses a method and apparatus for cross-blockchain transaction synchronization. The method comprises the following steps: receiving a first frozen transaction; executing a first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result; receiving a first transfer transaction sent by a bridging system; executing a first transfer transaction to call a first transfer logic in the intelligent contract, and under the condition that the second freezing result is determined to be successful, executing unfreezing operation and carrying out balance transfer on the account corresponding to the block chain based on the transaction information to obtain a first transfer result; receiving a confirmation transaction sent by a bridging system; and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.

Description

Cross-block-chain transaction synchronization method and device
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for synchronizing transactions across blockchains.
Background
In the related art, the consensus of transactions among all blockchain nodes in the blockchain system can be performed to ensure the consistency of data. If data consistency is to be guaranteed among a plurality of blockchain systems, the above consensus method cannot be used to achieve the data consistency. Based on this, how to synchronize the transactions of the cross-block chain system becomes the key point of attention in the industry.
Disclosure of Invention
In view of the above, the present specification provides a method and an apparatus for transaction synchronization across block chains.
Specifically, the description is realized by the following technical scheme:
a transaction synchronization method across blockchains is used for realizing transaction synchronization between a first blockchain system and a second blockchain system based on a bridging system, and the method is applied to any blockchain node on the first blockchain system and comprises the following steps:
receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result;
receiving a first transfer transaction sent by a bridging system, wherein the first transfer transaction carries a second freezing result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of a second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful to obtain a first transfer result;
receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
A transaction synchronization method across blockchains is used for realizing transaction synchronization between a first blockchain system and a second blockchain system based on a bridging system, and the method is applied to any blockchain node on the second blockchain system and comprises the following steps:
receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system executing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the corresponding account on the block chain based on the transaction information under the condition that the first freezing result is determined to be successful to obtain a second freezing result;
receiving a second transfer transaction sent by a bridging system, wherein the second transfer transaction carries a first transfer result obtained by a first block chain system executing unfreezing operation on an account corresponding to the transaction information on a block chain and carrying out balance transfer under the condition that a second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
A transaction synchronization method across blockchains is used for realizing transaction synchronization between a first blockchain system and a second blockchain system based on a bridging system, and comprises the following steps:
monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
monitoring a second freezing result of a second blockchain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
monitoring a first dialing result of a first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
monitoring a second transfer result of a second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
A transaction synchronization apparatus across a blockchain, the apparatus comprising:
the first frozen transaction receiving unit is used for receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
the first frozen transaction execution unit is used for executing the first frozen transaction so as to call a first frozen logic in the intelligent contract to execute a freezing operation on the account corresponding to the block chain based on the transaction information to obtain a first frozen result;
the first transfer transaction receiving unit is used for bridging a first transfer transaction sent by the system, and the first transfer transaction carries a second freezing result obtained by executing a freezing operation on an account corresponding to the transaction information on a block chain of the second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
the first transfer transaction execution unit is used for executing the first transfer transaction so as to call a first transfer logic in the intelligent contract, and when the second freezing result is determined to be successful, the first transfer transaction execution unit executes unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information to obtain a first transfer result;
the confirmed transaction receiving unit is used for receiving a confirmed transaction sent by the bridging system, and the confirmed transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on the blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and the confirmed transaction execution unit is used for executing the confirmed transaction so as to call a confirmation logic in the intelligent contract, and under the condition that the second transfer result is successful, the transaction information to be synchronized is determined to be synchronized.
A transaction synchronization apparatus across a blockchain, the apparatus comprising:
the second frozen transaction receiving unit is used for receiving a second frozen transaction sent by the bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by the first block chain system performing a freezing operation on an account corresponding to the transaction information on the block chain;
the second frozen transaction execution unit is used for executing a second frozen transaction to call a second frozen logic in the intelligent contract, and under the condition that the first frozen result is determined to be successful, freezing operation is executed on the account corresponding to the block chain based on the transaction information to obtain a second frozen result;
the second transfer transaction receiving unit is used for receiving a second transfer transaction sent by the bridging system, and the second transfer transaction carries a first transfer result obtained by the first block chain system executing unfreezing operation on an account corresponding to the transaction information on the block chain and carrying out balance transfer under the condition that the second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and the second transfer transaction execution unit is used for executing a second transfer transaction so as to call a second transfer logic in the intelligent contract, and when the first transfer result is determined to be successful, the corresponding account on the local block chain is unfrozen and balance transfer is carried out based on the transaction information so as to obtain a second transfer result, so that the first block chain system can determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
A transaction synchronization apparatus across a blockchain, the apparatus comprising:
the first freezing result monitoring unit is used for monitoring a first freezing result obtained by the first block chain system performing freezing operation on an account corresponding to the transaction information to be synchronized on the block chain;
the second frozen transaction sending unit generates a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sends the second frozen transaction to a second block chain system;
the second freezing result monitoring unit monitors a second freezing result of the second block chain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
the first transfer transaction sending unit generates a first transfer transaction based on the second freezing result and sends the first transfer transaction to a first block chain system;
the first allocation result monitoring unit monitors a first allocation result of the first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
the second transfer transaction sending unit generates a second transfer transaction based on the first transfer result and sends the second transfer transaction to a second block chain system;
the second allocation result monitoring unit monitors a second allocation result of the second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and the confirmed transaction sending unit is used for generating a confirmed transaction based on the second transfer result and sending the confirmed transaction to the first block chain system so as to ensure that the first block chain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
A transaction synchronization device across a blockchain, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to transaction synchronization logic across a blockchain, the processor is caused to:
receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result;
receiving a first transfer transaction sent by a bridging system, wherein the first transfer transaction carries a second freezing result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of a second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful to obtain a first transfer result;
receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
A transaction synchronization device across a blockchain, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to transaction synchronization logic across a blockchain, the processor is caused to:
receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system executing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the corresponding account on the block chain based on the transaction information under the condition that the first freezing result is determined to be successful to obtain a second freezing result;
receiving a second transfer transaction sent by a bridging system, wherein the second transfer transaction carries a first transfer result obtained by a first block chain system executing unfreezing operation on an account corresponding to the transaction information on a block chain and carrying out balance transfer under the condition that a second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
A transaction synchronization device across a blockchain, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to transaction synchronization logic across a blockchain, the processor is caused to:
monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
monitoring a second freezing result of a second blockchain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
monitoring a first dialing result of a first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
monitoring a second transfer result of a second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
One embodiment of the present specification realizes that any blockchain node on the first blockchain may receive a first frozen transaction that carries transaction information to be synchronized, execute the first frozen transaction to invoke a first freezing logic in the intelligent contract to freeze a corresponding account on the blockchain based on the transaction information, and obtain a first frozen result. The bridging system can monitor the first freezing result, generate a second freezing transaction based on the first freezing result and the transaction information to be synchronized, and send the second freezing transaction to the second blockchain system, so that the second blockchain system executes the second freezing transaction, and a second freezing logic in the intelligent contract is called to freeze an account corresponding to the transaction information on the blockchain of the intelligent contract to obtain a second freezing result when the first freezing result is determined to be successful. The bridging system can monitor a second freezing result, generate a first dialing transaction based on the second freezing result and send the first dialing transaction to the first blockchain system, the first blockchain system can call a first dialing logic in the intelligent contract after receiving the first dialing transaction, and when the second freezing result is determined to be successful, the corresponding account on the blockchain is unfrozen based on the transaction information and balance is dialed to obtain a first dialing result. The bridging system can monitor the first allocation result, generate a second allocation transaction based on the first allocation result, and send the second allocation transaction to the second blockchain system, so that the second blockchain system executes the second allocation transaction, and call a second allocation logic in the intelligent contract to unfreeze an account corresponding to the transaction information on the blockchain of the intelligent contract and perform balance allocation to obtain the second allocation result under the condition that the first allocation result is determined to be successful. The bridge system may monitor the second transfer result, generate a confirmation transaction based on the second transfer result, and send the confirmation transaction to the first blockchain system, and the first blockchain system may execute the confirmation transaction to call a confirmation logic in the intelligent contract to determine that the synchronization of the transaction information to be synchronized is completed when the second transfer result is determined to be successful.
By adopting the method, the first blockchain system can synchronize the transaction information to be synchronized based on the bridging system and the second blockchain system, the bridging system can generate corresponding transactions based on the transaction types currently executed by the first blockchain system and the second blockchain system, and the first blockchain system and the second blockchain system are promoted to execute corresponding processes through the transactions, the data synchronization is realized on the blockchain in the whole process, and the problem that the transaction information is tampered due to the fact that the transaction information is processed under the chain can be avoided. And the first block chain system and the second block chain system perform the next processing after the execution success of the other party is determined, so that the problems of missing and unsuccessful synchronization of transaction information needing synchronization caused by the fact that a certain party fails to execute successfully can be avoided, and the safety and reliability of transaction synchronization can be greatly improved.
Drawings
FIG. 1 is a schematic diagram of a scenario of a transaction synchronization method across a blockchain according to an exemplary embodiment of the present disclosure;
FIG. 2 is a flow diagram illustrating a method of transaction synchronization across a blockchain in accordance with an exemplary embodiment of the present description;
FIG. 3 is a flow diagram illustrating another method of transaction synchronization across blockchains in accordance with an exemplary embodiment of the present description;
FIG. 4 is a flow diagram illustrating another method of transaction synchronization across blockchains in accordance with an exemplary embodiment of the present description;
FIG. 5 is a multi-party interaction diagram illustrating a cross blockchain transaction synchronization methodology in accordance with an exemplary embodiment of the present specification;
FIG. 6 is a hardware block diagram of an electronic device in which a cross blockchain transaction synchronization mechanism is located in an exemplary embodiment of the present description;
FIG. 7 is a block diagram of a transaction synchronization mechanism across a blockchain as shown in an exemplary embodiment of the present description;
FIG. 8 is a block diagram of another transaction synchronization mechanism across a blockchain as shown in an exemplary embodiment of the present description;
fig. 9 is a block diagram of another transaction synchronization mechanism across a blockchain as shown in an exemplary embodiment of the present description.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The block chain technology, also called distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" together, and a complete distributed database is maintained together. The blockchain technology has been widely used in many fields due to its characteristics of decentralization, transparency, participation of each computing device in database records, and rapid data synchronization between computing devices.
In the blockchain technology, real data generated in the physical world can be constructed into a transaction (transaction) format in a standard supported by the blockchain, and then is issued to the blockchain, and a node device in the blockchain performs consensus processing on the received transaction. Through consensus, the transactions stored on each node device in the block chain can be synchronized to ensure that the transactions stored on each node device are the same, thereby achieving data consistency.
However, the above-mentioned consensus method can only achieve transaction synchronization between node devices in the blockchain system, and if it is desired to achieve transaction synchronization across blockchains among a plurality of blockchain systems, it cannot be achieved by the above-mentioned consensus method. In the related technology, transaction synchronization between the inter-block chain systems can be realized through a notary mechanism, specifically, a centralized third-party system is used for confirming and forwarding the transaction of the inter-block chain, however, the method has the risks of tampering and omission of the transaction, and the security is low.
Based on this, the present specification provides a method for synchronizing transactions across block chains, which can synchronize transactions across block chain systems, and ensure that the transactions are not tampered during the synchronization process, avoid omission, and improve the security and reliability of transaction synchronization.
First, a description will be given of a scenario of a transaction synchronization method across block chains described in this specification.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a transaction synchronization method across a blockchain according to an exemplary embodiment of the present disclosure.
Fig. 1 includes a first blockchain system 10, a second blockchain system 20, and a bridging system 30. The first blockchain system 10 may maintain a blockchain, which includes a plurality of blockchain nodes for carrying the blockchain, i.e., a blockchain node 1i including a blockchain link point 11, a blockchain link point 12, a blockchain link point 13, and a blockchain node 14 … …. The second blockchain system 20 may maintain a blockchain including a plurality of blockchain nodes for carrying the blockchain, i.e., blockchain node 21, blockchain point 22, blockchain point 23, and blockchain point 24 … … blockchain node 2 j.
The number of the blockchain link points of the first blockchain system may be the same as or different from the number of the nodes of the second blockchain system. The first blockchain system 10 and the second blockchain system 20 can each interact with the bridging system 30, and the transaction synchronization between the two blockchain systems is realized through the bridging system 30, which will be described in detail in the following embodiments.
Of course, the scenario shown in fig. 1 is merely an exemplary illustration and is not used to limit the present specification.
Having set forth the foregoing scenario, an embodiment of a method for transaction synchronization across blockchains as provided by the present specification is described below.
Referring to fig. 2, fig. 2 is a flowchart illustrating a transaction synchronization method across block chains according to an exemplary embodiment of the present disclosure. The method may be applied to any blockchain node on the first blockchain system, such as blockchain link point 11 in first blockchain system 10 in fig. 1. The method may comprise the steps of:
step 202, receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized.
The embodiment can realize the transaction synchronization between the first blockchain system and the second blockchain system aiming at the transaction information to be synchronized. For example, the transaction information to be synchronized may be transfer transaction information and remittance transaction information, and the transaction information may include a transaction amount and corresponding transfer-out account and transfer-in account, for example, the transaction information may include 500 yuan for transfer of zhang three to lie four, where the transfer-out account is zhang three, the transfer-in account is lie four, and the transaction amount is 500 yuan.
In one example, the bridge system may interface with the business system, the user may initiate a transaction based on the business system, such as a remittance transaction as in the above example, and then the business system may determine whether the transaction needs to be synchronized, and if so, may provide information of the transaction to the bridge system, and the bridge system may provide information of the transaction to be synchronized to the first blockchain system and the second blockchain system for synchronization.
There are various methods for determining whether the transaction is the transaction information to be synchronized, for example, determining whether the transaction type conforms to the type specified by the transaction to be synchronized, for example, the specified type may be cross-border remittance, and in the context of cross-border remittance, there are an intra-border blockchain and an extra-border blockchain, so that the remittance transaction needs to be synchronized on the two blockchains. Of course, this example is merely an exemplary illustration, and other methods may be adopted in an actual service scenario, and this embodiment does not specifically limit this.
In another example, the user may also directly initiate a transaction to any one of the blockchain nodes of the first blockchain system, and the first blockchain system may determine the transaction information as the transaction information to be synchronized and synchronize with the second blockchain system based on the bridging system.
For example, the bridging system may monitor blocking events at any blockchain node on the first blockchain system, acquire these blocks, acquire transactions from these blocks, and then provide these transactions to the second blockchain system. A plurality of target user IDs needing transaction synchronization may be preset, and the second blockchain system may determine whether the user IDs corresponding to the transactions belong to the target user IDs, and if so, the transactions are synchronous. Or, a keyword may also be preset when the intelligent contract is deployed, the first blockchain system may include the keyword in an execution result after executing the transaction to be synchronized, and the bridging system or the second blockchain system may determine the transaction that needs to be synchronized based on the keyword.
Of course, the user may also directly initiate a transaction to any blockchain node of the second blockchain system, and the second blockchain system may determine the transaction information of the transaction as the transaction information to be synchronized and synchronize with the first blockchain system based on the bridging system, which is not limited in this respect.
In this embodiment, a blockchain node on the first blockchain system may receive a first frozen transaction, and the first frozen transaction may carry transaction information to be synchronized. The first frozen transaction may be sent by the bridging system or by another party.
In an example, for the above example where the user initiates the transaction information to be synchronized based on the service system, after the service system sends the transaction information of the transaction to the bridge system, the bridge system may generate a first frozen transaction based on the transaction information to be synchronized, and send the first frozen transaction to any blockchain node on the first blockchain system.
In another example, for the above example where the user initiates the transaction to be synchronized directly to any blockchain node on the first blockchain system, then the blockchain node may receive the first frozen transaction directly.
And 204, executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the local block chain based on the transaction information to obtain a first freezing result.
In this embodiment, after the block link node on the first block chain receives the first frozen transaction, the first frozen transaction may be executed to invoke a first freezing logic in the intelligent contract to find the corresponding account on the block chain based on the transaction information, and execute a freezing operation on the account.
Among them, the freezing operation may be various.
For example, the balances of the transferred account and the transferred account corresponding to the transaction amount can be frozen, that is, no one is allowed to transfer the balances of the two accounts. Still taking the example of 500 remittances of zhang san and lie, as described above, the account with zhang san and the account with lie xi can be found, and then the two accounts can be blocked.
For another example, only the balance of the transferred account may be frozen. Still taking the above example as an example, the account balance of Zhang three may be frozen without freezing the account balance information of Liqu.
As another example, only the transfer account may be blocked for the transaction amount. Still taking the above example as an example, 500 dollars may be frozen for only three accounts. After freezing, the situation that the balance of Zhang Sandan account operated by other parties causes the balance to be less than 500 yuan can be avoided.
In this embodiment, a first freeze result may be obtained after freezing, which may be a success or a failure.
Step 206, receiving a first transfer transaction sent by a bridging system, where the first transfer transaction carries a second frozen result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of the second block chain system when the first frozen result is determined to be successful; and the first freezing result is obtained by monitoring by the bridging system.
And 208, executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful, so as to obtain a first transfer result.
In this embodiment, the bridging system may monitor the first freeze result from the first blockchain system, and the monitoring method may refer to the related art, which is not limited to this. The bridging system may generate a second frozen transaction based on the first frozen result and the pending transaction information and then send the second frozen transaction to any blockchain node in the second blockchain system. After receiving the second freezing transaction, the block link node may invoke a second freezing logic in the intelligent contract to find the corresponding account on the block chain based on the transaction information carried in the second freezing transaction, and perform a freezing operation on the account to obtain a second freezing result, where the second freezing result may be success or failure. The freezing operation may specifically refer to the freezing operation performed at any block link point on the first block chain, and is not described herein again.
The bridging system may monitor a second freeze result from the second blockchain system, generate a first transfer transaction based on the second freeze result, and then send the first transfer transaction to any blockchain node in the first blockchain system. After receiving the first transfer transaction, the block chain link point may call a first transfer logic in the intelligent contract, and perform a defreezing operation on the account corresponding to the block chain based on the transaction information and perform balance transfer when determining that the second freezing result is successful.
Wherein the thawing operation may correspond to the freezing operation.
For example, still taking the example of 500-nm of Zhang three to LieIV as the previous example, if the freeze operation is to freeze the account balances of Zhang three and LieIV, then the unfreeze operation may be to unfreeze both account balances.
For another example, if the freeze operation is to only freeze 500 yuan for zhang san account, the unfreeze operation may be 500 yuan unfreezing of zhang san account balance.
The balance transfer may then be performed for the transfer-out account and the transfer-in account for the transaction amount.
Still taking the above example as an example, 500 yuan may be deducted from the account of zhang san, and 500 yuan may be transferred to the account of lie xi to implement balance transfer. After the balance is transferred, a first transfer result can be obtained, and the first transfer result can be success or failure.
Step 210, receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and performing balance transfer under the condition that the first transfer result is determined to be successful; and the first dialing result is obtained by monitoring by the bridging system.
And 212, executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
In this embodiment, the bridging system may monitor the first transfer result from the first blockchain system, generate a second transfer transaction based on the first transfer result, and then send the second transfer transaction to any blockchain node in the second blockchain system. After receiving the second transfer transaction, the block chain link point may call a second transfer logic in the intelligent contract to perform a defrosting operation on the account corresponding to the block chain based on the transaction information and perform balance transfer to obtain a second transfer result, where the second transfer result may be success or failure, when it is determined that the first transfer result is successful. The thawing operation and balance allocation method may specifically refer to a thawing operation and balance allocation method executed by any block link point on the first block chain, and are not described herein again.
The bridging system may monitor a second transfer result from the second blockchain system, generate a confirmation transaction based on the second transfer result, and then send the confirmation transaction to any blockchain node in the first blockchain system. After the block chain link point receives the confirmed transaction, the confirmation logic in the intelligent contract can be called to confirm that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
As can be seen from the above description, in an embodiment of the present specification, any blockchain node on the first blockchain may receive a first frozen transaction carrying transaction information to be synchronized, execute the first frozen transaction to invoke first freezing logic in the intelligent contract to freeze a corresponding account on the blockchain based on the transaction information, so as to obtain a first frozen result. The bridging system can monitor the first freezing result, generate a second freezing transaction based on the first freezing result and the transaction information to be synchronized, and send the second freezing transaction to the second blockchain system, so that the second blockchain system executes the second freezing transaction, and a second freezing logic in the intelligent contract is called to freeze an account corresponding to the transaction information on the blockchain of the intelligent contract to obtain a second freezing result when the first freezing result is determined to be successful. The bridging system can monitor a second freezing result, generate a first dialing transaction based on the second freezing result and send the first dialing transaction to the first blockchain system, the first blockchain system can call a first dialing logic in the intelligent contract after receiving the first dialing transaction, and when the second freezing result is determined to be successful, the corresponding account on the blockchain is unfrozen based on the transaction information and balance is dialed to obtain a first dialing result. The bridging system can monitor the first allocation result, generate a second allocation transaction based on the first allocation result, and send the second allocation transaction to the second blockchain system, so that the second blockchain system executes the second allocation transaction, and call a second allocation logic in the intelligent contract to unfreeze an account corresponding to the transaction information on the blockchain of the intelligent contract and perform balance allocation to obtain the second allocation result under the condition that the first allocation result is determined to be successful. The bridge system may monitor the second transfer result, generate a confirmation transaction based on the second transfer result, and send the confirmation transaction to the first blockchain system, and the first blockchain system may execute the confirmation transaction to call a confirmation logic in the intelligent contract to determine that the synchronization of the transaction information to be synchronized is completed when the second transfer result is determined to be successful.
By adopting the method, the first blockchain system can synchronize the transaction information to be synchronized based on the bridging system and the second blockchain system, the bridging system can generate corresponding transactions based on the transaction types currently executed by the first blockchain system and the second blockchain system, and the first blockchain system and the second blockchain system are promoted to execute corresponding processes through the transactions, the data synchronization is realized on the blockchain in the whole process, and the problem that the transaction information is tampered due to the fact that the transaction information is processed under the chain can be avoided. And the first block chain system and the second block chain system perform the next processing after the execution success of the other party is determined, so that the problems of missing and unsuccessful synchronization of transaction information needing synchronization caused by the fact that a certain party fails to execute successfully can be avoided, and the safety and reliability of transaction synchronization can be greatly improved.
Another embodiment of a method for transaction synchronization across blockchains is provided herein.
Referring to fig. 3, fig. 3 is a flowchart illustrating another transaction synchronization method across block chains according to an exemplary embodiment of the present disclosure. The method may be applied to any blockchain node on the second blockchain system, such as blockchain node 21 in second blockchain system 20 in fig. 1.
The method may comprise the steps of:
step 302, receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system performing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
step 304, executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the account corresponding to the block chain based on the transaction information under the condition that the first freezing result is determined to be successful, so as to obtain a second freezing result;
step 306, receiving a second transfer transaction sent by the bridging system, where the second transfer transaction carries a first transfer result obtained by the first blockchain system performing unfreezing operation on an account corresponding to the transaction information on the blockchain and performing balance transfer on the account when the second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and 308, executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation on the account corresponding to the block chain based on the transaction information and performing balance transfer under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
The above steps are explained in detail below.
In this embodiment, any blockchain link point on the second blockchain system may receive a second frozen transaction sent by the bridging system, where the second frozen transaction includes transaction information to be synchronized and a first frozen result obtained by the first blockchain system freezing an account corresponding to the transaction information on the blockchain of the first blockchain system. The method for obtaining the first freezing result of the first block chain refers to the foregoing embodiments, and is not described herein again.
After any block chain node on the second block chain system receives the second freezing transaction, the second freezing transaction can be executed to call a second freezing logic in the intelligent contract, whether the first freezing result carried in the transaction is successful or not is judged, and under the condition that the first freezing result is successful, the freezing operation is executed on the account corresponding to the block chain based on the transaction information, and the second freezing result is obtained. The second freeze result may be a success or a failure. The freezing operation can specifically refer to the foregoing embodiments, and is not described herein again.
The bridging system can monitor the second freezing result, generate a first allocation transaction based on the second freezing result, and send the first allocation transaction to any blockchain node on the first blockchain, so that the blockchain node performs unfreezing operation on an account corresponding to the transaction information on the blockchain and performs balance allocation to obtain the first allocation result under the condition that the second freezing result is determined to be successful. The method for obtaining the first allocation result of the first blockchain refers to the foregoing embodiments, and is not described herein again.
The bridging system can monitor the first transfer result, generate a second transfer transaction based on the first transfer result, and send the second transfer transaction to any blockchain node on the second blockchain, wherein the second transfer transaction includes the first transfer result.
After any block chain link point on the second block chain system receives a second transfer transaction, the second transfer transaction can be executed, so that a second transfer logic in the intelligent contract is called, whether a first transfer result carried in the transaction is successfully frozen or not is judged, and under the condition that the first transfer result is successfully determined, unfreezing operation is executed on the account corresponding to the block chain based on the transaction information, balance transfer is carried out, and a second transfer result is obtained. The second freeze result may be a success or a failure. The thawing operation and balance allocation method may specifically refer to the foregoing embodiments, and are not described herein again.
The bridging system can monitor the second transfer result, generate a confirmation transaction based on the first transfer result, and send the confirmation transaction to any blockchain node on the first blockchain, so that the blockchain node determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful. The specific method for determining whether the transaction information to be synchronized is synchronized by the first blockchain system may refer to the foregoing embodiments, and details are not repeated herein.
For the second blockchain system, it may be determined that the synchronization of the transaction information to be synchronized is completed when the second transfer result is successful, and that the synchronization of the transaction information to be synchronized is failed when the transfer result is failed. Of course, other methods may be adopted, and no particular limitation is imposed thereon.
As can be seen from the above description, in an embodiment of the present specification, the second blockchain system may perform transaction synchronization with the first blockchain system based on the bridging system, and the whole process is to implement data synchronization on the blockchain, so that the problem that the transaction information is tampered due to processing of the transaction information under the chain can be avoided. And the first block chain system and the second block chain system perform the next processing after the execution success of the other party is determined, so that the problems of missing and unsuccessful synchronization of transaction information needing synchronization caused by the fact that a certain party fails to execute successfully can be avoided, and the safety and reliability of transaction synchronization can be greatly improved.
Another embodiment of a method for transaction synchronization across blockchains is provided herein.
Referring to fig. 4, fig. 4 is a flowchart illustrating another transaction synchronization method across block chains according to an exemplary embodiment of the present disclosure. The method may be applied to a bridging system, such as bridging system 30 in fig. 1. The method may comprise the steps of:
step 402, monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
step 404, generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
step 406, a second freezing result of the second block chain system is monitored; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
step 408, generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
step 410, monitoring a first transfer result of the first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
step 412, generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
step 414, a second transfer result to the second blockchain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and 416, generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system, so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
The above steps are explained in detail below.
In this embodiment, the bridging system may monitor a first freezing result on the first blockchain, where the first freezing result may be obtained by the first blockchain system freezing an account corresponding to the transaction information to be synchronized on the blockchain of the first blockchain, and the first freezing result may be success or failure.
The method for monitoring by the bridging system may refer to the related art, which is not limited in this embodiment.
Wherein the first frozen transaction may be generated and sent by the bridging system to the first blockchain system. That is, the bridging system may acquire transaction information to be synchronized, generate a first frozen transaction based on the transaction information, and send the transaction to any blockchain node on the first blockchain system. Alternatively, the first frozen transaction may also be sent by other parties, which may specifically refer to the foregoing embodiments and will not be described herein again.
After monitoring the first freezing result, the bridging system can generate a second freezing transaction based on the transaction information to be synchronized and the first freezing result, and send the second freezing transaction to any blockchain node on the second blockchain system, so that the blockchain node executes the second freezing transaction and freezes an account corresponding to the transaction information on the blockchain of the blockchain node under the condition that the first freezing result is determined to be successful, and a second freezing result is obtained.
The bridging system may monitor a second freezing result from the second blockchain, generate a first transfer transaction based on the second freezing result, and send the first transfer transaction to the first blockchain system, so that the first blockchain system executes the first transfer transaction, and when it is determined that the second freezing result is successful, defreeze an account corresponding to the transaction information on the blockchain and transfer a balance to obtain a first transfer result.
The bridging system can monitor a first transfer result from the first blockchain, generate a second transfer transaction based on the first transfer result, and send the second transfer transaction to the second blockchain system, so that the second blockchain system executes the second transfer transaction, and when the first freezing result is determined to be successful, the account corresponding to the transaction information on the blockchain is thawed and the balance is transferred to obtain a second transfer result.
The bridging system may monitor a second transfer result from the second blockchain, generate a confirmation transaction based on the second transfer result, and send the confirmation transaction to the first blockchain system, so that the first blockchain determines that the transaction information to be synchronized is synchronized when the second transfer result is successful.
As can be seen from the above description, in an embodiment of the present specification, the second blockchain system may perform transaction synchronization with the first blockchain system based on the bridging system, and the whole process is to implement data synchronization on the blockchain, so that the problem that the transaction information is tampered due to processing of the transaction information under the chain can be avoided. And the first block chain system and the second block chain system perform the next processing after the execution success of the other party is determined, so that the problems of missing and unsuccessful synchronization of transaction information needing synchronization caused by the fact that a certain party fails to execute successfully can be avoided, and the safety and reliability of transaction synchronization can be greatly improved.
Another embodiment of a method for transaction synchronization across blockchains is provided herein.
In this embodiment, an intelligent contract may be deployed, where the intelligent contract may include interfaces of different types, and the different interfaces may correspond to different logics to implement different functions. See table 1 below:
Figure BDA0003122626440000141
TABLE 1
As shown in the above table 1, the intelligent contract may include five interfaces, i.e., a start interface, a predandle interface, a handle interface, a confirm interface, and an end interface, and different interfaces may correspond to different logics, for example, the start interface may correspond to a first freeze logic, the predandle interface may correspond to a second freeze logic, the handle interface may correspond to a first dial logic, the end interface may correspond to a second dial logic, and the end interface may correspond to a confirmation logic. Where each different logic may be used to implement different functions, as will be described in more detail in the following embodiments.
Of course, table 1 above is merely illustrative and not intended to limit the present disclosure. For example, in other embodiments, a corresponding intelligent contract may be generated for each logic, that is, 5 intelligent contracts may be generated, which is not particularly limited.
In addition, in this embodiment, the first blockchain system and the second blockchain system may further have respective public and private key pairs, and the public and private key pairs may be obtained by applying from a certification authority, which may refer to related technologies. In this embodiment, the first blockchain system and the second blockchain system may verify the received data by a public and private key to verify whether the data is tampered, so as to improve the security of transaction synchronization between the two systems. Details will be described in the following examples. The public keys of the blockchain systems can be exchanged in advance, or the public keys can be carried in the execution result of the transaction, so that the bridging system transmits the public keys to the corresponding blockchain systems. This is not particularly limited.
Of course, besides the above verification method based on public and private keys, other methods may also be adopted to verify whether the information is tampered, for example, a symmetric key may also be adopted to verify, which is not limited in this specification.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a multi-party interaction of a transaction synchronization method across a blockchain according to an exemplary embodiment of the present disclosure.
The method may comprise the steps of:
at step 502, the bridging system generates a first frozen transaction.
In this embodiment, the bridging system may acquire the transaction information to be synchronized, and then generate a first frozen transaction, where the first frozen transaction includes the transaction information to be synchronized.
In step 504, the bridging system sends a first frozen transaction to the first blockchain system.
Step 506, the first blockchain system executes the first freeze transaction to obtain a first freeze result.
In this embodiment, the bridging system may send a first frozen transaction to any blockchain node on the first blockchain, where the first frozen transaction may be used to invoke a start interface in the intelligent contract. After receiving the first frozen transaction, the block link point may determine to invoke a first freezing logic in the intelligent contract based on a start interface, and freeze a corresponding account on the block chain based on the transaction information to obtain a first freezing result. Wherein the first freeze result may be a success or a failure.
The bridging system listens for the first freeze result, step 508.
At step 510, the bridging system generates a second frozen transaction.
In step 512, the bridging system sends a second freeze transaction to the second blockchain system.
In this embodiment, the bridging system may monitor the first freezing result from the first blockchain, and the first freezing result may be obtained by encrypting with a private key of the first blockchain, for example, the first freezing result may be monitored from a world state, and results obtained after a subsequent blockchain system executes a transaction may all be monitored from the world state.
Moreover, the bridge system may also hold the call order of each interface, for example, the call order may be start, prehandle, handle, confirm, and end. After monitoring the first freezing result, the bridging system may also monitor that the first freezing result is obtained by invoking a start interface, and then the bridging system may determine that a next interface to be invoked is a predandle according to the above sequence. The bridging system may generate a second frozen transaction that may include the first frozen result, transaction information to be synchronized, which may be encrypted using the private key of the first blockchain. The bridging system may then send a second frozen transaction to any blockchain node on the second blockchain, the second frozen transaction used to invoke the prehandle interface in the smart contract.
In step 514, the second blockchain system executes a second freeze transaction to obtain a second freeze result.
In this embodiment, after receiving the second frozen transaction, any block link point on the second block chain system may determine to invoke a second freezing logic in the intelligent contract based on the prehandle interface, where the second freezing logic may determine whether the first freezing result is successful, verify whether the first freezing result is tampered (for example, decrypt and verify private key encrypted data carried in the transaction based on a public key of the first block chain system, and if the first freezing result is successful, it indicates that the transaction is not tampered), and freeze an account corresponding to the transaction information on the block chain when the first freezing result is successful and the first freezing result is not tampered, to obtain a second freezing result.
If the first freezing result is failure and/or the second freezing result is tampered, the second blockchain system may not freeze the account corresponding to the blockchain, and may also end the synchronization or reinitiate the synchronization. And a second freezing result of the freezing failure can be obtained, and after the subsequent bridging system provides the result to the first blockchain system, the first blockchain system can know that the second blockchain system fails to perform the freezing so as to finish the synchronization of this time or restart the synchronization.
The bridging system listens for the second freeze at step 516.
At step 518, the bridging system generates a first dial-up transaction.
In step 520, the bridging system sends a first transfer transaction to the first blockchain system.
In this embodiment, the bridging system may monitor a second freezing result from the second blockchain, where the second freezing result may be obtained by encrypting with a private key of the second blockchain system. And the bridge system may also monitor that the second freezing result is obtained by invoking a predrade interface, and the bridge system may determine that the next interface to be invoked is a handle according to the above sequence. The bridging system may generate a first transfer transaction that may include a second frozen result encrypted based on the private key of the second blockchain. The bridging system may then send a first transfer transaction to any blockchain node on the first blockchain system, the first transfer transaction for invoking a handle interface in the smart contract.
In step 522, the first blockchain system executes the first allocation transaction to obtain a first allocation result.
In this embodiment, after receiving the first transfer transaction, any block chain link point on the first block chain system may determine to transfer a first transfer logic in the intelligent contract based on the handle interface, where the first transfer logic may determine whether the second freezing result is successful, verify whether the second freezing result is tampered, and unfreeze and transfer balance to an account corresponding to the transaction information on the block chain under the conditions that the second freezing result is successful and the second freezing result is not tampered, to obtain a first transfer result.
Similarly, if the second freezing result is failure and/or the second freezing result is tampered, the first blockchain system may not unfreeze the account corresponding to the blockchain and transfer balance, and end or reinitiate synchronization, and may also obtain a first transfer result of transfer failure, and after the subsequent bridging system provides the result to the second blockchain system, the second blockchain system may learn that the first blockchain system fails to transfer balance, so as to end or reinitiate synchronization.
In this embodiment, after the first blockchain system executes the first freeze logic, the first freeze logic may further determine whether the first transfer transaction sent by the bridge system is received within a first preset time period; if not, a rollback operation may be performed, such as unfreezing the account. And may end this synchronization or reinitiate synchronization. The first preset duration may be preset, for example, may be set based on the block out frequency of the blockchain, and assuming that the block out frequency on the blockchain is approximately 3 seconds once, the first preset duration may be 20 times block out, that is, 1 minute.
The bridging system listens for the first dialing result, step 524.
At step 526, the bridging system generates a second transfer transaction.
At step 528, the bridging system sends a second transfer transaction to the second blockchain system.
In this embodiment, the bridging system may monitor the first block chain for the first dialing result, where the first dialing result may be obtained by encrypting with a private key of the first block chain system. Moreover, the bridge system may also monitor that the first dialing result is obtained by invoking a handle interface, and then the bridge system may determine that the next interface to be invoked is a confirm according to the above sequence. The bridging system may generate a second transfer transaction that may include the first transfer result encrypted based on the private key of the first blockchain. The bridging system may then send a second transfer transaction to any blockchain node on the second blockchain system, the second transfer transaction being used to invoke the confirm interface in the smart contract.
In step 530, the second blockchain system executes a second transfer transaction to obtain a second transfer result.
In this embodiment, after receiving the second transfer transaction, any block chain node on the second block chain system may determine to transfer a second transfer logic in the intelligent contract based on the confirm interface, where the second transfer logic may determine whether the first transfer result is successful, verify whether the first transfer result is tampered, and thaw an account corresponding to the transaction information on the block chain and transfer a balance to obtain a second transfer result when the first transfer result is successful and the first transfer result is not tampered.
Similarly, if the first allocation result is failure and/or the first allocation result is tampered, the second blockchain system may not unfreeze the account corresponding to the blockchain and allocate the balance, and end or reinitiate the synchronization, and may also obtain a second allocation result that the allocation fails, and after the subsequent bridging system provides the result to the first blockchain system, the first blockchain system may know that the second blockchain system fails to execute the balance allocation, so as to end or reinitiate the synchronization.
In this embodiment, after the second blockchain system executes the second freeze logic, the second freeze logic may further determine whether a second transfer transaction sent by the bridge system is received within a third preset time period; if not, a rollback operation may be performed, such as unfreezing the account. And may end this synchronization or reinitiate synchronization. The third preset time period may also be preset, and the foregoing embodiment may be specifically referred to.
In step 532, the bridge system listens for the second transfer result.
At step 524, the bridging system generates a confirmation transaction.
In step 526, the bridging system sends an acknowledgement transaction to the first blockchain system.
In this embodiment, the bridging system may monitor a second transfer result from the second blockchain, where the second transfer result may be obtained by encrypting with a private key of the second blockchain system. Moreover, the bridge system may also monitor that the second transfer result is obtained by calling the confirm interface, and then the bridge system may determine that the next interface to be called is end according to the above sequence. The bridging system may generate a confirmation transaction that may include a second transfer result encrypted based on the private key of the second blockchain. The bridging system may then send a confirmation transaction to any blockchain node on the first blockchain system, the confirmation transaction being used to invoke the end interface in the smart contract.
At step 528, the first blockchain system performs a confirmation transaction.
In this embodiment, after receiving the confirmation transaction, any block chain link point on the first block chain system may determine to invoke a confirmation logic in the intelligent contract based on the end interface, where the confirmation logic may determine whether the second transfer result is successful, verify whether the second transfer result is tampered, and determine that the transaction information to be synchronized is synchronized when the second transfer result is successful and the second transfer result is not tampered.
Similarly, if the second transfer result is a failure and/or the second transfer result is tampered, the first blockchain system may determine that the transaction information to be synchronized is not successfully synchronized, and may end the synchronization or reinitiate the synchronization. And after the message is provided to the second blockchain system based on the bridging system, the second blockchain system can end the synchronization process or reinitiate synchronization after learning the message.
As can be seen from the above description, in an embodiment of the present specification, the first blockchain system and the second blockchain system may further have their own public and private key pair, and verify the received information based on the public and private key pair to verify whether the received information is tampered, and perform subsequent processing without being tampered, so as to improve the security of information synchronization.
And after the first block chain system executes the first frozen transaction, whether the first transfer transaction is received within a preset time length can be judged, and if the first transfer transaction is not received, a rollback operation can be executed, namely the corresponding account is unfrozen. Similarly, after the first blockchain system executes the first dialing transaction, if the confirmation transaction is not received within the preset time length, the rollback operation can be executed; after the second blockchain system executes the second frozen transaction, if the second transfer transaction is not received within the preset time length, the rollback operation can be executed. By adopting the method, the transaction information can be prevented from being omitted and lost in the synchronization process, and the reliability of transaction synchronization is improved.
Of course, if the first blockchain receives the confirmation transaction sent by the bridge system after the preset time length, the first blockchain system has executed rollback at this time, and the balance of the account corresponding to the transaction information is the balance before transfer, the bridge system may continue to monitor the execution result on the first blockchain system, and may monitor that the balance of the account becomes the initial value after rollback, and the bridge system may send the monitored result to the second blockchain system, so that the second blockchain system also performs rollback operation, and it is ensured that the data of both parties are synchronous.
In other embodiments of this specification, there may also be multiple bridging systems, each bridging system may monitor the result of the transactions performed by the first blockchain system and the second blockchain system, generate and send a corresponding transaction to the corresponding blockchain system based on the result, and may carry its own bridging system identifier in the transaction, so that the blockchain system determines which bridging system the transaction was sent by based on the identifier.
Moreover, after the blockchain system verifies that the information carried in the transaction is not tampered, the blockchain system can also award the bridging system sending the transaction.
For example, when the first blockchain receives a first transfer transaction sent by a certain bridge system and executes the first transfer transaction, if a second freezing result carried in the transaction is not tampered, the first transfer logic may deduct an award amount from a specified account in an account corresponding to the transaction information and transfer the award amount to the account corresponding to the bridge system when performing balance transfer. Wherein, the reward amount can be preset, such as 0.1% of the transaction amount. The designated account may be, for example, a roll-out account corresponding to the transaction amount.
For example, if the transaction message is 500 yen for zhangsi, the award amount may be 500 x 0.1% to 0.5 yen. Then 500.5 dollars may be deducted from Zhang III account, 500 dollars may be transferred to Liqu account, and 0.5 dollars may be transferred to the bridging system account when the balance is transferred.
For another example, the designated account may be a transfer-out account corresponding to the transaction amount. For example, the transaction information is 500 RMT of Zhang three to Li four, the reward amount is 0.5 Yuan, 500 Yuan can be deducted from the account of Zhang three, 499.5 Yuan is transferred to the account of Li four, and 0.5 Yuan is transferred to the account of the bridge system during balance transfer.
Of course, the above examples are merely exemplary, and other balance transfer methods may be adopted in practical applications, for example, the designated account may also be both an account transfer-out and an account transfer-in, which are not examples.
Similarly, when the second blockchain system receives a second transfer transaction sent by a certain bridge system and executes the second transfer transaction, if a first transfer result carried in the transaction is not tampered, the second transfer logic can deduct an award amount from a specified account in an account corresponding to the transaction information and transfer the award amount to the account corresponding to the bridge system when transferring balance. The reward amount is the same as the reward amount when the balance is transferred by the first blockchain system.
For another example, when the first blockchain system receives a confirmation transaction sent by a certain bridge system and executes the confirmation transaction, if the second transfer result carried in the transaction is not tampered, the confirmation logic may also deduct the award amount from the designated account in the account corresponding to the transaction information and transfer the award amount to the account corresponding to the bridge system. The specific implementation method may be various, and this embodiment is not described here.
Similarly, when the second blockchain system receives a second frozen transaction sent by a certain bridge system and executes the second frozen transaction, if the first frozen result carried in the transaction is not tampered, the second frozen logic may also deduct the reward amount from the designated account in the account corresponding to the transaction information and transfer the reward amount to the account corresponding to the bridge system. The specific implementation method may be various, and this embodiment is not described here.
By adopting the method, a plurality of bridging systems can compete to monitor the execution result of the related transaction on the blockchain node, generate the corresponding transaction and send the corresponding blockchain system to the corresponding blockchain system, and if the blockchain system verifies that the information in the transaction is not tampered, the information can be rewarded based on the bridging system, so that the bridging system can be promoted to transmit the information between the first blockchain system and the second blockchain system, the information synchronization efficiency is improved, the malicious tampering of the bridging system on the related information in the transaction process can be prevented to a certain extent, and the safety and reliability of transaction synchronization are improved.
Corresponding to the foregoing embodiments of the method for transaction synchronization across block chains, the present specification also provides embodiments of a transaction synchronization apparatus across block chains.
Embodiments of the present description of a cross blockchain transaction synchronization apparatus may be applied on a server. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 6, the hardware structure diagram of the electronic device where the transaction synchronization apparatus of the cross block chain is located in this specification is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 6, the electronic device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the electronic device, which is not described again.
Fig. 7 is a block diagram of a transaction synchronization mechanism across a blockchain as shown in an exemplary embodiment of the present description.
Referring to fig. 7, the transaction synchronization apparatus 700 across block chains can be applied to the electronic device shown in fig. 6, and includes: a first frozen transaction receiving unit 710, a first frozen transaction executing unit 720, a first dial transaction receiving unit 730, a first dial transaction executing unit 740, a confirmed transaction receiving unit 750, and a confirmed transaction executing unit 760.
The first frozen transaction receiving unit 710 receives a first frozen transaction, where the first frozen transaction carries transaction information to be synchronized;
the first frozen transaction executing unit 720 is configured to execute the first frozen transaction to call a first frozen logic in the intelligent contract to execute a freezing operation on the account corresponding to the block chain based on the transaction information, so as to obtain a first frozen result;
the first transfer transaction receiving unit 730 bridges a first transfer transaction sent by the system, where the first transfer transaction carries a second freezing result obtained by a second blockchain system performing a freezing operation on an account corresponding to the transaction information on a blockchain of the second blockchain system when the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
the first transfer transaction execution unit 740 is configured to execute the first transfer transaction to call a first transfer logic in the intelligent contract, and execute a unfreezing operation and a balance transfer on the account corresponding to the local block chain based on the transaction information under the condition that the second freezing result is determined to be successful, so as to obtain a first transfer result;
the confirmed transaction receiving unit 750 is used for receiving a confirmed transaction sent by the bridging system, wherein the confirmed transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on the blockchain and performing balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and the confirmed transaction executing unit 760 is used for executing the confirmed transaction to call the confirmation logic in the intelligent contract, and under the condition that the second transfer result is determined to be successful, the transaction information to be synchronized is determined to be synchronized.
Optionally, the first allocating logic is further configured to:
and verifying whether the second freezing result is tampered or not, and performing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is not tampered and the second freezing result is successful.
Optionally, when the second freezing result is not tampered, the first transfer transaction executing unit 740, when performing a unfreezing operation on the account corresponding to the block chain based on the transaction information and performing a balance transfer:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
Optionally, the validation logic is further configured to:
and verifying whether the second transfer result is tampered or not, so as to determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is not tampered and the second transfer result is successful.
Optionally, the validation logic is further configured to:
and verifying whether the second transfer result is tampered or not, so as to determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is not tampered and the second transfer result is successful.
Optionally, the first freeze logic is further configured to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a first transfer transaction sent by a bridging system is received within a first preset time is judged;
and if not, performing unfreezing operation on the account.
Optionally, the first allocating logic is further configured to:
after the corresponding account on the local block chain is defrosted and balance is allocated based on the transaction information, whether a confirmation transaction sent by the bridging system is received within a second preset time length is judged;
and if not, revoking the transfer of the account balance.
Optionally, after the first frozen transaction is transaction information to be synchronized acquired by the bridging system, the first frozen transaction is generated based on the transaction information to be synchronized and sent to the first block chain system.
Optionally, the transaction information includes a transaction amount and a corresponding transfer-out account and transfer-in account, and the first frozen transaction executing unit 720 performs a freezing operation on the corresponding account on the local block chain based on the transaction information, including:
and freezing the transaction amount in the transfer-out account on the block chain.
Fig. 8 is a block diagram of a transaction synchronization mechanism across a blockchain as shown in an exemplary embodiment of the present description.
Referring to fig. 8, the transaction synchronization apparatus 800 across block chains can be applied to the electronic device shown in fig. 6, and includes: a second frozen transaction receiving unit 810, a second frozen transaction executing unit 820, a second transfer transaction receiving unit 830 and a second transfer transaction executing unit 840.
The second frozen transaction receiving unit 810 receives a second frozen transaction sent by the bridge system, where the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by the first blockchain system performing a freezing operation on an account corresponding to the transaction information on the blockchain;
the second frozen transaction executing unit 820 is configured to execute a second frozen transaction to call a second frozen logic in the intelligent contract, and execute a freezing operation on a corresponding account in the local block chain based on the transaction information to obtain a second frozen result when the first frozen result is determined to be successful;
the second transfer transaction receiving unit 830 is configured to receive a second transfer transaction sent by the bridge system, where the second transfer transaction carries a first transfer result obtained by the first blockchain system performing a unfreezing operation on an account corresponding to the transaction information on the blockchain of the first blockchain system and performing balance transfer when it is determined that the second freezing result is successful; the second freezing result is obtained by monitoring by a bridging system;
and the second transfer transaction execution unit 840 executes a second transfer transaction to call a second transfer logic in the intelligent contract, and executes unfreezing operation and balance transfer on the account corresponding to the local block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the synchronization of the transaction information to be synchronized is completed under the condition that the second transfer result is successful.
Optionally, the second freeze logic is further configured to:
and verifying whether the first freezing result is tampered or not so as to execute a freezing operation on a corresponding account on the local blockchain based on the transaction information if the first freezing result is not tampered and the first freezing result is successful.
Optionally, the second transfer logic is further configured to:
and verifying whether the first transfer result is tampered or not, so that when the first transfer result is not tampered and the first transfer result is successful, a unfreezing operation is executed on the account corresponding to the local block chain based on the transaction information, and balance transfer is performed.
Optionally, when the first transfer result is not tampered, the second transfer transaction execution unit 840, when performing a defreezing operation on the account corresponding to the local block chain based on the transaction information and performing balance transfer:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
Optionally, the second freeze logic is further configured to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a second transfer transaction sent by the bridging system is received within a third preset time length is judged;
and if not, performing unfreezing operation on the account.
Optionally, the transaction information includes a transaction amount and a corresponding transfer-out account and transfer-in account, and the second frozen transaction executing unit 820, when executing a freezing operation on a corresponding account on the local block chain based on the transaction information:
and freezing the transaction amount in the transfer-out account on the block chain.
Fig. 9 is a block diagram of a transaction synchronization mechanism across a blockchain as shown in an exemplary embodiment of the present description.
Referring to fig. 9, the transaction synchronization apparatus 900 across block chains can be applied to the electronic device shown in fig. 6, and includes: a first frozen transaction sending unit 910, a first frozen result monitoring unit 920, a second frozen transaction sending unit 930, a second frozen result monitoring unit 940, a first allocated transaction sending unit 950, a first allocated result monitoring unit 960, a second allocated transaction sending unit 970, a second allocated result monitoring unit 980 and a confirmed transaction sending unit 990.
The first freezing result monitoring unit 920 monitors a first freezing result obtained by the first blockchain system performing a freezing operation on an account corresponding to the transaction information to be synchronized on the blockchain;
a second frozen transaction sending unit 930, configured to generate a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and send the second frozen transaction to a second blockchain system;
a second freezing result monitoring unit 940 which monitors a second freezing result of the second block chain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
a first transfer transaction sending unit 950 configured to generate a first transfer transaction based on the second freezing result and send the first transfer transaction to a first blockchain system;
a first allocation result monitoring unit 960, configured to monitor a first allocation result of the first blockchain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
the second transfer transaction sending unit 970 is used for generating a second transfer transaction based on the first transfer result and sending the second transfer transaction to a second blockchain system;
a second transfer result monitoring unit 980 for monitoring a second transfer result of the second blockchain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
the confirmed transaction sending unit 990 generates a confirmed transaction based on the second transfer result, and sends the confirmed transaction to the first blockchain system, so that the first blockchain determines that the synchronization of the transaction information to be synchronized is completed when the second transfer result is successful.
Optionally, the method further includes the first frozen transaction sending unit 910:
acquiring transaction information to be synchronized;
generating a first frozen transaction, wherein the transaction information is carried in the first frozen transaction;
sending the first frozen transaction to a first blockchain system.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the foregoing embodiments of the method for synchronizing transactions across block chains, the present specification further provides a device for synchronizing transactions across block chains, including: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result;
receiving a first transfer transaction sent by a bridging system, wherein the first transfer transaction carries a second freezing result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of a second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful to obtain a first transfer result;
receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
Optionally, the first allocating logic is further configured to:
and verifying whether the second freezing result is tampered or not, and performing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is not tampered and the second freezing result is successful.
Optionally, in a case that the second freezing result is not tampered, when a unfreezing operation is performed on a corresponding account on the local blockchain based on the transaction information and a balance is transferred, the processor is caused to:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
Optionally, the validation logic is further configured to:
and verifying whether the second transfer result is tampered or not, so as to determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is not tampered and the second transfer result is successful.
Optionally, the first freeze logic is further configured to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a first transfer transaction sent by a bridging system is received within a first preset time is judged;
and if not, performing unfreezing operation on the account.
Optionally, the first allocating logic is further configured to:
after the corresponding account on the local block chain is defrosted and balance is allocated based on the transaction information, whether a confirmation transaction sent by the bridging system is received within a second preset time length is judged;
and if not, revoking the transfer of the account balance.
Optionally, after the first frozen transaction is transaction information to be synchronized acquired by the bridging system, the first frozen transaction is generated based on the transaction information to be synchronized and sent to the first block chain system.
Optionally, the transaction information includes a transaction amount, a corresponding transfer-out account and a transfer-in account, and the performing a freezing operation on the account corresponding to the block chain based on the transaction information includes:
and freezing the transaction amount in the transfer-out account on the block chain.
Corresponding to the foregoing embodiments of the method for synchronizing transactions across block chains, the present specification further provides a device for synchronizing transactions across block chains, including: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system executing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the corresponding account on the block chain based on the transaction information under the condition that the first freezing result is determined to be successful to obtain a second freezing result;
receiving a second transfer transaction sent by a bridging system, wherein the second transfer transaction carries a first transfer result obtained by a first block chain system executing unfreezing operation on an account corresponding to the transaction information on a block chain and carrying out balance transfer under the condition that a second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
Optionally, the second freeze logic is further configured to:
and verifying whether the first freezing result is tampered or not so as to execute a freezing operation on a corresponding account on the local blockchain based on the transaction information if the first freezing result is not tampered and the first freezing result is successful.
Optionally, the second transfer logic is further configured to:
and verifying whether the first transfer result is tampered or not, so that when the first transfer result is not tampered and the first transfer result is successful, a unfreezing operation is executed on the account corresponding to the local block chain based on the transaction information, and balance transfer is performed.
Optionally, in a case that the first transfer result is not tampered, when a corresponding account on the local blockchain is defrosted and a balance is transferred based on the transaction information, the processor is caused to:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
Optionally, the second freeze logic is further configured to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a second transfer transaction sent by the bridging system is received within a third preset time length is judged;
and if not, performing unfreezing operation on the account.
Optionally, the transaction information includes a transaction amount and corresponding transfer-out and transfer-in accounts, and when a freeze operation is performed on a corresponding account on the local block chain based on the transaction information, the processor is caused to:
and freezing the transaction amount in the transfer-out account on the block chain.
Corresponding to the foregoing embodiments of the method for synchronizing transactions across block chains, the present specification further provides a device for synchronizing transactions across block chains, including: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
monitoring a second freezing result of a second blockchain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
monitoring a first dialing result of a first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
monitoring a second transfer result of a second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
Optionally, the processor is further caused to:
acquiring transaction information to be synchronized;
generating a first frozen transaction, wherein the transaction information is carried in the first frozen transaction;
sending the first frozen transaction to a first blockchain system.
In correspondence with the aforementioned embodiments of the transaction synchronization method across blockchains, the present specification further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of:
receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result;
receiving a first transfer transaction sent by a bridging system, wherein the first transfer transaction carries a second freezing result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of a second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful to obtain a first transfer result;
receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
Optionally, the first allocating logic is further configured to:
and verifying whether the second freezing result is tampered or not, and performing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is not tampered and the second freezing result is successful.
Optionally, when the second freezing result is not tampered, the unfreezing operation and balance transfer of the account corresponding to the local blockchain are performed based on the transaction information, including:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
Optionally, the validation logic is further configured to:
and verifying whether the second transfer result is tampered or not, so as to determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is not tampered and the second transfer result is successful.
Optionally, the first freeze logic is further configured to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a first transfer transaction sent by a bridging system is received within a first preset time is judged;
and if not, performing unfreezing operation on the account.
Optionally, the first allocating logic is further configured to:
after the corresponding account on the local block chain is defrosted and balance is allocated based on the transaction information, whether a confirmation transaction sent by the bridging system is received within a second preset time length is judged;
and if not, revoking the transfer of the account balance.
Optionally, after the first frozen transaction is transaction information to be synchronized acquired by the bridging system, the first frozen transaction is generated based on the transaction information to be synchronized and sent to the first block chain system.
Optionally, the transaction information includes a transaction amount, a corresponding transfer-out account and a transfer-in account, and the performing a freezing operation on the account corresponding to the block chain based on the transaction information includes:
and freezing the transaction amount in the transfer-out account on the block chain.
In correspondence with the aforementioned embodiments of the transaction synchronization method across blockchains, the present specification further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of:
receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system executing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the corresponding account on the block chain based on the transaction information under the condition that the first freezing result is determined to be successful to obtain a second freezing result;
receiving a second transfer transaction sent by a bridging system, wherein the second transfer transaction carries a first transfer result obtained by a first block chain system executing unfreezing operation on an account corresponding to the transaction information on a block chain and carrying out balance transfer under the condition that a second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
Optionally, the second freeze logic is further configured to:
and verifying whether the first freezing result is tampered or not so as to execute a freezing operation on a corresponding account on the local blockchain based on the transaction information if the first freezing result is not tampered and the first freezing result is successful.
Optionally, the second transfer logic is further configured to:
and verifying whether the first transfer result is tampered or not, so that when the first transfer result is not tampered and the first transfer result is successful, a unfreezing operation is executed on the account corresponding to the local block chain based on the transaction information, and balance transfer is performed.
Optionally, when the first transfer result is not tampered, performing a defreezing operation and performing a balance transfer on an account corresponding to the block chain based on the transaction information includes:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
Optionally, the second freeze logic is further configured to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a second transfer transaction sent by the bridging system is received within a third preset time length is judged;
and if not, performing unfreezing operation on the account.
Optionally, the transaction information includes a transaction amount, a corresponding transfer-out account and a transfer-in account, and the performing a freezing operation on the account corresponding to the block chain based on the transaction information includes:
and freezing the transaction amount in the transfer-out account on the block chain.
In correspondence with the aforementioned embodiments of the transaction synchronization method across blockchains, the present specification further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of:
monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
monitoring a second freezing result of a second blockchain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
monitoring a first dialing result of a first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
monitoring a second transfer result of a second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
Optionally, the method further includes:
acquiring transaction information to be synchronized;
generating a first frozen transaction, wherein the transaction information is carried in the first frozen transaction;
sending the first frozen transaction to a first blockchain system.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (25)

1. A transaction synchronization method across blockchains is used for realizing transaction synchronization between a first blockchain system and a second blockchain system based on a bridging system, and the method is applied to any blockchain node on the first blockchain system, and comprises the following steps:
receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result;
receiving a first transfer transaction sent by a bridging system, wherein the first transfer transaction carries a second freezing result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of a second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful to obtain a first transfer result;
receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
2. The method of claim 1, the first transfer logic further to:
and verifying whether the second freezing result is tampered or not, and performing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is not tampered and the second freezing result is successful.
3. The method according to claim 2, wherein in a case that the second freezing result is not tampered, performing a defreezing operation and performing a balance transfer on a corresponding account on the local blockchain based on the transaction information includes:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
4. The method of claim 1, the validation logic further to:
and verifying whether the second transfer result is tampered or not, so as to determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is not tampered and the second transfer result is successful.
5. The method of claim 1, the first freeze logic further to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a first transfer transaction sent by a bridging system is received within a first preset time is judged;
and if not, performing unfreezing operation on the account.
6. The method of claim 1, the first transfer logic further to:
after the corresponding account on the local block chain is defrosted and balance is allocated based on the transaction information, whether a confirmation transaction sent by the bridging system is received within a second preset time length is judged;
and if not, revoking the transfer of the account balance.
7. The method according to claim 1, wherein the first frozen transaction is generated based on the transaction information to be synchronized and sent to the first blockchain system after the bridging system acquires the transaction information to be synchronized.
8. The method of claim 1, wherein the transaction information includes a transaction amount and corresponding transfer-out and transfer-in accounts, and wherein performing a freeze operation on a corresponding account on the local blockchain based on the transaction information includes:
and freezing the transaction amount in the transfer-out account on the block chain.
9. A transaction synchronization method across blockchains is used for realizing transaction synchronization between a first blockchain system and a second blockchain system based on a bridging system, and the method is applied to any blockchain node on the second blockchain system, and comprises the following steps:
receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system executing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the corresponding account on the block chain based on the transaction information under the condition that the first freezing result is determined to be successful to obtain a second freezing result;
receiving a second transfer transaction sent by a bridging system, wherein the second transfer transaction carries a first transfer result obtained by a first block chain system executing unfreezing operation on an account corresponding to the transaction information on a block chain and carrying out balance transfer under the condition that a second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
10. The method of claim 9, the second freeze logic further to:
and verifying whether the first freezing result is tampered or not so as to execute a freezing operation on a corresponding account on the local blockchain based on the transaction information if the first freezing result is not tampered and the first freezing result is successful.
11. The method of claim 9, the second transfer logic further to:
and verifying whether the first transfer result is tampered or not, so that when the first transfer result is not tampered and the first transfer result is successful, a unfreezing operation is executed on the account corresponding to the local block chain based on the transaction information, and balance transfer is performed.
12. The method according to claim 11, wherein in a case that the first transfer result is not tampered, performing a defreezing operation and performing a balance transfer on a corresponding account on the local blockchain based on the transaction information, includes:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
13. The method of claim 9, the second freeze logic further to:
after freezing operation is performed on the account corresponding to the local block chain based on the transaction information, whether a second transfer transaction sent by the bridging system is received within a third preset time length is judged;
and if not, performing unfreezing operation on the account.
14. The method of claim 9, wherein the transaction information includes a transaction amount and corresponding roll-out and roll-in accounts, and wherein performing a freeze operation on a corresponding account on the local blockchain based on the transaction information includes:
and freezing the transaction amount in the transfer-out account on the block chain.
15. A transaction synchronization method across blockchains is used for realizing transaction synchronization between a first blockchain system and a second blockchain system based on a bridging system, and the method is applied to the bridging system and comprises the following steps:
monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
monitoring a second freezing result of a second blockchain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
monitoring a first dialing result of a first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
monitoring a second transfer result of a second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
16. The method of claim 15, further comprising:
acquiring transaction information to be synchronized;
generating a first frozen transaction, wherein the transaction information is carried in the first frozen transaction;
sending the first frozen transaction to a first blockchain system.
17. A transaction synchronization apparatus across a blockchain, the apparatus comprising:
the first frozen transaction receiving unit is used for receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
the first frozen transaction execution unit is used for executing the first frozen transaction so as to call a first frozen logic in the intelligent contract to execute a freezing operation on the account corresponding to the block chain based on the transaction information to obtain a first frozen result;
the first transfer transaction receiving unit is used for bridging a first transfer transaction sent by the system, and the first transfer transaction carries a second freezing result obtained by executing a freezing operation on an account corresponding to the transaction information on a block chain of the second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
the first transfer transaction execution unit is used for executing the first transfer transaction so as to call a first transfer logic in the intelligent contract, and when the second freezing result is determined to be successful, the first transfer transaction execution unit executes unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information to obtain a first transfer result;
the confirmed transaction receiving unit is used for receiving a confirmed transaction sent by the bridging system, and the confirmed transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on the blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and the confirmed transaction execution unit is used for executing the confirmed transaction so as to call a confirmation logic in the intelligent contract, and under the condition that the second transfer result is successful, the transaction information to be synchronized is determined to be synchronized.
18. The apparatus of claim 17, the first allocate logic further to:
and verifying whether the second freezing result is tampered or not, and performing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is not tampered and the second freezing result is successful.
19. The apparatus according to claim 18, wherein, when the second freeze result is not tampered with, the first transfer transaction execution unit, when performing a defreezing operation and a balance transfer on a corresponding account on the local blockchain based on the transaction information:
unfreezing an account corresponding to the transaction information;
and carrying out balance transfer on the account corresponding to the bridging system and the account corresponding to the transaction information so as to deduct the reward amount from the specified account in the account corresponding to the transaction information, and transferring the reward amount to the account corresponding to the bridging system.
20. The apparatus of claim 17, the validation logic further to:
and verifying whether the second transfer result is tampered or not, so as to determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is not tampered and the second transfer result is successful.
21. A transaction synchronization apparatus across a blockchain, the apparatus comprising:
the second frozen transaction receiving unit is used for receiving a second frozen transaction sent by the bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by the first block chain system performing a freezing operation on an account corresponding to the transaction information on the block chain;
the second frozen transaction execution unit is used for executing a second frozen transaction to call a second frozen logic in the intelligent contract, and under the condition that the first frozen result is determined to be successful, freezing operation is executed on the account corresponding to the block chain based on the transaction information to obtain a second frozen result;
the second transfer transaction receiving unit is used for receiving a second transfer transaction sent by the bridging system, and the second transfer transaction carries a first transfer result obtained by the first block chain system executing unfreezing operation on an account corresponding to the transaction information on the block chain and carrying out balance transfer under the condition that the second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and the second transfer transaction execution unit is used for executing a second transfer transaction so as to call a second transfer logic in the intelligent contract, and when the first transfer result is determined to be successful, the corresponding account on the local block chain is unfrozen and balance transfer is carried out based on the transaction information so as to obtain a second transfer result, so that the first block chain system can determine that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
22. A transaction synchronization apparatus across a blockchain, the apparatus comprising:
the first freezing result monitoring unit is used for monitoring a first freezing result obtained by the first block chain system performing freezing operation on an account corresponding to the transaction information to be synchronized on the block chain;
the second frozen transaction sending unit generates a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sends the second frozen transaction to a second block chain system;
the second freezing result monitoring unit monitors a second freezing result of the second block chain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
the first transfer transaction sending unit generates a first transfer transaction based on the second freezing result and sends the first transfer transaction to a first block chain system;
the first allocation result monitoring unit monitors a first allocation result of the first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
the second transfer transaction sending unit generates a second transfer transaction based on the first transfer result and sends the second transfer transaction to a second block chain system;
the second allocation result monitoring unit monitors a second allocation result of the second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and the confirmed transaction sending unit is used for generating a confirmed transaction based on the second transfer result and sending the confirmed transaction to the first block chain system so as to ensure that the first block chain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
23. A transaction synchronization device across a blockchain, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to transaction synchronization logic across a blockchain, the processor is caused to:
receiving a first frozen transaction, wherein the first frozen transaction carries transaction information to be synchronized;
executing the first freezing transaction to call a first freezing logic in the intelligent contract to execute a freezing operation on the corresponding account on the block chain based on the transaction information to obtain a first freezing result;
receiving a first transfer transaction sent by a bridging system, wherein the first transfer transaction carries a second freezing result obtained by performing a freezing operation on an account corresponding to the transaction information on a block chain of a second block chain system under the condition that the first freezing result is determined to be successful; the first freezing result is obtained by monitoring by a bridging system;
executing the first transfer transaction to call a first transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the second freezing result is determined to be successful to obtain a first transfer result;
receiving a confirmation transaction sent by a bridging system, wherein the confirmation transaction carries a second transfer result obtained by a second blockchain system executing unfreezing operation on an account corresponding to the transaction information on a blockchain and carrying out balance transfer under the condition that the first transfer result is determined to be successful; the first dialing result is obtained by monitoring of a bridging system;
and executing the confirmation transaction to call a confirmation logic in the intelligent contract, and determining that the transaction information to be synchronized is synchronized under the condition that the second transfer result is determined to be successful.
24. A transaction synchronization device across a blockchain, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to transaction synchronization logic across a blockchain, the processor is caused to:
receiving a second frozen transaction sent by a bridging system, wherein the second frozen transaction carries transaction information to be synchronized and a first frozen result obtained by a first block chain system executing a freezing operation on an account corresponding to the transaction information on a block chain of the first block chain system;
executing a second freezing transaction to call a second freezing logic in the intelligent contract, and executing a freezing operation on the corresponding account on the block chain based on the transaction information under the condition that the first freezing result is determined to be successful to obtain a second freezing result;
receiving a second transfer transaction sent by a bridging system, wherein the second transfer transaction carries a first transfer result obtained by a first block chain system executing unfreezing operation on an account corresponding to the transaction information on a block chain and carrying out balance transfer under the condition that a second freezing result is determined to be successful; the second freezing result is obtained by monitoring by a bridging system;
and executing a second transfer transaction to call a second transfer logic in the intelligent contract, and executing unfreezing operation and balance transfer on the account corresponding to the block chain based on the transaction information under the condition that the first transfer result is determined to be successful to obtain a second transfer result, so that the first block chain system determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
25. A transaction synchronization device across a blockchain, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to transaction synchronization logic across a blockchain, the processor is caused to:
monitoring a first freezing result obtained by a first blockchain system performing a freezing operation on an account corresponding to transaction information to be synchronized on a blockchain of the first blockchain system;
generating a second frozen transaction based on the transaction information to be synchronized and the first frozen result, and sending the second frozen transaction to a second blockchain system;
monitoring a second freezing result of a second blockchain system; the second freezing result is that the second freezing transaction is executed by a second blockchain system, and under the condition that the first freezing result is determined to be successful, the freezing operation is executed on the account corresponding to the blockchain based on the transaction information to obtain the second freezing transaction;
generating a first transfer transaction based on the second freezing result, and sending the first transfer transaction to a first blockchain system;
monitoring a first dialing result of a first block chain system; the first transfer result is obtained by executing the first transfer transaction by a first blockchain system, and executing unfreezing operation on the account corresponding to the blockchain based on the transaction information and carrying out balance transfer under the condition that the second freezing result is determined to be successful;
generating a second transfer transaction based on the first transfer result, and sending the second transfer transaction to a second blockchain system;
monitoring a second transfer result of a second block chain system; the second transfer result is obtained by executing the second transfer transaction by a second blockchain system, and executing unfreezing operation on the corresponding account on the blockchain based on the transaction information and carrying out balance transfer under the condition that the first transfer result is determined to be successful;
and generating a confirmation transaction based on the second transfer result, and sending the confirmation transaction to the first blockchain system so that the first blockchain determines that the transaction information to be synchronized is synchronized under the condition that the second transfer result is successful.
CN202110680483.4A 2021-06-18 2021-06-18 Cross-block-chain transaction synchronization method and device Active CN113409145B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110680483.4A CN113409145B (en) 2021-06-18 2021-06-18 Cross-block-chain transaction synchronization method and device
PCT/CN2022/093512 WO2022262510A1 (en) 2021-06-18 2022-05-18 Method and apparatus for synchronizing cross-blockchain transactions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110680483.4A CN113409145B (en) 2021-06-18 2021-06-18 Cross-block-chain transaction synchronization method and device

Publications (2)

Publication Number Publication Date
CN113409145A true CN113409145A (en) 2021-09-17
CN113409145B CN113409145B (en) 2022-04-22

Family

ID=77681711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110680483.4A Active CN113409145B (en) 2021-06-18 2021-06-18 Cross-block-chain transaction synchronization method and device

Country Status (2)

Country Link
CN (1) CN113409145B (en)
WO (1) WO2022262510A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022262510A1 (en) * 2021-06-18 2022-12-22 支付宝(杭州)信息技术有限公司 Method and apparatus for synchronizing cross-blockchain transactions
CN115687527A (en) * 2022-11-09 2023-02-03 呼和浩特市大旗网络有限公司 Storage system based on block chain big data
WO2023078124A1 (en) * 2021-11-08 2023-05-11 支付宝(杭州)信息技术有限公司 Blockchain-based cross-border remittance

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107742210A (en) * 2017-10-13 2018-02-27 布比(北京)网络技术有限公司 Across the chain fund transfer system and method for a kind of different blocks interchain
CN108712257A (en) * 2018-04-03 2018-10-26 阿里巴巴集团控股有限公司 The authentication method and device, electronic equipment of transregional piece of chain
CN109842655A (en) * 2017-11-28 2019-06-04 北京众享比特科技有限公司 A kind of method of data synchronization of transregional piece of chain network
US20200145431A1 (en) * 2018-02-27 2020-05-07 Alibaba Group Holding Limited Method, apparatus, system, and electronic device for cross-blockchain interaction
CN112651724A (en) * 2020-04-28 2021-04-13 北京邮电大学 Cross-chain interaction method, device and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190172026A1 (en) * 2017-12-02 2019-06-06 Alchemy Limited LLC Cross blockchain secure transactions
CN109325762B (en) * 2018-08-30 2020-07-10 杭州复杂美科技有限公司 Parallel chain cross-chain transaction method, equipment and storage medium
CN110428332A (en) * 2019-07-29 2019-11-08 杭州复杂美科技有限公司 A kind of across the chain method of commerce of parallel chain, equipment and storage medium
CN111953754B (en) * 2020-07-31 2021-06-08 成都质数斯达克科技有限公司 Cross-chain transaction method, electronic device and readable storage medium
CN112671908B (en) * 2020-12-25 2023-03-21 成都质数斯达克科技有限公司 Network management method and device, electronic equipment and readable storage medium
CN113409145B (en) * 2021-06-18 2022-04-22 支付宝(杭州)信息技术有限公司 Cross-block-chain transaction synchronization method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107742210A (en) * 2017-10-13 2018-02-27 布比(北京)网络技术有限公司 Across the chain fund transfer system and method for a kind of different blocks interchain
CN109842655A (en) * 2017-11-28 2019-06-04 北京众享比特科技有限公司 A kind of method of data synchronization of transregional piece of chain network
US20200145431A1 (en) * 2018-02-27 2020-05-07 Alibaba Group Holding Limited Method, apparatus, system, and electronic device for cross-blockchain interaction
CN108712257A (en) * 2018-04-03 2018-10-26 阿里巴巴集团控股有限公司 The authentication method and device, electronic equipment of transregional piece of chain
CN112651724A (en) * 2020-04-28 2021-04-13 北京邮电大学 Cross-chain interaction method, device and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MICHAEL BORKOWSKI: "Dextt: Deterministic Cross-Blockchain", 《IEEE》 *
李芳: "区块链跨链技术进展研究", 《软件学报》 *
马理: "区块链技术在支付结算领域的应用与风险", 《金融评论》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022262510A1 (en) * 2021-06-18 2022-12-22 支付宝(杭州)信息技术有限公司 Method and apparatus for synchronizing cross-blockchain transactions
WO2023078124A1 (en) * 2021-11-08 2023-05-11 支付宝(杭州)信息技术有限公司 Blockchain-based cross-border remittance
CN115687527A (en) * 2022-11-09 2023-02-03 呼和浩特市大旗网络有限公司 Storage system based on block chain big data
CN115687527B (en) * 2022-11-09 2023-10-10 北京北纬三十度网络科技有限公司 Storage system based on big data of block chain

Also Published As

Publication number Publication date
CN113409145B (en) 2022-04-22
WO2022262510A1 (en) 2022-12-22

Similar Documents

Publication Publication Date Title
CN113409145B (en) Cross-block-chain transaction synchronization method and device
CN108712257B (en) Cross-block-chain authentication method and device and electronic equipment
CN108683630B (en) Cross-block-chain authentication method and device and electronic equipment
US11496300B2 (en) Computer-implemented system and method for time release encryption over a blockchain network
CN110417775B (en) Virtual article transaction method and device based on block chain and server
JP6882474B2 (en) Systems and methods for detecting replay attacks
CN109345386A (en) Transaction common recognition processing method and processing device, electronic equipment based on block chain
CN111160913B (en) Block chain account balance deposit certificate and recovery method and device
CN108848119A (en) The exchange method and device, system, electronic equipment of transregional piece of chain
Schindler et al. Ethdkg: Distributed key generation with ethereum smart contracts
CN109688012A (en) A kind of method of alliance's chain node hot standby switch
US20210233068A1 (en) Settlement system, settlement method, user device, and settlement program
CN110351363A (en) Data back up method, equipment and computer readable storage medium
WO2021023304A1 (en) Fork processing method and blockchain node
CN111640017A (en) Transaction correctness verification method and device applied to alliance chain cross-chain transfer
CN112612856B (en) Block chain-based data processing method and device
CN110414961A (en) Prevent transfer account method, device, equipment and the storage medium of the track transactions side of producing
Charapko et al. Bridging paxos and blockchain consensus
CN110941834B (en) Multiparty computing, data auditing and data processing method, system and equipment
US20230259930A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium
Constantinescu et al. A fair and resilient decentralized clock network for transaction ordering
Cachin State machine replication with Byzantine faults
CN110163606A (en) Withdrawing method and device, electronic equipment based on block chain
CN109615513B (en) Method and system for fair exchange of value or items to be exchanged within a blockchain
CN116777631B (en) Transaction uplink method and device based on blockchain, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240220

Address after: Room 1408, No. 447 Nanquan North Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Patentee after: Shanghai Ant Chuangjiang Information Technology Co.,Ltd.

Country or region after: China

Address before: 310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Patentee before: Alipay (Hangzhou) Information Technology Co.,Ltd.

Country or region before: China

Patentee before: Ant blockchain Technology (Shanghai) Co.,Ltd.