Data tracing method and device based on zero-knowledge proof
Patent Information
- Application Number
- CN202311532412.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-11-16
AI Technical Summary
[0003]然而,区块链的链式结构往往需要顺序查询链上内容才能获取数据间的关系,这严重限制了追溯效率
[0060] The above technical solution stores zero-knowledge proofs and association numbers in the block header of blocks generated in the blockchain network. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm and can be used to verify whether the block contains the data to be traced. The association number represents the association type between the block and other blocks. Other blocks in the blockchain network whose association relationship with the block belongs to the association type represented by the association number can be considered as the block's traceable neighbor blocks. Therefore, the target block containing the traceable association number and the traceable neighbor blocks of the target block can be determined by using the traceable association number used to trace the data to be traced, thus forming a corresponding target block traceability chain. This allows for tracing the source of data and verifying the validity of related transactions by querying the zero-knowledge proof in the block header without needing complete block data, significantly improving the performance and throughput of the blockchain traceability system. Based on this, combined with the target block traceability chain, the relevant blocks of the traceable data can be quickly located, further improving data traceability efficiency.
Smart Images

Figure CN117763574B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of blockchain technology, and more specifically, to a data traceability method and apparatus based on zero-knowledge proofs. Background Technology
[0002] Blockchain technology features a distributed, tamper-proof data storage and verification mechanism, making it a popular solution for addressing data traceability and trustworthiness issues. In many industries, data traceability and trustworthiness are crucial for ensuring product quality, protecting consumer rights, and achieving regulatory compliance. Traditional centralized data storage and management methods are susceptible to tampering and manipulation, while blockchain, through its decentralized and distributed consensus mechanism, provides a more secure, transparent, and traceable data management approach.
[0003] However, the chain structure of blockchains often requires sequential querying of content on the chain to obtain relationships between data, which severely limits traceability efficiency. Therefore, improving data traceability efficiency is a pressing issue in current blockchain traceability processes. Summary of the Invention
[0004] The purpose of this disclosure is to provide a data tracing method and apparatus based on zero-knowledge proofs to improve the efficiency of data tracing.
[0005] To achieve the above objectives, according to a first aspect of the present disclosure, a data tracing method based on zero-knowledge proof is provided, applied to any node in a blockchain network. The block header of a block generated in the blockchain network stores a zero-knowledge proof and an association number. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm. The association number is used to characterize the association type between the block and other blocks in the blockchain network. Other blocks in the blockchain network whose association relationship with the block belongs to the association type characterized by the association number are the traceable adjacent blocks of the block.
[0006] The method includes:
[0007] Obtain the data to be traced and the traceability association number used to trace the data to be traced;
[0008] The block whose header includes the traceable association number is taken as the target block, and the traceable adjacent blocks of the target block are determined based on the traceable association number.
[0009] Based on the target block and its adjacent traceable blocks, a traceability chain for the target block is determined.
[0010] Query the block header of the block on the target block traceability chain, and verify whether the block containing the block header includes the data to be traced based on the zero-knowledge proof stored in the block header;
[0011] If the block containing the block header includes the data to be traced, the data stored in the block containing the block header is obtained.
[0012] Optionally, the step of determining the association number includes:
[0013] Determine the association weight value that characterizes the degree of association between the block and other blocks in the blockchain network;
[0014] A reference value for association weight is determined based on the association weight values of the block and other blocks in the blockchain network;
[0015] The association number of the block is determined based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value.
[0016] Optionally, the step of determining the association number further includes:
[0017] Determine the creation time of the block and other blocks in the blockchain network;
[0018] A reference value for the creation time is determined based on the creation time of the block and other blocks in the blockchain network;
[0019] The step of determining the association number of the block based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value includes:
[0020] The association number of the block is determined based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value, as well as the relationship between the creation time of other blocks in the blockchain network and the creation time reference value.
[0021] Optionally, determining the association number of the block based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value, and the chronological relationship between the creation time of other blocks in the blockchain network and the creation time reference value, includes:
[0022] Based on the creation time of other blocks in the blockchain network, the creation time reference value, the association weight value between the block and other blocks in the blockchain network, and the association weight reference value, the first traceable adjacent block whose creation time is earlier than the creation time reference value and whose association weight value with the block is less than the association weight reference value is numbered as the first association number; the second traceable adjacent block whose creation time is earlier than the creation time reference value and whose association weight value with the block is greater than the association weight reference value is numbered as the second association number; the third traceable adjacent block whose creation time is later than the creation time reference value and whose association weight value with the block is less than the association weight reference value is numbered as the third association number; and the fourth traceable adjacent block whose creation time is later than the creation time reference value and whose association weight value with the block is greater than the association weight reference value is numbered as the fourth association number.
[0023] The associated number of the block includes at least one of the first associated number, the second associated number, the third associated number, and the fourth associated number.
[0024] Optionally, determining the association weight value, which characterizes the degree of association between the block and other blocks in the blockchain network, includes:
[0025] Obtain the first data stored in the block and the second data stored in other blocks in the blockchain network;
[0026] Extract keywords of preset attribute types from the first data and the second data;
[0027] The association weight value between the block and other blocks in the blockchain network is determined based on the difference between the first frequency of occurrence of the keyword in the first data and the second frequency of occurrence in the second data.
[0028] The difference is inversely proportional to the associated weight value.
[0029] Optionally, the generation process of the zero-knowledge proof includes:
[0030] Create an initial bit array, wherein the values at all positions of the elements in the initial bit array are first preset values;
[0031] The original hash value is obtained by calculating the data in the block using a preset hash function;
[0032] The original numerical value is determined based on the original hash value and the length of the initial bit array;
[0033] The value at the element position corresponding to the original value in the initial bit array is set to the second preset value to obtain the original bit array;
[0034] The zero-knowledge proof of the block includes the original bit array.
[0035] Optionally, the step of verifying whether the block containing the block header includes the data to be traced based on the zero-knowledge proof stored in the block header includes:
[0036] The data to be traced is calculated using the preset hash function to obtain the hash value to be traced.
[0037] The target value is determined based on the hash value to be traced and the length of the original bit array included in the zero-knowledge proof;
[0038] Determine whether the values at the positions of the elements corresponding to the target value in the original bit array are all the second preset values;
[0039] If the values at the positions of the elements corresponding to the target value in the original bit array are all determined to be the second preset value, then the block containing the block header is determined to include the data to be traced.
[0040] Optionally, the method further includes:
[0041] Identify the target node with the highest business-related equity value in the blockchain traceability network;
[0042] In the blockchain traceability network, each block's header stores an associated number, and each block and its adjacent traceable blocks constitute the blockchain traceability network. The business-related rights and interests value is determined based on the historical transaction data of the nodes in the blockchain network and the topology data of the responsible block of the node in the blockchain traceability network.
[0043] After determining the target block tracing chain based on the target block and its adjacent tracing blocks, the method further includes:
[0044] The block belonging to the responsible block of the target node in the target block tracing chain is taken as the starting block to be traced in the target block tracing chain.
[0045] Optionally, the steps for determining the value of business-related equity include:
[0046] The historical transaction data of each node in each block and the topology data of the blocks each node is responsible for in the blockchain traceability network are obtained from the blockchain network. Multiple evaluation indicators and corresponding indicator values for each node are extracted from the historical transaction data and the topology data. The evaluation indicators for each node include at least the node's most recent transaction time interval, the number of transactions in the most recent preset time period, the number of historical transactions of the current transaction, and the degree centrality, proximity centrality, and betweenness centrality of the blocks the node is responsible for in the blockchain traceability network.
[0047] For each evaluation indicator, determine the evaluation weight of each node's indicator value under that evaluation indicator, determine the information entropy of that evaluation indicator based on the evaluation weight of all nodes under that evaluation indicator, and determine the corresponding business-related weights based on the information entropy of each evaluation indicator.
[0048] The business-related equity value of each node is determined based on multiple indicator values for each node and the business-related weights of the evaluation indicators corresponding to each indicator value.
[0049] According to a second aspect of the present disclosure, a data tracing device based on zero-knowledge proof is provided, applied to any node in a blockchain network. The block header of a block generated in the blockchain network stores a zero-knowledge proof and an association number. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm. The association number is used to characterize the association type between the block and other blocks in the blockchain network. Other blocks in the blockchain network whose association relationship with the block belongs to the association type characterized by the association number are the traceable adjacent blocks of the block.
[0050] The device includes:
[0051] The first acquisition module is used to acquire the data to be traced and the traceability association number used to trace the data to be traced.
[0052] The first determining module is used to take the block whose block header includes the traceable association number as the target block, and determine the traceable adjacent blocks of the target block based on the traceable association number;
[0053] The second determining module is used to determine the target block tracing chain based on the target block and the target block's tracing adjacent blocks;
[0054] The query module is used to query the block header of the block on the target block traceability chain, and verify whether the block containing the block header includes the data to be traced based on the zero-knowledge proof stored in the block header;
[0055] The second acquisition module is used to acquire the data stored in the block where the block header is located when the block containing the data to be traced includes the data to be traced.
[0056] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0057] According to a fourth aspect of the present disclosure, a node is provided, comprising:
[0058] A memory on which computer programs are stored;
[0059] A processor for executing the computer program in the memory to implement the steps of the method described in any of the first aspects above.
[0060] The above technical solution stores zero-knowledge proofs and association numbers in the block header of blocks generated in the blockchain network. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm and can be used to verify whether the block contains the data to be traced. The association number represents the association type between the block and other blocks. Other blocks in the blockchain network whose association relationship with the block belongs to the association type represented by the association number can be considered as the block's traceable neighbor blocks. Therefore, the target block containing the traceable association number and the traceable neighbor blocks of the target block can be determined by using the traceable association number used to trace the data to be traced, thus forming a corresponding target block traceability chain. This allows for tracing the source of data and verifying the validity of related transactions by querying the zero-knowledge proof in the block header without needing complete block data, significantly improving the performance and throughput of the blockchain traceability system. Based on this, combined with the target block traceability chain, the relevant blocks of the traceable data can be quickly located, further improving data traceability efficiency.
[0061] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0062] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:
[0063] Figure 1 This is a flowchart illustrating a data tracing method based on zero-knowledge proof, as shown in an exemplary embodiment of this disclosure.
[0064] Figure 2 This is a schematic diagram illustrating an associated number as shown in an exemplary embodiment of this disclosure.
[0065] Figure 3 This is a schematic diagram illustrating a method for tracing adjacent blocks as shown in an exemplary embodiment of this disclosure.
[0066] Figure 4 This is a schematic diagram illustrating a method for determining the business-related rights value of a node, as shown in an exemplary embodiment of this disclosure.
[0067] Figure 5 This is a block diagram of a data tracing device based on zero-knowledge proof, as shown in an exemplary embodiment of this disclosure.
[0068] Figure 6 This is a block diagram of a node as shown in an exemplary embodiment of this disclosure. Detailed Implementation
[0069] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0070] Currently, numerous blockchain-based data traceability solutions exist, covering areas such as food safety traceability, drug traceability, and supply chain traceability. These solutions typically leverage the immutability and decentralization of blockchain to achieve transparency and trustworthiness in data traceability. Specifically, the immutability and decentralization of blockchain are achieved through distributed ledgers. The distributed ledger involved in blockchain technology is a database shared, replicated, and synchronized among nodes, recording transactions between them.
[0071] Blockchain-based data traceability solutions often involve tracing the origins of various data assets. Data assets can refer to data with clearly defined ownership that has undergone data processing, cleaning, and mining—all part of the data capitalization process—or data owned by an enterprise and capable of continuously generating revenue for the enterprise. Tracing the origins of various data assets also involves blockchain's cross-chain technology. Cross-chain technology is a crucial technical means for blockchain to achieve interconnectivity and improve scalability.
[0072] In traditional blockchain systems, the block header can include the block's metadata, such as the hash value of the previous block and a timestamp. This metadata can be used to link previous blocks, thus forming the blockchain network. However, this design of blockchain does not provide sufficient information to support efficient data traceability and correlation analysis. Consequently, related technologies often only rely on the chain structure of the blockchain for data traceability, which severely limits traceability efficiency.
[0073] In view of this, this disclosure provides a data traceability method and apparatus based on zero-knowledge proofs. By storing zero-knowledge proofs and association numbers in the block headers of blocks generated in a blockchain network, it is possible to verify whether a block contains data to be traced based on zero-knowledge proofs, and to determine the target block containing the traceable association number and its adjacent traceable blocks based on the traceable association number used to trace the data to be traced, thus forming a corresponding target block traceability chain. Therefore, without requiring complete block data, the source of data can be traced and the validity of related transactions verified by querying the zero-knowledge proofs in the block header, significantly improving the performance and throughput of the blockchain traceability system. Furthermore, by combining the target block traceability chain, the relevant blocks of the data to be traced can be quickly located, further improving data traceability efficiency.
[0074] Figure 1 This is a flowchart illustrating a data tracing method based on zero-knowledge proofs, as shown in an exemplary embodiment of this disclosure. This data tracing method can be applied to any node in a blockchain network. Nodes in the blockchain network can be represented in the form of computing devices, such as tablets, desktop computers, and laptops.
[0075] In this embodiment of the disclosure, the block header of a block generated in the blockchain network stores a zero-knowledge proof and an association number. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm. The association number is used to characterize the association type between the block and other blocks in the blockchain network. Other blocks in the blockchain network whose association relationship with the block belongs to the association type characterized by the association number are the block's tracing neighbor blocks.
[0076] It should be noted that zero-knowledge proof algorithms can be used to verify the validity of data without revealing the specific data content. Therefore, by generating corresponding zero-knowledge proofs based on calculations of the data in a block using zero-knowledge proof algorithms, and storing these proofs in the block header, verification nodes can trace the source of data and verify the validity of related transactions without needing the complete block data, while maintaining the traceability and immutability of the blockchain. This significantly improves the performance and throughput of the blockchain traceability system.
[0077] Association type can characterize the relationship between a block and other blocks. In specific implementations, one or more association types can be determined according to the actual situation. For example, different association types can be determined based on the block's creation time, or based on the degree of association between a block and other blocks. Based on this, a corresponding association number can be set according to the association type; however, this embodiment does not impose specific limitations on the specific association number set.
[0078] By setting association numbers, connections can be established between blocks. This allows other blocks in the blockchain network whose association relationships fall under the type represented by the association number to be considered as adjacent blocks for tracing, forming a corresponding block tracing chain. Thus, based on determining the corresponding target block tracing chain using the tracing association number used to trace the data to be traced, the relevant blocks of the data to be traced can be quickly located based on this target block tracing chain, thereby further improving data tracing efficiency.
[0079] like Figure 1 As shown, the data tracing method provided in this disclosure embodiment may include the following steps:
[0080] In step S101, the data to be traced and the traceability association number used to trace the data to be traced are obtained.
[0081] In step S102, the block whose block header includes the traceable association number is taken as the target block, and the traceable neighboring blocks of the target block are determined based on the traceable association number.
[0082] In step S103, the target block traceability chain is determined based on the target block and its adjacent traceability blocks.
[0083] It should be noted that, depending on the specific implementation, the association type between a block and other blocks can include one or more, and correspondingly, the association number representing the association type between the block and other blocks in the blockchain network can also include one or more. In a specific implementation, for one association number to be traced, a target block traceability chain can be determined; for multiple association numbers to be traced, one or more target block traceability chains can be determined.
[0084] In one embodiment, traceable data and traceable association numbers for tracing the traceable data can be received from other node devices. If there are multiple traceable association numbers, the tracing order of these multiple traceable association numbers can also be received. In another embodiment, based on the received traceable data, traceable association numbers for tracing the traceable data can be configured according to a preset tracing strategy.
[0085] Among them, the preset traceability strategy can be used to specify the traceability order of the associated numbers.
[0086] When there is only one association type, the preset tracing strategy can be used to configure the association number corresponding to the association type as the traceable association number for tracing the source data. Therefore, based on the traceable association number, it is possible to prioritize querying traceable adjacent blocks whose association relationship with the block belongs to the association type represented by the traceable association number, thereby improving data tracing efficiency.
[0087] When there are multiple association types, for example, for association types determined by the degree of association between a block and other blocks, a preset tracing strategy can be used to determine the corresponding sequential association numbers to be traced according to the order of the degree of association represented by the association type from largest to smallest. Therefore, based on the sequential sequential association numbers to be traced, adjacent blocks with a higher degree of association with the block can be queried first, thereby improving data tracing efficiency.
[0088] In step S104, the block header of the block on the target block traceability chain is queried, and the zero-knowledge proof stored in the block header is used to verify whether the block containing the block header contains the data to be traced.
[0089] In step S105, if the block containing the block header includes the data to be traced, the data stored in the block containing the block header is obtained.
[0090] It should be understood that any block on the target block traceability chain can serve as the starting block to be traced. Based on this, one can start by querying the block headers of blocks on the target block traceability chain, and verify whether the block containing the block header contains the data to be traced, using the zero-knowledge proofs stored therein. If it is determined that the block containing the block header contains the data to be traced, the data stored in that block can be retrieved to complete the data traceability.
[0091] The above technical solution stores zero-knowledge proofs and association numbers in the block header of blocks generated in the blockchain network. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm and can be used to verify whether the block contains the data to be traced. The association number represents the association type between the block and other blocks. Other blocks in the blockchain network whose association relationship with the block belongs to the association type represented by the association number can be considered as the block's traceable neighbor blocks. Therefore, the target block containing the traceable association number and the traceable neighbor blocks of the target block can be determined by using the traceable association number used to trace the data to be traced, thus forming a corresponding target block traceability chain. This allows for tracing the source of data and verifying the validity of related transactions by querying the zero-knowledge proof in the block header without needing complete block data, significantly improving the performance and throughput of the blockchain traceability system. Based on this, combined with the target block traceability chain, the relevant blocks of the traceable data can be quickly located, further improving data traceability efficiency.
[0092] It should be noted that when there are multiple association types and multiple association numbers to be traced, different target block traceability chains can be generated by combining different search techniques and the tracing order of the multiple association numbers to be traced. The search techniques can include depth-first search and breadth-first search.
[0093] For example, by combining depth-first search technology, a target block tracing chain consisting of adjacent blocks of the same tracing type can be determined for each tracing association number. Based on this, the target block tracing chains corresponding to the tracing association numbers can be queried sequentially according to the tracing order.
[0094] For example, when combined with breadth-first search technology, the target block tracing chain can be determined for each target block and its tracing neighboring blocks according to the tracing order, thereby obtaining multiple target block tracing chains based on all target blocks.
[0095] It is easy to understand that, after adaptive modifications to the embodiments of this disclosure, data tracing can also be performed in conjunction with other retrieval technologies, and this disclosure does not impose specific limitations on this.
[0096] In one possible implementation, the technical solution provided in this disclosure can determine the association type based on at least one of the block creation time and the degree of association between the block and other blocks, and set the association number corresponding to the association type.
[0097] In Example 1, the association type is determined based on the block's creation time, and a corresponding association number is set. In this case, the step of determining the association number may include:
[0098] Determine the creation time of the block and other blocks in the blockchain network;
[0099] The creation time reference value is determined based on the creation time of the block and other blocks in the blockchain network;
[0100] The associated number of a block is determined based on the chronological relationship between its creation time and a reference value for creation time.
[0101] The creation time of a block can be determined based on the timestamp recorded in the block. The reference value for the creation time can be determined according to the actual situation, for example, it can be the median value of the creation times of all blocks.
[0102] For example, based on the chronological relationship between the block's creation time and a creation time reference value, adjacent blocks whose creation time is earlier than the creation time reference value can be numbered as first time-related numbers, and adjacent blocks whose creation time is later than the creation time reference value can be numbered as second time-related numbers. Furthermore, the block's related number can include at least one of the first time-related number and the second time-related number.
[0103] In Example 2, the association type is determined based on the degree of association between the block and other blocks, and a corresponding association number is set. In this case, the step of determining the association number may include:
[0104] Determine the association weight value that characterizes the degree of association between a block and other blocks in the blockchain network;
[0105] The association weight reference value is determined based on the association weight values of the block and other blocks in the blockchain network;
[0106] The association number of a block is determined based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value.
[0107] The correlation weight, which characterizes the degree of correlation between a block and other blocks in the blockchain network, can be determined based on the data content stored in the block and the data content stored in other blocks, for example, based on the similarity between the data content stored in the block and the data content stored in other blocks. The reference value for the correlation weight can be determined according to the actual situation; for example, it can be the median of all correlation weight values.
[0108] For example, based on the relationship between the association weight values of a block and other blocks in the blockchain network and their association weight reference values, adjacent blocks with association weight values less than the association weight reference value can be numbered as first weight association numbers, and adjacent blocks with association weight values greater than the association weight reference value can be numbered as second weight association numbers. Furthermore, the association number of a block can include at least one of the first weight association number and the second weight association number.
[0109] In Example 3, the association type is determined based on the block creation time and the degree of association between the block and other blocks, and a corresponding association number is set. In this case, the association number can be determined by combining the creation time and creation time reference value of other blocks determined in Example 1, and the association weight value and association weight reference value between other blocks determined in Example 2, through the following steps:
[0110] The association number of a block is determined based on the relationship between the association weight value and the association weight reference value of the block and other blocks in the blockchain network, as well as the relationship between the creation time and the creation time reference value of other blocks in the blockchain network.
[0111] For example, based on the creation time and creation time reference value of other blocks in the blockchain network, as well as the association weight value and association weight reference value of the block and other blocks in the blockchain network, the following can be defined: the first traceable neighboring block whose creation time is earlier than the creation time reference value and whose association weight value with the block is less than the association weight reference value can be designated as the first association number; the second traceable neighboring block whose creation time is earlier than the creation time reference value and whose association weight value with the block is greater than the association weight reference value can be designated as the second association number; the third traceable neighboring block whose creation time is later than the creation time reference value and whose association weight value with the block is less than the association weight reference value can be designated as the third association number; and the fourth traceable neighboring block whose creation time is later than the creation time reference value and whose association weight value with the block is greater than the association weight reference value can be designated as the fourth association number.
[0112] Based on this, the associated number of a block may include at least one of the first associated number, the second associated number, the third associated number, and the fourth associated number.
[0113] It should be noted that the embodiments disclosed herein do not impose specific restrictions on the specific form of the association number. For example, the association number can be set based on natural numbers or based on English letters.
[0114] Reference Figure 2 , Figure 2 This is a schematic diagram illustrating an associated number as shown in an exemplary embodiment of this disclosure. Based on the above-described embodiment three, Figure 2 The following is an illustration based on different creation time reference values T. mid and the associated weight reference value S mid The determined association number. And it's easy to understand that the block creation time can be converted into a natural number from smallest to largest based on the chronological order.
[0115] Based on this, with T mid =25, S mid For example, if the value is 50, the first traceable neighboring block with a creation time less than 25 and a correlation weight value of less than 50 can be numbered as the first correlation number 00, the second traceable neighboring block with a creation time less than 25 and a correlation weight value of greater than 50 can be numbered as the second correlation number 01, the third traceable neighboring block with a creation time greater than 25 and a correlation weight value of less than 50 can be numbered as the third correlation number 10, and the fourth traceable neighboring block with a creation time greater than 25 and a correlation weight value of greater than 50 can be numbered as the fourth correlation number 11.
[0116] Therefore, by using the creation time and reference value of other blocks, and the association weight value and reference value between the block and other blocks, we can determine the four adjacent blocks that a block can trace in terms of time and degree of association. These four association types can be represented by association numbers 00, 01, 10, and 11, respectively. These association numbers can serve as prefixes for transactions in the block's neighborhood. In this way, the block establishes association relationships with other blocks, allowing us to determine the tracing order based on the fit between the data to be traced and each association relationship, and then trace the data using the association number indicating that tracing order.
[0117] Reference Figure 3 , Figure 3 This is a schematic diagram illustrating a method for tracing adjacent blocks according to an exemplary embodiment of this disclosure. Based on the above-described embodiment three, each block can be considered to have established corresponding association relationships with other blocks in four directions: 00, 01, 10, and 11. These association types in four directions reflect the association relationship between each block and its tracing adjacent blocks in terms of the degree of association and creation time. Based on this, when a retrieval... Figure 3 When referring to block 1, the specific tracing directions of blocks 20, 30, and 100 in block 1 can be obtained, and the adjacent tracing blocks in each specific tracing direction can be queried sequentially according to the determined tracing order.
[0118] In one possible implementation, the query concurrency level and the number of concurrent blocks can be set. For example, the concurrency level can be set to 4, and the concurrent blocks can be set to block 1, block 25, block 50, and block 75. This allows queries to be performed in parallel from block 1, block 25, block 50, and block 75, tracing back to adjacent blocks. During the query process, it is not necessary to read the complete data of each block; only the zero-knowledge proof in the block header needs to be verified. This structure offers high search efficiency and strong concurrency, with particularly significant advantages when tracing large amounts of data.
[0119] In practice, different creation time reference values and association weight reference values can be determined according to actual needs, so that data traceability can be performed at different association granularities.
[0120] It is worth noting that the association weight values between blocks and the block creation time are important dimensions for achieving efficient retrieval. By determining the association number and the corresponding target block traceability chain through these two dimensions, the efficiency of data traceability can be effectively improved.
[0121] In one possible implementation, determining the association weight value, which characterizes the degree of association between a block and other blocks in the blockchain network, may include the following steps:
[0122] Obtain the first data stored in the block and the second data stored in other blocks in the blockchain network;
[0123] Extract keywords of preset attribute types from the first and second data;
[0124] The association weight value between the block and other blocks in the blockchain network is determined based on the difference between the first frequency of occurrence of the keyword in the first data and the second frequency of occurrence in the second data.
[0125] The difference can be inversely proportional to the association weight value. Preset attribute types can be set according to actual conditions; for example, frequently occurring attribute types in the block data can be used as preset attribute types, or general preset attribute types can be set. Keywords can be extracted from the data using regular expressions and other methods, and manual verification can be combined to ensure the accuracy of the extraction.
[0126] It should be understood that the preset attribute types and keywords to be extracted may differ for different data or blocks of data to be traced. For example, for data related to automotive parts, the preset attribute types may include number, name, date, and status. Keywords under the name type may include, for example, bearings. The specifics can be determined according to the actual situation, and this disclosure does not impose specific limitations on them.
[0127] For example, for the first data stored in a block and the second data stored in other blocks in the blockchain network, based on the preset attribute types including four categories: number, name, date, and status, each piece of data in the first and second data can be labeled according to these four categories. Then, regular expressions used to extract keywords from these four categories are used to extract keywords from the labeled data, followed by manual verification. Afterwards, the first frequency of occurrence of each of the four categories—number, name, date, and status—in the first data and the second frequency of occurrence in the second data are statistically analyzed. Based on this, the association weight value between the block and other blocks can be determined according to the difference between the first and second frequencies of occurrence.
[0128] It should be noted that when the preset attribute types include multiple types, multiple differences can be determined. In this case, the corresponding association weight value can be determined based on the smallest difference among the multiple differences, or it can be determined based on the largest difference; this disclosure does not specifically limit this. As in the previous example, the preset attribute types include four types, thus four differences can be determined. Based on this, the corresponding association weight value can be determined based on the smallest difference among the four differences.
[0129] In one possible implementation, synonyms of words in the same category can be used to replace keywords, so that the synonyms of keywords and keywords can be identified as words of the same preset attribute type. For example, for the keyword "repair" and its synonym "maintenance" extracted under the status type, "repair" can be replaced with "maintenance", so that the frequency of the synonym "maintenance" can be included in the statistical results of the frequency of the keyword "repair".
[0130] Optionally, the process of generating zero-knowledge proofs may include:
[0131] Create an initial bit array, where the values at all positions of all elements in the initial bit array are the first preset values;
[0132] The original hash value is obtained by calculating the data in the block using a preset hash function;
[0133] The original value is determined based on the original hash value and the length of the initial bit array;
[0134] Set the value at the element position corresponding to the original value in the initial bit array to the second preset value to obtain the original bit array;
[0135] The zero-knowledge proof of the block includes the original bit array. The first and second preset values can be set according to actual conditions; for example, the first preset value can be 0 and the second preset value can be 1. The preset hash function can refer to related technologies, and this disclosure does not specifically limit it.
[0136] It should be noted that multiple preset hash functions can be used to calculate the data in the block, thereby obtaining multiple original hash values, and determining multiple original numerical values based on these original hash values. Therefore, by setting the values of multiple element positions corresponding to multiple original numerical values in the initial bit array to a second preset value to obtain the original bit array, multiple verification bits can be provided for the zero-knowledge proof verification process, thereby reducing the false positive rate of verification.
[0137] To achieve the aforementioned effect, in one possible implementation, the length L of the initial bit array can be determined by the following formula 1, and the number of preset hash functions k can be determined by the following formula 2.
[0138] L = -(d·ln(p)) / (ln(2)) 2 (Formula 1)
[0139] k = (L / d)·ln(2) (Formula 2)
[0140] Where d is the number of data items to be added to the chain, and p is the hash collision rate.
[0141] In Example 1, during the data uploading phase of the example block, an initial bit array of length m can be created, and the values of all elements in the initial bit array can be initialized to 0. Based on this, k preset hash functions can be determined, and the data to be uploaded can be processed using these k preset hash functions to obtain k original hash values h1, ..., h2. k Next, k original values can be determined by modulo operation between the original hash value and the length of the initial bit array, and the values at the corresponding positions of the original values in the initial bit array are set to 1, thus obtaining the original bit array. This original bit array can then be packaged as a zero-knowledge proof and stored in the block header of the example block.
[0142] Based on this, step S104 above, verifying whether the block containing the block header contains the data to be traced based on the zero-knowledge proof stored in the block header, may include:
[0143] The hash value to be traced is obtained by calculating the data to be traced using a preset hash function;
[0144] The target value is determined based on the hash value to be traced and the length of the original bit array included in the zero-knowledge proof;
[0145] Determine whether the values at the corresponding positions of the elements in the original bit array that correspond to the target value are all the second preset values;
[0146] If the values at the corresponding target values in the original bit array are all determined to be the second preset values, then the block containing the block header is determined to include the data to be traced.
[0147] Following the example in Example 1, for the stage of tracing the source data of the example block, k hash values h1', ..., h2' to be traced can be obtained by calculating the source data using k preset hash functions. k Based on this, k target values can be determined using the modulo operation between the hash value to be traced and the length of the original bit array in the example block. Then, it can be determined whether the values at the corresponding positions of the target values in the original bit array are all 1. If any position is 0, it is determined that the data to be traced is not in the example block. If all k positions are 1, it is determined that the example block includes the data to be traced, thus allowing the extraction of detailed data from the example block.
[0148] It should be noted that the traceable adjacent blocks provided in this embodiment are other blocks in the blockchain network whose association relationship with the block belongs to the association type represented by the association number. That is, the block and its traceable adjacent blocks can be linked by the association relationship represented by the association type. Based on this, the traceable adjacent blocks of a block can be any other block in the blockchain network. Based on the association relationship between the block and its traceable adjacent blocks, a dedicated blockchain traceability network can be constructed.
[0149] Since large-scale data tracing processes typically involve numerous nodes, and related technologies often rely on frequent interactive communication to achieve consensus, this inefficient consensus method affects the efficiency of data tracing.
[0150] To address this, this disclosure proposes an efficient consensus method based on entropy weighting. This method extracts multiple evaluation metrics from the historical transaction data of nodes in the blockchain network and the topological data of the blocks each node is responsible for in the blockchain traceability network. Entropy values are then used to measure the dispersion of these metrics and their impact on the overall evaluation. This identifies the node with the highest business-related equity value in the blockchain traceability network as responsible for writing blocks. This avoids the high communication overhead of existing consensus methods when tracing a large number of nodes.
[0151] The responsible block of a node can refer to the block that the node owns in the blockchain network.
[0152] Based on this, the technical solution provided in the embodiments of this disclosure may further include:
[0153] Identify the target node with the highest business-related equity value in the blockchain traceability network.
[0154] In the blockchain traceability network, each block header stores an associated number. Each block and its adjacent traceable blocks constitute the blockchain traceability network. The business-related rights and interests are determined based on the historical transaction data of the nodes in the blockchain network and the topology data of the responsible blocks of the nodes in the blockchain traceability network.
[0155] Therefore, after step S103 above, the technical solution provided by this disclosure embodiment may further include:
[0156] The block that belongs to the responsible block of the target node in the target block traceability chain is taken as the starting block to be checked in the target block traceability chain.
[0157] It is worth noting that the blockchain data stored by each node in the blockchain network is consistent. Therefore, each node can independently calculate the node with the highest business-related equity value based on its local computing power to be responsible for writing the block. This avoids the problem of complex communication between nodes in traditional consensus methods, achieves the goal of fast consensus, and reduces the impact on data traceability efficiency.
[0158] In one possible implementation, since the node with the highest business-related equity value can be regarded as the node most relevant to the business, its responsible block can be regarded as the block most relevant to the data to be traced. Using this block as the starting block to be checked in the target block tracing chain can further improve the efficiency of data tracing.
[0159] Figure 4 This is a schematic diagram illustrating a method for determining the business-related rights value of a node, as shown in an exemplary embodiment of this disclosure. Figure 4 As shown, the steps to determine the value of business-related equity may include:
[0160] The historical transaction data of each node in each block and the topology data of the responsible blocks of each node in the blockchain traceability network are obtained from the historical transaction data and topology data. Multiple evaluation indicators and corresponding indicator values for each node are extracted from the historical transaction data and topology data.
[0161] For each evaluation indicator, determine the evaluation weight of each node's indicator value under that evaluation indicator, determine the information entropy of that evaluation indicator based on the evaluation weight of all nodes under that evaluation indicator, and determine the corresponding business-related weights based on the information entropy of each evaluation indicator.
[0162] The business-related equity value of each node is determined based on multiple indicator values for each node and the business-related weights of the evaluation indicators corresponding to each indicator value.
[0163] It should be noted that the evaluation metrics extracted from historical transaction data and topology data can be determined according to the actual situation. In one possible implementation, the evaluation metrics for each node may include at least the node's most recent transaction time interval, the number of transactions within the most recent preset time period, the number of historical transactions of the current transaction, and the degree centrality, proximity centrality, and betweenness centrality of the block the node is responsible for in the blockchain traceability network.
[0164] The transaction analysis of a node can be achieved by analyzing its most recent transaction time interval, the number of transactions within the most recent preset time period, and the number of historical transactions for the current transaction. The degree centrality, proximity centrality, and betweenness centrality of the blocks a node is responsible for within the blockchain traceability network can be used to analyze the topology of those blocks. By conducting transaction and topology analyses on nodes, their business relevance can be evaluated.
[0165] Based on this, the entropy weight method can be used to measure the variability of each evaluation indicator at each node, and thereby determine the objective weight. For example, the smaller the entropy value of an evaluation indicator, the greater the degree of variation in its value, and the more information it provides. In this case, the evaluation indicator can play a greater role in the comprehensive evaluation, and thus a larger weight can be determined.
[0166] Continue to introduce Figure 4 For example, given m evaluation indicators and their values, after normalizing the indicator values, a data matrix X = (x_m - x_m) with n nodes can be constructed. ij ) m×n For any evaluation index, the index value x of each node under that evaluation index. ij The greater the difference, the greater the role of the evaluation index in the comprehensive evaluation. If the index values of each node are basically equal, then the evaluation index corresponding to that index value has almost no effect. The normalization process for index values can refer to relevant techniques; for example, the Max-Min deviation standardization method can be used to linearly transform the original index values, so that the transformed index values are within the interval [0,1].
[0167] Based on this, the entropy weight method can be used to assign weights to each evaluation index.
[0168] For example, the index value x for each node is determined using the following Formula 3. ij The proportion P under the evaluation index corresponding to this index value ij And the information entropy E of the evaluation index is determined by formula four below, based on the evaluation weight of all nodes under the evaluation index. j Therefore, the information entropy of each evaluation indicator can be determined. Then, the corresponding business-related weight W can be determined based on the information entropy of each evaluation indicator using the following formula (Formula 5). j And through Formula Six below, the business-related equity value R of each node is determined based on multiple indicator values for each node and the business-related weights of the evaluation indicators corresponding to each indicator value. (vi) .
[0169]
[0170]
[0171] Where, when P ij When = 0, it can be defined Therefore, the information entropy of each indicator can be obtained as E1, E2, ..., E m .
[0172]
[0173] Where, 0≤W j ≤1,
[0174]
[0175] By selecting evaluation metrics that reflect transaction analysis and topology analysis, the relevance of blockchain nodes to traceable transactions within the blockchain traceability system can be reflected, that is, the business relevance of blockchain nodes. Therefore, in large-scale traceability processes, the node with the highest business-related equity value can be considered the node with the highest business relevance, and this node can be used to be responsible for consensus.
[0176] Understandably, current mainstream consortium blockchain algorithms such as RAFT and PBFT suffer from frequent message broadcasting, often causing network stagnation even with just a few dozen nodes. To address this, the method described in this embodiment for calculating node business relevance (i.e., business-related stake value) allows each node to calculate its stake value locally based on blockchain data consistency. This reduces the communication complexity of the consensus process to O(1), thus benefiting consensus processes with thousands or more nodes.
[0177] Compared to on-chain sequential queries based on obtaining complete block data, the technical solution provided in this disclosure uses zero-knowledge proofs as block headers. This allows verification nodes to verify the existence of traceable data in the current block or in neighboring blocks composed of adjacent traceable blocks without requiring complete block data, significantly improving the performance and throughput of the blockchain traceability system. Furthermore, by storing association numbers representing the association type between blocks and other blocks in the block header, a dedicated traceability chain corresponding to the association type can be constructed while maintaining the traceability and immutability of the blockchain, thereby further improving data traceability efficiency.
[0178] Based on this, multiple evaluation indicators can be extracted from the historical transaction data of nodes in the blockchain network and the topological data of the blocks that the nodes are responsible for in the blockchain traceability network. Entropy values are used to measure the dispersion of these multiple evaluation indicators and their impact on the comprehensive evaluation. In this way, the node with the highest business-related equity value in the blockchain traceability network is responsible for writing the block. This can avoid the high communication overhead of existing consensus methods when tracing a large number of nodes.
[0179] Based on the same inventive concept, this disclosure provides a data traceability device based on zero-knowledge proof. Figure 5This is a block diagram of a data tracing device 500 based on zero-knowledge proof, as shown in an exemplary embodiment of this disclosure. The data tracing device 500 can be applied to any node in a blockchain network. The block header of a block generated in the blockchain network stores a zero-knowledge proof and an association number. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm. The association number is used to characterize the association type between the block and other blocks in the blockchain network. Other blocks in the blockchain network with the same association type as the block are the block's tracing neighbor blocks. (Refer to...) Figure 5 The data traceability device 500 includes:
[0180] The first acquisition module 501 is used to acquire the data to be traced and the traceability association number used to trace the data to be traced.
[0181] The first determining module 502 is used to take the block whose block header includes the association number to be traced as the target block, and determine the traceable adjacent blocks of the target block based on the association number to be traced.
[0182] The second determining module 503 is used to determine the target block traceability chain based on the target block and the target block's traceable adjacent blocks;
[0183] The query module 504 is used to query the block header of the block on the target block traceability chain, and verify whether the block containing the block header contains the data to be traced based on the zero-knowledge proof stored in the block header.
[0184] The second acquisition module 505 is used to acquire the data stored in the block containing the block header when the block containing the block header includes the data to be traced.
[0185] In one embodiment, the data tracing device 500 further includes a third determining module for determining an association number. The step of determining the association number may include:
[0186] Determine the association weight value that characterizes the degree of association between a block and other blocks in the blockchain network;
[0187] The association weight reference value is determined based on the association weight values of the block and other blocks in the blockchain network;
[0188] The association number of a block is determined based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value.
[0189] In one embodiment, the third determining module is used to:
[0190] Determine the creation time of the block and other blocks in the blockchain network;
[0191] The creation time reference value is determined based on the creation time of the block and other blocks in the blockchain network;
[0192] The association number of a block is determined based on the relationship between the association weight value and the association weight reference value of the block and other blocks in the blockchain network, as well as the relationship between the creation time and the creation time reference value of other blocks in the blockchain network.
[0193] In one embodiment, the third determining module is used to:
[0194] Based on the creation time and creation time reference value of other blocks in the blockchain network, as well as the association weight value and association weight reference value of the block and other blocks in the blockchain network, the first traceable adjacent block with a creation time earlier than the creation time reference value and an association weight value less than the association weight reference value is numbered as the first association number; the second traceable adjacent block with a creation time earlier than the creation time reference value and an association weight value greater than the association weight reference value is numbered as the second association number; the third traceable adjacent block with a creation time later than the creation time reference value and an association weight value less than the association weight reference value is numbered as the third association number; and the fourth traceable adjacent block with a creation time later than the creation time reference value and an association weight value greater than the association weight reference value is numbered as the fourth association number.
[0195] The associated number of the block includes at least one of the first associated number, the second associated number, the third associated number, and the fourth associated number.
[0196] In one embodiment, the third determining module is used to:
[0197] Obtain the first data stored in the block and the second data stored in other blocks in the blockchain network;
[0198] Extract keywords of preset attribute types from the first and second data;
[0199] The association weight value between the block and other blocks in the blockchain network is determined based on the difference between the first frequency of occurrence of the keyword in the first data and the second frequency of occurrence in the second data.
[0200] Among them, the difference and the correlation weight value are inversely proportional.
[0201] In one embodiment, the data tracing device 500 further includes a generation module for generating zero-knowledge proofs. The generation process of the zero-knowledge proofs may include:
[0202] Create an initial bit array, where the values at all positions of all elements in the initial bit array are the first preset values;
[0203] The original hash value is obtained by calculating the data in the block using a preset hash function;
[0204] The original value is determined based on the original hash value and the length of the initial bit array;
[0205] Set the value at the element position corresponding to the original value in the initial bit array to the second preset value to obtain the original bit array;
[0206] The zero-knowledge proof of a block includes the original bit array.
[0207] In one embodiment, the query module 504 is used for:
[0208] The hash value to be traced is obtained by calculating the data to be traced using a preset hash function;
[0209] The target value is determined based on the hash value to be traced and the length of the original bit array included in the zero-knowledge proof;
[0210] Determine whether the values at the corresponding positions of the elements in the original bit array that correspond to the target value are all the second preset values;
[0211] If the values at the corresponding target values in the original bit array are all determined to be the second preset values, then the block containing the block header is determined to include the data to be traced.
[0212] In one embodiment, the data tracing device 500 further includes a fourth determining module, used for:
[0213] Identify the target node with the highest business-related equity value in the blockchain traceability network;
[0214] In the blockchain traceability network, each block header stores an associated number. Each block and its adjacent traceable blocks constitute the blockchain traceability network. The business-related rights and interests are determined based on the historical transaction data of the nodes in the blockchain network and the topology data of the responsible blocks of the nodes in the blockchain traceability network.
[0215] The data traceability device 500 also includes a fifth determining module, used for:
[0216] After determining the target block traceability chain based on the target block and its adjacent traceable blocks, the block in the target block traceability chain that belongs to the responsible block of the target node is taken as the starting block to be checked in the target block traceability chain.
[0217] In one embodiment, the data tracing device 500 further includes a sixth determining module, used to determine the value of business-related rights and interests. The step of determining the value of business-related rights and interests may include:
[0218] The historical transaction data of each node in each block and the topology data of the blocks responsible for each node in the blockchain traceability network are obtained from the blockchain network. Multiple evaluation indicators and corresponding indicator values are extracted for each node from the historical transaction data and topology data. The evaluation indicators of each node include at least the node's most recent transaction time interval, the number of transactions in the most recent preset time period, the number of historical transactions of the current transaction, and the degree centrality, proximity centrality, and betweenness centrality of the blocks responsible for the node in the blockchain traceability network.
[0219] For each evaluation indicator, determine the evaluation weight of each node's indicator value under that evaluation indicator, determine the information entropy of that evaluation indicator based on the evaluation weight of all nodes under that evaluation indicator, and determine the corresponding business-related weights based on the information entropy of each evaluation indicator.
[0220] The business-related equity value of each node is determined based on multiple indicator values for each node and the business-related weights of the evaluation indicators corresponding to each indicator value.
[0221] Regarding the zero-knowledge proof-based data tracing device 500 in the above embodiments, the specific methods by which each module performs its operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0222] Figure 6 This is a block diagram illustrating a node 600 according to an exemplary embodiment. For example... Figure 6 As shown, node 600 may include: processor 601, memory 602. Node 600 may also include one or more of the following: multimedia component 603, input / output (I / O) interface 604, and communication component 605.
[0223] The processor 601 controls the overall operation of the node 600 to complete all or part of the steps in the zero-knowledge proof-based data tracing method described above. The memory 602 stores various types of data to support the operation of the node 600. This data may include, for example, instructions for any application or method operating on the node 600, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 602 or transmitted via communication component 605. The audio component also includes at least one speaker for outputting audio signals. I / O interface 604 provides an interface between processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 605 is used for wired or wireless communication between node 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 605 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0224] In an exemplary embodiment, node 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the aforementioned zero-knowledge proof-based data tracing method.
[0225] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the data tracing method based on zero-knowledge proof described above. For example, the computer-readable storage medium may be the memory 602 including the program instructions, which may be executed by the processor 601 of node 600 to complete the data tracing method based on zero-knowledge proof described above.
[0226] In another exemplary embodiment, a computer program product is also provided, comprising a computer program executable by a programmable device, the computer program having a code portion for performing the aforementioned zero-knowledge proof-based data tracing method when executed by the programmable device.
[0227] The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0228] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0229] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A data provenance method based on zero-knowledge proof, characterized in that, This method is applied to any node in a blockchain network. The block header of a block generated in the blockchain network stores a zero-knowledge proof and an association number. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm. The association number is used to characterize the association type between the block and other blocks in the blockchain network. Other blocks in the blockchain network whose association relationship with the block belongs to the association type characterized by the association number are the traceable neighbor blocks of the block. The method includes: Obtain the data to be traced and the traceability association number used to trace the data to be traced; The block whose header includes the traceable association number is taken as the target block, and the traceable adjacent blocks of the target block are determined based on the traceable association number. Based on the target block and its adjacent traceable blocks, a traceability chain for the target block is determined. Query the block header of the block on the target block traceability chain, and verify whether the block containing the block header includes the data to be traced based on the zero-knowledge proof stored in the block header; If the block containing the block header includes the data to be traced, the data stored in the block containing the block header is obtained.
2. The data tracing method based on zero-knowledge proof according to claim 1, characterized in that, The step of determining the association number includes: Determine the association weight value that characterizes the degree of association between the block and other blocks in the blockchain network; A reference value for association weight is determined based on the association weight values of the block and other blocks in the blockchain network; The association number of the block is determined based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value.
3. The data tracing method based on zero-knowledge proof according to claim 2, characterized in that, The step of determining the association number further includes: Determine the creation time of the block and other blocks in the blockchain network; A reference value for the creation time is determined based on the creation time of the block and other blocks in the blockchain network; The step of determining the association number of the block based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value includes: The association number of the block is determined based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value, as well as the relationship between the creation time of other blocks in the blockchain network and the creation time reference value.
4. The data tracing method based on zero-knowledge proof according to claim 3, characterized in that, The step of determining the association number of the block based on the relationship between the association weight value of the block and other blocks in the blockchain network and the association weight reference value, and the chronological relationship between the creation time of other blocks in the blockchain network and the creation time reference value, includes: Based on the creation time of other blocks in the blockchain network, the creation time reference value, the association weight value between the block and other blocks in the blockchain network, and the association weight reference value, the first traceable adjacent block whose creation time is earlier than the creation time reference value and whose association weight value with the block is less than the association weight reference value is numbered as the first association number; the second traceable adjacent block whose creation time is earlier than the creation time reference value and whose association weight value with the block is greater than the association weight reference value is numbered as the second association number; the third traceable adjacent block whose creation time is later than the creation time reference value and whose association weight value with the block is less than the association weight reference value is numbered as the third association number; and the fourth traceable adjacent block whose creation time is later than the creation time reference value and whose association weight value with the block is greater than the association weight reference value is numbered as the fourth association number. The associated number of the block includes at least one of the first associated number, the second associated number, the third associated number, and the fourth associated number.
5. The data tracing method based on zero-knowledge proof according to claim 2, characterized in that, The determination of the association weight value, which characterizes the degree of association between the block and other blocks in the blockchain network, includes: Obtain the first data stored in the block and the second data stored in other blocks in the blockchain network; Extract keywords of preset attribute types from the first data and the second data; The association weight value between the block and other blocks in the blockchain network is determined based on the difference between the first frequency of occurrence of the keyword in the first data and the second frequency of occurrence in the second data. The difference is inversely proportional to the associated weight value.
6. The data tracing method based on zero-knowledge proof according to any one of claims 1-5, characterized in that, The generation process of the zero-knowledge proof includes: Create an initial bit array, wherein the values at all positions of the elements in the initial bit array are first preset values; The original hash value is obtained by calculating the data in the block using a preset hash function; The original numerical value is determined based on the original hash value and the length of the initial bit array; The value at the element position corresponding to the original value in the initial bit array is set to the second preset value to obtain the original bit array; The zero-knowledge proof of the block includes the original bit array.
7. The data tracing method based on zero-knowledge proof according to claim 6, characterized in that, The verification of whether the block containing the block header contains the data to be traced, based on the zero-knowledge proof stored in the block header, includes: The data to be traced is calculated using the preset hash function to obtain the hash value to be traced. The target value is determined based on the hash value to be traced and the length of the original bit array included in the zero-knowledge proof; Determine whether the values at the positions of the elements corresponding to the target value in the original bit array are all the second preset values; If the values at the positions of the elements corresponding to the target value in the original bit array are all determined to be the second preset value, then the block containing the block header is determined to include the data to be traced.
8. The data tracing method based on zero-knowledge proof according to claim 1, characterized in that, The method further includes: Identify the target node with the highest business-related equity value in the blockchain traceability network; In the blockchain traceability network, each block's header stores an associated number, and each block and its adjacent traceable blocks constitute the blockchain traceability network. The business-related rights and interests value is determined based on the historical transaction data of the nodes in the blockchain network and the topology data of the responsible block of the node in the blockchain traceability network. After determining the target block tracing chain based on the target block and its adjacent tracing blocks, the method further includes: The block belonging to the responsible block of the target node in the target block tracing chain is taken as the starting block to be traced in the target block tracing chain.
9. The data tracing method based on zero-knowledge proof according to claim 8, characterized in that, The steps to determine the value of business-related equity include: The historical transaction data of each node in each block and the topology data of the blocks each node is responsible for in the blockchain traceability network are obtained from the blockchain network. Multiple evaluation indicators and corresponding indicator values for each node are extracted from the historical transaction data and the topology data. The evaluation indicators for each node include at least the node's most recent transaction time interval, the number of transactions in the most recent preset time period, the number of historical transactions of the current transaction, and the degree centrality, proximity centrality, and betweenness centrality of the blocks the node is responsible for in the blockchain traceability network. For each evaluation indicator, determine the evaluation weight of each node's indicator value under that evaluation indicator, determine the information entropy of that evaluation indicator based on the evaluation weight of all nodes under that evaluation indicator, and determine the corresponding business-related weights based on the information entropy of each evaluation indicator. The business-related equity value of each node is determined based on multiple indicator values for each node and the business-related weights of the evaluation indicators corresponding to each indicator value.
10. A data traceability device based on zero-knowledge proof, characterized in that, This method is applied to any node in a blockchain network. The block header of a block generated in the blockchain network stores a zero-knowledge proof and an association number. The zero-knowledge proof is generated by calculating the data in the block based on a zero-knowledge proof algorithm. The association number is used to characterize the association type between the block and other blocks in the blockchain network. Other blocks in the blockchain network whose association relationship with the block belongs to the association type characterized by the association number are the traceable neighbor blocks of the block. The device includes: The first acquisition module is used to acquire the data to be traced and the traceability association number used to trace the data to be traced. The first determining module is used to take the block whose block header includes the traceable association number as the target block, and determine the traceable adjacent blocks of the target block based on the traceable association number; The second determining module is used to determine the target block tracing chain based on the target block and the target block's tracing adjacent blocks; The query module is used to query the block header of the block on the target block traceability chain, and verify whether the block containing the block header includes the data to be traced based on the zero-knowledge proof stored in the block header; The second acquisition module is used to acquire the data stored in the block where the block header is located when the block containing the data to be traced includes the data to be traced.
Citation Information
Patent Citations
Block chain-based traceability data acquisition method and related device
CN110222053A
Data tracing system and data tracing method based on block chain
CN115392927A