WO2022141059A1 - 区块链信息跨链交互方法、系统、电子设备及存储介质 - Google Patents

区块链信息跨链交互方法、系统、电子设备及存储介质 Download PDF

Info

Publication number
WO2022141059A1
WO2022141059A1 PCT/CN2020/140868 CN2020140868W WO2022141059A1 WO 2022141059 A1 WO2022141059 A1 WO 2022141059A1 CN 2020140868 W CN2020140868 W CN 2020140868W WO 2022141059 A1 WO2022141059 A1 WO 2022141059A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
node
block
information
data information
Prior art date
Application number
PCT/CN2020/140868
Other languages
English (en)
French (fr)
Inventor
张焱
施逸
杨东
李汪红
Original Assignee
合肥达朴汇联科技有限公司
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 合肥达朴汇联科技有限公司 filed Critical 合肥达朴汇联科技有限公司
Priority to PCT/CN2020/140868 priority Critical patent/WO2022141059A1/zh
Publication of WO2022141059A1 publication Critical patent/WO2022141059A1/zh

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

Definitions

  • the invention relates to the technical field of blockchain and data processing technology, and in particular to a method, system, electronic device and storage medium for cross-chain interaction of blockchain information.
  • the information island restricts the development of the blockchain from two aspects of value and information, and the poor interoperability between the blockchains limits the application space of the blockchain. For example: when the user wants to transfer the data of the A chain to the B chain, when the user or some smart contracts of the B chain need to use the data of the A chain, it can only be uploaded manually, which makes the data possible. has been tampered with and lost its credibility.
  • cross-chain technology is the key to realizing the Internet of Value. It is a good medicine to save the blockchain from scattered islands and a bridge for the expansion and connection of the blockchain.
  • Cross-chain is to allow information to flow across the barriers between chains, realize asset flow, information exchange, and application collaboration between different blockchains, and reduce the cost of chain-to-chain transmission.
  • the existing blockchain cross-chain technologies are different, and there are various limitations due to different implementation methods.
  • the invention patent application with the application number "CN202010475109.6” discloses a cross-chain between blockchains.
  • the cross-chain information interaction system includes a first blockchain, a relay blockchain and a second blockchain, the first blockchain includes a first blockchain account and a first cross-chain contract, and the second blockchain includes a first blockchain.
  • the second blockchain account and the second cross-chain contract, the first blockchain, the relay blockchain and the second blockchain all have collectors. When interacting across chains, the first blockchain account will report to the second blockchain.
  • a cross-chain contract sends a cross-chain interaction request
  • the collector in the relay blockchain actively collects the cross-chain interaction request in the first cross-chain contract, and records it on the relay blockchain after signature verification.
  • the collector in the chain actively collects the cross-chain interaction records on the relay blockchain, sends a cross-chain interaction request to the second cross-chain contract, and the second cross-chain contract unlocks the mapped interaction data and transfers it to the second blockchain account.
  • the patented scheme uses the relay blockchain to enable the mutual transfer of information between various public chains, avoiding the situation that a blockchain is a data island; using multiple collectors to collect cross-chain information and signature verification methods, and It cannot support cross-chain information replication of homogeneous chains or heterogeneous chains at the same time.
  • the patented solution also needs to perform intrusive operations on the original blockchain, that is, it needs to modify the original blockchain to a certain extent or add additional functions to To achieve cross-chain, however, this is unacceptable in the existing public chain, such as the Bitcoin blockchain.
  • the method includes: acquiring first transaction information of a cross-chain transaction monitored from a source blockchain network, where the cross-chain transaction is a transaction between the source blockchain network and the target blockchain network, the first The transaction information includes: the cross-chain transaction data; based on the cross-chain transaction data, second transaction information is sent to the target blockchain network, where the second transaction information includes: the cross-chain transaction data;
  • the target blockchain network obtains the execution result of the monitored execution of the second transaction information; based on the execution result, sends indication information to the source blockchain network, where the indication information is used to indicate the cross-chain
  • the cross-chain method is simple and easy to implement, however, there are problems of centralization or third-party dependence, and it is impossible to retain the decentralized and trustless features of blockchain technology at the system level.
  • the technical problem to be solved by the present invention is to overcome the huge difference in the implementation of the underlying technology between different blockchains, which brings obstacles to the realization of the cross-chain.
  • a method for cross-chain interaction of blockchain information comprising:
  • the t1 node of the blockchain T judges whether the blockchain A meets the first feedback condition, and if so, the t1 node obtains and verifies the first data information of the blockchain A;
  • the block-producing node of the blockchain T receives the verification signal of the t1 node, stores the first data information on the local chain to generate a block, and the t2 node of the blockchain T receives the block and sends it to the blockchain. B sends the transaction;
  • the block producing node discards the first data information after receiving the signal that the t1 node has not passed the verification
  • the blockchain B receives the transaction and executes the packaging and block-producing operation
  • the t2 node of the blockchain T starts the monitoring operation to read the block information of the blockchain B, and judges whether the blockchain B is successfully packaged and produced. If the packaging is successful, the t2 node reads the data of the blockchain B , to verify whether the threshold conditions are met. If the block is not successfully packaged, the cross-chain copying of information fails;
  • the cross-chain copying information is successful, and the t2 node sends a packaging instruction to give the block node; if the threshold conditions are not met, the cross-chain copying information fails;
  • the block-producing node receives the packaging instruction of the t2 node to obtain the information of the blockchain B for packaging and producing the block.
  • the information on the blockchain A is saved to the blockchain B through the t1 node, t2 node, and block-producing node on an additional blockchain T, which can support the information replication of homogeneous chains, and can also support heterogeneous chains.
  • Cross-chain letter information replication can support the information replication of homogeneous chains, and can also support heterogeneous chains.
  • the obtaining and verifying the first data information of the blockchain A includes: the t1 node of the blockchain T reads the first data of an arbitrary node a1 on the blockchain A information, and convert the first data information of node a1 into tradable data information of blockchain T;
  • the t1 node verifies the first data information. If the verification is passed, the first data information is stored on the local chain, and the transaction is sent to the blockchain B. If the verification fails, the first data information is discarded. .
  • the verification of the first data information by the t1 node includes: the t1 node reads the second data information from the non-a1 node of the blockchain A, and judges the first data information. Whether the data information is consistent with the second data information, if they are consistent, the verification is passed, and if they are inconsistent, the verification is not passed.
  • the t1 node reads the first data information of an arbitrary node a1 on the blockchain A and further includes:
  • node t1 needs to wait for consensus confirmation to obtain the first data information on blockchain A;
  • blockchain A adopts a consensus algorithm with weak consistency, when blockchain A generates several subsequent blocks after the block where the first data information is generated, node t1 reads the first data information of blockchain A.
  • the transaction includes first data information in a format identifiable by blockchain B.
  • the transaction also includes the data on the original blockchain A, the height of the first data information on the blockchain A on the blockchain T, the transaction sequence number, the transaction time, and the transaction creator.
  • the operation of packing and generating blocks includes: the block chain B packs and generates blocks based on its own preset chain rules.
  • whether the packaged block is successful includes: the t2 node of the blockchain T monitors the blockchain B to read the first data information of the latest block packaged by the blockchain B, based on the reading The obtained first data information is used to verify whether the packaging and block generation are successful.
  • the verification based on the read first data information to verify whether the packaged block is successful includes: when the t2 node of the blockchain T successfully reads from the latest block packaged by the blockchain B, For the first data information of blockchain T, the t2 node reads the third data information of the same height from other nodes of the blockchain B again, and the t2 node judges whether the heights of the first data information and the third data information are consistent, if they are consistent Then the block chain B successfully packs and produces a block. If it is inconsistent, the block chain B fails to pack and produce a block, and the cross-chain copying of information fails.
  • the threshold condition is: if blockchain B adopts a consensus algorithm with strong consistency, the threshold condition is that the block is successfully generated;
  • the threshold condition is: after the latest block with the first data information in blockchain B is generated, wait for a certain number of blocks to be generated.
  • a blockchain information cross-chain interaction system including:
  • a first acquisition module configured to enable the t1 node of the blockchain T to determine whether the blockchain A meets the first feedback condition, and if so, the t1 node acquires and verifies the first data information of the blockchain A;
  • the block-producing node of the blockchain T receives the verification signal of the t1 node, stores the first data information on the local chain to generate a block, and the t2 node of the blockchain T receives the block and sends it to the blockchain. B sends the transaction;
  • the block producing node discards the first data information after receiving the signal that the t1 node has not passed the verification
  • a block-producing module configured to enable the blockchain B to receive the transaction to perform a package-producing operation
  • the monitoring module is used to enable the t2 node of the blockchain T to start the monitoring operation to read the block information of the blockchain B, and to determine whether the blockchain B is successfully packaged and produced. If the packaging is successful, the t2 node reads Take the data of blockchain B and verify whether the threshold conditions are met. If the block is not successfully packaged, the cross-chain copying of information will fail;
  • the cross-chain copying information is successful, and the t2 node sends a packaging instruction to give the block node; if the threshold conditions are not met, the cross-chain copying information fails;
  • the second obtaining module is used to make the block producing node receive the packaging instruction of the t2 node to obtain the information of the blockchain B to package and produce the block.
  • An electronic device comprising a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the blockchain Information cross-chain interaction method.
  • the cross-chain technology to be realized by the present invention is to save the information on the blockchain A to the blockchain B through an additional blockchain T, which can support the information replication of the homogeneous chain, and can also support the heterogeneous chain.
  • Cross-chain information replication and there is no problem of centralization or third-party dependence.
  • the present invention is not limited to use on blockchains with cross-chain functions. Even if blockchains A and B do not have cross-chain functions, they can still use this technology to copy information, such as: Bitcoin, Ethereum Square and so on.
  • the present invention uses a non-intrusive method, without any modification or addition of functions to blockchain A and blockchain B, so that it does not have any impact on the original blockchain and the target blockchain, and replicates the entire blockchain.
  • blockchain A and blockchain B can maintain normal operation.
  • Blockchain A and blockchain B do not perceive the cross-chain, so that the original blockchain can be compared with the original blockchain during the entire information cross-chain process.
  • the cross-chain operation is completed without any impact on the target blockchain.
  • the cross-chain information backup record can be traced back and cannot be tampered with.
  • the present invention has no single point of dependence, centralized trust or third-party trust, so that the entire system retains the features of decentralization, trustlessness and non-tampering of the blockchain.
  • FIG. 1 is a schematic diagram of the principle of a method for cross-chain interaction of blockchain information provided in Embodiment 1 of the present invention.
  • FIG. 2 is a schematic flowchart of a method for cross-chain interaction of blockchain information provided in Embodiment 1 of the present invention.
  • FIG. 3 is a schematic flowchart of another method for cross-chain interaction of blockchain information provided in Embodiment 1 of the present invention.
  • FIG. 4 is a schematic flowchart of a method for cross-chain interaction of blockchain information applied to a t1 node according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic flowchart of a method for cross-chain interaction of blockchain information applied to a block producing node according to Embodiment 3 of the present invention.
  • FIG. 6 is a schematic flowchart of a method for cross-chain interaction of blockchain information applied to a t2 node according to Embodiment 4 of the present invention.
  • FIG. 7 shows a structural block diagram of a device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a computer system suitable for implementing a method for cross-chain interaction of blockchain information according to an embodiment of the present disclosure.
  • the t1 node of the blockchain T determines whether the blockchain A meets the first feedback condition, and if so, the blockchain T obtains and verifies the first feedback condition of the blockchain A data information; if the verification is passed, the first data information is stored on the local chain, and the transaction is sent to the blockchain B, if the verification fails, the first data information is discarded; the blockchain B receives the transaction Execute the package and block operation; the blockchain T starts the monitoring operation to read the block information of the block chain B, and judges whether the block chain B is successfully packaged and generated. If the block is successfully packaged, the t2 node reads the block. Chain B data, verify whether the threshold conditions are met.
  • the cross-chain copy information fails; if so, the cross-chain copy information is successful, and the block chain T obtains the main information of block chain B and packs it again. A block is generated; if it does not match, the cross-chain copying of information will fail.
  • blockchain T is an additional blockchain, including t1 node, t2 node...block-producing node, there is no requirement for the consensus algorithm of blockchain T, and the choice can be made according to the actual situation.
  • the blockchain T adopts the consensus algorithm of DPOS, which is characterized by short block generation time and high efficiency.
  • FIG. 1 is a schematic diagram of the principle of a method for cross-chain interaction of blockchain information in Embodiment 1 of the present invention
  • FIG. 2 is a schematic flowchart of a method for cross-chain interaction of blockchain information in Embodiment 1 of the present invention, including The following steps:
  • the t1 node of the blockchain T judges whether the blockchain A meets the first feedback condition, and if so, the t1 node of the blockchain T obtains and verifies the first data information of the blockchain A;
  • the block-producing node of the blockchain T receives the verification signal of the t1 node and stores the first data information on the local chain to generate a block; the t2 node of the blockchain T receives the block and sends it to the blockchain B. send transaction;
  • the block producing node discards the first data information after receiving the signal that the t1 node has not passed the verification
  • the blockchain B receives the transaction and performs a packaging and block-producing operation
  • the t2 node of the blockchain T starts the monitoring operation to read the block information of the blockchain B, and judges whether the blockchain B successfully packs and produces a block. If the packaging is successful, the t2 node reads the blockchain B data, verify whether the read data of blockchain B meets the threshold conditions, if the block is not successfully packaged, the cross-chain copying of information will fail;
  • the cross-chain copy information is successful, and the t2 node sends a packaging instruction to give the block node; if the threshold conditions are not met, the cross-chain copy information fails;
  • the block-producing node of the blockchain T receives the packaging instruction of the t2 node, obtains the information of the blockchain B, and packs the block again (generally, the main information can be used to pack the block again).
  • step S1 the first feedback condition is preset on the blockchain T.
  • step S1 it also includes:
  • the t1 node of the blockchain T reads the first data information of an arbitrary node a1 on the blockchain A, and converts the first data information of the node a1 Converted into tradable data information on the blockchain T.
  • the t1 node of the blockchain T can also read the transaction of chain A data from the blockchain A.
  • the t1 node of the blockchain T performs a corresponding read operation to obtain the corresponding data from the blockchain A.
  • the blockchain T needs to wait for consensus confirmation to read the first data information on blockchain A; if blockchain A adopts a weak consensus algorithm Consistent consensus algorithm, because weak consensus consensus will have the risk of rollback, in order to reduce the risk, the blockchain T needs to wait for the generation of the block where the first data information is located, and then wait for a certain number of subsequent blocks to be generated (also That is, when blockchain A generates several subsequent blocks after the block where the first data information is generated, the t1 node of blockchain T reads the first data information of blockchain A), and then the block can be read.
  • the first data information of chain A is to say: if blockchain A adopts a strong consensus consensus algorithm, the t1 node of blockchain T needs to wait for consensus confirmation to read the first data information on blockchain A; if blockchain A adopts a weak consensus algorithm Consistent consensus algorithm, because weak consensus consensus will have the risk of rollback, in order to reduce the risk, the blockchain T needs to wait for the generation of the block where the first data information is located, and then wait for a certain
  • the certain number can be set according to specific conditions. For example, on the Bitcoin blockchain, after the block where the target information (that is, the first data information to be obtained) is located, there are 6 blocks after confirmation. Then read the target information.
  • the t1 node of the blockchain T verifies the first data information, and if the verification passes, a verification pass signal is sent to the block producing node, and the block producing node of the blockchain T stores the first data information on the local chain , that is, the block-producing node of blockchain T packages the information of blockchain A and generates a block, and the t2 node converts the block generated by the block-producing node and sends it to blockchain B; and sends it to blockchain B
  • the block-producing node discards the first data information
  • the t1 node of the blockchain T reads the second data information from the non-a1 node (that is, other nodes) of the blockchain A, and judges whether the first data information is consistent with the second data information. If they are consistent, then If the verification is passed, if inconsistent, the verification fails, and the first data information is discarded.
  • the a1 node By comparing the first data information with the second data information, the a1 node can be prevented from doing evil and producing false data.
  • the t1 node of the blockchain T will read the second data information from the non-a1 node of the blockchain A.
  • the specific method is to extract the corresponding data information according to the unique identifier of the block and transaction where the different data information is located. , and then the t1 node compares the first data information and the second data information received twice, if the first data information and the second data information are consistent, it means that the first data information obtained from the blockchain A has passed the verification.
  • non-a1 node used for verification in this verification step can be configured or determined according to the consensus mechanism of the blockchain.
  • the storing the first data information on the local chain includes: after the first data information of the blockchain A is verified and passed, the block producing node of the blockchain T will write the first data information into a new block .
  • the t2 node of the blockchain T converts the first data information of the blockchain A into a format recognizable by the blockchain B to obtain recognizable first data information, and sends the first data information to the target blockchain B sends the transaction with the identifiable first data message.
  • the transaction sent by the t2 node of the blockchain T to the blockchain B also includes the data information on the blockchain T.
  • the data information of the blockchain T includes: the height of the first data information on the blockchain A on the blockchain T, the transaction sequence number, the transaction time, the transaction creator, and the like.
  • step S2 the block chain B receives the transaction with the identifiable first data information, and generates the latest block by packaging the block based on the chain rules preset by itself.
  • step S3 including:
  • the t2 node of the blockchain T After sending the blockchain T information to the blockchain B, the t2 node of the blockchain T starts the monitoring operation, and the monitoring time interval can be set according to the actual situation, for example, refer to the block generation time of the blockchain B .
  • the blockchain B may not produce a block immediately, so the t2 node of the blockchain T needs to continuously monitor the information of the blockchain B node to confirm whether the information has been added. to blockchain B.
  • the t2 node of the blockchain T can also read to the multi-nodes of the blockchain B, thereby reducing some problems caused by the network.
  • the t2 node of the blockchain T monitors the blockchain B to read the first data information in the latest block packaged by the blockchain B, and verifies whether the packaging and the block generation are successful based on the read first data information;
  • the verification based on the read first data information whether the packaged block is successful includes: when the block chain T successfully reads the first data information of the block chain T from the latest block packaged by the block chain B,
  • the t2 node of the blockchain T can read the third data information of the same height from other nodes of the blockchain B again, and the t2 node of the blockchain T judges whether the heights of the first data information and the third data information are consistent. If they are consistent, blockchain B successfully packs and produces blocks. If they are inconsistent, blockchain B fails to pack and produce blocks, and cross-chain copying of information fails.
  • the t2 node of the blockchain T verifies whether the information content has been tampered by comparing the information at the same height of different nodes of the blockchain B, thereby preventing the occurrence of the single-node evil problem. If they are consistent, it means that the blockchain B If the block is successfully packaged, it indicates that the cross-chain copying of information is successful.
  • the packaging is successful, the t2 node of the blockchain T reads the data of the blockchain B, and verifies whether the read data of the blockchain B meets the threshold conditions. If the packaging is unsuccessful, the information is copied across the chain fail.
  • step S33 including:
  • the verification of whether the read data of blockchain B meets the threshold conditions, that is, the t2 node of blockchain T reads the block height of blockchain B, and then judges whether the transaction is located according to the strong or weak consistency of the blockchain. Whether the block height has exceeded the threshold; specifically:
  • the threshold condition is that blockchain B successfully packs a block, that is, the cross-chain copying of information is successful this time (that is, the success of packaging and generating a block is the threshold condition);
  • the threshold condition for blockchain B to determine whether it satisfies itself is: after the latest block with the first data information in blockchain B is produced, wait for a certain number of Block generation; if the threshold conditions are met, the cross-chain copying of information succeeds, otherwise the cross-chain copying of information fails.
  • the certain number here can also be set according to specific conditions.
  • the block-producing node of the blockchain T will extract the main information of the block containing the information of the blockchain A in the blockchain B and package it out again.
  • the main information can include: blockchain B contains the block height of blockchain A information, transaction serial number, block generation time, etc., as the basis for the successful copying of information this time.
  • FIG. 3 is a schematic flowchart of another method for cross-chain interaction of blockchain information provided in Embodiment 1 of the present invention. It also includes step S5. After the cross-chain copying of information fails, re-execute the cross-chain information interaction method of the blockchain, that is, the t1 node, the t2 node, the block-producing node, and the blockchain B of the blockchain T re-execute steps S1-S4. , or the t2 node of blockchain T will send a closing transaction message to itself to trigger the closing task.
  • step 1) the blockchain performs step 2):
  • Blockchain T will send a closing transaction message to itself to trigger the closing task.
  • the closed transaction information includes the block height, transaction sequence number, time, etc. of the previously copied blockchain A information, and the blockchain T will refund the cost of performing the copying task this time.
  • the transaction of packaging the data of blockchain A can be found on the blockchain T, which is used as the voucher for copy initiation, and the transaction of the feedback information of blockchain B is used as the voucher for the completion of copying, so as to confirm the cross-chain copying information. success or failure.
  • FIG. 4 is a schematic flowchart of a method for cross-chain interaction of blockchain information applied to node t1 in Embodiment 2 of the present invention, a method for cross-chain interaction of blockchain information, applied to node t1 of blockchain T , the t1 node is any node in the blockchain T (which can be configured in advance), including the following steps:
  • the t1 node determines whether the blockchain A meets the first feedback condition, and if so, the t1 node of the blockchain T obtains and verifies the first data information of the blockchain A;
  • step S200 the first feedback condition is preset on the blockchain T.
  • step S200 it also includes:
  • the t1 node of the blockchain T reads the first data information of an arbitrary node a1 on the blockchain A, and converts the first data information of the node a1 Converted into tradable data information on the blockchain T.
  • the t1 node of the blockchain T can also read the transaction of chain A data from the blockchain A.
  • the t1 node of the blockchain T performs a corresponding read operation to obtain the corresponding data from the blockchain A.
  • the blockchain T needs to wait for consensus confirmation to read the first data information on blockchain A; if blockchain A adopts a weak consensus algorithm Consistent consensus algorithm, because weak consensus consensus will have the risk of rollback, in order to reduce the risk, the blockchain T needs to wait for the generation of the block where the first data information is located, and then wait for a certain number of subsequent blocks to be generated (also That is, when blockchain A generates several subsequent blocks after the block where the first data information is generated, the t1 node of blockchain T reads the first data information of blockchain A), and then the block can be read.
  • the first data information of chain A is to say: if blockchain A adopts a strong consensus consensus algorithm, the t1 node of blockchain T needs to wait for consensus confirmation to read the first data information on blockchain A; if blockchain A adopts a weak consensus algorithm Consistent consensus algorithm, because weak consensus consensus will have the risk of rollback, in order to reduce the risk, the blockchain T needs to wait for the generation of the block where the first data information is located, and then wait for a certain
  • the certain number can be set according to specific conditions. For example, on the Bitcoin blockchain, after the block where the target information (that is, the first data information to be obtained) is located, there are 6 blocks after confirmation. Then read the target information.
  • the t1 node of the blockchain T verifies the first data information, and if the verification is passed, a verification pass signal is sent to the block node;
  • the t1 node of the blockchain T reads the second data information from the non-a1 node (that is, other nodes) of the blockchain A, and judges whether the first data information is consistent with the second data information. If they are consistent, then If the verification is passed, if inconsistent, the verification fails, and the first data information is discarded.
  • the a1 node By comparing the first data information with the second data information, the a1 node can be prevented from doing evil and producing false data.
  • the t1 node of the blockchain T will read the second data information from the non-a1 node of the blockchain A.
  • the specific method is to extract the corresponding data information according to the unique identifier of the block and transaction where the different data information is located. , and then the t1 node compares the first data information and the second data information received twice, if the first data information and the second data information are consistent, it means that the first data information obtained from the blockchain A has passed the verification.
  • non-a1 node used for verification in this verification step can be configured or determined according to the consensus mechanism of the blockchain.
  • the storing the first data information on the local chain includes: when the first data information of the blockchain A is verified and passed, sending a verification pass signal to the block producing node of the blockchain T.
  • Step S201 is also included. After the cross-chain copying of information fails, step S200 is continued to be executed, or the execution is terminated.
  • Figure 5 is a schematic flowchart of a method for cross-chain interaction of blockchain information applied to a block-producing node in Embodiment 3 of the present invention.
  • a method for cross-chain interaction of blockchain information is applied to the output of blockchain T.
  • Block node including the following steps:
  • the block-producing node receives the signal that the t1 node has not passed the verification, the first data information is discarded;
  • the block-producing node stores the first data information on the local chain, that is, the block-producing node of the blockchain T packs the blockchain A information and generates a block, and the t2 node converts the block generated by the block-producing node and generates a block.
  • the block-producing node of the blockchain T receives the packaging instruction of the t2 node, obtains the information of the blockchain B, and packs the block again (generally, the main information is used to pack the block again).
  • Step S302 is also included. After the cross-chain copying of information fails, the steps S300 and S301 are continued to be executed, or the execution is terminated.
  • Figure 6 is a schematic flowchart of a method for cross-chain interaction of blockchain information applied to t2 node in Embodiment 4 of the present invention, a method for cross-chain interaction of blockchain information, applied to the t2 node of blockchain T , including the following steps:
  • the t2 node of the blockchain T receives the block and sends the transaction to the blockchain B;
  • the t2 node of the blockchain T starts the monitoring operation to read the block information of the blockchain B, and judges whether the blockchain B successfully packs and produces a block. If the packaging is successful, the t2 node reads the blockchain B data, verify whether the read data of blockchain B meets the threshold conditions,
  • step S400 the t2 node of the blockchain T converts the first data information of the blockchain A into a format recognizable by the blockchain B to obtain recognizable first data information, and sends the first data information to the target blockchain B send a transaction with an identifiable first data message;
  • the transaction sent by the t2 node of the blockchain T to the blockchain B also includes the data information on the blockchain T.
  • the data information of the blockchain T includes: the height of the first data information on the blockchain A on the blockchain T, the transaction sequence number, the transaction time, the transaction creator, and the like.
  • step S401 including:
  • the t2 node of block chain T After sending the block chain T information to block chain B, the t2 node of block chain T starts the monitoring operation, and the monitoring time interval can be set according to the actual situation, for example, refer to the block generation time of block chain B .
  • the blockchain B may not produce a block immediately, so the t2 node of the blockchain T needs to continuously monitor the information of the blockchain B node to confirm whether the information has been added. to blockchain B.
  • the t2 node of the blockchain T can also read to the multi-nodes of the blockchain B, thereby reducing some problems caused by the network.
  • the t2 node of the blockchain T monitors the blockchain B to read the first data information in the latest block packaged by the blockchain B, and verifies whether the packaged block is successful based on the read first data information;
  • the verification based on the read first data information whether the packaged block is successful includes: when the block chain T successfully reads the first data information of the block chain T from the latest block packaged by the block chain B,
  • the t2 node of the blockchain T can read the third data information of the same height from other nodes of the blockchain B again, and the t2 node of the blockchain T judges whether the heights of the first data information and the third data information are consistent. If they are consistent, blockchain B successfully packs and produces blocks. If they are inconsistent, blockchain B fails to pack and produce blocks, and cross-chain copying of information fails.
  • the t2 node of the blockchain T verifies whether the information content has been tampered by comparing the information at the same height of different nodes of the blockchain B, thereby preventing the occurrence of the single-node evil problem. If they are consistent, it means that the blockchain B If the block is successfully packaged, it indicates that the cross-chain copying of information is successful.
  • the packaging is successful, the t2 node of the blockchain T reads the data of the blockchain B, and verifies whether the read data of the blockchain B meets the threshold conditions. If the packaging is unsuccessful, the information is copied across the chain fail.
  • the verification of whether the read data of blockchain B meets the threshold conditions, that is, the t2 node of blockchain T reads the block height of blockchain B, and then judges whether the transaction is located according to the strong or weak consistency of the blockchain. Whether the block height has exceeded the threshold; specifically:
  • the threshold condition is that blockchain B successfully packs a block, that is, the cross-chain copying of information is successful this time (that is, the success of packaging and generating a block is the threshold condition);
  • the threshold condition for blockchain B to determine whether it satisfies itself is: after the latest block with the first data information in blockchain B is produced, wait for a certain number of Block generation; if the threshold conditions are met, the cross-chain copying of information succeeds, otherwise the cross-chain copying of information fails.
  • the certain number here can also be set according to specific conditions.
  • the block-producing node of the blockchain T will extract the main information of the block containing the information of the blockchain A in the blockchain B and package it out again.
  • the main information can include: blockchain B contains the block height of blockchain A information, transaction serial number, block generation time, etc., as the basis for the successful copying of information this time.
  • step S403 after the cross-chain copying of information fails, re-execute the cross-chain information interaction method of the blockchain, that is, the blockchain A, the blockchain T, and the blockchain B re-execute steps S1-S4, or the blockchain
  • the t2 node of T will send a closing transaction message to itself to trigger the closing task.
  • step 1) the blockchain performs step 2):
  • the closed transaction information includes the block height, transaction sequence number, time, etc. of the previously copied blockchain A information, and the t2 node of blockchain T will refund the cost of performing the copying task this time.
  • the transaction of packaging the data of blockchain A can be found on the t2 node of the blockchain T, as the certificate for copy initiation, and the transaction of the feedback information of the blockchain B as the certificate for the completion of the copy, thereby confirming the cross-border transaction. Success or failure of chain replication information.
  • a blockchain information cross-chain interaction system including:
  • a first acquisition module configured to enable the t1 node of the blockchain T to determine whether the blockchain A meets the first feedback condition, and if so, the t1 node acquires and verifies the first data information of the blockchain A;
  • the block-producing node of the blockchain T receives the verification signal of the t1 node, stores the first data information on the local chain to generate a block, and the t2 node of the blockchain T receives the block and sends it to the blockchain. B sends the transaction;
  • the block-producing node discards the first data information after receiving the unverified signal from the t1 node; it is also used for:
  • the obtaining and verifying the first data information of the blockchain A includes: the t1 node of the blockchain T reads the first data information of any node a1 on the blockchain A, and converts the first data information of the node a1.
  • the first data information is converted into tradable data information of the blockchain T;
  • the t1 node verifies the first data information. If the verification is passed, the first data information is stored on the local chain, and the transaction is sent to the blockchain B. If the verification fails, the first data information is discarded. ;
  • the verification of the first data information by the t1 node includes: the t1 node reads the second data information from the non-a1 node of the blockchain A, and judges the first data information and the second data information. Whether the data information is consistent, if it is consistent, the verification passes; if it is inconsistent, the verification fails;
  • the first data information of an arbitrary node a1 on the blockchain A read by the t1 node further includes:
  • node t1 needs to wait for consensus confirmation to obtain the first data information on blockchain A;
  • blockchain A adopts a consensus algorithm with weak consistency, when blockchain A generates several subsequent blocks after the block where the first data information is generated, the t1 node reads the first data information of blockchain A;
  • the transaction includes first data information in a format identifiable by blockchain B;
  • the transaction further includes the data on the original blockchain A, the height of the first data information on the blockchain A on the blockchain T, the transaction sequence number, the transaction time, and the transaction creator;
  • the transaction also includes the data on the original blockchain A, the height of the first data information on the blockchain A on the blockchain T, the transaction sequence number, the transaction time, and the transaction creator.
  • the block-producing module is used to make the blockchain B receive the transaction to perform the package block-producing operation; it is also used to:
  • the operation of packaging and producing a block includes: the blockchain B packaging and producing a block based on a chain rule preset by itself.
  • the monitoring module is used to enable the t2 node of the blockchain T to start the monitoring operation to read the block information of the blockchain B, and to determine whether the blockchain B is successfully packaged and produced. If the packaging is successful, the t2 node reads Take the data of blockchain B and verify whether the threshold conditions are met. If the block is not successfully packaged, the cross-chain copying of information will fail;
  • the cross-chain copying information is successful, and the t2 node sends a packaging instruction to give the block node; if the threshold conditions are not met, the cross-chain copying information fails;
  • Whether the packaged block is successful includes: the t2 node of the blockchain T reads the first data information of the latest block packaged by the blockchain B, and based on the read first data information, verifying whether the packaged block is successful;
  • Described based on the read first data information to verify whether the packaged block is successful includes:
  • the t2 node of the blockchain T When the t2 node of the blockchain T successfully reads the first data information of the blockchain T from the latest block packaged by the blockchain B, the t2 node reads the first data of the same height from the other nodes of the blockchain B again. Three data information, the t2 node judges whether the heights of the first data information and the third data information are consistent, if they are consistent, the block chain B successfully packs and produces a block; Information failed.
  • the cross-chain copying of information is successful, and the block-producing node of blockchain T obtains the information of block-chain B and packs the blocks again; if the threshold conditions are not met, the cross-chain copying of information fails;
  • the threshold condition is: if blockchain B adopts a consensus algorithm with strong consistency, the threshold condition is that the block is successfully generated;
  • the threshold condition is: after the latest block with the first data information in blockchain B is generated, wait for a certain number of blocks to be generated.
  • the second obtaining module is used to make the block producing node receive the packaging instruction of the t2 node to obtain the information of the blockchain B to package and produce the block.
  • Embodiments of the present disclosure further include a blockchain information cross-chain interaction system, which is applied to the t1 node and used to implement step S200 (ie, Embodiment 2), including:
  • the judgment module is used for the t1 node to judge whether the blockchain A meets the first feedback condition, and if so, the t1 node of the blockchain T obtains and verifies the first data information of the blockchain A
  • the embodiment of the present disclosure also discloses another blockchain information cross-chain interaction system, which is applied to the block-producing node of the blockchain T, and is used to implement steps S300 and S301 (ie, Embodiment 3), including:
  • a storage module used to make the block-producing node store the first data information on the local chain to generate a block if it receives the t1 node verification pass signal
  • the block-producing node receives the signal that the t1 node has not passed the verification, the first data information is discarded;
  • Packing block module which is used for the block generating node of blockchain T to receive the packing instruction of the t2 node, obtain the information of blockchain B, and then package the block again (generally, the main information can be used to package the block again).
  • the embodiment of the present disclosure also discloses another blockchain information cross-chain interaction system, which is applied to the t2 node and used to implement steps S400, S401, and S402 (ie, Embodiment 4), including the following:
  • the transaction module is used to receive blocks and send transactions to blockchain B;
  • the threshold module is used to start the monitoring operation to read the block information of the blockchain B, and judge whether the packaging of the blockchain B is successful. If the packaging is successful, the t2 node reads the data of the blockchain B and verifies the read Take whether the data of blockchain B meets the threshold condition,
  • the sending instruction module is used to verify that if the threshold condition is met, the cross-chain copying information is successful, and the t2 node sends a packaging instruction to the block node;
  • FIG. 7 shows a structural block diagram of a device according to an embodiment of the present disclosure.
  • the structures of blockchain A, blockchain T, and blockchain B may be Implemented as an electronic device, as shown in FIG. 9 , the electronic device 900 may include a processor 901 and a memory 902 .
  • the memory 902 is used to store a program that supports the processor to execute the method for cross-chain interaction of blockchain information in any of the above embodiments, and the processor 901 is configured to execute the program stored in the memory 902.
  • the memory 902 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 901 to implement the following steps:
  • the t1 node of the blockchain T judges whether the blockchain A meets the first feedback condition, and if so, the t1 node of the blockchain T obtains and verifies the first data information of the blockchain A;
  • the block-producing node of the blockchain T receives the verification signal of the t1 node and stores the first data information on the local chain to generate a block; the t2 node of the blockchain T receives the block and sends it to the blockchain B. send transaction;
  • the block producing node discards the first data information after receiving the signal that the t1 node has not passed the verification
  • the blockchain B receives the transaction and performs a packaging and block-producing operation
  • the t2 node of the blockchain T starts the monitoring operation to read the block information of the blockchain B, and judges whether the blockchain B successfully packs and produces a block. If the packaging is successful, the t2 node reads the blockchain B data, verify whether the read data of blockchain B meets the threshold conditions, if the block is not successfully packaged, the cross-chain copying of information will fail;
  • the cross-chain copy information is successful, and the t2 node sends a packaging instruction to give the block node; if the threshold conditions are not met, the cross-chain copy information fails;
  • the block-producing node of the blockchain T receives the packaging instruction of the t2 node, obtains the information of the blockchain B, and packs the block again (generally, the main information can be used to pack the block again);
  • this program can implement the steps of Embodiment 1.
  • the one or more computer instructions are executed by the processor 901 to implement steps S200 or S300, S301 or S400, S401, S402.
  • FIG. 8 is a schematic structural diagram of a computer system suitable for implementing a method for cross-chain interaction of blockchain information according to an embodiment of the present disclosure.
  • a computer system 1000 includes a processor (CPU, GPU, FPGA, etc.) 1001, which can be loaded into a random access memory (RAM) according to a program stored in a read only memory (ROM) 1002 or from a storage section 1008
  • the program in 1003 executes part or all of the processing in the embodiments shown in the above drawings.
  • various programs and data necessary for the operation of the system 1000 are also stored.
  • the processor 1001 , the ROM 1002 and the RAM 1003 are connected to each other through a bus 1004 .
  • An input/output (I/O) interface 1005 is also connected to the bus 1004 .
  • the following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc. ; and a communication section 1009 including a network interface card such as a LAN card, a modem, and the like. The communication section 1009 performs communication processing via a network such as the Internet.
  • a drive 1010 is also connected to the I/O interface 1005 as needed.
  • a removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1010 as needed so that a computer program read therefrom is installed into the storage section 1008 as needed.
  • embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a readable medium thereof, the computer program containing program code for performing the methods of the accompanying drawings.
  • the computer program may be downloaded and installed from the network through the communication section 1009, and/or installed from the removable medium 1011.
  • each block in the diagram or block diagram may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function. executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the units or modules involved in the embodiments of the present disclosure can be implemented in software or hardware.
  • the described units or modules may also be provided in the processor, and the names of these units or modules do not constitute limitations to the units or modules themselves in certain circumstances.
  • the present disclosure also provides a storage medium, where the storage medium is a computer-readable storage medium, and the computer-readable storage medium may be the computer-readable storage medium included in the nodes in the foregoing embodiments; or It is a computer-readable storage medium that exists alone, not assembled into a device.
  • the computer-readable storage medium stores one or more programs used by one or more processors to perform the methods described in the present disclosure.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

