CN116308368B - Relay block chain cross-chain data secure storage method and device and related equipment - Google Patents

Relay block chain cross-chain data secure storage method and device and related equipment Download PDF

Info

Publication number
CN116308368B
CN116308368B CN202310593980.XA CN202310593980A CN116308368B CN 116308368 B CN116308368 B CN 116308368B CN 202310593980 A CN202310593980 A CN 202310593980A CN 116308368 B CN116308368 B CN 116308368B
Authority
CN
China
Prior art keywords
merck tree
data
target
transaction
chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310593980.XA
Other languages
Chinese (zh)
Other versions
CN116308368A (en
Inventor
郭庆雷
李达
王伟贤
周冬旭
陈帅
赵丽花
施萱轩
严嘉慧
王文帝
张禄
朱正谊
李香龙
潘鸣宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Digital Technology Holdings Co ltd
State Grid Blockchain Technology Beijing Co ltd
State Grid Corp of China SGCC
State Grid Beijing Electric Power Co Ltd
Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
State Grid Digital Technology Holdings Co ltd
State Grid Blockchain Technology Beijing Co ltd
State Grid Corp of China SGCC
State Grid Beijing Electric Power Co Ltd
Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Digital Technology Holdings Co ltd, State Grid Blockchain Technology Beijing Co ltd, State Grid Corp of China SGCC, State Grid Beijing Electric Power Co Ltd, Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd filed Critical State Grid Digital Technology Holdings Co ltd
Priority to CN202310593980.XA priority Critical patent/CN116308368B/en
Publication of CN116308368A publication Critical patent/CN116308368A/en
Application granted granted Critical
Publication of CN116308368B publication Critical patent/CN116308368B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3827Use of message hashing
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • 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
    • 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

Abstract

The application provides a relay block chain cross-chain data secure storage method, a device and related equipment, which are applied to the technical field of block chains. The method comprises the following steps: receiving a transaction list sent by a first application chain; encoding the merck tree by using the erasure codes and the transaction list to obtain a target merck tree; randomly sampling the target merck tree to obtain sampling data; decoding the target merck tree according to the sampling data to obtain a decoding result; and if the decoding result represents that the decoding is successfully completed on the target merck tree, the transaction list is sent to a second application chain to complete the cross-chain transaction. The merck tree is encoded through the erasure codes, redundancy is added to the transaction data, invalid transaction data can be amplified, invalid transaction can be easily detected in the decoding process, the problem of data availability attack is further solved, and safe storage of relay block chain cross-chain data is realized.

Description

Relay block chain cross-chain data secure storage method and device and related equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and apparatus for securely storing relay blockchain cross-chain data, and related devices.
Background
The block chain is composed of a series of data blocks, each of which holds a certain information, which are connected into a chain according to the time sequence. The blockchain has the characteristics that the data is difficult to tamper and decentralize, and based on the characteristics, the data information recorded by the blockchain is more real and reliable. In order to exert the value of the blockchain to a greater extent, public chains, private chains and alliance chains can be transmitted through a cross-chain technology, so that the value originally stored on a specific blockchain is converted into the value on another chain, and the circulation of the value is realized.
However, during blockchain cross-chain transactions, data may be subject to data availability attacks, rendering the data invalid, further resulting in the cross-chain transactions not being completed, and the data availability attacks being very hidden from discovery.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method, an apparatus, and a related device for securely storing relay blockchain cross-link data, which aim to detect a data availability attack and improve security of relay blockchain cross-link data storage.
In a first aspect, an embodiment of the present application provides a method for securely storing relay blockchain cross-chain data, where the method includes:
receiving a transaction list sent by a first application chain;
encoding the merck tree by using the erasure codes and the transaction list to obtain a target merck tree;
randomly sampling the target merck tree to obtain sampling data;
decoding the target merck tree according to the sampling data to obtain a decoding result;
and if the decoding result represents that the decoding is successfully completed on the target merck tree, the transaction list is sent to a second application chain to complete the cross-chain transaction.
Optionally, the encoding the merck tree using the erasure code and the transaction list includes:
acquiring a data symbol set corresponding to the transaction list, wherein the data symbol set comprises data symbols corresponding to all transactions in the transaction list;
constructing a code symbol set by using the data symbol set and the erasure codes, wherein the code symbol set comprises code symbols corresponding to each hash value;
the merck tree is encoded with the set of data symbols and the set of encoding symbols.
Optionally, the encoding the merck tree with the set of data symbols and the set of encoding symbols includes:
writing all data symbols in the data symbol set and all code symbols in the code symbol set into a base layer of the merck tree;
the merck tree is encoded according to a base layer of the merck tree.
Optionally, the encoding the merck tree according to the base layer of the merck tree includes:
calculating hash values corresponding to each data symbol and each coding symbol in a base layer of the merck tree;
the merck tree is encoded according to a plurality of the hash values.
Optionally, the method further comprises:
if the decoding result represents decoding errors of the target merck tree, deleting the transaction which causes the decoding errors in the transaction list according to merck certificates corresponding to the target merck tree to obtain a target transaction list;
and sending the target transaction list to the second application chain to complete the cross-chain transaction.
Optionally, the transaction list includes a plurality of transactions, and an initiation address and a receiving address corresponding to each transaction.
Optionally, the erasure code is a parity code.
Optionally, the randomly sampling the target merck tree includes:
each layer of the target merck tree is randomly sampled.
In a second aspect, embodiments of the present application provide a relay blockchain cross-chain data secure storage device, the device including:
the receiving module is used for receiving the transaction list sent by the first application chain;
the coding module is used for coding the merck tree by using the erasure codes and the transaction list to obtain a target merck tree;
the sampling module is used for randomly sampling the target merck tree to obtain sampling data;
the decoding module is used for decoding the target merck tree according to the sampling data to obtain a decoding result;
and the sending module is used for sending the transaction list to a second application chain to complete the cross-chain transaction if the decoding result represents that the decoding of the target merck tree is completed successfully.
Optionally, the encoding module includes:
an obtaining unit, configured to obtain a data symbol set corresponding to the transaction list, where the data symbol set includes data symbols corresponding to each transaction in the transaction list;
a construction unit configured to construct a set of encoded symbols using the set of data symbols and the erasure codes, the set of encoded symbols including encoded symbols corresponding to each of the hash values;
and the coding unit is used for coding the merck tree by utilizing the data symbol set and the coding symbol set.
Optionally, the coding unit is specifically configured to:
writing all data symbols in the data symbol set and all code symbols in the code symbol set into a base layer of the merck tree;
the merck tree is encoded according to a base layer of the merck tree.
Optionally, the coding unit is specifically configured to:
the encoding the merck tree according to the base layer of the merck tree includes:
calculating hash values corresponding to each data symbol and each coding symbol in a base layer of the merck tree;
the merck tree is encoded according to a plurality of the hash values.
Optionally, the sending module is further configured to:
if the decoding result represents decoding errors of the target merck tree, deleting the transaction which causes the decoding errors in the transaction list according to merck certificates corresponding to the target merck tree to obtain a target transaction list;
and sending the target transaction list to the second application chain to complete the cross-chain transaction.
Optionally, the transaction list includes a plurality of transactions, and an initiation address and a receiving address corresponding to each transaction.
Optionally, the erasure code is a parity code.
Optionally, the sampling module is specifically configured to:
each layer of the target merck tree is randomly sampled.
In a third aspect, embodiments of the present application provide an apparatus, the apparatus including a memory for storing instructions or code, and a processor for executing the instructions or code to cause the apparatus to perform the method for securely storing relay blockchain cross-chain data of any of the preceding first aspects.
In a fourth aspect, embodiments of the present application provide a computer storage medium having code stored therein, where when the code is executed, a device executing the code implements the method for securely storing relay blockchain cross-chain data according to any of the first aspects.
The embodiment of the application provides a relay block chain cross-chain data secure storage method, a device and related equipment. When the method is executed, a transaction list sent by a first application chain is received firstly to obtain related information of transaction, then the merck tree is encoded by using erasure codes and the transaction list to obtain a target merck tree, then the target merck tree is randomly sampled, the target merck tree is decoded according to sampling data, whether the transaction is available or not is judged according to a decoding result, if the decoding result represents that the target merck tree is successfully decoded, the data is indicated to be available and complete, the transaction list is sent to a second application chain to complete cross-chain transaction. Therefore, the merck tree is encoded through erasure codes, redundancy is added to transaction data, the fault tolerance purpose is achieved, invalid transaction data can be amplified, and invalid transactions can be easily detected in the decoding process. And the target merck tree obtained by encoding the merck tree through the erasure codes and the transaction list can be decoded by sampling part of data, so that the availability verification of transaction data is realized, invalid transactions cannot be hidden, the problem of data availability attack is effectively solved, and the safety of relay block chain cross-chain data storage is improved.
Drawings
In order to more clearly illustrate the present embodiments or the technical solutions in the prior art, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for securely storing relay blockchain cross-chain data according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a transaction list and a data symbol set according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a data symbol set and a code symbol set according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a merck tree base layer provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a target merck tree according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a relay blockchain cross-chain data secure storage device according to an embodiment of the present application.
Detailed Description
The cross-chain serves as a bridge for connecting the blockchains, and reliable bottom support can be provided for the formation of a blockchain interconnection network and the intercommunication of value islands. Relay links are an important cross-link technology that aims to construct a third party public link that connects other links in a blockchain network through a cross-link messaging protocol. While a relay chain may pass information of one chain to the other, the data stored in the relay chain may suffer from data availability attacks. The data availability attack means that a malicious full node builds a merck tree according to a transaction list, but part of transactions are hidden in the building process, so that transaction data is incomplete and invalidated. When a malicious full node issues a block header, a part of invalid transactions are reserved, the honest full node cannot verify the block and generate fraud proof, so that cross-chain transactions cannot be realized. Since transactions are much smaller than chunks, it is difficult for malicious chunk producers to hide a small portion of the transactions.
Based on the technical problems, the application provides a relay block chain cross-chain data secure storage method, a device and related equipment. The erasure code is used for solving the problems of data error detection and error correction in the storage system, and can improve the reliability of the storage system. According to the method, the merck tree is encoded by using the erasure codes and the transaction list, redundancy is added to data in the transaction list through the erasure codes, any small hidden on an original block representing transaction data is unavailable to a large part of the encoded block, invalid transaction data is amplified in this way, and then the invalid transaction is detected, so that the problem of data availability attack is solved, and the safety of relay block chain cross-chain data storage is improved.
It is emphasized that a cross-chain transaction between relay blockchains may refer to an operation initiated by a cross-chain user or a cross-chain facility on one blockchain to exchange data with another blockchain for storage. Transactions between relay blockchains are understood to mean the exchange and storage of data between blockchains, which is not limited to commodity purchases and sales, but may also be the transfer and exchange of data in the blockchain domain.
It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a flowchart of a method for securely storing relay blockchain cross-chain data according to an embodiment of the present application, including:
s101: and receiving a transaction list sent by the first application chain.
The first application chain comprises a plurality of cross-chain users, and the cross-chain users on the first application chain can realize cross-chain transactions with the second application chain by sending transaction instructions. The transaction list includes a plurality of transactions. And after the transaction instructions in the first application chain reach a certain number, packaging the transaction instructions to obtain a transaction list. As an example, the first cross-link gateway receives cross-link transaction information through an event thrown by the first application chain, and packages and encapsulates the cross-link transaction information after collecting enough cross-link transaction information.
In one possible implementation, the transaction list includes a plurality of transactions, and an originating address and a receiving address corresponding to each transaction. Each transaction corresponds to one transaction instruction sent by the cross-chain user. The initiating address is the address for initiating the transaction instruction; the received address is the address of the other party that receives the transaction instruction or performs the cross-chain transaction. In a cross-chain transaction, the originating address and the receiving address are located in two different application chains, such as: the originating address is an address in a first application chain and the receiving address is an address in a second application chain.
S102: and encoding the merck tree by using the erasure codes and the transaction list to obtain a target merck tree.
Erasure codes are a data protection method, and redundancy is added for transactions through erasure codes, so that fault tolerance can be improved. The merck tree, also known as merkel tree, is an important data structure of a blockchain, which functions to quickly generalize and check the existence and integrity of blockdata; briefly, the merck tree is one way to hash large numbers of aggregated data "chunks," and relies on splitting these data "chunks" into smaller data chunks. The merck tree generally performs a packet hash on the data of the block, and inserts the generated new hash value into the merck tree, so that the process recursively until only the last root hash value remains and is recorded as the merck root of the block header. In the method, erasure codes are added in the encoding process of the merck tree by utilizing the transaction list, and the erasure codes are combined with each layer of the merck tree to obtain the target merck tree.
Note that, the type of erasure codes is not limited in the present application, and may include RS codes, horizontal array codes, vertical array codes, and parity check codes.
In this application, as a preferred implementation, the erasure code is a parity code.
Among the parity check codes, an (n, k) erasure code may be represented by an n× (n-k) parity check matrix H. Each column of the parity check matrix represents a parity check equation. For any code set C, there is. Each stopped set of the parity check matrix corresponds to a set of encoded symbols, the concealment of which will prevent the decoder from correctly recovering the data symbols. When H is j If (1.ltoreq.j.ltoreq.m) stop set is not available, then the j-layer of the target merck tree cannot be successfully decoded if at H τ No columns have a non-zero element, then a set of rows τ ⊂ [ n ] j ]Called the stop set. H τ Is H j Is a submatrix of (H) τ Only the rows in τ. In the index of τ, there is no parity check equation that contains only one code symbol. Thus, if the set of encoded symbols are hidden, there is no one parity check equation to recover them. Given that two integers c and d satisfy n j c=(n j -s j ) d, firstly generating an n j c=(n j -s j ) d the matrix Y is arranged in random rows of the identity matrix. Dividing Y matrix into n j ×(n j -s j ) Each slice is a c×d sub-matrix. If the submatrix contains an odd number of 1 s from the v-th position to the w-th position, v.epsilon.1:n j ],w∈[1:(n j -s j )],H j [v,w]=1。
S103: and randomly sampling the target merck tree to obtain sampling data.
After the target merck tree is obtained by encoding in step S102, the target merck tree is randomly sampled to verify the availability of the transaction.
S104: and decoding the target merck tree according to the sampling data to obtain a decoding result.
The sample data obtained in step S103 is part of the data of the target merck tree. Specifically, the target merck tree may be decoded using a hash-aware stripper decoder. And decoding the target merck tree from top to bottom in sequence by utilizing partial data of the target merck tree, and calculating all hash values corresponding to each layer. If all transactions are available and valid, the target merck tree can be fully decoded, and if invalid transactions exist, an error code is detected at a certain layer, wherein the error code is a code obtained by adding redundancy to the invalid transactions by using erasure codes.
S105: and if the decoding result represents that the decoding is successfully completed on the target merck tree, the transaction list is sent to a second application chain to complete the cross-chain transaction.
If the decoding result represents that the decoding is successfully completed on the target merck tree, the fact that all the transactions are available is indicated to be effective, the transaction list can be directly sent to the second application chain, and after the second application chain receives the transaction list, all the cross-chain transactions in the transaction list can be completed. Specifically, the cross-chain transaction may be completed according to the sending address and the receiving address corresponding to each transaction.
In a possible implementation manner, if the decoding result represents that the decoding of the target merck tree is wrong, deleting the transaction which causes the decoding error in the transaction list according to the merck certificate corresponding to the target merck tree to obtain a target transaction list; and sending the target transaction list to the second application chain to complete the cross-chain transaction.
Specifically, if the decoding result represents decoding errors of the target merck tree, that is, error encoding is detected in a certain layer, it is indicated that invalid transactions exist, the invalid transactions are found and deleted according to merck certificates corresponding to the target merck tree, and the rest of transactions are sent to the second application chain as a target transaction list.
The embodiment of the application provides a relay block chain cross-chain data secure storage method. The method comprises the steps of firstly receiving a transaction list sent by a first application chain to obtain related information of transaction, then encoding a merck tree by using erasure codes and the transaction list to obtain a target merck tree, further randomly sampling the target merck tree, decoding the target merck tree according to sampling data to judge whether the transaction is available or not according to decoding results, and if the decoding results represent that the decoding of the target merck tree is completed successfully, indicating that the data is available and complete, sending the transaction list to a second application chain to complete cross-chain transaction. Therefore, the merck tree is encoded through erasure codes, redundancy is added to transaction data, the fault tolerance purpose is achieved, invalid transaction data can be amplified, and invalid transactions can be easily detected in the decoding process. And the target merck tree obtained by encoding the merck tree through the erasure codes and the transaction list can be decoded by sampling part of data, so that the availability verification of transaction data is realized, invalid transactions cannot be hidden, the problem of data availability attack is effectively solved, and the safety of relay block chain cross-chain data storage is improved.
In this embodiment of the present application, step S102 described in fig. 1 specifically includes:
step 1: and acquiring a data symbol set corresponding to the transaction list, wherein the data symbol set comprises data symbols corresponding to all transactions in the transaction list.
A plurality of transactions are included in the transaction list, and each transaction corresponds to one data symbol, and the set of data symbols corresponding to all transactions is referred to as a set of data symbols. Fig. 2 is a schematic diagram of a transaction list and a data symbol set according to an embodiment of the present application, as shown in fig. 2. The left side in fig. 2 represents the transaction list and the transactions included in the transaction list: "transaction 1", "transaction 2", "transaction 3" and "transaction 4", the right side represents the data symbols of the data symbol set, which are collectively comprised of: "H1", "H2", "H3", and "H4", where "transaction 1" corresponds to "H1", "transaction 2" corresponds to "H2", "transaction 3" corresponds to "H3", and "transaction 4" corresponds to "H4".
Step 2: and constructing a coding symbol set by using the data symbol set and the erasure codes, wherein the coding symbol set comprises coding symbols corresponding to each hash value.
After the data symbol set is obtained, the erasure code and each data symbol are utilized to construct the corresponding code symbol, namely, redundant data is added, and the set of all the code symbols is called as the code symbol set. Referring to fig. 3, fig. 3 is a schematic diagram of a data symbol set and a code symbol set according to an embodiment of the present application. The left side in fig. 3 represents the data symbol set and the data symbols that the data symbol set always includes: "H1", "H2", "H3" and "H4", the right side represents the set of code symbols and the code symbols that the set of code symbols always includes: "A1", "A2", "A3" and "A4", wherein "H1" corresponds to "A1", "H2" corresponds to "A2", "H3" corresponds to "A3", and "H4" corresponds to "A4".
Step 3: the merck tree is encoded with the set of data symbols and the set of encoding symbols.
The merck tree is encoded using the set of data symbols and the set of encoding symbols as a basis. Specifically, writing all data symbols in the data symbol set and all code symbols in the code symbol set into the base layer of the merck tree; the merck tree is encoded according to a base layer of the merck tree.
Referring to fig. 4, fig. 4 is a schematic diagram of a merck tree base layer according to an embodiment of the present application. All data symbols and all coding symbols are written into the merck tree base layer to serve as a basis, and the whole merck tree is built according to the merck tree base layer.
In one possible implementation, the encoding the merck tree according to the base layer of the merck tree includes:
calculating hash values corresponding to each data symbol and each coding symbol in a base layer of the merck tree;
the merck tree is encoded according to a plurality of the hash values.
First, the hash values of the data symbols and the code symbols in the base layer are calculated, and then the merck tree is used for coding. Specifically, each layer of the merck tree is encoded, wherein the data symbols of one layer are generated from the hash value of the encoded symbol of the layer (sub-layer) above it. Assuming a block B, the Merker tree of block B has m layers (excluding the root), L 1 ,L 2 ,L 3 ...,L m Wherein L is m Is the bottom layer, the root of the merck tree is L 0 . Block B is divided into a plurality of small blocks, each small block being a data symbol, each small block corresponding to a transaction. With L j For the layer as an example, L is set for j.ltoreq.m.ltoreq.1 j Co-producing n j The corresponding data symbols also generate n j The code symbols are encoded and the error correction code used has a parity check matrix H j Wherein the data symbols are encoded by an error correction code to generate encoded symbols. Let N be j [i]Represents the j-th layer L j I+1th symbol of (2), wherein 0.ltoreq.i.ltoreq.n j . Set Q j [i]=N j [i]Represents the j-th layer L j Wherein 0.ltoreq.i.ltoreq.rn j . Let P be j [i]=N j [i]Representing the code symbol of the j-th layer Lj, where rn j ≤i≤n j . Code symbol P j [i]Is formed by data symbols Q j [i]Obtained by using error correction code with rate r, L j Hash values of every q code symbols are concatenated into L j-1 Can obtain L j Number of code symbols of (a)Where j=1, 2,..m. By iteratively concatenating and encoding symbols, the number of symbols in a layer t=n is known 1 The t hash values are the root size. Let q j And p j Respectively represent L j The number of (3)The number of symbols and code symbols, then q j =rn j ,p j =(1-r)n j . For j is more than or equal to 1 and less than or equal to m, L j-1 Is formed by L j Is composed of code symbols:
wherein concat and Hash represent a string join function and Hash, respectively.
Referring to fig. 5, fig. 5 is a schematic diagram of a target merck tree according to an embodiment of the present application. The base layer of the target merck tree shown in fig. 5 includes data symbols of H1-H4 and encoded symbols of A1-A4, a first data symbol of the penultimate layer is constructed by using H1, H3, A1 and A3 of the base layer, and the first encoded symbol is correspondingly generated, and a second data symbol of the penultimate layer is constructed by using H2, H4, A2 and A4, and the second encoded symbol is correspondingly generated, so as to complete the construction of the penultimate layer. And so on until one block remains as the root of the merck tree.
By encoding the merck tree in the above manner, the availability and integrity of the data can be verified in real time at a very small cost. It can also be used to extend the communication of a tiled blockchain system, where the entirety of one tile operates as a light node for the other tile, allowing them to effectively check the availability and integrity of blocks in the other tile.
In one possible implementation, the randomly sampling the target merck tree includes:
each layer of the target merck tree is randomly sampled.
In order to determine the availability and integrity of each transaction, the coding symbols in the base layer are randomly sampled, when different coding symbols of the base layer are randomly sampled, according to the merck evidence that the coding symbols of each intermediate layer are not used for sampling, probability sampling is also carried out on the coding symbols of the intermediate layer, and for each pair of father layers and son intermediate layers, if the data symbols of the father layers are sampled, one of q (1-r) son coding symbols of the father layers is uniformly and randomly sampled with the probability of 1-r.
On the basis of the above embodiment, step S104: decoding the target merck tree according to the sampling data to obtain a decoding result, wherein the decoding result specifically comprises:
the target merck tree is decoded from top to bottom using a hash-aware stripper decoder. With L j For example, given all n of layer j j Code symbols and (1-alpha) n j And (3) iteratively solving a first-level parity equation according to the hash values of the code symbols, and checking each code symbol according to the hash values and the related parity equation. Upon successful decoding of the symbols of the layer, the decoded encoded symbols will provide all the hash values required for layer-1. The decoder will continue until the data block is decoded or an error is detected at a layer of the code. When an error code is detected, the decoder generates a merck proof related to the error code. Erasure codes and decoding algorithms produce a large uncodable ratio α for erroneous encoded symbols, which is the smallest part of the encoded symbols that a malicious block producer needs to make unusable in order to prevent complete decoding. By the decoding method, the data of all nodes can be directly verified, namely whether the transaction in the transaction list is available or not, so that a malicious all nodes have no way to hide part of the transaction or submit false transaction.
It should be noted that, the above decoding process is performed by each of multiple honest full nodes, that is, the merck tree for the same target may be performed by multiple honest full nodes, so as to avoid error or interference of decoding under other conditions.
By the method, erasure codes are combined with each layer of the merck tree, and when invalid transactions exist, error codes can be effectively detected and processed, so that guarantee is provided for cross-chain transactions.
The embodiments of the present application provide some specific implementations of a method for securely storing relay blockchain cross-chain data, and based on this, the present application also provides a corresponding apparatus. The apparatus provided in the embodiments of the present application will be described from the viewpoint of functional modularization.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a relay blockchain cross-chain data secure storage device 600 according to an embodiment of the present application, where the device 600 includes a receiving module 601, an encoding module 602, a sampling module 603, a decoding module 604, and a sending module 605.
A receiving module 601, configured to receive a transaction list sent by a first application chain;
the encoding module 602 is configured to encode the merck tree by using the erasure code and the transaction list to obtain a target merck tree;
the sampling module 603 is configured to randomly sample the target merck tree to obtain sampling data;
a decoding module 604, configured to decode the target merck tree according to the sampled data, so as to obtain a decoding result;
and the sending module 605 is configured to send the transaction list to a second application chain to complete a cross-chain transaction if the decoding result indicates that decoding is completed on the target merck tree successfully.
In one possible implementation, the encoding module 602 includes:
an obtaining unit, configured to obtain a data symbol set corresponding to the transaction list, where the data symbol set includes data symbols corresponding to each transaction in the transaction list;
a construction unit configured to construct a set of encoded symbols using the set of data symbols and the erasure codes, the set of encoded symbols including encoded symbols corresponding to each of the hash values;
and the coding unit is used for coding the merck tree by utilizing the data symbol set and the coding symbol set.
In a possible implementation, the coding unit is specifically configured to:
writing all data symbols in the data symbol set and all code symbols in the code symbol set into a base layer of the merck tree;
the merck tree is encoded according to a base layer of the merck tree.
In a possible implementation, the coding unit is specifically configured to:
the encoding the merck tree according to the base layer of the merck tree includes:
calculating hash values corresponding to each data symbol and each coding symbol in a base layer of the merck tree;
the merck tree is encoded according to a plurality of the hash values.
In one possible implementation, the sending module 605 is further configured to:
if the decoding result represents decoding errors of the target merck tree, deleting the transaction which causes the decoding errors in the transaction list according to merck certificates corresponding to the target merck tree to obtain a target transaction list;
and sending the target transaction list to the second application chain to complete the cross-chain transaction.
In one possible implementation, the transaction list includes a plurality of transactions, and an originating address and a receiving address corresponding to each transaction.
In one possible implementation, the erasure code is a parity code.
In a possible implementation manner, the sampling module 603 is specifically configured to:
each layer of the target merck tree is randomly sampled.
The embodiment of the application provides a relay blockchain cross-chain data secure storage device. The method comprises the steps of firstly receiving a transaction list sent by a first application chain to obtain related information of transaction, then encoding a merck tree by using erasure codes and the transaction list to obtain a target merck tree, further randomly sampling the target merck tree, decoding the target merck tree according to sampling data to judge whether the transaction is available or not according to decoding results, and if the decoding results represent that the decoding of the target merck tree is completed successfully, indicating that the data is available and complete, sending the transaction list to a second application chain to complete cross-chain transaction. Therefore, the merck tree is encoded through erasure codes, redundancy is added to transaction data, the fault tolerance purpose is achieved, invalid transaction data can be amplified, and invalid transactions can be easily detected in the decoding process. And the target merck tree obtained by encoding the merck tree through the erasure codes and the transaction list can be decoded by sampling part of data, so that the availability verification of transaction data is realized, invalid transactions cannot be hidden, the problem of data availability attack is effectively solved, and the safety of relay block chain cross-chain data storage is improved.
The embodiment of the application also provides corresponding equipment and a computer storage medium, which are used for realizing the scheme provided by the embodiment of the application.
The device comprises a memory and a processor, wherein the memory is used for storing instructions or codes, and the processor is used for executing the instructions or codes to enable the device to execute the relay blockchain cross-chain data security storage method according to any embodiment of the application.
The computer storage medium stores codes, and when the codes are executed, equipment for executing the codes realizes the relay blockchain cross-chain data security storage method in any embodiment of the application.
The "first" and "second" in the names of "first", "second" (where present) and the like in the embodiments of the present application are used for name identification only, and do not represent the first and second in sequence.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus general hardware platforms. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, or the like, including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the methods described in the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application.

