WO2022205960A1 - Cross-chain data processing method and apparatus - Google Patents

Cross-chain data processing method and apparatus Download PDF

Info

Publication number
WO2022205960A1
WO2022205960A1 PCT/CN2021/133068 CN2021133068W WO2022205960A1 WO 2022205960 A1 WO2022205960 A1 WO 2022205960A1 CN 2021133068 W CN2021133068 W CN 2021133068W WO 2022205960 A1 WO2022205960 A1 WO 2022205960A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
type
blockchain
chain
certification
Prior art date
Application number
PCT/CN2021/133068
Other languages
French (fr)
Chinese (zh)
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 蚂蚁区块链科技(上海)有限公司
Publication of WO2022205960A1 publication Critical patent/WO2022205960A1/en

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing

Abstract

A cross-chain data processing method and apparatus. The method is executed by a data provider device, and comprises: obtaining first data from a first blockchain; generating second data, the second data having a predetermined data structure, and the second data comprising: a chain identifier of the first blockchain, the first data, and related information of the first data, wherein the related information of the first data comprises a chain type of the first blockchain; and providing the second data for a data receiver device.

Description

跨链数据处理方法和装置Cross-chain data processing method and device 技术领域technical field
本说明书实施例涉及区块链技术领域,更具体地,涉及跨链数据处理方法和装置。The embodiments of this specification relate to the field of blockchain technology, and more particularly, to a method and apparatus for processing cross-chain data.
背景技术Background technique
区块链技术也被称之为分布式账本技术,是一种去中心化的分布式数据库技术,其特点是去中心化、公开透明、不可篡改、可信任。区块链的每笔数据,都会广播到全网的区块链节点,每个全节点都有全量的、一致的数据。随着区块链技术的火热,出现了许多不同类型的链,应用在金融、健康医疗、供应链、资产管理和溯源等领域。然而大部分链上应用(加密货币或者智能合约)都无法跨越当前链的边界,不能与其他链协同合作实现价值的流通,从而限制了区块链的发挥空间。如何能让不同类型的链协同合作实现价值的流通成了探索的方向。Blockchain technology, also known as distributed ledger technology, is a decentralized distributed database technology characterized by decentralization, openness, transparency, immutability, and trustworthiness. Each data of the blockchain will be broadcast to the blockchain nodes of the entire network, and each full node has a full amount of consistent data. With the popularity of blockchain technology, many different types of chains have emerged, which are applied in the fields of finance, health care, supply chain, asset management and traceability. However, most on-chain applications (encrypted currencies or smart contracts) cannot cross the boundary of the current chain and cannot cooperate with other chains to realize the circulation of value, thus limiting the development space of the blockchain. How to make different types of chains cooperate to realize the circulation of value has become the direction of exploration.
不同类型的区块链的账本数据的数据结构、数据格式、数据语义、链上证明和验证信任根都不相同,以以太坊链和Hyperledger Fabric链为例,二者的数据结构中的字段定义都不一样,并且以太坊链类型区块链的数据格式为rlp编码,Fabric链类型区块链的数据格式为protobuf编码,以太坊链的证明数据为Spv证明数据,Fabric链的证明数据为多个背书节点的签名,以太坊链的验证根为创世块数据,Fabric链的验证根为多个背书节点各自的公钥。因此,在跨链、多链应用中面临处理差异化数据的问题。The data structure, data format, data semantics, on-chain proof and verification root of trust of the ledger data of different types of blockchains are different. Taking the Ethereum chain and the Hyperledger Fabric chain as examples, the field definitions in the data structures of the two are different. The data format of the Ethereum chain type blockchain is rlp encoding, the data format of the Fabric chain type blockchain is protobuf encoding, the proof data of the Ethereum chain is Spv proof data, and the proof data of the Fabric chain is more The signature of each endorsing node, the verification root of the Ethereum chain is the genesis block data, and the verification root of the Fabric chain is the respective public keys of multiple endorsing nodes. Therefore, it faces the problem of processing differentiated data in cross-chain and multi-chain applications.
因此,需要一种更有效的跨链数据处理方案。Therefore, a more efficient cross-chain data processing scheme is needed.
发明内容SUMMARY OF THE INVENTION
本说明书实施例旨在提供一种更有效的跨链数据处理方案,以解决现有技术中的不足。The embodiments of this specification aim to provide a more effective cross-chain data processing solution to solve the deficiencies in the prior art.
为实现上述目的,本说明书一个方面提供一种跨链数据处理方法,所述方法由数据提供方设备执行,包括:从第一区块链获取第一数据;生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;将所述第二数据提供给数据接收方设备。To achieve the above purpose, one aspect of this specification provides a cross-chain data processing method. The method is executed by a data provider device, and includes: acquiring first data from a first blockchain; generating second data, the second The data has a predetermined data structure, and the second data includes: a chain identifier of the first blockchain, first data, and related information of the first data, wherein the related information of the first data includes the first data. A chain type of blockchain; providing the second data to the data recipient device.
在一种实施方式中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型。In an implementation manner, 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, and receipt type.
在一种实施方式中,从第一区块链获取第一数据包括,从第一区块链获取第一数据及其证明数据,所述第二数据中还包括所述证明数据。In one embodiment, acquiring the first data from the first blockchain includes acquiring the first data and its certification data from the first blockchain, and the second data further includes the certification data.
在一种实施方式中,所述第二数据中还包括所述证明数据的相关信息,所述证明数据的相关信息包括以下至少一项:所述证明数据的类型、所述证明数据的数据结构类型、所述证明数据的哈希值、所述证明数据的验证根。In an embodiment, the second data further includes related information of the certification data, and the related information of the certification data includes at least one of the following: the type of the certification data, the data structure of the certification data Type, hash value of the attestation data, verification root of the attestation data.
在一种实施方式中,所述证明数据的类型为以下一种类型:Spv证明数据类型、多签证明数据类型。In one embodiment, the type of the certification data is one of the following types: Spv certification data type, multi-issue certification data type.
在一种实施方式中,所述第一区块链的类型为以下一种类型:比特币链类型、以太坊链类型、Hyperledger Fabric链类型。In one embodiment, the type of the first blockchain is one of the following types: a Bitcoin chain type, an Ethereum chain type, and a Hyperledger Fabric chain type.
本说明书另一方面提供一种跨链数据处理方法,所述方法由数据接收方设备执行,包括:从数据提供方设备接收第二数据,所述第二数据具有预定数据结构,且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器;Another aspect of the present specification provides a cross-chain data processing method, the method being performed by a data receiver device, comprising: receiving second data from a data provider device, the second data having a predetermined data structure, and the first The second data includes: the chain identifier of the first blockchain, the first data, and the related information of the first data, wherein the related information of the first data includes the chain type of the first blockchain; The relevant information of the first data determines a data parser corresponding to the first data;
通过数据解析器解析所述第一数据。The first data is parsed by 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 data analysis corresponding to the first data is determined based on the related information of the first data The parser includes, based on the type of the first blockchain and the data structure type of the first data, determining a data parser corresponding to the first data.
在一种实施方式中,所述数据接收方设备中预设有所述第一区块链的链标识与所述第一区块链的第一验证根的对应关系,所述第二数据中还包括所述第一数据的证明数据,所述方法还包括:确定与所述证明数据对应的证明数据解析器和验证器;通过所述证明数据解析器解析所述证明数据;通过所述验证器基于所述第一验证根和所述证明数据对所述第一数据进行验证。In an embodiment, the data receiver device is preset with a corresponding relationship between the chain identifier of the first blockchain and the first verification root of the first blockchain, and the second data contains It also 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 certification data through the certification data parser; passing the verification The device verifies the first data based on the first verification root and the certification data.
在一种实施方式中,确定与所述证明数据对应的证明数据解析器和验证器包括,基于所述第一区块链的类型、所述第一数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。In one embodiment, determining the attestation data parser and verifier corresponding to the attestation data includes, based on the type of the first blockchain and the data structure type of the first data, determining the attestation data with the attestation data Corresponding proof data parser and validator.
在一种实施方式中,所述第二数据中还包括所述证明数据的类型、所述证明数据的数据结构类型,其中,确定与所述证明数据对应的证明数据解析器和验证器包括,基于所述证明数据的类型、所述证明数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。In an embodiment, the second data further includes the type of the certification data and the data structure type of the certification data, wherein determining the certification data parser and verifier corresponding to the certification data includes: The attestation data parser and verifier corresponding to the attestation data are determined based on the type of 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 verification is performed by the verifier based on the first verification root and the certification data. The first data is verified, and the second verification root is verified by the verifier based on the first verification root, and after the verification is passed, the verification is performed by the verifier based on the second verification root and the certification data. Verify the first data.
本说明书另一方面提供一种跨链数据处理装置,所述装置部署于数据提供方设备,包括:获取单元,配置为,从第一区块链获取第一数据;生成单元,配置为,生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;提供单元,配置为,将所述第二数据提供给数据接收方设备。Another aspect of this specification provides a cross-chain data processing apparatus, the apparatus is deployed on a data provider device, and includes: an acquisition unit, configured to acquire first data from a first blockchain; a generation unit, configured to generate second data, the second data has a predetermined data structure, and the second data includes: a chain identifier of the first blockchain, first data, and related information of the first data, wherein the first data The related information includes the chain type of the first blockchain; the providing unit is configured to provide the second data to the data receiver device.
在一种实施方式中,所述获取单元还配置为,从第一区块链获取第一数据及其证明数据,所述第二数据中还包括所述证明数据。In one 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-chain data processing apparatus, the apparatus being deployed in a data receiver device, comprising: a receiving unit configured to receive second data from the data provider device, the second data having predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, and the related information of the first data, wherein the related information of the first data includes the first blockchain The first determining unit is configured to determine a data parser corresponding to the first data based on the relevant information of the first data; the first parsing unit is configured to analyze the first data parser through the data parser. a data.
在一种实施方式中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型,其中,所述第一确定单元还配置为,基于所述第一区块链的类型和所述第一数据的数据结构类型,确定与所述第一数据对应的数据解析器。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 be based on the type of the first blockchain and the data structure type of the first data to determine a data parser corresponding to the first data.
在一种实施方式中,所述数据接收方设备中预设有所述第一区块链的链标识与所述第一区块链的第一验证根的对应关系,所述第二数据中还包括所述第一数据的证明数据, 所述装置还包括:第二确定单元,配置为,确定与所述证明数据对应的证明数据解析器和验证器;第二解析单元,配置为,通过所述证明数据解析器解析所述证明数据;验证单元,配置为,通过所述验证器基于所述第一验证根和所述证明数据对所述第一数据进行验证。In an embodiment, the data receiver device is preset with a corresponding relationship between the chain identifier of the first blockchain and the first verification root of the first blockchain, and the second data contains It also includes certification data of the first data, and the device further includes: a second determination unit, configured to determine a certification data parser and a validator corresponding to the certification data; a second parsing unit, configured to pass The certification data parser parses the certification data; the verification unit is configured to verify the first data based on the first verification root and the certification data through the verifier.
在一种实施方式中,所述第二确定单元还配置为,基于所述第一区块链的类型、所述第一数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。In one embodiment, the second determining unit is further configured to determine, based on the type of the first blockchain and the data structure type of the first data, a certification data parser and a certification data parser corresponding to the certification data. validator.
在一种实施方式中,所述第二数据中还包括所述证明数据的类型、所述证明数据的数据结构类型,其中,所述第二确定单元还配置为,基于所述证明数据的类型、所述证明数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。In an embodiment, the second data further includes the type of the certification data and the data structure type of the certification data, wherein the second determining unit is further configured to, based on the type of the certification data . The data structure type of the attestation data determines the attestation data parser and verifier corresponding to the attestation data.
在一种实施方式中,所述第二数据中还包括所述第一区块链的第二验证根,其中,所述验证单元包括,第一验证子单元,配置为,通过所述验证器基于所述第一验证根对所述第二验证根进行验证,第二验证子单元,配置为,在验证通过之后,通过所述验证器基于所述第二验证根和所述证明数据对所述第一数据进行验证。In one embodiment, the second data further includes a second verification root of the first blockchain, wherein the verification unit includes a first verification sub-unit configured to pass the validator The second verification root is verified based on the first verification root, and the second verification subunit is configured to, after the verification is passed, the verification device based on the second verification root and the certification data. The first data is verified.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序或指令,当所述计算机程序或指令在计算机中执行时,令计算机执行上述任一项方法。Another aspect of the present specification provides a computer-readable storage medium on which a computer program or instruction is stored, and when the computer program or instruction is executed in a computer, causes the computer to execute any one of the above methods.
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有计算机程序或指令,所述处理器在执行所述计算机程序或指令时,实现上述任一项方法。Another aspect of the present specification provides a computing device, including a memory and a processor, where a computer program or instruction is stored in the memory, and the processor implements any one of the above methods when executing the computer program or instruction.
通过根据本说明书实施例的对跨链数据的数据处理方案,可将不同的跨链数据转换为统一的数据结构,从而便于数据接收方只需要在本地预设较少的数据,即可实现对不同跨链数据的解析和证明过程,从而可实现数据量较小的多链客户端、或多链数据处理智能合约等,提高了跨链通信的便利性。Through the data processing scheme for cross-chain data according to the embodiments of this specification, different cross-chain data can be converted into a unified data structure, so that the data receiver only needs to preset less data locally to realize the The analysis and proof process of different cross-chain data can realize multi-chain clients with a small amount of data, or multi-chain data processing smart contracts, etc., which improves the convenience of cross-chain communication.
附图说明Description of drawings
通过结合附图描述本说明书实施例,可以使得本说明书实施例更加清楚:By describing the embodiments of the present specification in conjunction with the accompanying drawings, the embodiments of the present specification can be made clearer:
图1示出根据本说明书实施例的跨链系统的示意图;FIG. 1 shows a schematic diagram of a cross-chain system according to an embodiment of the present specification;
图2示出根据本说明书实施例的一种跨链数据处理方法流程图;FIG. 2 shows a flowchart of a method for processing cross-chain data according to an embodiment of the present specification;
图3示意示出了自描述跨链数据的一种数据结构;Figure 3 schematically shows a data structure of self-describing cross-chain data;
图4示意示出了自描述跨链数据的一种数据结构;Figure 4 schematically shows a data structure of self-describing cross-chain data;
图5示意示出了自描述跨链数据的一种数据结构;Figure 5 schematically shows a data structure of self-describing cross-chain data;
图6示意示出了自描述跨链数据的一种数据结构;FIG. 6 schematically shows a data structure of self-describing cross-chain data;
图7示意示出了自描述跨链数据的一种数据结构;FIG. 7 schematically shows a data structure of self-describing cross-chain data;
图8示出根据本说明书实施例的一种跨链数据处理方法流程图;FIG. 8 shows a flowchart of a method for processing cross-chain data according to an embodiment of the present specification;
图9示出根据本说明书实施例的一种跨链数据处理装置900;FIG. 9 shows a cross-chain data processing apparatus 900 according to an embodiment of the present specification;
图10示出根据本说明书实施例的一种跨链数据处理装置1000。FIG. 10 shows a cross-chain data processing apparatus 1000 according to an embodiment of the present specification.
具体实施方式Detailed ways
下面将结合附图描述本说明书实施例。The embodiments of the present specification will be described below with reference to the accompanying drawings.
图1示出根据本说明书实施例的跨链系统的示意图。如图1所示,所述跨链系统包括第一区块链11、链下网络12和第二区块链13。其中,第一区块链11和第二区块链13例如为不同类型的区块链,例如第一区块链11为以太坊链,第二区块链13为Fabric链。第一区块链11中包括节点1,第二区块链13中包括节点2,链下网络12中包括第一中继设备121和第二中继设备122。在该跨链系统中,节点1、节点2、第一中继设备121和第二中继设备122都可对应于具体的计算设备,其各自具有各自的连接地址,从而,其之间可通过连接地址相互连接,并相互发送、接收数据,例如,如图1中所示,节点1和节点2可相互连接、节点1可与第一中继设备121连接,节点2可与第二中继设备122连接,第一中继设备121与第二中继设备122可直接或间接的连接。从而,例如,节点1可从本地读取第一区块链11中的账本数据,并将该数据提供给第一中继设备121或者节点2,或者,第二中继设备122可连接节点2并从节点2的账本数据中读取第二区块链13中的账本数据,并将该数据提供给第一中继设备121或节点1,等等。FIG. 1 shows a schematic diagram of a cross-chain system according to an embodiment of the present specification. As shown in FIG. 1 , the cross-chain system includes a first blockchain 11 , an off-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 Ethereum chain, and the second blockchain 13 is a Fabric chain. The first blockchain 11 includes node 1, the second blockchain 13 includes node 2, and the off-chain network 12 includes a first relay device 121 and a second relay device 122. In this cross-chain system, node 1, node 2, the first relay device 121 and the second relay device 122 can all correspond to specific computing devices, each of which has its own connection address, so that they can pass The connection addresses are connected to each other, and send and receive data to each other. For example, as shown in FIG. 1, node 1 and node 2 can be connected to each other, node 1 can be connected to the first relay device 121, and node 2 can be connected to the second relay device. The device 122 is connected, and the first relay device 121 and the second relay device 122 can be directly or indirectly connected. Thus, for example, node 1 can locally read the ledger data in the first blockchain 11 and provide the data to the first relay device 121 or node 2, or the second relay device 122 can connect to node 2 And read the ledger data in the second blockchain 13 from the ledger data of the node 2, and provide the data to the first relay device 121 or the node 1, and so on.
由于第一区块链11和第二区块链13为不同的区块链,当第一中继设备121接收到分别来自第一区块链11和第二区块链13的账本数据时,将采用不同的解析方法解析数据,并采用不同的验证方法来验证数据。第一中继设备121中例如安装有多链客户端,该多链客户端中预先设置了各个区块链的域名和验证根、以及以及与各种链类型分别对应的解析算法、验证算法等。为了通过使用该多链客户端对接收数据进行解析和验证,需要由数据提供方预先基于区块链账本数据配置自描述数据,并将该自描述数据提供给数据接收方(例如第一中继设备121)。从而,在第一中继设备121接收到上述自描述数据之后,可通过多链客户端从该自描述数据中读取该自描述数据中包括的账本数据对 应的区块链域名、数据结构类型等,从而可基于该读取的内容确定相应的解析算法和验证算法,最终获取经验证的账本数据。Since the first blockchain 11 and the second blockchain 13 are different blockchains, when the first relay device 121 receives the ledger data from the first blockchain 11 and the second blockchain 13, respectively, The data will be parsed using different parsing methods and validated using different validation methods. For example, a multi-chain client is installed in the first relay device 121, and the multi-chain client is preset with the domain name and verification root of each blockchain, as well as the parsing algorithm and verification algorithm corresponding to various chain types, etc. . In order to parse and verify the received data by using the multi-chain client, the data provider needs to configure the self-describing data based on the blockchain ledger data in advance, and provide the self-describing data to the data receiver (for example, the first relay device 121). Therefore, after the first relay device 121 receives the above-mentioned self-describing data, the multi-chain client can read the blockchain domain name and data structure type corresponding to the ledger data included in the self-describing data from the self-describing data. and so on, so that the corresponding parsing algorithm and verification algorithm can be determined based on the read content, and finally the verified ledger data can be obtained.
可以理解,上述参考图1的描述仅是对本说明书实施例的示例描述,而不用于限制本说明书实施例的范围,例如,数据提供方除了可以为区块链节点、中继器之外,还可以为区块链代理节点,数据接收方除了可以为区块链节点、中继设备之外,还可以为区块链代理节点,数据接收方不限于通过多链客户端来处理接收的区块链数据,例如,数据接收方也可以通过执行预定智能合约来处理接收的区块链数据,相应地,在该预定智能合约中可预设各个区块链的域名和验证根、以及以及与各种链类型分别对应的解析算法、验证算法等。It can be understood that the above description with reference to FIG. 1 is only an example description of the embodiments of this specification, and is not used to limit the scope of the embodiments of this specification. For example, in addition to a blockchain node and a repeater, the data provider can also It can be a blockchain proxy node. The data receiver can be a blockchain proxy node in addition to a blockchain node and a relay device. The data receiver is not limited to processing the received blocks through a multi-chain client. For example, the data receiver can also process the received blockchain data by executing a predetermined smart contract. Correspondingly, the domain name and verification root of each blockchain can be preset in the predetermined smart contract. Each chain type corresponds to the parsing algorithm, verification algorithm, etc.
下面将详细描述上述在数据提供方和数据接收方的数据处理过程。The above data processing process at the data provider and the data receiver will be described in detail below.
图2示出根据本说明书实施例的一种跨链数据处理方法流程图,所述方法由数据提供方设备执行,包括:步骤S202,从第一区块链获取第一数据;步骤S204,生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;步骤S206,将所述第二数据提供给数据接收方设备。2 shows a flowchart of a method for processing cross-chain data according to an embodiment of the present specification. The method is executed by a data provider device, including: step S202, obtaining first data from a first blockchain; step S204, generating second data, the second data has a predetermined data structure, and the second data includes: a chain identifier of the first blockchain, first data, and related information of the first data, wherein the first data The relevant information of the first blockchain includes the chain type of the first blockchain; step S206, the second data is provided to the data receiver device.
如上文所述,这里的数据提供方可以是区块链节点、代理节点、链下中继设备等等。数据接收方可以是区块链节点、代理节点、链下中继设备等等,其可通过多链客户端接收数据,或者,区块链节点可以通过预定智能合约接收数据。下文中,将示例地以节点1作为数据提供方、以第一中继设备121作为数据接收方进行描述。As mentioned above, the data provider here can be a blockchain node, a proxy node, an off-chain relay device, and so on. The data receiver can be a blockchain node, an agent node, an off-chain relay device, etc., which can receive data through a multi-chain client, or a blockchain node can receive data through a predetermined smart contract. Hereinafter, description will be given by taking the node 1 as the data provider and the first relay device 121 as the data receiver by way of example.
首先,在步骤S202,从第一区块链获取第一数据。First, in step S202, the first data is obtained from the first blockchain.
在一种实施方式中,所述第一数据可以为第一区块链11中的任何数据,节点1可直接从本地存储的账本数据中读取第一数据。在节点1中可通过其中设置的第一区块链11的客户端来从本地读取第一数据。In one embodiment, the first data can be any data in the first blockchain 11, and the node 1 can directly read the first data 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 set therein.
在一种实施方式中,节点1可通过其客户端从本地读取第一数据及其Spv证明数据。在该情况中,第一数据可以为区块头数据、交易数据、收据数据、账户状态数据,这些数据都可以通过简单支付验证(Spv)证明数据验证其确实为区块链账本数据中存入的经共识的数据。例如,第一数据为第一区块链11中的区块1中的收据1,则相应的Spv证明数据包括:区块1的区块头哈希值、区块1中包括的收据树根哈希值、收据树中从收据1到根节点的树路径中其它各个节点的哈希值。In one embodiment, the node 1 can read the first data and its Spv proof data locally through its client. In this case, the first data can be block header data, transaction data, receipt data, and account status data, all of which can be verified by simple payment verification (Spv) proof data that they are indeed stored in the blockchain ledger data Consensus data. For example, if the first data is receipt 1 in block 1 in the first blockchain 11, the corresponding Spv proof data includes: the block header hash value of block 1, the receipt tree root hash value included in block 1 Hash value, the hash value of each other node in the tree path from receipt 1 to the root node in the receipt tree.
可以理解,由于节点1从本地获取第一区块链11的数据,而第一区块链11为以太坊链类型区块链,因此,第一数据的证明数据为Spv数据。不同类型的区块链具有不同类型的证明数据,例如,如果第一数据为第二区块链13中的数据,第二区块链13为Fabric链,则第一数据的证明数据为第二区块链13中的预定数目的背书节点各自的对该第一数据的数字签名。It can be understood that since the node 1 obtains the data of the first blockchain 11 locally, and the first blockchain 11 is an Ethereum chain type blockchain, the proof data of the first data is Spv data. Different types of blockchains have different types of proof data. For example, if the first data is the data in the second blockchain 13 and the second blockchain 13 is the Fabric chain, the proof data of the first data is the second The digital signature of the first data by each of the predetermined number of endorsing nodes in the blockchain 13 .
在步骤S204,生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型。In step S204, second data is generated, the second data has a predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, and the related information of the first data, wherein, The relevant information of the first data includes the chain type of the first blockchain.
节点1在从本地读取到数据之后,为了便于跨链通讯,可以基于读取的数据配置自描述跨链数据,该自描述跨链数据具有预定的数据结构,即,其中包括预定的字段布置,以便于数据接收方设备的读取。After node 1 reads the data locally, in order to facilitate cross-chain communication, it can configure self-describing cross-chain data based on the read data. The self-describing cross-chain data has a predetermined data structure, that is, it includes a predetermined field arrangement. , so that it can be read by the data receiver device.
图3示意示出了自描述跨链数据的一种数据结构。如图3所示,在该数据结构中包括三个字段:链标识、数据元和数据元信息。其中,链标识是唯一标识区块链实例的标识,与区块链实例唯一对应。链标识例如为区块链的域名。为了在跨链领域唯一标识每个区块链(即区块链实例),例如可对每个区块链分配唯一的链域名,与网站域名类似地,该链域名具有可读性、易于识别性,从而具有更强的可操作性。可以理解,链标识不限于为链域名,也可以为区块链实例的其它唯一标识,如区块链的验证根等。FIG. 3 schematically shows a data structure of self-describing cross-chain data. As shown in Figure 3, the data structure includes three fields: chain identification, data element and data element information. Among them, the chain identifier is an identifier that uniquely identifies the blockchain instance, and uniquely corresponds to the blockchain instance. The chain identifier is, for example, the domain name of the blockchain. In order to uniquely identify each blockchain (that is, a blockchain instance) in the cross-chain field, for example, each blockchain can be assigned a unique chain domain name, which is readable and easy to identify, similar to a website domain name. , so as to have stronger operability. It can be understood that the chain identifier is not limited to the chain domain name, but can also be other unique identifiers of the blockchain instance, such as the verification root of the blockchain.
所述数据元字段即为待跨链传输的跨链数据,如所述第一数据。所述数据元信息即为用于解析该第一数据的信息。在一种实施方式中,该数据元信息包括链类型,链类型是指区块链实例的区块链类型,如以太坊链类型、比特币链类型、Hyperledger Fabric链类型等等。在一种实施方式中,该数据元信息包括链类型和数据元的数据结构类型,如上文所述,所述第一数据可以为区块链中的区块头数据、交易数据、收据数据、账户状态数据等,相对应地,该第一数据在为不同的数据时具有不同的数据结构类型,因此,数据元的数据结构类型例如包括区块头类型、交易类型、账户状态类型、收据类型等等。The data element field is the cross-chain data to be transmitted across the chain, such as the first data. The data element information is information used for parsing the first data. In one embodiment, the data metadata includes a chain type, and the chain type refers to the blockchain type of the blockchain instance, such as the Ethereum chain type, the Bitcoin chain type, the Hyperledger Fabric chain type, and so on. In one embodiment, the data element information includes a chain type and a data structure type of the data element. As described above, the first data may be block header data, transaction data, receipt data, and account data in the blockchain. Status data, etc. Correspondingly, the first data has different data structure types when it is different data. Therefore, the data structure types of the data elements include, for example, block header type, transaction type, account status type, receipt type, etc. .
图4示意示出了自描述跨链数据的一种数据结构。在一种实施方式中,数据元信息包括图4中所示的三个字段:链类型、数据结构类型、哈希值。其中,哈希值字段为跨链数据的哈希值,其用于对跨链数据进行哈希值验证。FIG. 4 schematically shows a data structure of self-describing cross-chain data. In one embodiment, the metadata information includes the three fields shown in FIG. 4: chain type, data structure type, and hash value. The hash value field is the hash value of the cross-chain data, which is used to verify the hash value of the cross-chain data.
图5示意示出了自描述跨链数据的一种数据结构。相比于图3所示的数据结构,图5中的数据结构中还包括证明元字段,该证明元字段即为用于对跨链数据进行验证的证 明数据。该证明数据根据具体链的类型具有不同的形式,例如,在以太坊链类型的区块链中,证明数据为Spv证明数据,在Fabric类型的区块链中,证明数据为背书节点对数据元的数字签名。其中,在以太坊链类型的区块链中,如上文所述,可证明的数据包括区块头数据、收据数据、交易数据和账户状态数据,因此,在图5所示的数据结构中,在数据元信息中应至少包括链类型和数据结构类型,以用于确定该自描述跨链数据具体对应哪种可证明的数据,以便于数据接收方对该可证明数据的解析。Figure 5 schematically shows a data structure of self-describing cross-chain data. Compared with the data structure shown in Figure 3, the data structure in Figure 5 also includes a proof meta field, which is the proof data used to verify the cross-chain data. The proof data has different forms according to the type of the specific chain. For example, in the blockchain type of Ethereum chain, the proof data is Spv proof data, and in the blockchain type of Fabric, the proof data is the endorsement node pair data element digital signature. Among them, in the blockchain of the Ethereum chain type, as mentioned above, the provable data includes block header data, receipt data, transaction data and account status data. Therefore, in the data structure shown in Figure 5, in The data metadata should include at least the chain type and the data structure type, so as to determine which provable data the self-describing cross-chain data corresponds to, so as to facilitate the parsing of the provable data by the data receiver.
图6示意示出了自描述跨链数据的一种数据结构。相比于图5所示的数据结构,图6中的数据结构中还包括证明元信息字段,该证明元信息字段包括用于解析和验证证明数据的信息。在一种实施方式中,该证明元信息字段可包括证明类型字段。在一种实施方式中,该证明元信息字段可包括证明类型字段和数据结构类型字段,这里的数据结构类型字段为证明数据的数据结构类型,如与Spv证明数据对应的数据结构类型、与多签证明数据对应的数据结构类型等。FIG. 6 schematically shows a data structure of self-describing cross-chain data. Compared with the data structure shown in FIG. 5 , the data structure in FIG. 6 further includes a certification meta-information field, and the certification meta-information field includes information for parsing and verifying the certification data. In one embodiment, the attestation meta-information field may include an attestation type field. In one embodiment, the certification meta information field may include a certification type field and a data structure type field, where the data structure type field is the data structure type of the certification data, such as the data structure type corresponding to the Spv certification data, and the multiple The type of data structure corresponding to the data is indicated.
图7示意示出了自描述跨链数据的一种数据结构。在该数据结构中示意示出证明元信息字段中包括:证明类型字段、数据结构类型字段、哈希值字段、验证根字段。其中,哈希值字段为证明数据的哈希值,用于对证明数据进行验证,验证根字段为证明数据的验证根,也即相应区块链实例中的验证根,该验证根用于结合证明数据进行对跨链数据的验证。FIG. 7 schematically shows a data structure of self-describing cross-chain data. It is schematically shown in the data structure that the certification meta information field includes: a certification type field, a data structure type field, a hash value field, and a verification root field. Among them, the hash value field is the hash value of the proof data, which is used to verify the proof data, and the verification root field is the verification root of the proof data, that is, the verification root in the corresponding blockchain instance, and the verification root is used for combining The proof data is used to verify the cross-chain data.
在一种实施方式中,节点1在读取到第一数据之后,可根据图3或图4的数据结构基于第一数据配置自描述跨链数据,以获取第二数据。节点1中例如通过第一区块链11的客户端配置具有图3所示数据结构的自描述跨链数据,在该客户端中预先设置了第一区块链11的链标识(例如“Chain1”)和第一区块链11的链类型(即以太坊链类型),从而在客户端中将“Chain1”填入图3中的链标识字段,将第一数据填入图3中的数据元字段,将“以太坊链类型”填入图3中的神经元信息字段,从而获取与第一数据对应的自描述跨链数据。In one embodiment, after reading the first data, node 1 may configure 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. Node 1 configures self-describing cross-chain data with the data structure shown in ”) and the chain type of the first blockchain 11 (ie, the Ethereum chain type), so that “Chain1” is filled in the chain identification field in FIG. 3 in the client, and the first data is filled in the data in FIG. 3 Meta field, fill in "Ethereum chain type" into the neuron information field in Figure 3, so as to obtain the self-describing cross-chain data corresponding to the first data.
在一种实施方式中,第一数据例如为收据1,节点1在读取到收据1及其Spv证明数据之后,可根据预定的图5-图7中任一数据结构配置对应的自描述跨链数据作为所述第二数据。例如,节点1的客户端中预先设置了区块链11的链标识、链类型、第一区块链11中的四种数据结构类型(即区块头数据类型、交易数据类型、收据数据类型、账户状态数据类型)、证明类型(即Spv证明类型)、证明数据的数据结构类型(即Spv证明的数据结构类型)、以及验证根,并且客户端中还设置了哈希值的计算单元。 节点1的客户端在读取了收据1及其证明之后,确定收据1的数据结构类型为收据数据类型,通过哈希值计算单元计算收据1及其证明各自的哈希值,将上述各项、收据1、其证明及其各自的哈希值填充到图7所示的数据结构中,从而获取与收据1及其证明数据对应的自描述跨链数据。In one embodiment, the first data is, for example, receipt 1. After reading receipt 1 and its Spv proof data, node 1 can configure the corresponding self-describing cross-section according to any of the predetermined data structures in FIG. 5-FIG. 7 . chain data as the second data. For example, the client of node 1 is pre-set with the chain identifier of the blockchain 11, the chain type, and the four data structure types in the first blockchain 11 (that is, the block header data type, transaction data type, receipt data type, Account status data type), proof type (that is, Spv proof type), data structure type of proof data (that is, the data structure type of Spv proof), and verification root, and the calculation unit of the hash value is also set in the client. After reading receipt 1 and its certificate, the client of node 1 determines that the data structure type of receipt 1 is the receipt data type, calculates the respective hash values of receipt 1 and its certificate through the hash value calculation unit, and combines the above items. , Receipt 1, its proof and their respective hash values are filled into the data structure shown in Figure 7, thereby obtaining self-describing cross-chain data corresponding to Receipt 1 and its proof data.
可以理解,作为数据提供方,第一区块链11中的节点1的客户端中仅需要预先设置如上文所述的与第一区块链11相关的各项参数即可,而在第一中继设备121作为数据提供方的情况中,其例如与多个区块链连接,其可能会从其连接的各个区块链读取数据并将其转换为自描述跨链数据,在该情况中,在第一中继设备121中就需要预先设置好与各个区块链相关的参数。例如,在第一中继设备121的多链客户端中需要预先设置好与第一区块链11相关的各项参数和与第二区块链12相关的各项参数,从而,第一中继设备121可分别从第一区块链11和第二区块链12读取数据并将其分别转换成自描述跨链数据。It can be understood that, as a data provider, the client of the node 1 in the first blockchain 11 only needs to preset various parameters related to the first blockchain 11 as described above. In the case where the relay device 121 acts as a data provider, it is connected to multiple blockchains, for example, it may read data from the respective blockchains to which it is connected and convert it into self-describing cross-chain data, in this case In the first relay device 121, the parameters related to each blockchain need to be preset. 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 The relay device 121 may read data from the first blockchain 11 and the second blockchain 12 and convert them into self-describing cross-chain data, respectively.
在步骤S206,将所述第二数据提供给数据接收方设备。In step S206, the second data is provided to the data recipient device.
在一种实施方式中,节点1在获取第二数据之后,可将第二数据直接发送给第一中继设备121的设备。In an embodiment, after acquiring the second data, the node 1 may directly send the second data to the device of the first relay device 121 .
在数据提供方为第一中继设备121,数据接收方为节点2的情况中,第一中继设备121可通过向节点2发送交易而将第二数据提供给节点2,在该交易中以第二数据作为传入参数调用第二区块链13中的预定合约,从而将第二数据提供给节点2。In the case where the data provider is the first relay device 121 and the data receiver is the node 2, the first relay device 121 can provide the second data to the node 2 by sending a transaction to the node 2, in which the transaction starts with The second data is used as an incoming parameter to invoke a predetermined contract in the second blockchain 13 , thereby providing the second data to the node 2 .
图8示出根据本说明书实施例的一种跨链数据处理方法流程图,所述方法由数据接收方设备执行,包括:步骤S802,从数据提供方设备接收第二数据,所述第二数据具有预定数据结构,且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;步骤S804,基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器;步骤S806,通过数据解析器解析所述第一数据。8 shows a flow chart of a method for processing cross-chain data according to an embodiment of the present specification. The method is executed by a data receiver device, including: step S802, receiving second data from a data provider device, the second data It has a predetermined data structure, and the second data includes: a chain identifier of the first blockchain, first data, and related information of the first data, wherein the related information of the first data includes the first data. The chain type of the blockchain; Step S804, determine a data parser corresponding to the first data based on the relevant information of the first data; Step S806, parse the first data through the data parser.
如上文所述,数据接收方可以是区块链节点、代理节点、链下中继设备等等,其可通过多链客户端接收数据,或者,区块链节点可以通过预定智能合约接收数据。下文中,将示例地以节点1作为数据提供方、以第一中继设备121作为数据接收方进行描述。As mentioned above, the data recipient can be a blockchain node, proxy node, off-chain relay device, etc., which can receive data through a multi-chain client, or a blockchain node can receive data through a predetermined smart contract. Hereinafter, description will be given by taking the node 1 as the data provider and the first relay device 121 as the data receiver by way of example.
在步骤S802,从数据提供方设备接收第二数据,所述第二数据具有预定数据结构,且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中, 所述第一数据的相关信息中包括所述第一区块链的链类型。In step S802, second data is received from the data provider device, the second data has a predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, the first data The related information, wherein the related information of the first data includes the chain type of the first blockchain.
如上文所述,第二数据可能具有如图3-图7中任一个所示的数据结构。其中,数据元信息和证明元信息也可以如上文所述包括不同的字段配置。例如,第二数据中可包括以下字段:链标识、数据元,链类型,或者,第二数据中可包括以下字段:链标识、数据元,链类型、数据结构类型,或者,第二数据中可包括以下字段:链标识、数据元,链类型、数据结构类型、哈希值,等等。As described above, the second data may have a data structure as shown in any one of FIGS. 3-7 . The data meta-information and the certification meta-information may also include different field configurations as described above. For example, the second data may include the following fields: chain identifier, data element, chain type, or the second data may include the following fields: chain identifier, data element, chain type, data structure type, or, in the second data The following fields may be included: chain ID, data element, chain type, data structure type, hash value, etc.
在步骤S804,基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器。步骤S806,通过数据解析器解析所述第一数据。In step S804, a data parser corresponding to the first data is determined based on the relevant information of the first data. Step S806, parsing the first data through a data parser.
由于第一中继设备121与节点1已经预先协商好采用的自描述跨链数据的数据结构,因此,第一中继设备121可基于该数据结构对该自描述数据进行解析,从而从中读取该自描述数据中各个字段的数据,从而可获取其中的第一数据的相关信息,并可基于该相关信息确定用于解析第一数据的解析器,该解析器指一种解析算法。Since the first relay device 121 and the node 1 have negotiated the data structure of the self-describing cross-chain data in advance, the first relay device 121 can parse the self-describing data based on the data structure, so as to read from it. The data of each field in the self-describing data can obtain relevant information of the first data therein, and a parser for parsing the first data can be determined based on the relevant information, where the parser refers to a parsing algorithm.
第一中继设备121中的多链客户端中可预设与各个区块链类型对应的解析器,由于各个区块链类型采用不同的数据格式,例如,如上文所述,以太坊链类型区块链的数据格式为rlp编码,Fabric链类型区块链的数据格式为protobuf编码,因此,与各个区块链类型对应的解析器用于对不同的数据格式进行解码。The parser corresponding to each blockchain type can be preset in the multi-chain client in the first relay device 121, since each blockchain type adopts different data formats, for example, as mentioned above, the Ethereum chain type The data format of the blockchain is rlp encoding, and the data format of the Fabric chain type blockchain is protobuf encoding. Therefore, the parser corresponding to each blockchain type is used to decode different data formats.
第一中继设备121中的多链客户端中还可以预设与区块链中的不同数据结构分别对应的解析器,该与不同数据结构分别对应的解析器用于基于不同数据结构对数据进行解析。例如,在以太坊链类型区块链中,假设第一数据的类型为收据,在通过上述解析器对第一数据进行解码之后,还通过与收据对应的解析器对第一数据进行解析,以获取第一数据的内容。The multi-chain client in the first relay device 121 may also preset parsers corresponding to different data structures in the blockchain, and the parsers corresponding to different data structures are used to perform data processing based on different data structures. Parse. For example, in an Ethereum chain type blockchain, assuming that the type of the first data is a receipt, after the first data is decoded by the above parser, the parser corresponding to the receipt is also used to parse the first data to obtain Obtain the content of the first data.
因此,第一中继设备121的多链客户端在获取第一数据的相关信息之后,可基于第一数据的相关信息选取对应的解析器来对第一数据进行解析。例如,第一数据的相关信息中包括以太坊链类型,从而第一中继设备121中的多链客户端选取其中用于对rlp编码进行解码的解析器来解析第一数据。例如,第一数据的相关信息中包括:以太坊链类型,收据类型,从而第一中继设备121中的多链客户端首先选取用于对rlp编码进行解码的解析器来解析第一数据,然后选取用于读取收据的解析器来进一步读取第一数据,从而可获取第一数据的内容。Therefore, after acquiring the relevant information of the first data, the multi-chain client of the first relay device 121 can select a corresponding parser to parse the first data based on the relevant information of the first data. For example, the related information of the first data includes the Ethereum chain type, so that the multi-chain client in the first relay device 121 selects a parser for decoding the rlp code to parse the first data. For example, the relevant information of the first data includes: Ethereum chain type, receipt type, so the multi-chain client in the first relay device 121 first selects a parser for decoding the rlp code to parse the first data, Then, a parser for reading the receipt is selected to further read the first data, so that the content of the first data can be obtained.
在一种实施方式中,如图4所示,所述数据元信息中还包括第一数据的哈希值,从 而,在解析第一数据之前,可计算第一数据的哈希值并与数据元信息中的哈希值进行比较,以确定该第一数据是否为数据提供方提供的原始数据。In one embodiment, as shown in FIG. 4 , the data element 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 combined with the data The hash value in the meta information is compared to determine whether the first data is the original data provided by the data provider.
在一种实施方式中,所述第二数据中还包括所述第一数据的证明数据,数据接收方在接收到第二数据之后,还可执行以下步骤以对第二数据中包括的第一数据进行验证:步骤S808,确定与所述证明数据对应的证明数据解析器和验证器;步骤S810,通过所述证明数据解析器解析所述证明数据;步骤S812,通过所述验证器使用所述证明数据对所述第一数据进行验证。In an implementation manner, the second data further includes certification data of the first data, and after receiving the second data, the data recipient may further perform the following steps to verify the first data included in the second data Verify the data: Step S808, determine the certification data parser and verifier corresponding to the certification data; Step S810, parse the certification data through the certification data parser; Step S812, use the verifier to use the certification data The proof data verifies the first data.
首先,在步骤S808,确定与所述证明数据对应的证明数据解析器和验证器。First, in step S808, the certification data parser and verifier corresponding to the certification data are determined.
第一中继设备121的多链客户端中预设了与各种链类型分别对应的证明数据解析器和验证器,例如,所述多链客户端中包括与以太坊链类型对应的Spv证明数据解析器(即解析算法)、和用于使用Spv证明数据进行验证的验证器(即验证算法),另外,所述多链客户端中还包括与Fabric链类型对应的多签证明数据解析器、和用于使用多签证明数据进行验证的验证器。Proof data parsers and validators corresponding to various chain types are preset in the multi-chain client of the first relay device 121. For example, the multi-chain client includes an Spv proof corresponding to the Ethereum chain type. A data parser (that is, a parsing algorithm), and a validator (that is, a verification algorithm) for verifying using the Spv proof data, in addition, the multi-chain client also includes a multi-state certification data parser corresponding to the type of Fabric chain , and a validator for authenticating with multi-signature proof data.
在一种实施方式中,所述第二数据具有图5所示的数据结构,所述多链客户端基于数据元信息中的链类型(以太坊链类型),和数据元信息中的数据结构类型(收据类型),确定与以太坊链类型区块链中的收据的Spv证明数据进行解析的解析器,确定使用该Spv证明数据进行验证的验证器。In one embodiment, the second data has the data structure shown in FIG. 5 , and the multi-chain client is based on the chain type (Ethereum chain type) in the data metadata and the data structure in the data metadata Type (receipt type), which determines the parser that parses the Spv proof data of the receipt in the Ethereum chain type blockchain, and determines the validator that uses the Spv proof data for verification.
在一种实施方式中,所述第二数据具有图6或图7所示的数据结构,所述多链客户端可直接基于第二数据中的证明类型和数据结构类型,确定对应的解析器和验证器。In one embodiment, the second data has the data structure shown in FIG. 6 or FIG. 7 , and the multi-chain client can directly determine the corresponding parser based on the proof type and data structure type in the second data and validator.
步骤S810,通过所述证明数据解析器解析所述证明数据。该解析过程与上文中对第一数据的解析过程类似,包括对数据格式的解码过程和对数据结构的读取过程,在此不再赘述。Step S810: Parse the certification data through the certification data parser. The parsing process is similar to the parsing process for the first data above, including the decoding process of the data format and the reading process of the data structure, which will not be repeated here.
在步骤S812,通过所述验证器使用所述证明数据对所述第一数据进行验证。In step S812, the first data is verified by the verifier using the certification data.
如上文所述,所述验证器即表示所述多链客户端中预设的验证算法。另外,该多链客户端中还预设了各个区块链的链标识及最小验证根。多链客户端基于第二数据中的第一区块链11的链标识,可获取其中预设的与第一区块链11对应的最小验证根,该最小验证根例如为第一区块链11的创世块的哈希值。As mentioned above, the validator refers to a preset validation algorithm in the multi-chain client. In addition, the chain identifier and minimum verification root of each blockchain are preset in the multi-chain client. Based on the chain identifier of the first blockchain 11 in the second data, the multi-chain client can obtain the preset minimum verification root corresponding to the first blockchain 11, and the minimum verification root is, for example, the first blockchain The hash of the genesis block of 11.
例如,所述第一数据为收据1,所述证明数据相应地为收据1的Spv证明数据。所述多链客户端中可通过如下步骤对收据1进行验证:计算收据1的哈希值;基于Spv证 明数据中包括的树路径中其它各节点的哈希值,计算区块1中收据树的根哈希值;将计算的根哈希值与Spv证明数据中包括的区块1的收据树的根哈希值进行比较,以确定收据1是否为区块1中的收据1;以及,基于Spv证明数据中包括区块1的区块头哈希值、以及多链客户端中预先设置的第一区块链11的最小验证根,确定区块1是否为第一区块链11中的区块。For example, the first data is receipt 1 , and the certification data is correspondingly the Spv certification data of receipt 1 . The multi-chain client can verify receipt 1 through the following steps: calculate the hash value of receipt 1; calculate the receipt tree in block 1 based on the hash values of other nodes in the tree path included in the Spv proof data the root hash value of ; compare the calculated root hash value to the root hash value of the receipt tree of block 1 included in the Spv proof data to determine whether receipt 1 is receipt 1 in block 1; and, Based on the Spv proof data including the block header hash value of block 1 and the minimum verification root of the first block chain 11 preset in the multi-chain client, determine whether block 1 is in the first block chain 11 block.
在一种实施方式中,如图7所示,所述证明元信息中还包括验证根,例如,该验证根相对于多链客户端中预设的最小验证根可包括更多的验证根信息,例如,可包括创世块的区块信息、区块1在区块链中的最长链信息等等,从而,多链客户端可使用最小验证根对第二数据中的验证根进行验证,在验证通过之后,可基于该验证根和Spv证明数据对收据1进行验证。所述证明元信息中包括的验证根也可以为所述最小验证根。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 than the minimum verification root preset in the multi-chain client. , for example, can include the block information of the genesis block, the longest chain information of block 1 in the blockchain, etc., so that the multi-chain client can use the minimum verification root to verify the verification root in the second data. , after the verification is passed, the receipt 1 can be verified based on the verification root and the Spv proof data. The verification root included in the certification meta information may also be the minimum verification root.
在一种实施方式中,如图7所示,所述证明元信息中还包括证明数据的哈希值,从而,在使用证明数据进行验证之前,可计算该证明数据的哈希值并与证明元信息中的哈希值进行比较,以确定该证明数据是否为数据提供方提供的原始数据。In one embodiment, as shown in FIG. 7 , the proof meta information further includes a hash value of the proof data, so that before using the proof data for verification, the hash value of the proof data can be calculated and compared with the proof data. The hash value in the meta information is compared to determine whether the proof data is the original data provided by the data provider.
图9示出根据本说明书实施例的一种跨链数据处理装置900,所述装置部署于数据提供方设备,包括:获取单元91,配置为,从第一区块链获取第一数据;生成单元92,配置为,生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;提供单元93,配置为,将所述第二数据提供给数据接收方设备。FIG. 9 shows a cross-chain data processing apparatus 900 according to an embodiment of the present specification. The apparatus is deployed in a data provider device, and includes: an obtaining unit 91 configured to obtain first data from a first blockchain; The unit 92 is configured to generate second data, the second data has a predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, and the related information of the first data, Wherein, the relevant information of the first data includes the chain type of the first blockchain; the providing unit 93 is configured to provide the second data to the data receiver device.
在一种实施方式中,所述获取单元91还配置为,从第一区块链获取第一数据及其证明数据,所述第二数据中还包括所述证明数据。In one embodiment, the obtaining unit 91 is further configured to obtain first data and its certification data from the first blockchain, and the second data further includes the certification data.
图10示出根据本说明书实施例的一种跨链数据处理装置1000,所述装置部署于数据接收方设备,包括:接收单元101,配置为,从数据提供方设备接收第二数据,所述第二数据具有预定数据结构,且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;第一确定单元102,配置为,基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器;第一解析单元103,配置为,通过数据解析器解析所述第一数据。FIG. 10 shows a cross-chain data processing apparatus 1000 according to an embodiment of the present specification. The apparatus is deployed in a data receiver device, and includes: a receiving unit 101 configured to receive second data from a data provider device, the The second data has a predetermined data structure, and the second data includes: a chain identifier of the first blockchain, first data, and related information of the first data, wherein the related information of the first data includes all the chain type of the first blockchain; the first determining unit 102 is configured to determine a data parser corresponding to the first data based on the relevant information of the first data; the first parsing unit 103 is configured to: The first data is parsed by a data parser.
在一种实施方式中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型,其中,所述第一确定单元102还配置为,基于所述第一区块链的类型和所述第一数 据的数据结构类型,确定与所述第一数据对应的数据解析器。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: The type and the data structure type of the first data determine the data parser corresponding to the first data.
在一种实施方式中,所述数据接收方设备中预设有所述第一区块链的链标识与所述第一区块链的第一验证根的对应关系,所述第二数据中还包括所述第一数据的证明数据,所述装置1000还包括:第二确定单元104,配置为,确定与所述证明数据对应的证明数据解析器和验证器;第二解析单元105,配置为,通过所述证明数据解析器解析所述证明数据;验证单元106,配置为,通过所述验证器基于所述第一验证根和所述证明数据对所述第一数据进行验证。In an embodiment, the data receiver device is preset with a corresponding relationship between the chain identifier of the first blockchain and the first verification root of the first blockchain, and the second data contains It also includes certification data of the first data, and the apparatus 1000 further includes: a second determination unit 104, configured to determine a certification data parser and a validator corresponding to the certification data; a second parsing unit 105, configured to In order to parse the certification data through the certification data parser; the verification unit 106 is configured to verify the first data based on the first verification root and the certification data through the verifier.
在一种实施方式中,所述第二确定单元104还配置为,基于所述第一区块链的类型、所述第一数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。In an embodiment, the second determining unit 104 is further configured to determine a certification data parser corresponding to the certification data based on the type of the first blockchain and the data structure type of the first data and validator.
在一种实施方式中,所述第二数据中还包括所述证明数据的类型、所述证明数据的数据结构类型,其中,所述第二确定单元104还配置为,基于所述证明数据的类型、所述证明数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。In an implementation manner, the second data further includes the type of the certification data and the data structure type of the certification data, wherein the second determining unit 104 is further configured to: The type, the data structure type of the attestation data, determines the attestation data parser and verifier corresponding to the attestation data.
在一种实施方式中,所述第二数据中还包括所述第一区块链的第二验证根,其中,所述验证单元106包括,第一验证子单元1061,配置为,通过所述验证器基于所述第一验证根对所述第二验证根进行验证,第二验证子单元1062,配置为,在验证通过之后,通过所述验证器基于所述第二验证根和所述证明数据对所述第一数据进行验证。In an embodiment, the second data further includes a second verification root of the first blockchain, wherein the verification unit 106 includes a first verification sub-unit 1061 configured to pass the The verifier verifies the second verification root based on the first verification root, and the second verification subunit 1062 is configured to, after the verification passes, pass the verifier based on the second verification root and the proof The data validates the first data.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序或指令,当所述计算机程序或指令在计算机中执行时,令计算机执行上述任一项方法。Another aspect of the present specification provides a computer-readable storage medium on which a computer program or instruction is stored, and when the computer program or instruction is executed in a computer, causes the computer to execute any one of the above methods.
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有计算机程序或指令,所述处理器在执行所述计算机程序或指令时,实现上述任一项方法。Another aspect of the present specification provides a computing device, including a memory and a processor, where a computer program or instruction is stored in the memory, and the processor implements any one of the above methods when executing the computer program or instruction.
通过根据本说明书实施例的对跨链数据的数据处理方案,可将不同的跨链数据转换为统一的数据结构,从而便于数据接收方只需要在本地预设较少的数据,即可实现对不同跨链数据的解析和证明过程,从而可实现数据量较小的多链客户端、或多链数据处理智能合约等,提高了跨链通信的便利性。Through the data processing scheme for cross-chain data according to the embodiments of this specification, different cross-chain data can be converted into a unified data structure, so that the data receiver only needs to preset less data locally to realize the The analysis and proof process of different cross-chain data can realize multi-chain clients with a small amount of data, or multi-chain data processing smart contracts, etc., which improves the convenience of cross-chain communication.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。 在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
本领域普通技术人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执轨道,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two, in order to clearly illustrate the hardware and software interchangeability, the components and steps of each example have been generally described in terms of functions in the above description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Persons of ordinary skill in the art may use different methods of implementing the described functionality for each particular application, but such implementations should not be considered beyond the scope of this application.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执轨道的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein may be implemented in hardware, a software module executed by a processor, or a combination of the two. A software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (28)

  1. 一种跨链数据处理方法,所述方法由数据提供方设备执行,包括:A cross-chain data processing method, the method is executed by a data provider device, comprising:
    从第一区块链获取第一数据;Obtain the first data from the first blockchain;
    生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;generating second data, the second data has a predetermined data structure, and the second data includes: a chain identifier of the first blockchain, first data, and related information of the first data, wherein the first The relevant information of the data includes the chain type of the first blockchain;
    将所述第二数据提供给数据接收方设备。The second data is provided to a data recipient device.
  2. 根据权利要求1所述的方法,其中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型。The method according to claim 1, wherein the related information of the first data further includes a data structure type of the first data.
  3. 根据权利要求2所述的方法,其中,所述第一数据的数据结构类型为以下一种类型:区块头类型、交易类型、账户状态类型、收据类型。The method according to claim 2, wherein the data structure type of the first data is one of the following types: block header type, transaction type, account status type, and receipt type.
  4. 根据权利要求1所述的方法,其中,从第一区块链获取第一数据包括,从第一区块链获取第一数据及其证明数据,所述第二数据中还包括所述证明数据。The method according to claim 1, wherein obtaining the first data from the first blockchain comprises obtaining the first data and its certification data from the first blockchain, and the second data further includes the certification data .
  5. 根据权利要求4所述的方法,其中,所述第二数据中还包括所述证明数据的相关信息,所述证明数据的相关信息包括以下至少一项:所述证明数据的类型、所述证明数据的数据结构类型、所述证明数据的哈希值、所述证明数据的验证根。The method according to claim 4, wherein the second data further includes related information of the certification data, and the related information of the certification data includes at least one of the following: the type of the certification data, the certification The data structure type of the data, the hash value of the attestation data, and the verification root of the attestation data.
  6. 根据权利要求5所述的方法,其中,所述证明数据的类型为以下一种类型:Spv证明数据类型、多签证明数据类型。The method according to claim 5, wherein the type of the certification data is one of the following types: Spv certification data type, multi-issue certification data type.
  7. 根据权利要求1所述的方法,其中,所述第一区块链的类型为以下一种类型:比特币链类型、以太坊链类型、Hyperledger Fabric链类型。The method according to claim 1, wherein the type of the first blockchain is one of the following types: a Bitcoin chain type, an Ethereum chain type, and a Hyperledger Fabric chain type.
  8. 一种跨链数据处理方法,所述方法由数据接收方设备执行,包括:A cross-chain data processing method, the method is executed by a data receiver device, comprising:
    从数据提供方设备接收第二数据,所述第二数据具有预定数据结构,且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;Receive second data from the data provider device, the second data has a predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, and the related information of the first data, wherein , the relevant information of the first data includes the chain type of the first blockchain;
    基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器;determining a data parser corresponding to the first data based on the relevant information of the first data;
    通过数据解析器解析所述第一数据。The first data is parsed by a data parser.
  9. 根据权利要求8所述的方法,其中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型,其中,基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器包括,基于所述第一区块链的类型和所述第一数据的数据结构类型,确定与所述第一数据对应的数据解析器。The method according to claim 8, wherein the related information of the first data further includes a data structure type of the first data, wherein the related information of the first data is determined based on the related information of the first data The corresponding data parser includes determining 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.
  10. 根据权利要求9所述的方法,其中,所述数据接收方设备中预设有所述第一区块 链的链标识与所述第一区块链的第一验证根的对应关系,所述第二数据中还包括所述第一数据的证明数据,所述方法还包括:The method according to claim 9, wherein a correspondence relationship between a chain identifier of the first blockchain and a first verification root of the first blockchain is preset in the data recipient device, and the The second data also includes certification data of the first data, and the method further includes:
    确定与所述证明数据对应的证明数据解析器和验证器;determining an attestation data parser and a validator corresponding to the attestation data;
    通过所述证明数据解析器解析所述证明数据;Parse the attestation data by the attestation data parser;
    通过所述验证器基于所述第一验证根和所述证明数据对所述第一数据进行验证。The first data is verified by the verifier based on the first verification root and the attestation data.
  11. 根据权利要求10所述的方法,其中,确定与所述证明数据对应的证明数据解析器和验证器包括,基于所述第一区块链的类型、所述第一数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。11. The method of claim 10, wherein determining an attestation data parser and a validator corresponding to the attestation data comprises, based on a type of the first blockchain and a data structure type of the first data, determining a parser and a validator corresponding to the attestation data The attestation data parser and verifier corresponding to the attestation data.
  12. 根据权利要求10所述的方法,其中,所述第二数据中还包括所述证明数据的类型、所述证明数据的数据结构类型,其中,确定与所述证明数据对应的证明数据解析器和验证器包括,基于所述证明数据的类型、所述证明数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。The method according to claim 10, wherein the second data further includes the type of the attestation data and the data structure type of the attestation data, wherein the attestation data parser and the attestation data parser corresponding to the attestation data are determined. The verifier includes a certification data parser and a verifier corresponding to the certification data determined based on the type of the certification data and the data structure type of the certification data.
  13. 根据权利要求10所述的方法,其中,所述第二数据中还包括所述第一区块链的第二验证根,其中,通过所述验证器基于所述第一验证根和所述证明数据对所述第一数据进行验证,通过所述验证器基于所述第一验证根对所述第二验证根进行验证,在验证通过之后,通过所述验证器基于所述第二验证根和所述证明数据对所述第一数据进行验证。11. The method of claim 10, wherein the second data further includes a second verification root of the first blockchain, wherein the verification is based on the first verification root and the proof by the validator The first data is verified by the data, the second verification root is verified by the validator based on the first verification root, and after the verification is passed, the second verification root is verified by the validator based on the second verification root and The certification data verifies the first data.
  14. 一种跨链数据处理装置,所述装置部署于数据提供方设备,包括:A cross-chain data processing device, the device is deployed in a data provider device, comprising:
    获取单元,配置为,从第一区块链获取第一数据;an obtaining unit, configured to obtain the first data from the first blockchain;
    生成单元,配置为,生成第二数据,所述第二数据具有预定数据结构,并且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;a generating unit, configured to generate second data, the second data has a predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, and the related information of the first data, Wherein, the relevant information of the first data includes the chain type of the first blockchain;
    提供单元,配置为,将所述第二数据提供给数据接收方设备。A providing unit is configured to provide the second data to a data recipient device.
  15. 根据权利要求14所述的装置,其中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型。The apparatus according to claim 14, wherein the related information of the first data further includes a data structure type of the first data.
  16. 根据权利要求15所述的装置,其中,所述第一数据的数据结构类型为以下一种类型:区块头类型、交易类型、账户状态类型、收据类型。The apparatus according to claim 15, wherein the data structure type of the first data is one of the following types: block header type, transaction type, account status type, and receipt type.
  17. 根据权利要求14所述的装置,其中,所述获取单元还配置为,从第一区块链获取第一数据及其证明数据,所述第二数据中还包括所述证明数据。The apparatus according to claim 14, wherein 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.
  18. 根据权利要求17所述的装置,其中,所述第二数据中还包括所述证明数据的相关信息,所述证明数据的相关信息包括以下至少一项:所述证明数据的类型、所述证明 数据的数据结构类型、所述证明数据的哈希值、所述证明数据的验证根。The device according to claim 17, wherein the second data further includes related information of the certification data, and the related information of the certification data includes at least one of the following: the type of the certification data, the certification The data structure type of the data, the hash value of the attestation data, and the verification root of the attestation data.
  19. 根据权利要求18所述的装置,其中,所述证明数据的类型为以下一种类型:Spv证明数据类型、多签证明数据类型。The apparatus according to claim 18, wherein the type of the certification data is one of the following types: Spv certification data type, multi-issue certification data type.
  20. 根据权利要求14所述的装置,其中,所述第一区块链的类型为以下一种类型:比特币链类型、以太坊链类型、Hyperledger Fabric链类型。The apparatus according to claim 14, wherein the type of the first blockchain is one of the following types: Bitcoin chain type, Ethereum chain type, Hyperledger Fabric chain type.
  21. 一种跨链数据处理装置,所述装置部署于数据接收方设备,包括:A cross-chain data processing device, the device is deployed in a data receiver device, comprising:
    接收单元,配置为,从数据提供方设备接收第二数据,所述第二数据具有预定数据结构,且所述第二数据中包括:第一区块链的链标识、第一数据、第一数据的相关信息,其中,所述第一数据的相关信息中包括所述第一区块链的链类型;a receiving unit, configured to receive second data from the data provider device, the second data has a predetermined data structure, and the second data includes: the chain identifier of the first blockchain, the first data, the first relevant information of the data, wherein the relevant information of the first data includes the chain type of the first blockchain;
    第一确定单元,配置为,基于所述第一数据的相关信息确定与所述第一数据对应的数据解析器;a first determining unit, configured to determine a data parser corresponding to the first data based on the relevant information of the first data;
    第一解析单元,配置为,通过数据解析器解析所述第一数据。The first parsing unit is configured to parse the first data through a data parser.
  22. 根据权利要求21所述的装置,其中,所述第一数据的相关信息中还包括所述第一数据的数据结构类型,其中,所述第一确定单元还配置为,基于所述第一区块链的类型和所述第一数据的数据结构类型,确定与所述第一数据对应的数据解析器。The apparatus according to claim 21, wherein 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, based on the first area The type of the block chain and the data structure type of the first data determine a data parser corresponding to the first data.
  23. 根据权利要求22所述的装置,其中,所述数据接收方设备中预设有所述第一区块链的链标识与所述第一区块链的第一验证根的对应关系,所述第二数据中还包括所述第一数据的证明数据,所述装置还包括:The apparatus according to claim 22, wherein a correspondence relationship 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 The second data further includes certification data of the first data, and the device further includes:
    第二确定单元,配置为,确定与所述证明数据对应的证明数据解析器和验证器;a second determining unit, configured to determine a certification data parser and a validator corresponding to the certification data;
    第二解析单元,配置为,通过所述证明数据解析器解析所述证明数据;a second parsing unit, configured to parse the attestation data through the attestation data parser;
    验证单元,配置为,通过所述验证器基于所述第一验证根和所述证明数据对所述第一数据进行验证。A verification unit configured to verify the first data based on the first verification root and the certification data by the verifier.
  24. 根据权利要求23所述的装置,其中,所述第二确定单元还配置为,基于所述第一区块链的类型、所述第一数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。The apparatus according to claim 23, wherein the second determination unit is further configured to determine the certificate corresponding to the certificate data based on the type of the first blockchain and the data structure type of the first data Data parsers and validators.
  25. 根据权利要求23所述的装置,其中,所述第二数据中还包括所述证明数据的类型、所述证明数据的数据结构类型,其中,所述第二确定单元还配置为,基于所述证明数据的类型、所述证明数据的数据结构类型确定与所述证明数据对应的证明数据解析器和验证器。The apparatus according to claim 23, wherein the second data further includes the type of the certification data and the data structure type of the certification data, wherein the second determining unit is further configured to, based on the The type of attestation data and the data structure type of the attestation data determine the attestation data parser and verifier corresponding to the attestation data.
  26. 根据权利要求23所述的装置,其中,所述第二数据中还包括所述第一区块链的第二验证根,其中,所述验证单元包括,第一验证子单元,配置为,通过所述验证器基 于所述第一验证根对所述第二验证根进行验证,第二验证子单元,配置为,在验证通过之后,通过所述验证器基于所述第二验证根和所述证明数据对所述第一数据进行验证。The apparatus according to claim 23, wherein the second data further includes a second verification root of the first blockchain, wherein the verification unit includes a first verification sub-unit configured to pass The verifier verifies the second verification root based on the first verification root, and the second verification subunit is configured to, after the verification is passed, pass the verifier based on the second verification root and the The proof data verifies the first data.
  27. 一种计算机可读存储介质,其上存储有计算机程序或指令,当所述计算机程序或指令在计算机中执行时,令计算机执行权利要求1-13中任一项的所述的方法。A computer-readable storage medium on which computer programs or instructions are stored, which, when executed in a computer, cause the computer to perform the method of any one of claims 1-13.
  28. 一种计算设备,包括存储器和处理器,所述存储器中存储有计算机程序或指令,所述处理器在执行所述计算机程序或指令时,实现权利要求1-13中任一项所述的方法。A computing device, comprising a memory and a processor, wherein a computer program or instruction is stored in the memory, and the processor implements the method according to any one of claims 1-13 when executing the computer program or instruction .