提供了一种区块链信息跨链交互方法、系统、电子设备及存储介质。方法包括:区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则t1节点获取并验证区块链A的第一数据信息;若验证通过后,则区块链T的出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块,t2节点接收区块并向区块链B发送交易;区块链B接收交易执行打包出块操作;t2节点读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件。通过一条额外区块链T将区块链A上的信息保存到区块链B上,能够支持同构链的信息复制,也能够支持异构链的跨链信信息复制。

Description

区块链信息跨链交互方法、系统、电子设备及存储介质 技术领域
本发明涉及区块链技术领域、数据处理技术领域,尤其涉及区块链信息跨链交互方法、系统、电子设备及存储介质。
背景技术
随着科技的不断进步和发展,区块链以势不可挡的趋势席卷全球。对于区块链的好处更是延展到各个领域,区块链的好处被尽可能地发挥了出来。与传统的发展途径相比,区块链的技术发展途径方面都更加快捷方便且安全可靠,这项技术的开发赢得了各个领域发展和越来越多人的认可和使用。
在区块链高速发展的同时也面临着诸多问题,区块链之间互通性极大程度的限制了区块链的应用空间。每条链相当于一个独立账本,不同账本间无法互通,区块链间存在信息孤岛问题。
信息孤岛从价值和信息两个方面制约了区块链的发展,区块链间互通性差导致区块链的应用空间被限制。比如:当用户想要将A链的数据转交给B链时,用户或者B链的某些智能合约需要用到A链的数据的时候只能通过手动的形式上传,这就会使得数据有可能被篡改而失去了可信性。
不论对于公有链还是私有链来看,跨链技术就是实现价值互联网的关键,它是把区块链从分散的孤岛中拯救出来的良药,是区块链向外拓展和连接的桥梁。
跨链就是让信息跨过链和链之间的障碍进行流通,实现不同区块链间 的资产流转、信息互通、应用协同,降低链与链间传输成本。
目前为止没有公认的普适型跨链机制,不同区块链之间的底层技术实现方式差异巨大,给跨链的实现带来障碍。
大多跨链技术专注于链上资产的转移,区块链信息转移在实际应用中也非常具有使用价值,如区块链信息备份,区块链重要信息收集,提取,等等。
目前存在的区块链跨链技术各有不同,也都因其实现方法的不同存在着各种局限,例如申请号为“CN202010475109.6”的发明专利申请公开了一种区块链间跨链信息交互方法、系统、介质、设备及应用,解决不同区块链项目之间的跨链方案。跨链信息交互系统包括第一区块链、中继区块链和第二区块链,第一区块链包括第一区块链账户和第一跨链合约,第二区块链包括第二区块链账户和第二跨链合约,第一区块链、中继区块链和第二区块链均设有收集人,跨链交互时,第一区块链账户向所述第一跨链合约发送跨链交互请求,中继区块链中的收集人主动收集第一跨链合约中的跨链交互请求,经签名验证后记录在中继区块链上,第二区块链中的收集人主动收集中继区块链上的跨链交互记录,向第二跨链合约发送跨链交互请求,第二跨链合约解锁映射的交互数据,并转移到第二区块链账户。但是该专利方案利用中继区块链使得各个公链之间能够实现信息互转,避免一条区块链就是一个数据孤岛的情况;利用多个收集人收集跨链信息以及签名验证的方式,并不能够同时支持同构链或者异构链的跨链信息复制,此外该专利方案还需对原区块链进行侵入式操作,即需对原区块链进行一定程度的修改或添加额外功能来实现跨链,然而这在现有的公链中是不可 接受的,如比特币区块链。
又如申请号为“CN201911403803.0”的发明专利提供了一种跨区块链通信方法、装置、跨链服务系统及跨链交易系统,涉及区块链技术领域,解决了不同的区块链网络之间难以互相通信的技术问题。该方法包括:从源区块链网络获取监听到的跨链交易的第一交易信息,所述跨链交易为与源区块链网络与目标区块链网络之间的交易,所述第一交易信息包括:所述跨链交易数据;基于所述跨链交易数据向所述目标区块链网络发送第二交易信息,所述第二交易信息包括:所述跨链交易数据;从所述目标区块链网络获取监听到的所述第二交易信息的执行结束的执行结果;基于所述执行结果向所述源区块链网络发送指示信息,所述指示信息用于指示所述跨链交易结束;但是该专利方案中,跨链方法简单易行,然而存在着中心化或第三方依赖的问题,无法在整个系统层面上保留区块链技术去中心化去信任的特色。
发明内容
本发明所要解决的技术问题在于克服不同区块链之间的底层技术实现方式差异巨大,给跨链的实现带来障碍的问题。
本发明通过以下技术手段实现解决上述技术问题的:
一种区块链信息跨链交互方法,包括:
区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述t1节点获取并验证所述区块链A的第一数据信息;
若验证通过后,则区块链T的出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块,区块链T的t2节点接收区块并向 区块链B发送交易;
若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
所述区块链B接收交易执行打包出块操作;
所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
若验证符合阈值条件,则跨链复制信息成功,则t2节点发送打包指令给出块节点,若不符合阈值条件,则跨链复制信息失败;
出块节点接收t2节点的打包指令获取区块链B的信息进行打包出块。
通过一条额外区块链T上的t1节点、t2节点、出块节点将区块链A上的信息保存到区块链B上,能够支持同构链的信息复制,也能够支持异构链的跨链信信息复制。
作为本发明进一步的方案:所述获取并验证所述区块链A的第一数据信息包括:所述区块链T的t1节点读取区块链A上某个任意节点a1的第一数据信息,并将节点a1的第一数据信息转化成区块链T可交易的数据信息;
所述t1节点对所述第一数据信息进行验证,若验证通过后,将第一数据信息存储到本地链上,并向区块链B发送交易,若验证未通过,则舍弃第一数据信息。
作为本发明进一步的方案:所述t1节点对所述第一数据信息进行验证包括:所述t1节点向区块链A的非a1节点读取所述第二数据信息,并判 断所述第一数据信息与所述第二数据信息是否一致,若一致,则验证通过,若不一致,则验证不通过。
作为本发明进一步的方案:所述t1节点读取区块链A上某个任意节点a1的第一数据信息还包括:
若区块链A采用强一致性的共识算法,则t1节点需要等共识确认后获取区块链A上的第一数据信息;
若区块链A采用弱一致性的共识算法,则当区块链A生成第一数据信息所在区块生成之后的若干个后续区块,t1节点读取区块链A的第一数据信息。
作为本发明进一步的方案:所述交易中包括区块链B可识别格式的第一数据信息。
作为本发明进一步的方案:所述交易还包括原始区块链A上的数据、区块链A上的第一数据信息在区块链T上的高度、交易序号、交易时间、交易创建者。
作为本发明进一步的方案:所述打包出块操作包括:所述区块链B基于本身预设好的链规则打包出块。
作为本发明进一步的方案:所述打包出块是否成功包括:区块链T的t2节点对区块链B进行监听读取区块链B所打包的最新区块的第一数据信息,基于读取的第一数据信息进行验证打包出块是否成功。
作为本发明进一步的方案:所述基于读取的第一数据信息进行验证打包出块是否成功包括:当区块链T的t2节点成功从区块链B所打包的最新区块上读取到区块链T的第一数据信息,t2节点再次向区块链B其他节点 读取相同高度的第三数据信息,所述t2节点判断第一数据信息、第三数据信息高度是否一致,若一致则区块链B打包出块成功,若不一致则区块链B打包出块未成功,跨链复制信息失败。
作为本发明进一步的方案:所述阈值条件为:若区块链B采用强一致性的共识算法,所述阈值条件为出块成功;
若区块链B采用弱一致性的共识算法,所述阈值条件为:区块链B中带有第一数据信息的最新区块出块后,等待一定数量的出块。
一种区块链信息跨链交互系统,包括:
第一获取模块,用于使区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述t1节点获取并验证所述区块链A的第一数据信息;
若验证通过后,则区块链T的出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块,区块链T的t2节点接收区块并向区块链B发送交易;
若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
出块模块,用于使所述区块链B接收交易执行打包出块操作;
监听模块,用于使所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
若验证符合阈值条件,则跨链复制信息成功,则t2节点发送打包指令给出块节点,若不符合阈值条件,则跨链复制信息失败;
第二获取模块,用于使出块节点接收t2节点的打包指令获取区块链B的信息进行打包出块。
一种电子设备,包括存储器和处理器;其中,所述存储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行以实现所述的区块链信息跨链交互方法。
一种存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现所述的区块链信息跨链交互方法。
本发明的优点在于:
1、本发明所要实现的跨链技术是通过一条额外区块链T将区块链A上的信息保存到区块链B上,能够支持同构链的信息复制,也能够支持异构链的跨链信信息复制,且不存在中心化或者第三方依赖的问题。
2、本发明是不仅限于在带有跨链功能的区块链上使用,区块链A和B即使本身不具备跨链功能,但仍可以通过此技术来复制信息,如:比特币,以太坊等等。
3、本发明使用了非入侵式的方法,无需对区块链A和区块链B进行任何改造或者添加功能,从而在对原区块链与目标区块链不产生任何影响,在整个复制信息的过程中区块链A和区块链B保持正常运行即可,区块链A和区块链B并不会感知跨链,实现在整个信息跨链的过程中对原区块链与目标区块链不产生任何影响的情况下完成跨链操作。
4、在使用本发明的跨链信息备份的同时,可以做到跨链信息备份记录可追溯且不可篡改。
5、本发明无单点依赖、中心化信任或第三方信任,从而使得整个系统 保留了区块链的去中心化、去信任、不可篡改的特点。
附图说明
图1为本发明实施例1提供的区块链信息跨链交互方法的原理示意图。
图2为本发明实施例1提供的区块链信息跨链交互方法的流程示意图。
图3为本发明实施例1提供的另一区块链信息跨链交互方法的流程示意图。
图4为本发明实施例2提供的应用于t1节点的区块链信息跨链交互方法的流程示意图。
图5为本发明实施例3提供的应用于出块节点的区块链信息跨链交互方法的流程示意图。
图6为本发明实施例4提供的应用于t2节点的区块链信息跨链交互方法的流程示意图。
图7示出根据本公开一实施方式的设备的结构框图。
图8是适于用来实现根据本公开一实施方式的区块链信息跨链交互方法的计算机系统的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在本公开的说明书和权利要求书及上述附图中的描述的一些流程中, 包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如101、102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。
根据本公开实施例提供的技术方案,区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述区块链T获取并验证所述区块链A的第一数据信息;若验证通过后,则第一数据信息存储到本地链上,并向区块链B发送交易,若验证未通过,则舍弃所述第一数据信息;所述区块链B接收交易执行打包出块操作;所述区块链T开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;若符合,则跨链复制信息成功,则区块链T获取区块链B的主要信息再次进行打包出块;若不符合,则跨链复制信息失败。
其中,区块链T是一条额外区块链,包括t1节点、t2节点…出块节点,对于区块链T的共识算法并无要求,可以根据具体实际情况做选择。优选的,在本发明中区块链T采用委托权益证明DPOS的共识算法,其特点为:出块时间短,效率高。
实施例1
参阅图1及图2,图1为本发明实施例1中区块链信息跨链交互方法的 原理示意图,图2为本发明实施例1中区块链信息跨链交互方法的流程示意图,包括以下步骤:
S1、区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述区块链T的t1节点获取并验证所述区块链A的第一数据信息;
若验证通过后,则区块链T的出块节点接收t1节点验证通过信号将第一数据信息存储到本地链上生成区块;区块链T的t2节点接收区块并向区块链B发送交易;
若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
S2、所述区块链B接收交易执行打包出块操作;
S3、所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链的B数据,验证所读取区块链B的数据是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
若验证符合阈值条件,则跨链复制信息成功,t2节点发送打包指令给出块节点;若不符合阈值条件,则跨链复制信息失败;
S4、区块链T的出块节点接收t2节点的打包指令,获取区块链B的信息再次进行打包出块(一般情况下采用主要信息再次打包出块即可)。
在步骤S1中,所述第一反馈条件是预设于区块链T上的。
在步骤S1中,还包括:
S11、在区块链A符合第一反馈条件后,所述区块链T的t1节点读取区块链A上某个任意节点a1的第一数据信息,并将节点a1的第一数据信 息转化成区块链T可交易的数据信息。
此外,所述区块链T的t1节点还可从区块链A中读取A链数据的交易。
示例性的,当区块链A出现与空气指数相关的数据时,区块链T的t1节点就执行相应的读取操作,从区块链A中获取相应的数据。
需要强调的是,本步骤中获取节点a1的数据需考虑区块链的最终一致性,一般来说区块链共识算法分为强一致性和弱一致性。
也就是说:若区块链A采用强一致性的共识算法,则区块链T的t1节点需要等共识确认后读取区块链A上的第一数据信息;若区块链A采用弱一致性的共识算法,因为弱一致性的共识会有回滚风险,为了降低风险,所以区块链T需要等待第一数据信息所在区块生成后,再等待一定数量的后续区块生成(也即当区块链A生成第一数据信息所在区块生成之后的若干个后续区块,区块链T的t1节点读取区块链A的第一数据信息),然后方可读取区块链A的第一数据信息。
其中,所述一定数量是可根据具体情况设置,例如,在比特币的区块链上,可在目标信息(即要获取的第一数据信息)所在的区块之后出现6个区块确认后再对目标信息进行读取。
S12、区块链T的t1节点对所述第一数据信息进行验证,若验证通过,发送验证通过信号至出块节点,区块链T的出块节点将第一数据信息存储到本地链上,也就是区块链T的出块节点打包区块链A信息并生成区块,t2节点将出块节点所出的区块转化并发送至区块链B处;并向区块链B发送交易,若验证未通过,发送验证未通过信号至出块节点,则出块节点舍弃第一数据信息;
S121、区块链T的t1节点向区块链A的非a1节点(即其他节点)读取第二数据信息,并判断所述第一数据信息与第二数据信息是否一致,若一致,则验证通过,若不一致,则验证不通过,舍弃该第一数据信息。
通过第一数据信息与第二数据信息的比对,可以防止a1节点作恶,制造虚假数据。
通过上述方案,区块链T的t1节点会向区块链A的非a1节点读取第二数据信息,具体方式为根据不同的数据信息所在区块和交易的唯一标识符,提取相应数据信息,然后所述t1节点对比两次接收的第一数据信息和第二数据信息,若第一数据信息和第二数据信息一致,则说明从区块链A获取的第一数据信息验证通过。
此外,本验证步骤中用于验证的所述非a1节点可配置,也可根据区块链的共识机制来决定。
所述将第一数据信息存储到本地链上包括:当区块链A的第一数据信息被验证通过后,区块链T的出块节点会将第一数据信息写入新的区块中。
S122、若验证通过,所述区块链T的t2节点将区块链A的第一数据信息转换成区块链B可识别的格式得到可识别的第一数据信息,并向目标区块链B发送带有可识别的第一数据信息的交易。
区块链T的t2节点发向区块链B的交易除了带有原始区块链A上的数据,还包括了区块链T上数据信息。
所述区块链T数据信息包括:区块链A上的第一数据信息在区块链T上的高度、交易序号、交易时间、交易创建者等。
通将区块链T数据信息一起发向区块链B可以实现在区块链B做到区 块链A信息复制过程的可追溯。
在步骤S2中,所述区块链B接收带有可识别的第一数据信息的交易,并基于本身预设好的链规则打包出块生成最新区块。
在步骤S3中,包括:
S31、在发送区块链T信息给区块链B之后,区块链T的t2节点即开启监听操作,监听的时间间隔可根据实际情况来设定,例如参考区块链B的出块时间。
由于区块链T的t2节点信息在发送后,区块链B并不一定会立即出块,所以区块链T的t2节点需持续监听区块链B节点的信息来确认信息是否已经被加入到区块链B。此处区块链T的t2节点也可以向区块链B多节点进行读取,从而降低由于网络引起的一些问题。
S32、区块链T的t2节点对区块链B进行监听读取区块链B所打包的最新区块中第一数据信息,基于读取的第一数据信息进行验证打包出块是否成功;
所述基于读取的第一数据信息进行验证打包出块是否成功包括:当区块链T成功从区块链B所打包的最新区块上读取到区块链T的第一数据信息,区块链T的t2节点可再次向区块链B其他节点读取相同高度的第三数据信息,所述区块链T的t2节点判断第一数据信息、第三数据信息高度是否一致,若一致则区块链B打包出块成功,若不一致则区块链B打包出块未成功,跨链复制信息失败。
也就是说,区块链T的t2节点通过比较区块链B不同节点相同高度中的信息,来验证信息内容是否被篡改,从而防止单节点作恶问题的发生, 如果一致则说明区块链B打包出块成功,表明跨链复制信息成功。
需要说明的是,此处读取区块链B不同节点数是可配置的,可根据区块链的共识机制来决定。
S33、若打包出块成功,则区块链T的t2节点读取区块链B数据,验证所读取区块链B数据是否符合阈值条件,若打包出块未成功,则跨链复制信息失败。
在步骤S33中,包括:
所述验证所读取区块链B数据是否符合阈值条件,即区块链T的t2节点读取区块链B的区块高度,然后根据区块链强或弱一致性去判断交易所在区块高度是否已经超过阈值;具体包括:
若区块链B采用强一致性的共识算法,所述阈值条件为区块链B打包出块成功,即为此次跨链复制信息成功(也就是说打包出块成功即为阈值条件);
若区块链B采用弱一致性的共识算法,区块链B判断自身是否满足的阈值条件为:等待区块链B中带有第一数据信息的最新区块出块后,等待一定数量的出块;若满足阈值条件,则跨链复制信息成功,否则跨链复制信息失败。
其中,此处的一定数量也可根据具体情况设置。
当此次信息复制成功之后区块链T的出块节点会提取区块链B中包含区块链A信息的区块的主要信息再次打包出块。主要信息可以包括:区块链B包含区块链A信息的区块高度,交易序号,出块时间等等,作为此次成功复制信息的依据凭证。
参阅图3,图3为本发明实施例1提供的另一区块链信息跨链交互方法的流程示意图。还包括步骤S5、在跨链复制信息失败后,重新执行区块链信息跨链交互方法,即区块链T的t1节点、t2节点、出块节点、区块链B重新执行步骤S1-S4,或者区块链T的t2节点会向本身发送一笔关闭交易信息来触发关闭任务。
具体的,实际上,由于某些原因可能导致区块链T向区块链B发送复制信息交易时候无法成功打包,如:费用不够等原因。所以此时区块链执行步骤1)或者步骤2):
1)、继续尝试复制:只要重复区块链T向区块链B发送交易过程,即重复区块链T执行步骤S1、S3及S4、区块链B执行步骤S2的过程,直到成功结束。
2)、关闭此处复制任务:区块链T会向本身发送一笔关闭交易信息来触发关闭任务。
此外,所述关闭交易信息中包含了之前复制区块链A信息区块高度和交易序号、时间等,同时区块链T会退回此次执行复制任务时所花费的费用。
整个流程完成后可以在区块链T上查到打包区块链A数据的交易,作为复制发起的凭证,和区块链B反馈信息的交易,作为复制完成的凭证,从而确认跨链复制信息的成功或失败。
实施例2
参与图4,图4为本发明实施例2中应用于t1节点的区块链信息跨链交互方法的流程示意图,一种区块链信息跨链交互方法,应用于区块链T 的t1节点,所述t1节点为区块链T中的任一节点(可以事先配置),包括以下步骤:
S200、t1节点判断区块链A是否符合第一反馈条件,若是,则所述区块链T的t1节点获取并验证所述区块链A的第一数据信息;
在步骤S200中,所述第一反馈条件是预设于区块链T上的。
在步骤S200中,还包括:
S2001、在区块链A符合第一反馈条件后,所述区块链T的t1节点读取区块链A上某个任意节点a1的第一数据信息,并将节点a1的第一数据信息转化成区块链T可交易的数据信息。
此外,所述区块链T的t1节点还可从区块链A中读取A链数据的交易。
示例性的,当区块链A出现与空气指数相关的数据时,区块链T的t1节点就执行相应的读取操作,从区块链A中获取相应的数据。
需要强调的是,本步骤中获取节点a1的数据需考虑区块链的最终一致性,一般来说区块链共识算法分为强一致性和弱一致性。
也就是说:若区块链A采用强一致性的共识算法,则区块链T的t1节点需要等共识确认后读取区块链A上的第一数据信息;若区块链A采用弱一致性的共识算法,因为弱一致性的共识会有回滚风险,为了降低风险,所以区块链T需要等待第一数据信息所在区块生成后,再等待一定数量的后续区块生成(也即当区块链A生成第一数据信息所在区块生成之后的若干个后续区块,区块链T的t1节点读取区块链A的第一数据信息),然后方可读取区块链A的第一数据信息。
其中,所述一定数量是可根据具体情况设置,例如,在比特币的区块 链上,可在目标信息(即要获取的第一数据信息)所在的区块之后出现6个区块确认后再对目标信息进行读取。
S2002、区块链T的t1节点对所述第一数据信息进行验证,若验证通过后,发送验证通过信号给出块节点;
若验证未通过,发送验证失败信号给出块节点;
S20021、区块链T的t1节点向区块链A的非a1节点(即其他节点)读取第二数据信息,并判断所述第一数据信息与第二数据信息是否一致,若一致,则验证通过,若不一致,则验证不通过,舍弃该第一数据信息。
通过第一数据信息与第二数据信息的比对,可以防止a1节点作恶,制造虚假数据。
通过上述方案,区块链T的t1节点会向区块链A的非a1节点读取第二数据信息,具体方式为根据不同的数据信息所在区块和交易的唯一标识符,提取相应数据信息,然后所述t1节点对比两次接收的第一数据信息和第二数据信息,若第一数据信息和第二数据信息一致,则说明从区块链A获取的第一数据信息验证通过。
此外,本验证步骤中用于验证的所述非a1节点可配置,也可根据区块链的共识机制来决定。
所述将第一数据信息存储到本地链上包括:当区块链A的第一数据信息被验证通过后,发送验证通过信号给区块链T的出块节点。
还包括步骤S201,在跨链复制信息失败后,继续执行步骤S200,或者终止执行。
实施例3
参与图5,图5为本发明实施例3中应用于出块节点的区块链信息跨链交互方法的流程示意图,一种区块链信息跨链交互方法,应用于区块链T的出块节点,包括以下步骤:
S300、若所述出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块;
若出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
其中,出块节点将第一数据信息存储到本地链上,也就是区块链T的出块节点打包区块链A信息并生成区块,t2节点将出块节点所出的区块转化并发送至区块链B处;并向区块链B发送交易;
S301、区块链T的出块节点接收t2节点的打包指令,获取区块链B的信息再次进行打包出块(一般情况下采用主要信息再次打包出块即可)。
还包括步骤S302,在跨链复制信息失败后,继续执行步骤S300、S301,或者终止执行。
实施例4
参与图6,图6为本发明实施例4中应用于t2节点的区块链信息跨链交互方法的流程示意图,一种区块链信息跨链交互方法,应用于区块链T的t2节点,包括以下步骤:
S400、区块链T的t2节点接收区块并向区块链B发送交易;
S401、所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证所读取区块链B的数据是否符合阈值条件,
若打包出块未成功,则跨链复制信息失败;
S402、若验证符合阈值未成功,则跨链复制值条件,则跨链复制信息成功,t2节点发送打包指令给出块节点;
若不符合阈值条件,则跨链复制信息失败。
在步骤S400中,所述区块链T的t2节点将区块链A的第一数据信息转换成区块链B可识别的格式得到可识别的第一数据信息,并向目标区块链B发送带有可识别的第一数据信息的交易;
区块链T的t2节点发向区块链B的交易除了带有原始区块链A上的数据,还包括了区块链T上数据信息。
所述区块链T数据信息包括:区块链A上的第一数据信息在区块链T上的高度、交易序号、交易时间、交易创建者等。
通将区块链T数据信息一起发向区块链B可以实现在区块链B做到区块链A信息复制过程的可追溯;
在步骤S401中,包括:
S4011、在发送区块链T信息给区块链B之后,区块链T的t2节点即开启监听操作,监听的时间间隔可根据实际情况来设定,例如参考区块链B的出块时间。
由于区块链T的t2节点信息在发送后,区块链B并不一定会立即出块,所以区块链T的t2节点需持续监听区块链B节点的信息来确认信息是否已经被加入到区块链B。此处区块链T的t2节点也可以向区块链B多节点进行读取,从而降低由于网络引起的一些问题。
S4012、区块链T的t2节点对区块链B进行监听读取区块链B所打包的最新区块中第一数据信息,基于读取的第一数据信息进行验证打包出块 是否成功;
所述基于读取的第一数据信息进行验证打包出块是否成功包括:当区块链T成功从区块链B所打包的最新区块上读取到区块链T的第一数据信息,区块链T的t2节点可再次向区块链B其他节点读取相同高度的第三数据信息,所述区块链T的t2节点判断第一数据信息、第三数据信息高度是否一致,若一致则区块链B打包出块成功,若不一致则区块链B打包出块未成功,跨链复制信息失败。
也就是说,区块链T的t2节点通过比较区块链B不同节点相同高度中的信息,来验证信息内容是否被篡改,从而防止单节点作恶问题的发生,如果一致则说明区块链B打包出块成功,表明跨链复制信息成功。
需要说明的是,此处读取区块链B不同节点数是可配置的,可根据区块链的共识机制来决定。
S4013、若打包出块成功,则区块链T的t2节点读取区块链B数据,验证所读取区块链B数据是否符合阈值条件,若打包出块未成功,则跨链复制信息失败。
在步骤S4103中,包括:
所述验证所读取区块链B数据是否符合阈值条件,即区块链T的t2节点读取区块链B的区块高度,然后根据区块链强或弱一致性去判断交易所在区块高度是否已经超过阈值;具体包括:
若区块链B采用强一致性的共识算法,所述阈值条件为区块链B打包出块成功,即为此次跨链复制信息成功(也就是说打包出块成功即为阈值条件);
若区块链B采用弱一致性的共识算法,区块链B判断自身是否满足的阈值条件为:等待区块链B中带有第一数据信息的最新区块出块后,等待一定数量的出块;若满足阈值条件,则跨链复制信息成功,否则跨链复制信息失败。
其中,此处的一定数量也可根据具体情况设置。
当此次信息复制成功之后区块链T的出块节点会提取区块链B中包含区块链A信息的区块的主要信息再次打包出块。主要信息可以包括:区块链B包含区块链A信息的区块高度,交易序号,出块时间等等,作为此次成功复制信息的依据凭证。
还包括步骤S403、在跨链复制信息失败后,重新执行区块链信息跨链交互方法,即区块链A、区块链T、区块链B重新执行步骤S1-S4,或者区块链T的t2节点会向本身发送一笔关闭交易信息来触发关闭任务。
具体的,实际上,由于某些原因可能导致区块链T向区块链B发送复制信息交易时候无法成功打包,如:费用不够等原因。所以此时区块链执行步骤1)或者步骤2):
1)、继续尝试复制:重复执行步骤S400、S401、S402,直到成功结束。
2)、关闭此处复制任务:区块链T的t2节点会向本身发送一笔关闭交易信息来触发关闭任务。
此外,所述关闭交易信息中包含了之前复制区块链A信息区块高度和交易序号、时间等,同时区块链T的t2节点会退回此次执行复制任务时所花费的费用。
整个流程完成后可以在区块链T的t2节点上查到打包区块链A数据的交易,作为复制发起的凭证,和区块链B反馈信息的交易,作为复制完成的凭证,从而确认跨链复制信息的成功或失败。
实施例5
一种区块链信息跨链交互系统,包括:
第一获取模块,用于使区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述t1节点获取并验证所述区块链A的第一数据信息;
若验证通过后,则区块链T的出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块,区块链T的t2节点接收区块并向区块链B发送交易;
若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;还用于:
所述获取并验证所述区块链A的第一数据信息包括:所述区块链T的t1节点读取区块链A上某个任意节点a1的第一数据信息,并将节点a1的第一数据信息转化成区块链T可交易的数据信息;
所述t1节点对所述第一数据信息进行验证,若验证通过后,将第一数据信息存储到本地链上,并向区块链B发送交易,若验证未通过,则舍弃第一数据信息;
所述t1节点对所述第一数据信息进行验证包括:所述t1节点向区块链A的非a1节点读取所述第二数据信息,并判断所述第一数据信息与所述第二数据信息是否一致,若一致,则验证通过,若不一致,则验证不通过;
所述t1节点读取区块链A上某个任意节点a1的第一数据信息还包括:
若区块链A采用强一致性的共识算法,则t1节点需要等共识确认后获取区块链A上的第一数据信息;
若区块链A采用弱一致性的共识算法,则当区块链A生成第一数据信息所在区块生成之后的若干个后续区块,t1节点读取区块链A的第一数据信息;
所述交易中包括区块链B可识别格式的第一数据信息;
所述交易还包括原始区块链A上的数据、区块链A上的第一数据信息在区块链T上的高度、交易序号、交易时间、交易创建者;
所述交易还包括原始区块链A上的数据、区块链A上的第一数据信息在区块链T上的高度、交易序号、交易时间、交易创建者。
出块模块,用于使所述区块链B接收交易执行打包出块操作;还用于:
所述打包出块操作包括:所述区块链B基于本身预设好的链规则打包出块。
监听模块,用于使所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
若验证符合阈值条件,则跨链复制信息成功,则t2节点发送打包指令给出块节点,若不符合阈值条件,则跨链复制信息失败;
所述打包出块是否成功包括:区块链T的t2节点读取区块链B所打包的最新区块的第一数据信息,基于读取的第一数据信息进行验证打包出块是否成功;
所述基于读取的第一数据信息进行验证打包出块是否成功包括:
当区块链T的t2节点成功从区块链B所打包的最新区块上读取到区块链T的第一数据信息,t2节点再次向区块链B其他节点读取相同高度的第三数据信息,所述t2节点判断第一数据信息、第三数据信息高度是否一致,若一致则区块链B打包出块成功,若不一致则区块链B打包出块未成功,跨链复制信息失败。
若验证符合阈值条件,则跨链复制信息成功,则区块链T的出块节点获取区块链B的信息再次进行打包出块;若不符合阈值条件,则跨链复制信息失败;
所述阈值条件为:若区块链B采用强一致性的共识算法,所述阈值条件为出块成功;
若区块链B采用弱一致性的共识算法,所述阈值条件为:区块链B中带有第一数据信息的最新区块出块后,等待一定数量的出块。
第二获取模块,用于使出块节点接收t2节点的打包指令获取区块链B的信息进行打包出块。
本公开实施例还包括一种区块链信息跨链交互系统,应用于t1节点,用于实现步骤S200(即实施例2),包括:
判断模块,用于t1节点判断区块链A是否符合第一反馈条件,若是,则所述区块链T的t1节点获取并验证所述区块链A的第一数据信息
本公开实施例还公开了另一种区块链信息跨链交互系统,应用于区块链T的出块节点,用于实现步骤S300、S301(即实施例3),包括:
存储模块,用于使所述出块节点若接收t1节点验证通过信号,将第一 数据信息存储到本地链上生成区块;
若出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
打包出块模块,用于区块链T的出块节点接收t2节点的打包指令,获取区块链B的信息再次进行打包出块(一般情况下采用主要信息再次打包出块即可)。
本公开实施例又公开了另一种区块链信息跨链交互系统,应用于t2节点,用于实现步骤S400、S401、S402(即实施例4),包括以下:
交易模块,用于接收区块并向区块链B发送交易;
阈值模块,用于开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证所读取区块链B的数据是否符合阈值条件,
若打包出块未成功,则跨链复制信息失败;
发送指令模块,用于若验证符合阈值条件,则跨链复制信息成功,t2节点发送打包指令给出块节点;
若不符合阈值条件,则跨链复制信息失败。
图7示出根据本公开一实施方式的设备的结构框图。
前述实施例描述了区块链A、区块链T、区块链B的内部功能和结构,在一个可能的设计中,前述区块链A、区块链T、区块链B的结构可实现为电子设备,如图9中所示,该电子设备900可以包括处理器901和存储器902。
所述存储器902用于存储支持处理器执行上述任一实施例中区块链信 息跨链交互方法的程序,所述处理器901被配置为用于执行所述存储器902中存储的程序。
所述存储器902用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器901执行以实现以下步骤:
S1、区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述区块链T的t1节点获取并验证所述区块链A的第一数据信息;
若验证通过后,则区块链T的出块节点接收t1节点验证通过信号将第一数据信息存储到本地链上生成区块;区块链T的t2节点接收区块并向区块链B发送交易;
若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
S2、所述区块链B接收交易执行打包出块操作;
S3、所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链的B数据,验证所读取区块链B的数据是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
若验证符合阈值条件,则跨链复制信息成功,t2节点发送打包指令给出块节点;若不符合阈值条件,则跨链复制信息失败;
S4、区块链T的出块节点接收t2节点的打包指令,获取区块链B的信息再次进行打包出块(一般情况下采用主要信息再次打包出块即可);
也就是说,该程序可以实现实施例1的步骤。
或者所述一条或多条计算机指令被所述处理器901执行以实现步骤 S200或者S300、S301或者S400、S401、S402。
图8是适于用来实现根据本公开一实施方式的区块链信息跨链交互方法的计算机系统的结构示意图。
如图8所示,计算机系统1000包括处理器(CPU、GPU、FPGA等)1001,其可以根据存储在只读存储器(ROM)1002中的程序或者从存储部分1008加载到随机访问存储器(RAM)1003中的程序而执行上述附图所示的实施方式中的部分或全部处理。在RAM1003中,还存储有系统1000操作所需的各种程序和数据。处理器1001、ROM1002以及RAM1003通过总线1004彼此相连。输入/输出(I/O)接口1005也连接至总线1004。
以下部件连接至I/O接口1005:包括键盘、鼠标等的输入部分1006;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1007;包括硬盘等的存储部分1008;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1009。通信部分1009经由诸如因特网的网络执行通信处理。驱动器1010也根据需要连接至I/O接口1005。可拆卸介质1011,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1010上,以便于从其上读出的计算机程序根据需要被安装入存储部分1008。
特别地,根据本公开的实施方式,上文参考附图描述的方法可以被实现为计算机软件程序。例如,本公开的实施方式包括一种计算机程序产品,其包括有形地包含在及其可读介质上的计算机程序,所述计算机程序包含用于执行附图中的方法的程序代码。在这样的实施方式中,该计算机程序可以通过通信部分1009从网络上被下载和安装,和/或从可拆卸介质1011 被安装。
附图中的流程图和框图,图示了按照本公开各种实施方式的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,路程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施方式中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。
作为另一方面,本公开还提供了一种存储介质,该存储介质为计算机可读存储介质,该计算机可读存储介质可以是上述实施方式中节点中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,所述程序被一个或者一个以上的处理器用来执行描述于本公开的方法。
以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照 前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (13)

  1. 一种区块链信息跨链交互方法,其特征在于,包括:
    区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述t1节点获取并验证所述区块链A的第一数据信息;
    若验证通过后,则区块链T的出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块,区块链T的t2节点接收区块并向区块链B发送交易;
    若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
    所述区块链B接收交易执行打包出块操作;
    所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
    若验证符合阈值条件,则跨链复制信息成功,则t2节点发送打包指令给出块节点,若不符合阈值条件,则跨链复制信息失败;
    出块节点接收t2节点的打包指令获取区块链B的信息进行打包出块。
  2. 根据权利要求1所述的区块链信息跨链交互方法,其特征在于,
    所述获取并验证所述区块链A的第一数据信息包括:所述区块链T的t1节点读取区块链A上某个任意节点a1的第一数据信息,并将节点a1的第一数据信息转化成区块链T可交易的数据信息;
    所述t1节点对所述第一数据信息进行验证,若验证通过后,将第一数据信息存储到本地链上,并向区块链B发送交易,若验证未通过,则舍弃第一数据信息。
  3. 根据权利要求2所述的区块链信息跨链交互方法,其特征在于,所述t1节点对所述第一数据信息进行验证包括:
    所述t1节点向区块链A的非a1节点读取所述第二数据信息,并判断所述第一数据信息与所述第二数据信息是否一致,若一致,则验证通过,若不一致,则验证不通过。
  4. 根据权利要求2所述的区块链信息跨链交互方法,其特征在于,所述t1节点读取区块链A上某个任意节点a1的第一数据信息还包括:
    若区块链A采用强一致性的共识算法,则t1节点需要等共识确认后获取区块链A上的第一数据信息;
    若区块链A采用弱一致性的共识算法,则当区块链A生成第一数据信息所在区块生成之后的若干个后续区块,t1节点读取区块链A的第一数据信息。
  5. 根据权利要求2所述的区块链信息跨链交互方法,其特征在于,所述交易中包括区块链B可识别格式的第一数据信息。
  6. 根据权利要求5所述的区块链信息跨链交互方法,其特征在于,所述交易还包括原始区块链A上的数据、区块链A上的第一数据信息在区块链T上的高度、交易序号、交易时间、交易创建者。
  7. 根据权利要求4所述的区块链信息跨链交互方法,其特征在于,
    所述打包出块操作包括:所述区块链B基于本身预设好的链规则打包出块。
  8. 根据权利要求7所述的区块链信息跨链交互方法,其特征在于,
    所述打包出块是否成功包括:区块链T的t2节点读取区块链B所打包的最新区块的第一数据信息,基于读取的第一数据信息进行验证打包出块 是否成功。
  9. 根据权利要求8所述的区块链信息跨链交互方法,其特征在于,所述基于读取的第一数据信息进行验证打包出块是否成功包括:
    当区块链T的t2节点成功从区块链B所打包的最新区块上读取到区块链T的第一数据信息,t2节点再次向区块链B其他节点读取相同高度的第三数据信息,所述t2节点判断第一数据信息、第三数据信息高度是否一致,若一致则区块链B打包出块成功,若不一致则区块链B打包出块未成功,跨链复制信息失败。
  10. 根据权利要求8所述的区块链信息跨链交互方法,其特征在于,所述阈值条件为:
    若区块链B采用强一致性的共识算法,所述阈值条件为出块成功;
    若区块链B采用弱一致性的共识算法,所述阈值条件为:区块链B中带有第一数据信息的最新区块出块后,等待一定数量的出块。
  11. 一种区块链信息跨链交互系统,其特征在于,包括:
    第一获取模块,用于使区块链T的t1节点判断区块链A是否符合第一反馈条件,若是,则所述t1节点获取并验证所述区块链A的第一数据信息;
    若验证通过后,则区块链T的出块节点接收t1节点验证通过信号,将第一数据信息存储到本地链上生成区块,区块链T的t2节点接收区块并向区块链B发送交易;
    若验证未通过,则出块节点接收t1节点未验证通过信号舍弃所述第一数据信息;
    出块模块,用于使所述区块链B接收交易执行打包出块操作;
    监听模块,用于使所述区块链T的t2节点开启监听操作读取区块链B的区块信息,判断区块链B打包出块是否成功,若打包出块成功,则t2节点读取区块链B数据,验证是否符合阈值条件,若打包出块未成功,则跨链复制信息失败;
    若验证符合阈值条件,则跨链复制信息成功,则t2节点发送打包指令给出块节点,若不符合阈值条件,则跨链复制信息失败;
    第二获取模块,用于使出块节点接收t2节点的打包指令获取区块链B的信息进行打包出块。
  12. 一种电子设备,包括存储器和处理器;其中,所述存储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行以实现如权利要求1~10任一项所述的方法。
  13. 一种存储介质,其上存储有计算机指令,该计算机指令被处理器执行时实现如权利要求1~10任一项所述的方法。
