A data verification method based on information entropy and computer-readable storage medium
By introducing information entropy to optimize the design of Merkle trees and erasure codes in the blockchain system, the high overhead and low accuracy problems of data synchronization verification are solved, a more efficient data verification and consensus process is achieved, and the system's fault tolerance and security are enhanced.
Patent Information
- Application Number
- CN202410678078.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-05-29
Smart Images

Figure CN118504004B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a data verification method based on information entropy and a computer-readable storage medium. Background Art
[0002] In blockchain systems, timely data transmission to the network is crucial. With the increasing use of blockchain, bandwidth efficiency and system security associated with data transmission have become prominent issues. Current proposals for implementing blockchain networks and erasure codes primarily employ erasure codes to encode data during the encoding phase, improving storage space utilization and fault tolerance.
[0003] However, this method's data dissemination process requires, first, downloading the entire block of data locally to verify its availability, resulting in significant bandwidth consumption and negatively impacting system efficiency and security. Furthermore, the lack of effective complete verification methods and probability calculation methods compromises the integrity of node data and the accuracy of data recovery. This results in limitations in defending against distributed network attacks and data recovery. Summary of the Invention
[0004] The main technical problem solved by the present invention is the performance issues such as data synchronization verification overhead, accuracy, efficiency, etc. in a distributed network.
[0005] According to a first aspect, an embodiment provides a data verification method based on information entropy, which is applied to a blockchain system, wherein the blockchain system includes full nodes and light nodes; the data verification method includes:
[0006] receiving a transaction data block to be verified based on the full node, constructing a plurality of corresponding Merkle trees based on the transaction data block to be verified, and selecting a reference Merkle tree from the plurality of Merkle trees according to information entropies corresponding to the plurality of Merkle trees;
[0007] Constructing a plurality of erasure codes based on the transaction data block to be verified, and selecting a reference erasure code from the plurality of erasure codes according to information entropy corresponding to the plurality of erasure codes;
[0008] Obtain a first data set corresponding to the reference erasure code, and upload the first data set to the block header corresponding to the full node; the first data set includes the Merkle root corresponding to each row of the reference erasure code, the Merkle root corresponding to each column of the reference erasure code, the total data root corresponding to the row, the total data root corresponding to the column, a polynomial, and a polynomial commitment corresponding to the polynomial;
[0009] When the light node receives a reference block header containing the first data set, the light node performs an initial verification based on the light node, the reference block header, and the erasure code to be referenced. When the initial verification passes, multiple reference paths are constructed based on the light node and the erasure code to be referenced, and a final path is selected from the multiple reference paths based on the information entropy corresponding to the multiple reference paths.
[0010] The transaction data corresponding to the final path is obtained based on the full node and the reference Merkle tree, and re-verification is performed according to the transaction data corresponding to the final path to obtain a re-verification result.
[0011] In some embodiments, constructing multiple corresponding Merkle trees based on the transaction data blocks to be verified includes:
[0012] Extracting multiple transaction data from the transaction data block to be verified;
[0013] Randomly arranging the plurality of transaction data to obtain a plurality of different data arrangement results corresponding to the plurality of transaction data;
[0014] A corresponding Merkle tree is constructed according to the data arrangement result and a preset Merkle tree generation rule; the multiple different data arrangement results correspond to multiple different Merkle trees.
[0015] In some embodiments, selecting a reference Merkle tree from the multiple Merkle trees based on information entropy corresponding to the multiple Merkle trees includes:
[0016] Calculate the information entropy corresponding to the multiple Merkle trees respectively according to a preset information entropy calculation formula;
[0017] The Merkle tree corresponding to the largest information entropy among the information entropies corresponding to the multiple Merkle trees is selected as the reference Merkle tree.
[0018] In some embodiments, obtaining the first data set corresponding to the reference erasure code includes:
[0019] Calculate the Merkle root corresponding to each row of data in the reference erasure code respectively to obtain the Merkle root corresponding to each row of the reference erasure code;
[0020] Calculate the Merkle root corresponding to each column of data in the reference erasure code respectively to obtain the Merkle root corresponding to each column of the reference erasure code;
[0021] Calculate the total data root corresponding to each row in the reference erasure code according to the Merkle root corresponding to each row;
[0022] Calculate the total data root corresponding to each column according to the Merkle root corresponding to each column in the reference erasure code;
[0023] Constructing a polynomial corresponding to each row of data in the reference erasure code, and calculating a polynomial commitment corresponding to the polynomial;
[0024] The Merkle root corresponding to each row of the to-be-referenced erasure code, the Merkle root corresponding to each column of the to-be-referenced erasure code, the total data root corresponding to the row, the total data root corresponding to the column, the polynomial, and the polynomial commitment corresponding to the polynomial are aggregated into a first data set.
[0025] In some embodiments, the initial verification based on the light node, the reference block header, and the to-be-referenced erasure code includes:
[0026] Calculate the total data roots corresponding to the rows and the total data roots corresponding to the columns in the reference erasure code according to the light node;
[0027] If the total data roots corresponding to the rows and the total data roots corresponding to the columns calculated by the light node are consistent with the data roots in the first data set in the reference block header, the initial verification is determined to be successful.
[0028] If the total data root corresponding to the row and the total data root corresponding to the column calculated by the light node are inconsistent with the data root in the first data set in the reference block header, it is determined that the initial verification has failed.
[0029] In some embodiments, obtaining the transaction data corresponding to the final path based on the full node and the reference Merkle tree includes:
[0030] When the full node receives the data search request sent by the light node, it searches for data in the reference Merkle tree according to the final path, and uses the data in the reference Merkle tree that is consistent with the final path as the transaction data corresponding to the final path.
[0031] In some embodiments, after obtaining the re-verification result, the method further includes:
[0032] When the re-verification result is re-verification passed, the light node sends the sampling information to the first full node; the first full node includes a full node that has a connection relationship with the light node; the sampling information includes the transaction data after re-verification passed and the total data root corresponding to the row and column corresponding to the transaction data;
[0033] When the first full node receives the sampling information, it broadcasts the sampling information to multiple full nodes in the blockchain system; the multiple full nodes include full nodes that have no connection relationship with the light node.
[0034] In some embodiments, constructing multiple reference paths based on the light node and the erasure code to be referenced includes:
[0035] A preset row and a preset column in the reference erasure code are respectively selected as reference paths.
[0036] In some embodiments, the transaction data block to be verified includes data partitioning based on transaction data in a preset distributed network to obtain multiple transaction data blocks, and a data block arbitrarily selected from the multiple transaction data blocks.
[0037] According to a second aspect, an embodiment provides a computer-readable storage medium having a program stored thereon, wherein the program can be executed by a processor to implement a data verification method based on information entropy.
[0038] According to the entropy-based data verification method and computer-readable storage medium of the above-described embodiment, by introducing entropy to optimize the design of erasure codes, the randomness and uncertainty of data encoding are increased, thereby improving data fault tolerance. Compared with traditional erasure codes, they can better cope with data loss or corruption and provide higher data reliability. Furthermore, the introduction of entropy during the Merkle tree construction process and the reference path construction process can optimize overall network efficiency and improve the efficiency of data transmission, data verification, and data consensus, better resist the influence of malicious nodes, and enhance the reliability and robustness of consensus. Therefore, the accuracy and efficiency of data verification in blockchain systems can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a data verification flow chart based on information entropy according to an embodiment of the present application;
[0040] Figure 2 A flowchart of data verification based on information entropy according to an embodiment;
[0041] Figure 3 A flowchart of data verification based on information entropy according to an embodiment;
[0042] Figure 4 A flowchart of data verification based on information entropy according to an embodiment;
[0043] Figure 5 A flowchart of data verification based on information entropy according to an embodiment;
[0044] Figure 6 A flowchart of data verification based on information entropy according to an embodiment;
[0045] Figure 7 A reference diagram of the operation of a light node in a blockchain system according to one embodiment. DETAILED DESCRIPTION
[0046] The present invention will be further described in detail below by means of specific embodiments in conjunction with the accompanying drawings. Similar elements in different embodiments are numbered with associated similar elements. In the following embodiments, many detailed descriptions are provided to enable the present application to be better understood. However, those skilled in the art will readily appreciate that some of the features may be omitted in different circumstances, or may be replaced by other elements, materials, or methods. In some cases, some operations related to the present application are not shown or described in the specification. This is to avoid the core portion of the present application being overwhelmed by excessive descriptions, and for those skilled in the art, it is not necessary to describe these related operations in detail. They will fully understand the related operations based on the description in the specification and the general technical knowledge in the art.
[0047] In addition, the features, operations, or characteristics described in the specification may be combined in any appropriate manner to form various embodiments. Furthermore, the steps or actions in the method description may be reordered or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various sequences in the specification and drawings are provided solely for the purpose of clearly describing a particular embodiment and are not intended to be mandatory, unless otherwise specified.
[0048] The serial numbers assigned to components herein, such as "first," "second," etc., are used solely to distinguish the objects being described and do not convey any sequential or technical meaning. References to "connection" and "coupling" herein, unless otherwise specified, include both direct and indirect connections (couplings).
[0049] Please refer to Figure 1 An embodiment of the present invention discloses a data verification method based on information entropy, which is applied to a blockchain system, wherein the blockchain system includes a full node and a light node; the data verification method includes steps S10 to S50, which are described in detail below.
[0050] Step S10: receiving the transaction data block to be verified based on the full node, constructing multiple corresponding Merkle trees based on the transaction data block to be verified, and selecting a reference Merkle tree from the multiple Merkle trees according to the information entropy corresponding to the multiple Merkle trees.
[0051] In some embodiments, data is divided according to transaction data in a preset distributed network to obtain multiple transaction data blocks, and one data block is arbitrarily selected from the multiple transaction data blocks as the transaction data block to be verified.
[0052] In some embodiments, blockchain systems can employ an Intelligent EcoNetworking (IEN) as the system architecture framework. Furthermore, the entropy-based data verification methods of the present invention can be applied not only to blockchain systems but also to other similar distributed systems. For example, distributed databases, the Internet of Things, and satellite network data synchronization are all potential application scenarios.
[0053] Please refer to Figure 2 In some embodiments, step S10 constructs corresponding multiple Merkle trees based on the transaction data block to be verified, including steps S11 to S13, which are described in detail below.
[0054] Step S11: extracting multiple transaction data from the transaction data block to be verified.
[0055] In some embodiments, it is assumed that the multiple transaction data in the transaction data block to be verified include transaction data A, transaction data B, transaction data C, and transaction data D.
[0056] Step S12: Randomly arrange the multiple transaction data to obtain multiple different data arrangement results corresponding to the multiple transaction data.
[0057] In some embodiments, multiple transaction data, such as transaction data A, transaction data B, transaction data C, and transaction data D, are randomly arranged to obtain multiple different data arrangement results. For example, the data arrangement result may include transaction data A, transaction data B, transaction data C, and transaction data D, or may also include transaction data A, transaction data C, transaction data B, and transaction data D, or may also include transaction data A, transaction data C, transaction data D, and transaction data B, and so on.
[0058] Step S13: constructing a corresponding Merkle tree according to the data arrangement result and the preset Merkle tree generation rule; multiple different data arrangement results correspond to multiple different Merkle trees.
[0059] In some embodiments, assuming that the data arrangement result is transaction data A, transaction data B, transaction data C, and transaction data D, the step of constructing the corresponding Merkle tree based on the data arrangement result and the preset Merkle tree generation rule includes first calculating the hash values corresponding to transaction data A, transaction data B, transaction data C, and transaction data D, respectively, to obtain N0 = Hash(A), N1 = Hash(B), N2 = Hash(C), and N3 = Hash(D). Secondly, hashing the hash value N0 corresponding to transaction data A and the hash value N1 corresponding to transaction data B to obtain N4 = Hash(N0 + N1). Hashing the hash value N2 corresponding to transaction data C and the hash value N3 corresponding to transaction data D to obtain N5 = Hash(N2 + N3). Finally, hashing the hash values N4 and N5 to obtain Root = Hash(N4 + N5). Among them, transaction data A, transaction data B, transaction data C and transaction data D are used as leaf nodes, hash value N4 and hash value N5 are used as intermediate nodes, and Root is used as the root node. The Merkle tree is constructed in a bottom-up order.
[0060] In some embodiments, randomizing transaction data before constructing the Merkle tree can enhance the randomness and defensiveness of the data. This can also improve the credibility and integrity of subsequent data verification, and better protect against malicious node attacks and network interference.
[0061] Please refer to Figure 3 In some embodiments, a reference Merkle tree is selected from a plurality of Merkle trees according to information entropies corresponding to the plurality of Merkle trees, including steps S14 to S15, which are described in detail below.
[0062] Step S14: Calculate the information entropy corresponding to the multiple Merkle trees according to the preset information entropy calculation formula.
[0063] In some embodiments, the preset information entropy calculation formula includes:
[0064] HRPS(M)=-NP(N,i)M(A ij )logM(A ij )F(i)-1
[0065] Among them, HRPS(M) represents the information entropy corresponding to the Merkle tree, M represents the probability function, N represents the preset representative data, P represents the data set composed of transaction data in the Merkle tree, and A ij represents the representative data after the transaction data is permuted and combined in the Merkle tree, F(i) represents the sum of the possibilities after the transaction data is permuted and combined in the Merkle tree, and i and j represent the transaction data in the Merkle tree.
[0066] Step S15: Selecting a Merkle tree corresponding to the largest information entropy among the multiple Merkle trees as the reference Merkle tree.
[0067] In some embodiments, the calculation of information entropy can further enhance the security and data integrity of the Merkle tree.
[0068] Step S20: construct multiple erasure codes based on the transaction data block to be verified, and select a reference erasure code from the multiple erasure codes according to the information entropy corresponding to the multiple erasure codes.
[0069] In some embodiments, the transaction data in the transaction data block to be verified is expanded into multiple erasure codes, wherein the erasure code is a two-dimensional RS (Reed-Solomon) erasure code. The erasure code can be transformed into an expanded matrix consisting of rows and columns.
[0070] In some embodiments, the information entropy corresponding to multiple erasure codes is calculated according to a preset erasure code information entropy calculation formula, and the erasure code with the largest information entropy is selected as the reference erasure code. The preset erasure code information entropy calculation formula includes:
[0071] Entropy=-∑(p_t*log2((p_t))
[0072] Where Entropy represents the information entropy corresponding to the erasure code, and p_t represents the frequency of occurrence of the t-th erasure code among multiple erasure codes.
[0073] In some embodiments, by dividing a dataset into different symbols and counting the number of each symbol, the diversity and complexity of the dataset can be understood. The Shannon entropy formula is then used to calculate the information entropy corresponding to the number of symbols, thereby quantifying the uncertainty and randomness within the dataset. The calculation of information entropy provides a quantitative metric to help determine the appropriate number of symbols. A higher information entropy indicates a greater number of different symbols in the dataset, indicating sufficient redundancy and fault tolerance. In this solution, the number of erasure codes is counted to understand the block characteristics of transaction data. A reference erasure code is then selected from multiple erasure codes based on the information entropy corresponding to each code, further quantifying the complexity and distribution of the erasure codes. Furthermore, by introducing information entropy, the design of erasure codes is optimized, increasing the randomness and uncertainty of data encoding, thereby improving data fault tolerance. Compared to traditional erasure codes, this approach is more resilient to data loss or corruption, and offers higher data reliability.
[0074] Step S30: Obtain a first data set corresponding to the erasure code to be referenced, and upload the first data set to the block header corresponding to the full node; the first data set includes the Merkle root corresponding to each row in the erasure code to be referenced, the Merkle root corresponding to each column in the erasure code to be referenced, the total data root corresponding to the row, the total data root corresponding to the column, the polynomial, and the polynomial commitment corresponding to the polynomial.
[0075] Please refer to Figure 4 In some embodiments, obtaining a first data set corresponding to the erasure code to be referenced includes steps S31 to S36, which are described in detail below.
[0076] Step S31: Calculate the Merkle root corresponding to each row of data in the reference erasure code to obtain the Merkle root corresponding to each row of the reference erasure code.
[0077] Step S32: Calculate the Merkle root corresponding to each column of data in the reference erasure code respectively to obtain the Merkle root corresponding to each column of the reference erasure code.
[0078] Step S33: Calculate the total data root corresponding to each row in the reference erasure code according to the Merkle root corresponding to each row.
[0079] Step S34: Calculate the total data root corresponding to each column according to the Merkle root corresponding to each column in the reference erasure code.
[0080] Step S35: Construct a polynomial corresponding to each row of data in the reference erasure code, and calculate the polynomial commitment corresponding to the polynomial.
[0081] In some embodiments, polynomials f1(x), f2(x), f3(x), .... are constructed corresponding to each row of data in the reference erasure code, and it is assumed that a value unknown to the other party is committed to s, and the calculated KZG polynomial commitment is [f1(s)]1.
[0082] Step S36: Aggregate the Merkle root corresponding to each row in the reference erasure code, the Merkle root corresponding to each column in the reference erasure code, the total data root corresponding to the row, the total data root corresponding to the column, the polynomial, and the polynomial commitment corresponding to the polynomial into a first data set.
[0083] In some embodiments, the first data set is uploaded to a block header of a full node.
[0084] Step S40: When the light node receives the reference block header containing the first data set, an initial verification is performed based on the light node, the reference block header, and the erasure code to be referenced. When the initial verification passes, multiple reference paths are constructed based on the light node and the erasure code to be referenced, and a final path is selected from the multiple reference paths based on the information entropy corresponding to the multiple reference paths.
[0085] Please refer to Figure 5 In some embodiments, initial verification is performed based on the light node, the reference block header, and the erasure code to be referenced, including steps S41 to S43, which are described in detail below.
[0086] Step S41: Calculate the total data roots corresponding to the rows and the total data roots corresponding to the columns in the erasure code to be referenced based on the light nodes.
[0087] Step S42: If the total data roots corresponding to the rows and the total data roots corresponding to the columns calculated by the light node are consistent with the data roots in the first data set in the reference block header, it is determined that the initial verification is passed.
[0088] Step S43: If the total data roots corresponding to the rows and the total data roots corresponding to the columns calculated by the light node are inconsistent with the data roots in the first data set in the reference block header, it is determined that the initial verification has failed.
[0089] In some embodiments, multiple reference paths are constructed based on light nodes and a reference erasure code. The construction of the multiple reference paths includes selecting predetermined rows and columns in the reference erasure code as reference paths. The information entropy corresponding to each of the multiple reference paths is calculated, and based on the information entropies corresponding to the multiple reference paths, the reference path with the largest information entropy is selected as the final path.
[0090] In some embodiments, a preset path information entropy calculation formula is used to calculate the information entropy corresponding to multiple paths, wherein the preset path information entropy calculation formula includes:
[0091] H=m(A ij )*log(A ij )
[0092] Among them, H represents the information entropy corresponding to the path, m(A ij ) represents the mass function, A ij Represents the representative data after the transaction data is arranged and combined in the Merkle tree.
[0093] In some embodiments, a reference path with the largest information entropy indicates that the path is more random, thereby enhancing the security and credibility of the proof.
[0094] Step S50: Based on the full node and the reference Merkle tree, the transaction data corresponding to the final path is obtained, and re-verification is performed according to the transaction data corresponding to the final path to obtain a re-verification result.
[0095] In some embodiments, the correspondence between a commitment and transaction data is verified during re-verification, thereby determining whether the full node has published the corresponding transaction data. Due to the properties of KZG polynomial commitments, light nodes only need to accept a polynomial generated from the original transaction data and a short proof to complete the verification process, without having to download the entire original transaction data.
[0096] In some embodiments, obtaining transaction data corresponding to the final path based on the full node and the reference Merkle tree includes:
[0097] When a full node receives a data search request from a light node, it searches for data in the reference Merkle tree based on the final path, and uses the data in the reference Merkle tree that is consistent with the final path as the transaction data corresponding to the final path.
[0098] In some embodiments, the light node randomly selects a preset row and column in the reference erasure code, for example, the third row and the fifth column, and requests the transaction data corresponding to the preset row and column from the full node. When the full node sends the transaction data requested by the light node, it also proves that the preset row or column belongs to its corresponding Merkle tree. In other words, the Merkle root corresponding to the preset row or column can be calculated from the preset row or column, so verification can be performed even when the full node only publishes the block header but not the transaction data.
[0099] Please refer to Figure 6 In some embodiments, after obtaining the re-verification result, steps S51 to S52 are also included, which are described in detail below.
[0100] Step S51: When the re-verification result is re-verification passed, the light node sends the sampling information to the first full node; the first full node includes the full node that has a connection relationship with the light node; the sampling information includes the transaction data after re-verification and the total data root corresponding to the row and column corresponding to the transaction data.
[0101] Step S52: When the first full node receives the sampling information, it broadcasts the sampling information to multiple full nodes in the blockchain system; the multiple full nodes include full nodes that have no connection relationship with the light nodes.
[0102] In some embodiments, when a light node completes revalidation, it notifies its connected full nodes of the sampled transaction data, along with the revalidated row and column summaries. The full node then broadcasts this information to all full nodes in the blockchain system. This is how information is shared across the network. Once enough light nodes complete multiple samplings, a consensus on the availability of transaction data in a particular block is reached.
[0103] Please refer to Figure 7 In some embodiments, when there are enough light nodes, i.e. Figure 7 After the Light Client in the network completes multiple samplings, a consensus on the availability of transaction data in a specific block will be formed on the network, that is, the Avail Network formed based on the Avail Node.
[0104] In some embodiments, entropy-based data verification methods and computer-readable storage media utilize entropy to optimize the design of erasure codes, increasing the randomness and uncertainty of data encoding and thus improving data fault tolerance. Compared to traditional erasure codes, these methods are more resilient to data loss or corruption, providing higher data reliability. Furthermore, the introduction of entropy into the Merkle tree construction process and the reference path construction process can optimize overall network efficiency and improve the efficiency of data transmission, data verification, and data consensus, better resisting the influence of malicious nodes, and enhancing the reliability and robustness of consensus. Consequently, the accuracy and efficiency of data verification in blockchain systems can be improved.
[0105] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer program. When all or part of the functions in the above embodiments are implemented by computer program, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above functions can be implemented. In addition, when all or part of the functions in the above embodiments are implemented by computer program, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and saved in the memory of the local device by downloading or copying, or the system of the local device is updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be implemented.
[0106] The above examples are used to illustrate the present invention, which are only used to help understand the present invention and are not intended to limit the present invention. Those skilled in the art can make several simple deductions, modifications or substitutions based on the concept of the present invention.
Claims
1. A data verification method based on information entropy, applied to a blockchain system, wherein the blockchain system includes full nodes and light nodes; characterized in that: The data verification method comprises: Receiving a transaction data block to be verified based on the full node, extracting multiple transaction data from the transaction data block to be verified, randomly arranging the multiple transaction data to obtain multiple different data arrangement results corresponding to the multiple transaction data, constructing corresponding Merkle trees based on the data arrangement results and a preset Merkle tree generation rule, wherein the multiple different data arrangement results correspond to multiple different Merkle trees, and selecting a Merkle tree to be referenced from the multiple Merkle trees based on information entropies corresponding to the multiple Merkle trees; Constructing a plurality of erasure codes based on the transaction data block to be verified, and selecting a reference erasure code from the plurality of erasure codes according to information entropy corresponding to the plurality of erasure codes; Obtain a first data set corresponding to the reference erasure code, and upload the first data set to the block header corresponding to the full node; the first data set includes the Merkle root corresponding to each row of the reference erasure code, the Merkle root corresponding to each column of the reference erasure code, the total data root corresponding to the row, the total data root corresponding to the column, a polynomial, and a polynomial commitment corresponding to the polynomial; When the light node receives a reference block header containing the first data set, an initial verification is performed based on the light node, the reference block header, and the erasure code to be referenced. When the initial verification passes, multiple reference paths are constructed based on the light node and the erasure code to be referenced, and a final path is selected from the multiple reference paths based on the information entropy corresponding to the multiple reference paths; wherein, a preset row and a preset column in the erasure code to be referenced are respectively selected as the reference paths; Based on the full node and the reference Merkle tree, the transaction data corresponding to the final path is obtained, and re-verification is performed according to the transaction data corresponding to the final path to obtain a re-verification result; wherein the re-verification includes verifying the correspondence between the polynomial commitment and the transaction data corresponding to the final path.
2. The method according to claim 1, wherein The selecting a reference Merkle tree from the multiple Merkle trees according to the information entropy corresponding to the multiple Merkle trees includes: Calculate the information entropy corresponding to the multiple Merkle trees respectively according to a preset information entropy calculation formula; The Merkle tree corresponding to the largest information entropy among the information entropies corresponding to the multiple Merkle trees is selected as the reference Merkle tree.
3. The method according to claim 1, wherein The obtaining of a first data set corresponding to the erasure code to be referenced includes: Calculate the Merkle root corresponding to each row of data in the reference erasure code respectively to obtain the Merkle root corresponding to each row of the reference erasure code; Calculate the Merkle root corresponding to each column of data in the reference erasure code respectively to obtain the Merkle root corresponding to each column of the reference erasure code; Calculate the total data root corresponding to each row in the reference erasure code according to the Merkle root corresponding to each row; Calculate the total data root corresponding to each column according to the Merkle root corresponding to each column in the reference erasure code; Constructing a polynomial corresponding to each row of data in the reference erasure code, and calculating a polynomial commitment corresponding to the polynomial; The Merkle root corresponding to each row of the to-be-referenced erasure code, the Merkle root corresponding to each column of the to-be-referenced erasure code, the total data root corresponding to the row, the total data root corresponding to the column, the polynomial, and the polynomial commitment corresponding to the polynomial are aggregated into a first data set.
4. The method according to claim 1, wherein The initial verification based on the light node, the reference block header, and the to-be-referenced erasure code includes: Calculate the total data roots corresponding to the rows and the total data roots corresponding to the columns in the reference erasure code according to the light node; If the total data roots corresponding to the rows and the total data roots corresponding to the columns calculated by the light node are consistent with the data roots in the first data set in the reference block header, the initial verification is determined to be successful. If the total data root corresponding to the row and the total data root corresponding to the column calculated by the light node are inconsistent with the data root in the first data set in the reference block header, it is determined that the initial verification has failed.
5. The method according to claim 1, wherein The obtaining the transaction data corresponding to the final path based on the full node and the reference Merkle tree includes: When the full node receives the data search request sent by the light node, it searches for data in the reference Merkle tree according to the final path, and uses the data in the reference Merkle tree that is consistent with the final path as the transaction data corresponding to the final path.
6. The method according to claim 1, wherein After obtaining the re-verification result, the method further includes: When the re-verification result is re-verification passed, the light node sends the sampling information to the first full node; the first full node includes a full node that has a connection relationship with the light node; the sampling information includes the transaction data after re-verification passed and the total data root corresponding to the row and column corresponding to the transaction data; When the first full node receives the sampling information, it broadcasts the sampling information to multiple full nodes in the blockchain system; the multiple full nodes include full nodes that have no connection relationship with the light node.
7. The method according to claim 1, wherein The transaction data block to be verified includes a plurality of transaction data blocks obtained by data division according to transaction data in a preset distributed network, and a data block arbitrarily selected from the plurality of transaction data blocks.
8. A computer-readable storage medium, characterized in that The medium stores a program, which can be executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Relay block chain cross-chain data security storage method and device and related equipment
CN116308368A
Scalable cloud file system with efficient integrity checks
US8706701B1