Claims (10)

1. A method for securely storing relay blockchain cross-chain data, the method comprising:
receiving a transaction list sent by a first application chain;
encoding the merck tree by using the erasure codes and the transaction list to obtain a target merck tree;
randomly sampling the target merck tree to obtain sampling data;
decoding the target merck tree according to the sampling data to obtain a decoding result;
and if the decoding result represents that the decoding is successfully completed on the target merck tree, the transaction list is sent to a second application chain to complete the cross-chain transaction.
2. The method of claim 1, wherein encoding the merck tree with the erasure code and the transaction list comprises:
acquiring a data symbol set corresponding to the transaction list, wherein the data symbol set comprises data symbols corresponding to all transactions in the transaction list;
constructing a set of code symbols using the set of data symbols and the erasure code, the set of code symbols comprising code symbols corresponding to each hash value;
the merck tree is encoded with the set of data symbols and the set of encoding symbols.
3. The method of claim 2, wherein the encoding the merck tree with the set of data symbols and the set of encoding symbols comprises:
writing all data symbols in the data symbol set and all code symbols in the code symbol set into a base layer of the merck tree;
the merck tree is encoded according to a base layer of the merck tree.
4. A method according to claim 3, wherein said encoding said merck tree according to its base layer comprises:
calculating hash values corresponding to each data symbol and each coding symbol in a base layer of the merck tree;
the merck tree is encoded according to a plurality of the hash values.
5. The method according to any one of claims 1-4, further comprising:
if the decoding result represents decoding errors of the target merck tree, deleting the transaction which causes the decoding errors in the transaction list according to merck certificates corresponding to the target merck tree to obtain a target transaction list;
and sending the target transaction list to the second application chain to complete the cross-chain transaction.
6. The method of claim 5, wherein the transaction list includes a plurality of transactions and an originating address and a receiving address for each transaction.
7. The method of claim 6, wherein the erasure code is a parity code.
8. The method of claim 5, wherein randomly sampling the target merck tree comprises:
each layer of the target merck tree is randomly sampled.
9. A relay blockchain cross-chain data secure storage device, the device comprising:
the receiving module is used for receiving the transaction list sent by the first application chain;
the coding module is used for coding the merck tree by using the erasure codes and the transaction list to obtain a target merck tree;
the sampling module is used for randomly sampling the target merck tree to obtain sampling data;
the decoding module is used for decoding the target merck tree according to the sampling data to obtain a decoding result;
and the sending module is used for sending the transaction list to a second application chain to complete the cross-chain transaction if the decoding result represents that the decoding of the target merck tree is completed successfully.
10. A computer device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the relay blockchain cross-chain data secure storage method of any of claims 1-8 when the computer program is executed.
CN202310593980.XA 2023-05-24 2023-05-24 Relay block chain cross-chain data secure storage method and device and related equipment Active CN116308368B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310593980.XA CN116308368B (en) 2023-05-24 2023-05-24 Relay block chain cross-chain data secure storage method and device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310593980.XA CN116308368B (en) 2023-05-24 2023-05-24 Relay block chain cross-chain data secure storage method and device and related equipment