PCT/CN2021/133068 2021-03-30 2021-11-25 Cross-chain data processing method and apparatus WO2022205960A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110340165.3 2021-03-30
CN202110340165.3A CN112734432B (en) 2021-03-30 2021-03-30 Cross-link data processing method and device

Publications (1)

Publication Number Publication Date
WO2022205960A1 true WO2022205960A1 (en) 2022-10-06

Family

ID=75596152

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133068 WO2022205960A1 (en) 2021-03-30 2021-11-25 Cross-chain data processing method and apparatus

Country Status (2)

Country Link
CN (2) CN112734432B (en)
WO (1) WO2022205960A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112734432B (en) * 2021-03-30 2021-07-23 支付宝(杭州)信息技术有限公司 Cross-link data processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559227A (en) * 2018-11-29 2019-04-02 咪咕文化科技有限公司 A kind of method of commerce, device and the storage medium of transregional piece of chain network
US20190340267A1 (en) * 2018-05-01 2019-11-07 International Business Machines Corporation Blockchain implementing cross-chain transactions
CN111311209A (en) * 2020-02-03 2020-06-19 腾讯科技(深圳)有限公司 Cross-block-chain data processing method, device, equipment and computer storage medium
CN111416808A (en) * 2020-03-13 2020-07-14 财付通支付科技有限公司 Cross-block-chain data mutual storage method, device, equipment and storage medium
CN112734432A (en) * 2021-03-30 2021-04-30 支付宝(杭州)信息技术有限公司 Cross-link data processing method and device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101701131B1 (en) * 2016-04-28 2017-02-13 주식회사 라피 Data recording and validation methods and systems using the connecting of blockchain between different type
US11895223B2 (en) * 2019-02-06 2024-02-06 International Business Machines Corporation Cross-chain validation
CN110288345B (en) * 2019-06-26 2022-04-05 深圳市迅雷网络技术有限公司 Cross-link communication method, device, main chain node and storage medium
CN110430162B (en) * 2019-06-28 2020-11-24 创新先进技术有限公司 Method and device for sending authenticable message in cross-link mode
CN110650189B (en) * 2019-09-20 2022-01-18 深圳供电局有限公司 Relay-based block chain interaction system and method
CN110766408A (en) * 2019-10-24 2020-02-07 杭州趣链科技有限公司 Cross-chain transaction verification method, engine, equipment and storage medium for heterogeneous block chain
CN111431903B (en) * 2020-03-25 2022-08-09 北京新创智链科技有限公司 Cross-link relay method, device and computer readable storage medium
CN111767484B (en) * 2020-08-31 2020-12-04 中国信息通信研究院 Industrial Internet identification analysis method and related device
CN111769958B (en) * 2020-09-02 2021-01-01 百度在线网络技术(北京)有限公司 Block chain cross-chain processing method, device, equipment and storage medium
CN112446785B (en) * 2020-11-06 2023-09-22 杭州趣链科技有限公司 Cross-chain transaction method, system, device, equipment and storage medium
CN112488679B (en) * 2020-12-03 2024-05-07 陈鹏 Cross-link contract analysis method of blockchain, relay chain and cross-link system
CN112837160B (en) * 2020-12-04 2022-09-27 腾讯科技(深圳)有限公司 Block chain-based cross-chain transaction method and device and computer-readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190340267A1 (en) * 2018-05-01 2019-11-07 International Business Machines Corporation Blockchain implementing cross-chain transactions
CN109559227A (en) * 2018-11-29 2019-04-02 咪咕文化科技有限公司 A kind of method of commerce, device and the storage medium of transregional piece of chain network
CN111311209A (en) * 2020-02-03 2020-06-19 腾讯科技(深圳)有限公司 Cross-block-chain data processing method, device, equipment and computer storage medium
CN111416808A (en) * 2020-03-13 2020-07-14 财付通支付科技有限公司 Cross-block-chain data mutual storage method, device, equipment and storage medium
CN112734432A (en) * 2021-03-30 2021-04-30 支付宝(杭州)信息技术有限公司 Cross-link data processing method and device
CN113673991A (en) * 2021-03-30 2021-11-19 支付宝(杭州)信息技术有限公司 Cross-link data processing method and device

