Disclosure of Invention
The embodiments of the present specification aim to provide a more efficient cross-chain data processing scheme to solve the deficiencies in the prior art.
To achieve the above object, one aspect of the present specification provides a method for processing cross-chain data, the method being performed by a data provider device, and including:
obtaining first data from a first blockchain;
generating second data, the second data having a predetermined data structure and including: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
providing the second data to a data recipient device.
In one embodiment, the related information of the first data further includes a data structure type of the first data.
In one embodiment, the data structure type of the first data is one of the following types: block header type, transaction type, account status type, receipt type.
In one embodiment, obtaining the first data from the first blockchain includes obtaining the first data and its attestation data from the first blockchain, the second data also including the attestation data.
In one embodiment, the second data further includes information related to the certification data, the information related to the certification data including at least one of: a type of the attestation data, a data structure type of the attestation data, a hash value of the attestation data, a verification root of the attestation data.
In one embodiment, the type of the attestation data is one of: spv attest data type, multiple visa attest data type.
In one embodiment, the type of the first blockchain is one of the following types: bitcoin chain type, Ether Fang chain type, Hyperridge Fabric chain type.
Another aspect of the present specification provides a method for processing cross-link data, where the method is performed by a data receiving device, and includes:
receiving second data from a data provider device, the second data having a predetermined data structure and including therein: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
determining a data parser corresponding to the first data based on the related information of the first data;
and analyzing the first data through a data analyzer.
In one embodiment, the related information of the first data further includes a data structure type of the first data, wherein determining the data parser corresponding to the first data based on the related information of the first data includes determining the data parser corresponding to the first data based on the type of the first blockchain and the data structure type of the first data.
In an embodiment, a correspondence between a chain identifier of the first blockchain and a first verification root of the first blockchain is preset in the data receiver device, and the second data further includes certification data of the first data, and the method further includes:
determining a certification data parser and a verifier corresponding to the certification data;
parsing the attestation data by the attestation data parser;
verifying, by the verifier, the first data based on the first verification root and the attestation data.
In one embodiment, determining the attestation data parser and verifier corresponding to the attestation data includes determining the attestation data parser and verifier corresponding to the attestation data based on a type of the first blockchain, a data structure type of the first data.
In one embodiment, the second data further includes a type of the attestation data and a data structure type of the attestation data, and determining the attestation data parser and verifier corresponding to the attestation data includes determining the attestation data parser and verifier corresponding to the attestation data based on the type of the attestation data and the data structure type of the attestation data.
In one embodiment, the second data further includes a second verification root of the first blockchain, wherein the first data is verified by the verifier based on the first verification root and the certification data, the second verification root is verified by the verifier based on the first verification root, and after verification, the first data is verified by the verifier based on the second verification root and the certification data.
Another aspect of the present specification provides a cross-chain data processing apparatus, which is deployed in a data provider device, including:
an acquisition unit configured to acquire first data from a first blockchain;
a generating unit configured to generate second data, the second data having a predetermined data structure and including: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
a providing unit configured to provide the second data to a data receiving apparatus.
In an embodiment, the obtaining unit is further configured to obtain the first data and its certification data from the first blockchain, and the second data further includes the certification data.
Another aspect of the present specification provides a cross-link data processing apparatus, where the apparatus is deployed in a data receiving device, and includes:
a receiving unit configured to receive second data from a data provider device, the second data having a predetermined data structure and including: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
a first determination unit configured to determine a data parser corresponding to the first data based on the related information of the first data;
a first parsing unit configured to parse the first data through a data parser.
In an embodiment, the related information of the first data further includes a data structure type of the first data, wherein the first determining unit is further configured to determine a data parser corresponding to the first data based on the type of the first blockchain and the data structure type of the first data.
In an embodiment, a correspondence between a chain identifier of the first blockchain and a first verification root of the first blockchain is preset in the data receiver device, and the second data further includes certification data of the first data, and the apparatus further includes:
a second determination unit configured to determine an attestation data parser and a verifier corresponding to the attestation data;
a second parsing unit configured to parse the certification data by the certification data parser;
a verification unit configured to verify, by the verifier, the first data based on the first verification root and the attestation data.
In one embodiment, the second determination unit is further configured to determine an attestation data parser and a verifier corresponding to the attestation data based on a type of the first blockchain and a data structure type of the first data.
In one embodiment, the second data further includes a type of the certification data and a data structure type of the certification data, and the second determining unit is further configured to determine a certification data parser and a verifier corresponding to the certification data based on the type of the certification data and the data structure type of the certification data.
In an embodiment, the second data further includes a second verification root of the first blockchain, where the verification unit includes a first verification subunit configured to verify, by the verifier, the second verification root based on the first verification root, and a second verification subunit configured to verify, by the verifier, the first data based on the second verification root and the attestation data after the verification is passed.
Another aspect of the present specification provides a computer readable storage medium having stored thereon a computer program or instructions which, when executed in a computer, cause the computer to perform any of the above methods.
Another aspect of the present specification provides a computing device comprising a memory having stored therein a computer program or instructions, and a processor that, when executed, implements any of the above methods.
Through the data processing scheme for the cross-link data according to the embodiment of the specification, different cross-link data can be converted into a uniform data structure, so that a data receiving party can analyze and prove different cross-link data only by presetting less data locally, a multi-link client with smaller data volume or intelligent contract of multi-link data processing and the like can be realized, and the convenience of cross-link communication is improved.
Detailed Description
The embodiments of the present specification will be described below with reference to the accompanying drawings.
FIG. 1 shows a schematic diagram of a cross-chain system in accordance with an embodiment of the present description. As shown in fig. 1, the chain crossing system includes a first blockchain 11, a down-chain network 12, and a second blockchain 13. The first blockchain 11 and the second blockchain 13 are, for example, different types of blockchains, for example, the first blockchain 11 is an ethernet chain, and the second blockchain 13 is a Fabric chain. The first blockchain 11 includes a node 1 therein, the second blockchain 13 includes a node 2 therein, and the downlink network 12 includes a first relay device 121 and a second relay device 122 therein. In the cross-chain system, each of the node 1, the node 2, the first relay device 121, and the second relay device 122 may correspond to a specific computing device, each of which has a respective connection address, so that they can be connected to each other through the connection addresses and can transmit and receive data to and from each other, for example, as shown in fig. 1, the node 1 and the node 2 may be connected to each other, the node 1 may be connected to the first relay device 121, the node 2 may be connected to the second relay device 122, and the first relay device 121 and the second relay device 122 may be directly or indirectly connected. Thus, for example, node 1 may locally read ledger data in first blockchain 11 and provide the data to first relay device 121 or node 2, or second relay device 122 may connect to node 2 and read ledger data in second blockchain 13 from the ledger data of node 2 and provide the data to first relay device 121 or node 1, and so on.
Since the first block chain 11 and the second block chain 13 are different block chains, when the first relay device 121 receives the account book data from the first block chain 11 and the second block chain 13, the data is analyzed by using different analysis methods, and the data is verified by using different verification methods. The first relay device 121 is equipped with, for example, a multi-link client in which a domain name and a verification root of each block link, and an analysis algorithm, a verification algorithm, and the like corresponding to each link type are set in advance. In order to parse and verify the received data by using the multi-chain client, it is necessary for the data provider to configure the self-description data in advance based on the blockchain ledger data and provide the self-description data to the data receiver (e.g., the first relay device 121). Accordingly, after the first relay device 121 receives the self-description data, the blockchain domain name, the data structure type, and the like corresponding to the ledger data included in the self-description data can be read from the self-description data by the multi-chain client, so that the corresponding parsing algorithm and verification algorithm can be determined based on the read content, and finally, verified ledger data can be obtained.
It is to be understood that the above description referring to fig. 1 is only an example description of the embodiments of the present specification, and is not intended to limit the scope of the embodiments of the present specification, for example, the data provider may be a blockchain proxy node in addition to a blockchain node and a repeater, the data receiver is not limited to process received blockchain data through a multi-chain client, for example, the data receiver may also process received blockchain data by executing a predetermined intelligent contract in which domain names and verification roots of respective blockchains and parsing algorithms, verification algorithms, etc. corresponding to respective various chain types may be preset.
The above-described data processing procedure at the data provider and the data receiver will be described in detail below.
Fig. 2 is a flowchart illustrating a method for processing cross-chain data, which is performed by a data provider device and includes:
step S202, acquiring first data from a first block chain;
step S204, generating second data, wherein the second data has a predetermined data structure and comprises: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
step S206, providing the second data to a data receiving device.
As described above, the data provider here may be a blockchain node, a proxy node, a down-link relay device, and the like. The data receiver may be a blockchain node, a proxy node, a down-link relay device, etc., which may receive data through a multi-chain client, or a blockchain node may receive data through a predetermined intelligent contract. Hereinafter, description will be made with the node 1 as a data provider and the first relay device 121 as a data receiver, by way of example.
First, in step S202, first data is acquired from a first blockchain.
In one embodiment, the first data may be any data in the first blockchain 11, and the node 1 may read the first data directly from the locally stored ledger data. The first data can be read locally in the node 1 by the client of the first blockchain 11 arranged therein.
In one embodiment, node 1 may read the first data and its Spv attestation data locally through its client. In this case, the first data may be block header data, transaction data, receipt data, account status data, all of which may be verified by simple payment verification (Spv) proof data to be indeed the consensus data deposited in the blockchain account data. For example, if the first data is receipt 1 in tile 1 in the first blockchain 11, the corresponding Spv certification data includes: a chunk header hash value for chunk 1, a receipt tree root hash value included in chunk 1, hash values for other respective nodes in a tree path from receipt 1 to the root node in the receipt tree.
It can be understood that since the node 1 obtains the data of the first blockchain 11 from the local, and the first blockchain 11 is the etherhouse-chain type blockchain, the certification data of the first data is Spv data. Different types of blockchains have different types of attestation data, e.g., if the first data is data in the second blockchain 13 and the second blockchain 13 is a Fabric chain, the attestation data of the first data is a digital signature of the first data by each of a predetermined number of endorsement nodes in the second blockchain 13.
In step S204, second data is generated, the second data having a predetermined data structure and including: the method comprises the steps of chain identification of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises a chain type of the first block chain.
After reading the data from the local, the node 1 may configure self-describing cross-link data based on the read data, which has a predetermined data structure, i.e., includes a predetermined field arrangement therein, so as to facilitate reading by the data receiving device, in order to facilitate cross-link communication.
FIG. 3 schematically illustrates one data structure for self-describing cross-chain data. As shown in fig. 3, three fields are included in the data structure: chain identification, data element, and data element information. The chain identifier is an identifier for uniquely identifying the blockchain instance, and uniquely corresponds to the blockchain instance. The chain identification is for example the domain name of the block chain. In order to uniquely identify each blockchain (i.e., blockchain instance) in the cross-chain domain, each blockchain may be assigned a unique chain domain name, for example, which is readable, easily identifiable, and thus more operable, similar to the website domain name. It is understood that the chain identifier is not limited to a chain domain name, but may be other unique identifiers of the blockchain instance, such as a verification root of the blockchain.
The data element field is cross-chain data to be transmitted in a cross-chain manner, such as the first data. The data meta information is information for analyzing the first data. In one embodiment, the data meta information includes a chain type, which refers to a blockchain type of a blockchain instance, such as an etherhouse chain type, a bitcoin chain type, a superledger Fabric chain type, and so on. In one embodiment, the data metadata information includes a chain type and a data structure type of the data metadata, and as described above, the first data may be a block header data, a transaction data, a receipt data, an account status data, etc. in a block chain, and correspondingly, the first data has a different data structure type when it is different data, and thus, the data structure type of the data metadata includes, for example, a block header type, a transaction type, an account status type, a receipt type, etc.
FIG. 4 schematically illustrates one data structure for self-describing cross-chain data. In one embodiment, the data metadata information includes three fields shown in FIG. 4: chain type, data structure type, hash value. The hash value field is a hash value of the cross-chain data, and is used for performing hash value verification on the cross-chain data.
FIG. 5 schematically illustrates one data structure for self-describing cross-chain data. Compared with the data structure shown in fig. 3, the data structure in fig. 5 further includes a certification meta field, which is certification data used for verifying the cross-chain data. The attestation data may take different forms depending on the type of particular chain, for example, in a blockchain of the etherhouse type, the attestation data is Spv attestation data, and in a blockchain of the Fabric type, the attestation data is a digital signature of an endorsement node on a data element. In the ethernet house chain type block chain, as described above, the provable data includes block header data, receipt data, transaction data, and account status data, and therefore, in the data structure shown in fig. 5, at least a chain type and a data structure type should be included in the data meta information to determine which provable data the self-describing cross-chain data specifically corresponds to, so as to facilitate the parsing of the provable data by the data receiving side.
FIG. 6 schematically illustrates one data structure for self-describing cross-chain data. In contrast to the data structure shown in fig. 5, the data structure in fig. 6 also includes a certification meta-information field that includes information for parsing and verifying certification data. In one embodiment, the attestation meta information field may include an attestation type field. In one embodiment, the attestation meta information field may include an attestation type field and a data structure type field, where the data structure type field is a data structure type of attestation data, such as a data structure type corresponding to Spv attestation data, a data structure type corresponding to multiple visa attestation data, and so on.
FIG. 7 schematically illustrates one data structure for self-describing cross-chain data. The certification meta-information fields are schematically shown in the data structure to include: a certification type field, a data structure type field, a hash value field, and a verification root field. The hash value field is a hash value of the certification data and is used for verifying the certification data, the verification root field is a verification root of the certification data, namely the verification root in the corresponding block chain example, and the verification root is used for verifying the cross-chain data by combining the certification data.
In one embodiment, after reading the first data, the node 1 may configure the self-describing cross-chain data based on the first data according to the data structure of fig. 3 or fig. 4 to obtain the second data. The node 1 configures self-description cross-Chain data with a data structure shown in fig. 3, for example, through a client of the first blockchain 11, where a Chain identifier (e.g., "Chain 1") of the first blockchain 11 and a Chain type (i.e., an etherhouse Chain type) of the first blockchain 11 are preset in the client, so that "Chain 1" is filled in a Chain identifier field in fig. 3, the first data is filled in a data element field in fig. 3, and the "etherhouse Chain type" is filled in a neuron information field in fig. 3, so as to obtain the self-description cross-Chain data corresponding to the first data.
In one embodiment, the first data is, for example, receipt 1, and after the receipt 1 and its Spv certification data are read, the node 1 may configure corresponding self-describing cross-chain data as the second data according to any one of the predetermined data structures in fig. 5 to 7. For example, a chain identifier of the blockchain 11, a chain type, four data structure types in the first blockchain 11 (i.e., a blockhead data type, a transaction data type, a receipt data type, an account status data type), an attestation type (i.e., an Spv attestation type), a data structure type of attestation data (i.e., a data structure type of Spv attestation), and a verification root are preset in the client of the node 1, and a calculation unit of a hash value is also set in the client. After reading the receipt 1 and the certificate thereof, the client of the node 1 determines that the data structure type of the receipt 1 is the receipt data type, calculates the hash values of the receipt 1 and the certificate thereof by the hash value calculation unit, and fills the items, the receipt 1, the certificate thereof and the hash values thereof in the data structure shown in fig. 7, thereby acquiring self-description cross-chain data corresponding to the receipt 1 and the certificate data thereof.
It will be appreciated that as a data provider, only the parameters related to the first blockchain 11 need to be preset in the client of the node 1 in the first blockchain 11 as described above, whereas in the case of the first relay device 121 as a data provider, it is connected to a plurality of blockchains, for example, which may read data from the respective blockchains connected thereto and convert it into self-describing cross-chain data, in which case the parameters related to the respective blockchains need to be preset in the first relay device 121. For example, parameters related to the first blockchain 11 and parameters related to the second blockchain 12 need to be preset in the multi-chain client of the first relay device 121, so that the first relay device 121 can read data from the first blockchain 11 and the second blockchain 12 and convert the data into self-description cross-chain data respectively.
In step S206, the second data is provided to the data receiving device.
In one embodiment, the node 1 may directly transmit the second data to the device of the first relay device 121 after acquiring the second data.
In case the data provider is the first relay device 121 and the data receiver is the node 2, the first relay device 121 may provide the second data to the node 2 by sending a transaction to the node 2 in which a predetermined contract in the second blockchain 13 is invoked with the second data as an incoming parameter, thereby providing the second data to the node 2.
Fig. 8 is a flowchart illustrating a method for processing cross-chain data, which is performed by a data receiving device and includes:
step S802, receiving second data from a data provider device, where the second data has a predetermined data structure and includes: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
step S804, determining a data resolver corresponding to the first data based on the related information of the first data;
step S806, parsing the first data by the data parser.
As described above, the data receiver may be a blockchain node, a proxy node, a down-link relay device, etc., which may receive data through a multi-chain client, or a blockchain node may receive data through a predetermined intelligent contract. Hereinafter, description will be made with the node 1 as a data provider and the first relay device 121 as a data receiver, by way of example.
In step S802, second data is received from a data provider device, the second data having a predetermined data structure and including: the method comprises the steps of chain identification of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises a chain type of the first block chain.
As described above, the second data may have a data structure as shown in any one of fig. 3-7. Wherein the data meta-information and the attestation meta-information may also comprise different field configurations as described above. For example, the following fields may be included in the second data: the chain identification, data element, chain type, or second data may include the following fields: the chain identification, data element, chain type, data structure type, or the second data may include the following fields: chain identification, data elements, chain type, data structure type, hash values, and the like.
In step S804, a data parser corresponding to the first data is determined based on the related information of the first data. Step S806, parsing the first data by the data parser.
Since the first relay device 121 and the node 1 have negotiated in advance the data structure of the adopted self-describing inter-link data, the first relay device 121 may parse the self-describing data based on the data structure, so as to read data of each field in the self-describing data, thereby obtaining related information of the first data therein, and may determine a parser for parsing the first data based on the related information, where the parser refers to a parsing algorithm.
The multi-link client in the first relay device 121 may preset a parser corresponding to each blockchain type, and since each blockchain type adopts a different data format, for example, as described above, the data format of the etherhouse-chain type blockchain is rlp encoded, and the data format of the Fabric-chain type blockchain is protobuf encoded, the parser corresponding to each blockchain type is used to decode the different data format.
Resolvers respectively corresponding to different data structures in the block chain may also be preset in the multi-chain client in the first relay device 121, where the resolvers respectively corresponding to the different data structures are used to resolve data based on the different data structures. For example, in the ether house chain type block chain, assuming that the type of the first data is a receipt, after the first data is decoded by the parser, the first data is further parsed by the parser corresponding to the receipt to obtain the content of the first data.
Therefore, after acquiring the related information of the first data, the multi-link client of the first relay device 121 may select a corresponding parser to parse the first data based on the related information of the first data. For example, the information related to the first data includes an etherhouse type, so that the multi-link client in the first relay device 121 selects a parser for decoding rlp codes to parse the first data. For example, the related information of the first data includes: ether house chain type, receipt type, so that the multi-chain client in the first relay device 121 first selects a parser for decoding rlp code to parse the first data, and then selects a parser for reading a receipt to further read the first data, so that the content of the first data can be acquired.
In one embodiment, as shown in fig. 4, the data meta information further includes a hash value of the first data, so that, before parsing the first data, the hash value of the first data can be calculated and compared with the hash value in the data meta information to determine whether the first data is original data provided by the data provider.
In one embodiment, the second data further includes certification data of the first data, and after receiving the second data, the data receiving side may further perform the following steps to verify the first data included in the second data:
step S808, determining a certification data parser and a verifier corresponding to the certification data;
step S810, analyzing the certification data through the certification data analyzer;
step S812, verifying the first data by the verifier using the attestation data.
First, in step S808, an attestation data parser and a verifier corresponding to the attestation data are determined.
The certification data parser and the verifier respectively corresponding to various chain types are preset in the multi-link client of the first relay device 121, for example, the multi-link client includes an Spv certification data parser (i.e., parsing algorithm) corresponding to the etherhouse chain type and a verifier (i.e., verification algorithm) for performing verification using Spv certification data, and further includes a multi-certificate data parser corresponding to the Fabric chain type and a verifier for performing verification using multi-certificate data.
In one embodiment, the second data has a data structure shown in fig. 5, and the multi-chain client determines a parser for parsing Spv certification data of a receipt in the etherhouse chain type block chain based on a chain type (etherhouse chain type) in the data metadata and a data structure type (receipt type) in the data metadata, and determines a verifier for verifying using the Spv certification data.
In one embodiment, the second data has a data structure as shown in fig. 6 or fig. 7, and the multi-chain client may determine the corresponding parser and verifier directly based on the certification type and the data structure type in the second data.
Step S810, parsing the certification data by the certification data parser. The parsing process is similar to the parsing process of the first data, and includes a decoding process of the data format and a reading process of the data structure, which are not described herein again.
In step S812, the first data is verified by the verifier using the attestation data.
As described above, the verifier represents a verification algorithm preset in the multi-chain client. In addition, the multi-chain client also presets the chain identification and the minimum verification root of each block chain. The multi-chain client may obtain a minimum verification root preset therein and corresponding to the first blockchain 11 based on the chain identifier of the first blockchain 11 in the second data, where the minimum verification root is, for example, a hash value of a created block of the first blockchain 11.
For example, the first data is receipt 1 and the certification data is correspondingly Spv certification data for receipt 1. The receipt 1 can be verified in the multi-chain client by the following steps: calculating the hash value of the receipt 1; calculating a root hash value of the receipt tree in the block 1 based on hash values of other nodes in the tree path included in the Spv certification data; comparing the calculated root hash value with a root hash value of a receipt tree of block 1 included in Spv certification data to determine whether the receipt 1 is a receipt 1 in block 1; and determining whether the block 1 is a block in the first block chain 11 based on the Spv certification data including the block header hash value of the block 1 and the minimum verification root of the first block chain 11 preset in the multi-chain client.
In one embodiment, as shown in fig. 7, the certification meta-information further includes a verification root, for example, the verification root may include more verification root information relative to a minimum verification root preset in the multi-chain client, for example, may include block information of a founder block, longest chain information of block 1 in the block chain, and the like, so that the multi-chain client may verify the verification root in the second data using the minimum verification root, and after the verification passes, the receipt 1 may be verified based on the verification root and the Spv certification data. The verification root included in the attestation meta-information may also be the minimum verification root.
In one embodiment, as shown in fig. 7, the certification meta-information further includes a hash value of the certification data, so that, before verification using the certification data, the hash value of the certification data may be calculated and compared with the hash value in the certification meta-information to determine whether the certification data is the original data provided by the data provider.
Fig. 9 shows a cross-chain data processing apparatus 900 according to an embodiment of the present specification, the apparatus being deployed in a data provider device, and including:
an obtaining unit 91 configured to obtain first data from the first blockchain;
a generating unit 92 configured to generate second data, the second data having a predetermined data structure and including: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
a providing unit 93 configured to provide the second data to a data receiving device.
In an embodiment, the obtaining unit 91 is further configured to obtain the first data and the certification data thereof from the first blockchain, and the second data further includes the certification data.
Fig. 10 shows a cross-chain data processing apparatus 1000 according to an embodiment of the present specification, the apparatus being deployed at a data receiving device, and including:
a receiving unit 101 configured to receive second data from a data provider device, the second data having a predetermined data structure and including: the method comprises the steps of identifying a chain of a first block chain, first data and related information of the first data, wherein the related information of the first data comprises the chain type of the first block chain;
a first determining unit 102 configured to determine a data parser corresponding to the first data based on the related information of the first data;
a first parsing unit 103 configured to parse the first data through a data parser.
In an embodiment, the related information of the first data further includes a data structure type of the first data, wherein the first determining unit 102 is further configured to determine a data parser corresponding to the first data based on the type of the first blockchain and the data structure type of the first data.
In an embodiment, a correspondence between a chain identifier of the first blockchain and a first verification root of the first blockchain is preset in the data receiver device, and the second data further includes certification data of the first data, and the apparatus 1000 further includes:
a second determination unit 104 configured to determine an attestation data parser and a verifier corresponding to the attestation data;
a second parsing unit 105 configured to parse the certification data by the certification data parser;
a verification unit 106 configured to verify, by the verifier, the first data based on the first verification root and the attestation data.
In an embodiment, the second determining unit 104 is further configured to determine an attestation data parser and a verifier corresponding to the attestation data based on a type of the first blockchain and a data structure type of the first data.
In an embodiment, the second data further includes a type of the certification data and a data structure type of the certification data, wherein the second determining unit 104 is further configured to determine a certification data parser and a verifier corresponding to the certification data based on the type of the certification data and the data structure type of the certification data.
In an embodiment, the second data further includes a second verification root of the first block chain, where the verification unit 106 includes a first verification subunit 1061 configured to verify, by the verifier, the second verification root based on the first verification root, and a second verification subunit 1062 configured to verify, by the verifier, the first data based on the second verification root and the certification data after the verification is passed.
Another aspect of the present specification provides a computer readable storage medium having stored thereon a computer program or instructions which, when executed in a computer, cause the computer to perform any of the above methods.
Another aspect of the present specification provides a computing device comprising a memory having stored therein a computer program or instructions, and a processor that, when executed, implements any of the above methods.
Through the data processing scheme for the cross-link data according to the embodiment of the specification, different cross-link data can be converted into a uniform data structure, so that a data receiving party can analyze and prove different cross-link data only by presetting less data locally, a multi-link client with smaller data volume or intelligent contract of multi-link data processing and the like can be realized, and the convenience of cross-link communication is improved.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
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.
It will be further appreciated by those of ordinary skill in the art that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether these functions are performed in hardware or software depends on the particular application of the solution and design constraints. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.