PCT/CN2020/140868 2020-12-29 2020-12-29 区块链信息跨链交互方法、系统、电子设备及存储介质 WO2022141059A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/140868 WO2022141059A1 (zh) 2020-12-29 2020-12-29 区块链信息跨链交互方法、系统、电子设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/140868 WO2022141059A1 (zh) 2020-12-29 2020-12-29 区块链信息跨链交互方法、系统、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022141059A1 true WO2022141059A1 (zh) 2022-07-07

Family

ID=82258706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/140868 WO2022141059A1 (zh) 2020-12-29 2020-12-29 区块链信息跨链交互方法、系统、电子设备及存储介质

Country Status (1)

Country Link
WO (1) WO2022141059A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766037A (zh) * 2022-11-28 2023-03-07 周加华 基于区块链的跨链交易方法
CN116542795A (zh) * 2023-05-09 2023-08-04 武汉智网兴电科技开发有限公司 基于区块链的审计数据跨链交互方法及装置
CN116827957A (zh) * 2023-08-30 2023-09-29 腾讯科技(深圳)有限公司 基于多区块链的信息处理方法、装置、设备以及介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009811A (zh) * 2017-11-30 2018-05-08 中国人民解放军国防科技大学 一种面向云际计算环境价值交换的跨链通信方法
CN108600315A (zh) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 区块链路由处理方法、装置及存储介质
CN108805704A (zh) * 2018-05-16 2018-11-13 深圳市网心科技有限公司 区块链业务实现方法、监听设备、存储介质及系统
CN110288345A (zh) * 2019-06-26 2019-09-27 深圳市网心科技有限公司 跨链通信方法、装置、主链节点及存储介质
CN110543488A (zh) * 2019-09-11 2019-12-06 深圳市网心科技有限公司 一种验证节点更新方法、装置及设备
US20200118068A1 (en) * 2018-10-10 2020-04-16 QuestaWeb, Inc. Hierarchical Blockchain Architecture for Global Trade Management
CN111181968A (zh) * 2019-12-30 2020-05-19 北京金山云网络技术有限公司 跨区块链通信方法、装置、跨链服务系统及跨链交易系统
CN111800463A (zh) * 2020-05-29 2020-10-20 易联众信息技术股份有限公司 区块链间跨链信息交互方法、系统、介质、设备及应用

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009811A (zh) * 2017-11-30 2018-05-08 中国人民解放军国防科技大学 一种面向云际计算环境价值交换的跨链通信方法
CN108600315A (zh) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 区块链路由处理方法、装置及存储介质
CN108805704A (zh) * 2018-05-16 2018-11-13 深圳市网心科技有限公司 区块链业务实现方法、监听设备、存储介质及系统
US20200118068A1 (en) * 2018-10-10 2020-04-16 QuestaWeb, Inc. Hierarchical Blockchain Architecture for Global Trade Management
CN110288345A (zh) * 2019-06-26 2019-09-27 深圳市网心科技有限公司 跨链通信方法、装置、主链节点及存储介质
CN110543488A (zh) * 2019-09-11 2019-12-06 深圳市网心科技有限公司 一种验证节点更新方法、装置及设备
CN111181968A (zh) * 2019-12-30 2020-05-19 北京金山云网络技术有限公司 跨区块链通信方法、装置、跨链服务系统及跨链交易系统
CN111800463A (zh) * 2020-05-29 2020-10-20 易联众信息技术股份有限公司 区块链间跨链信息交互方法、系统、介质、设备及应用

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766037A (zh) * 2022-11-28 2023-03-07 周加华 基于区块链的跨链交易方法
CN115766037B (zh) * 2022-11-28 2024-03-15 恒道礼创(深圳)发展合伙企业(有限合伙) 基于区块链的跨链交易方法
CN116542795A (zh) * 2023-05-09 2023-08-04 武汉智网兴电科技开发有限公司 基于区块链的审计数据跨链交互方法及装置
CN116542795B (zh) * 2023-05-09 2024-02-02 武汉智网兴电科技开发有限公司 基于区块链的审计数据跨链交互方法及装置
CN116827957A (zh) * 2023-08-30 2023-09-29 腾讯科技(深圳)有限公司 基于多区块链的信息处理方法、装置、设备以及介质
CN116827957B (zh) * 2023-08-30 2023-11-07 腾讯科技(深圳)有限公司 基于多区块链的信息处理方法、装置、设备以及介质