Publications (2)

Publication Number Publication Date
CN116308368A CN116308368A (en) 2023-06-23
CN116308368B true CN116308368B (en) 2023-07-18

Family

ID=86829119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310593980.XA Active CN116308368B (en) 2023-05-24 2023-05-24 Relay block chain cross-chain data secure storage method and device and related equipment

Country Status (1)

Country Link
CN (1) CN116308368B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827957B (en) * 2023-08-30 2023-11-07 腾讯科技(深圳)有限公司 Information processing method, device, equipment and medium based on multi-block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112200682A (en) * 2020-12-04 2021-01-08 腾讯科技(深圳)有限公司 Block chain-based cross-chain transaction method and device and computer-readable storage medium
CN112702400A (en) * 2020-12-15 2021-04-23 北京链飞未来科技有限公司 Block chain cross-chain transaction verification method based on multi-stage Mercker tree
CN113657900A (en) * 2021-07-13 2021-11-16 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system
CN114463002A (en) * 2021-12-31 2022-05-10 杭州趣链科技有限公司 Method and device for verifying legality of cross-link transaction, computer equipment and medium
CN114567643A (en) * 2020-11-27 2022-05-31 腾讯科技(深圳)有限公司 Cross-block-chain data transfer method, device and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109345388B (en) * 2018-09-20 2020-09-08 百度在线网络技术(北京)有限公司 Block chain intelligent contract verification method and device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567643A (en) * 2020-11-27 2022-05-31 腾讯科技(深圳)有限公司 Cross-block-chain data transfer method, device and related equipment
CN112200682A (en) * 2020-12-04 2021-01-08 腾讯科技(深圳)有限公司 Block chain-based cross-chain transaction method and device and computer-readable storage medium
CN112702400A (en) * 2020-12-15 2021-04-23 北京链飞未来科技有限公司 Block chain cross-chain transaction verification method based on multi-stage Mercker tree
CN113657900A (en) * 2021-07-13 2021-11-16 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system
CN114463002A (en) * 2021-12-31 2022-05-10 杭州趣链科技有限公司 Method and device for verifying legality of cross-link transaction, computer equipment and medium