Also Published As

Publication number Publication date
CN112734432A (en) 2021-04-30
CN113673991A (en) 2021-11-19
CN112734432B (en) 2021-07-23

Similar Documents

Publication Publication Date Title
US20220391831A1 (en) Blockchain-Based Authentication And Authorization
TWI770307B (en) Systems and methods for ensuring correct execution of computer program using a mediator computer system
WO2020134942A1 (en) Identity verification method and system therefor
KR20230163971A (en) Method for providing certificate service based on smart contract and server using the same
JP5513500B2 (en) Displaying security identities using claims
Kakei et al. Cross-certification towards distributed authentication infrastructure: A case of hyperledger fabric
Bhargavan et al. Verified implementations of the information card federated identity-management protocol
KR20220069020A (en) Distributed technology for data validation in transport layer security and other contexts
WO2022205960A1 (en) Cross-chain data processing method and apparatus
KR101890584B1 (en) Method for providing certificate service based on m of n multiple signatures and server using the same
CN116599669A (en) Data processing method, device, computer equipment and storage medium
Alber et al. Adapting the TPL trust policy language for a self-sovereign identity world
Rowe et al. Measuring protocol strength with security goals
Weilbach et al. Applying distributed ledger technology to digital evidence integrity
CN115550060B (en) Trusted certificate verification method, device, equipment and medium based on block chain
WO2022205957A1 (en) Method and apparatus for transferring message across chains on basis of relay device
WO2022205961A1 (en) Method and apparatus for updating blockchain domain name configuration
KR102494873B1 (en) Transaction execution device to implement a virtual machine based on a zero-knowledge proof circuit for general operation verification
Wanner et al. A formally verified protocol for log replication with byzantine fault tolerance
US20240031341A1 (en) Methods, devices and system related to a distributed ledger and user identity attribute
CN116488816A (en) Data processing method, device and storage medium based on blockchain network
KR20180041052A (en) Method for providing certificate service based on m of n multiple signatures and server using the same
CN114026586A (en) Zero knowledge or pay protocol for granting access to encrypted assets
Rak et al. Static evaluation of certificate policies for grid pkis interoperability
CN108880785A (en) A kind of detection C++ void table is by the method, apparatus, terminal and readable medium of hook

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: 21934596

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: 21934596

Country of ref document: EP

Kind code of ref document: A1