Similar Documents

Publication Publication Date Title
WO2022141059A1 (zh) 区块链信息跨链交互方法、系统、电子设备及存储介质
WO2018228338A1 (zh) 资源转移方法、装置、存储介质及计算机设备
US20220239470A1 (en) Cross-blockchain data processing method and apparatus, device, and computer storage medium
US20190172026A1 (en) Cross blockchain secure transactions
Civit et al. Polygraph: Accountable byzantine agreement
Goes The interblockchain communication protocol: An overview
WO2020258912A1 (zh) 一种区块链共识方法、装置和系统
CN111640017B (zh) 一种应用于联盟链跨链转账的交易正确性验证方法及装置
KR102050007B1 (ko) 블록체인 기반 외부 서비스 지원 시스템 및 그 방법
CN108681565A (zh) 区块链数据并行处理方法、装置、设备和存储介质
CN109118230A (zh) 基于区块链的信息处理方法和装置
WO2007087746A1 (fr) Procédé, système et dispositif de synchronisation de données
CN114902204A (zh) 分布式区块链交易系统
CN113179272A (zh) 基于智能合约的区块链跨链交互方法、装置和计算机可读存储介质
JP7254585B2 (ja) システム間連携方法およびノード
WO2023184881A1 (zh) 提案共识执行方法、区块链系统、设备和存储介质
WO2022206454A1 (zh) 提供跨链消息的方法和装置
CN111563124B (zh) 基于区块链的作业处理方法、装置及系统
CN108932249A (zh) 一种管理文件系统的方法及装置
CN114240439A (zh) 基于阈值签名与双哈希链模式的跨链交易回滚方法及装置
CN111915308A (zh) 一种区块链网络的交易处理方法及区块链网络
CN114785804A (zh) 用于跨区块链交互的系统及方法
CN112910946B (zh) 应用于t2节点的区块链信息跨链交互方法、系统、设备
CN112953999B (zh) 应用于t1节点的区块链信息跨链交互方法、系统、设备
CN112738243B (zh) 一种区块链信息跨链交互系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20967407

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20967407

Country of ref document: EP

Kind code of ref document: A1