Also Published As

Publication number Publication date
CN116308368A (en) 2023-06-23

Similar Documents

Publication Publication Date Title
CN116308368B (en) Relay block chain cross-chain data secure storage method and device and related equipment
JP5316411B2 (en) Transmitter and receiver
US8381062B1 (en) Proof of retrievability for archived files
CN109905247B (en) Block chain based digital signature method, device, equipment and storage medium
EP2348640A1 (en) Systematic encoding and decoding of chain reaction codes
US20080133921A1 (en) Message authentication system and message authentication method
CN105228157B (en) A kind of wireless sensor network security light weight reprogramming method
CN102164141A (en) Method for protecting security of account
Wu et al. Distributed error correction coding scheme for low storage blockchain systems
CN111415161A (en) Block chain-based data verification method and device and computer-readable storage medium
CN101779190A (en) Information transmission and integrated protection method
US11570168B2 (en) Techniques for repeat authentication
US20090158045A1 (en) Light-overhead and flexible wireless sensor message authentication method
CN111147227A (en) Communication method and communication platform based on block chain
CN111104694B (en) Data encoding method and system supporting data support sexual certification and data repair
US20190140667A1 (en) Optimal construction of regenerating code through rate-matching
WO2013185271A1 (en) Data reconstruction method and apparatus against byzantine failure in network storage, and method and apparatus for restoring failure data
EP3416332B1 (en) Quantum communication device, quantum communication system and quantum communication method
KR102211648B1 (en) Electronic device capable of data communication through electronic signatures based on syndrome and operating method thereof
CN104541469B (en) Method and apparatus for carrying out Fault recovery using the information about emitter
CN110941854B (en) Method and device for saving and recovering private data based on secure multi-party computing
US11356274B2 (en) Verifying a set of remotely stored data
CN112927078A (en) Block chain financial big data analysis processing system and method and transaction platform system
Li et al. Enjoy the benefit of network coding: Combat pollution attacks in 5G multihop networks
CN115952515B (en) Data security processing method and device based on big data

Legal Events

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