A verifiable provenance query method for multi-chain environment

By constructing the attribute-partitioned blockchain storage model SBSM and the two-layer index SBMI, the problems of low efficiency and poor result verification in multi-chain environments are solved, and efficient parallel query and result integrity verification are achieved.

CN117370422BActive Publication Date: 2026-11-24NORTHEASTERN UNIV CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311485265.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-09
Publication Date
2026-11-24
Estimated Expiration
2043-11-09

AI Technical Summary

Technical Problem

In a multi-chain environment, existing source tracing query methods suffer from weak query semantics, low efficiency, and poor result verification. In particular, in a multi-chain environment, query latency is long and the integrity of results is difficult to verify.

Method used

A blockchain storage model SBSM with attribute partitioning and semantics is constructed, and a two-layer blockchain index SBMI is constructed, including an inter-chain index S-Bitmap Index and an intra-chain index S-GTT Index. These indexes enable parallel inter-chain queries and verification of the integrity and correctness of results.

Benefits of technology

It enables efficient and verifiable traceability queries in a multi-chain environment, improving query efficiency and parallel execution capabilities while ensuring the correctness and completeness of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117370422B_ABST
    Figure CN117370422B_ABST
Patent Text Reader

Abstract

This invention discloses a verifiable traceability query method for multi-chain environments, relating to the field of blockchain technology. First, a blockchain storage model (SBSM) with semantic attributes is constructed; then, a two-layer blockchain index (SBMI) is constructed; finally, user query conditions are obtained, and the query is performed based on the two-layer inter-chain index, outputting the query results. Compared to traditional traceability query methods, this invention enables parallel execution between chains, improving query efficiency, and simultaneously supports verification of the correctness and integrity of the returned results. Especially when dealing with a large number of blockchains, where network transmission overhead gradually increases, the efficiency of multi-chain traceability queries will be significantly improved, providing a better user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, and in particular relates to a verifiable traceability query method for multi-chain environments. Background Technology

[0002] Blockchain systems, due to their advantages of decentralization, immutability, and data transparency, have been deployed in many application areas, such as product traceability, government regulation, and accountability. However, in many scenarios, not all participants can participate in a single blockchain system. Specifically, single blockchains lack scalability, and participants need to maintain a complete copy of the entire blockchain system. If there are too many participants and too much data in the blockchain, some participants may face excessively high storage and computational costs. Therefore, using multiple blockchains, with each blockchain jointly maintained and stored by a portion of the participants, and achieving data interoperability between chains through cross-chain technology, has become a trend.

[0003] Compared to single-chain queries, multi-chain tracing queries present three major challenges: longer query latency, greater semantic support, and more difficult result verification. Specifically, firstly, most existing blockchains use key-value pair storage, where attributes within the value are not differentiated, allowing queries only by the key and not directly by specific attribute values ​​stored within the value. Secondly, existing blockchain tracing queries mostly determine upstream target blockchains through downstream target blockchains, resulting in sequential execution between target blockchains, severely impacting connection query efficiency and user experience. Finally, malicious full nodes may return incorrect query results, requiring users to verify the completeness and correctness of query results. Current blockchain systems often use a local Merkle tree structure reconstruction compared to the Merkle root stored in the block header to verify the presence of the returned result in the block, but this cannot guarantee the absence of matching results in other blocks; it only verifies the correctness of the result, not its completeness.

[0004] Taking a supply chain scenario as an example, a vaccine supply chain is composed of multiple blockchains. When a user queries 'Q[vaccineID1]' to trace the vaccine based on the vaccine's vaccine ID and manufacturer, the system needs to return the production, transportation, and sales information of vaccineID1 from the supply chain. Current methods can only first query the production chain to obtain relevant production information data, then obtain the target blockchain and transportID containing the transportation information, and then use the transportID to query the target blockchain containing the transportation information, and so on sequentially, finally integrating the production, transportation, and sales information. This query method results in longer query delays as the number of blockchains increases, leading to a poor user experience. Furthermore, due to the existence of malicious nodes, the returned query results may be problematic. The main drawbacks of this query method are threefold:

[0005] First, the query semantics are weak. Because different blockchains may not use the same attributes as keys during storage, when a user queries using a key from one blockchain, that key might only be stored as an attribute value in other blockchains. However, most existing blockchain platforms store all attributes in the value field, without a clear distinction between different attribute types, making it impossible to query based on attribute values.

[0006] Second, query efficiency is low. In a multi-chain environment, tracing queries consist of multiple sub-queries on a single blockchain. However, because users cannot accurately specify the complete target blockchain when submitting a cross-blockchain tracing query request, parallel queries between blockchains are not possible. To ensure complete query results, existing cross-blockchain tracing query methods typically utilize the atomicity of cross-blockchain transactions, tracing in a downstream-to-upstream order, resulting in high query latency.

[0007] Third, result verification is poor. Due to computational and storage limitations, ordinary query users only act as light nodes to receive query results, while delegating storage and query services to a full node. In existing verification methods, light nodes verify the existence of returned results in a block by using the locally reconstructed Merkle root and the Merkle root stored in the block header, but they cannot verify that other blocks do not contain query results that match the query conditions. Summary of the Invention

[0008] To address the shortcomings of existing technologies, this invention provides a verifiable source tracing query method for multi-chain environments, thereby solving the problems of weak query semantics, low efficiency, and poor result verification in existing multi-chain source tracing query methods.

[0009] To achieve the above objectives, a verifiable traceability query method for multi-chain environments includes the following steps:

[0010] Step 1: Construct a blockchain storage model (SBSM) that is attribute-based and semantically meaningful;

[0011] Step 1.1: Construct a blockchain storage model SBSM; the blockchain storage model SBSM contains several semantic blockchains S, each semantic blockchain S consists of several semantic blocks S-Blocks combined in chronological order, S = S-Block1 + S-Block2 + S-Block3 + ... + S-Blockn, where S-Blocki is the i-th semantic block, and n is the number of semantic blocks; each semantic block S-Block contains two parts: a block header S-Block head and a block body S-Block body. The block header S-Block head contains the Merkle Root, the previous block hash PrevHash, the current block hash, the timestamp Time Stamp, and the index Merkle Root. The block body S-Block body contains a large number of semantic transactions, and the semantic transactions are stored in the following format:<Key,Columns> .

[0012] Step 1.2: Define the composition of semantic transactions to obtain the final attribute-based and semantically-integrated blockchain storage model (SBSM). The semantic transaction consists of: Key, a unique identifier representing the attribute of the semantic transaction; Columns, containing the attribute semantics and the corresponding semantic transaction attribute values, where Columns = {Ts = v1, SenID = v2, RecID = v3, Tname = v4, Attributesx}, where Ts is the timestamp of the semantic transaction, SenID is the initiator of the semantic transaction, RecID is the receiver of the semantic transaction, Tname is the semantic transaction type, and vi is the semantic transaction attribute value; Attributesx is a user-defined application-level attribute set, where Attributesx = {attr1 = v5, attr2 = v6, ..., attrn = vm}, where attrj is the semantic transaction attribute, vi is the semantic transaction attribute value, and m is the number of semantic transaction attributes; different attribute sets are set for different application scenarios and semantic transaction types.

[0013] Step 2: Construct a two-layer blockchain index SBMI; the two-layer blockchain index consists of an inter-chain index S-BitmapIndex and an intra-chain index S-GTT Index.

[0014] Step 2.1: Traverse the semantic transactions stored within the blockchain and construct the inter-chain index S-Bitmap Index;

[0015] Each inter-chain index S-Bitmap Index corresponds to a semantic transaction attribute. The inter-chain index includes several bitmaps, and each bitmap corresponds to a semantic transaction attribute value. The v-th bitmap indicates whether there is a semantic transaction with attrj of v-th value in each semantic blockchain. The i-th bit being '0' indicates that there is no semantic transaction with attrj of v-th value in the i-th semantic blockchain, and being '1' indicates that there is a semantic transaction with attrj of v-th value in the i-th semantic blockchain.

[0016] Step 2.2: Traverse the semantic transactions within the blockchain, and construct the in-chain index S-GTT Index according to the Merkle prefix tree structure and the size of the v-th value of attrj;

[0017] The in-chain index includes several leaf nodes. Each leaf node represents the location information of a semantic transaction that takes the v-th value from the attrj, including the block-id semantic block number and the position in the pn semantic block.

[0018] Step 3: Obtain the user's query conditions, perform the query based on the inter-chain index, and output the query results.

[0019] Step 3.1: Input a verifiable source tracing query Q = [key, track], where key is the unique identifier of the user's source tracing query object, and track represents the source tracing query;

[0020] Step 3.2: Perform inter-chain queries based on the verifiable traceability query Q = [key, track] to obtain the S-Bitmap Index of the semantic transaction attribute corresponding to the key. Determine whether it is the target blockchain by whether the i-th bit in the v-th bitmap is '0' or '1'. Obtain the complete target blockchain in query Q. That is, when the corresponding bit is '1', it means that the corresponding blockchain is one of the target blockchains. When the corresponding bit is '0', skip the blockchain and obtain all the target semantic blockchains.

[0021] Step 3.3: Obtain the on-chain S-GTTIndex of the semantic transaction attribute value corresponding to the key on different target semantic blockchains. Traverse the index starting from the root node, and determine whether the node meets the query conditions. If it meets the query conditions, further determine the node type. If it is an intermediate node, traverse its child nodes in sequence. If it is a leaf node, put it into the sub-query result position information RLj, where j is the sequence number of the target semantic blockchain. If it does not meet the query conditions, put it into the sub-query result integrity verification information VOcj. The RLj contains the transaction position information of the semantic transaction attribute value.<block-id,pn> , where block-id is the semantic block number, pn is the position in the semantic block, and VOcj includes intermediate nodes, child nodes, and the corresponding hash of the nodes that do not meet the query conditions;

[0022] Step 3.4: Based on the semantic block number block-id and the position pn within the semantic block in the sub-result location information RLj, obtain the complete semantic transaction and store it in the sub-query result Rj, and generate the sub-query result correctness verification information VOsj, which contains the hash values ​​of nodes that do not meet the query conditions;

[0023] Step 3.5: Collect the subquery results Rj and subverification information VOj generated in each blockchain, take the union of them, generate and return the complete traceability query result R and verification information VO, terminate the current calculation and wait for the next call;

[0024] The sub-verification information VOj includes sub-query result location information RLj, sub-query result integrity verification information VOcj, and sub-query result correctness verification information VOsj; the verification information VO includes query result location information RL, query result integrity verification information Voc, and query result correctness verification information VOs.

[0025] Step 3.6: After receiving the query results, the user regenerates the GTT root locally based on the query result location information RL and the query result integrity verification information VOc to verify the integrity of the transaction location information; and regenerates the Merkle root locally based on the source query result R and the query result correctness verification information VOs to verify the correctness of the transaction integrity information.

[0026] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0027] 1. The method provided by this invention is based on the SMBM blockchain storage model, which is divided by attributes and has semantics, to handle the problem of verifiable traceability query in multi-chain environment, and can realize efficient and verifiable traceability query in multi-blockchain environment.

[0028] 2. This invention provides a multi-chain verifiable tracing query method that constructs a two-layer blockchain index structure SMBI based on SMBM, consisting of two parts: S-Bitmap Index and S-GTT Index, to complete verifiable inter-chain tracing queries for shared attributes. Compared to traditional tracing query methods, the SMBI-based multi-chain verifiable tracing query method enables parallel execution between chains, improving query efficiency, and simultaneously supports verification of the correctness and integrity of the returned results. Especially when dealing with a large number of blockchains, where network transmission overhead gradually increases, the efficiency of multi-chain tracing queries will be significantly improved, providing a better user experience. Attached Figure Description

[0029] Figure 1 This is a flowchart of a verifiable traceability query method for a multi-chain environment according to an embodiment of the present invention;

[0030] Figure 2 This is a schematic diagram of the multi-chain tracing query model in the verifiable tracing query method for a multi-chain environment in an embodiment of the present invention;

[0031] Figure 3 This is a schematic diagram of the semantic block S-Block structure in the verifiable traceability query method for multi-chain environments in this embodiment of the invention;

[0032] Figure 4 This is a schematic diagram of the overall structure of the two-layer index SMBI in the verifiable traceability query method for multi-chain environments in this embodiment of the invention;

[0033] Figure 5 This is a flowchart of the process for constructing a two-layer index SMBI in the verifiable traceability query method for multi-chain environments in this embodiment of the invention;

[0034] Figure 6 This is a flowchart of the query process in the verifiable traceability query method for multi-chain environments in this embodiment of the invention. Detailed Implementation

[0035] To facilitate understanding of this application, a more comprehensive description of this application will be provided below with reference to the accompanying drawings.

[0036] Considering the cross-regional deployment of blockchains, executing queries sequentially across blockchains generates significant local computing load and network transmission overhead, severely impacting connection query efficiency and user experience. Furthermore, existing verification methods only guarantee the correctness of the returned results, lacking verification of the completeness of the results, thus affecting the trustworthiness of the results. Therefore, the purpose of this invention is to propose a verifiable traceability query method for multi-chain environments, which improves query efficiency compared to traditional query methods while ensuring the correctness and completeness of the results.

[0037] This embodiment presents a verifiable traceability query method for multi-chain environments, such as... Figure 1 As shown, it includes the following steps:

[0038] Step 1: Construct a blockchain storage model (SBSM) that is attribute-based and semantically meaningful;

[0039] Step 1.1: Construct a blockchain storage model SBSM; the blockchain storage model SBSM contains several semantic blockchains S, each semantic blockchain S consists of several semantic blocks S-Blocks combined in chronological order, S = S-Block1 + S-Block2 + S-Block3 + ... + S-Blockn, where S-Blocki is the i-th semantic block, and n is the number of semantic blocks; each semantic block S-Block contains two parts: a block header S-Block head and a block body S-Block body. The block header S-Block head contains the Merkle Root, the previous block hash PrevHash, the current block hash, the timestamp Time Stamp, and the index Merkle Root. The block body S-Block body contains a large number of semantic transactions, and the semantic transactions are stored in the following format:<Key,Columns> ;

[0040] In this embodiment, the SBSM consists of multiple semantic blocks, S = S-Block1 + S-Block2 + S-Block3 + ..., where S-Blocki is a semantic block. These semantic blocks are combined in chronological order to form a chain-like data structure, as shown below. Figure 2 As shown, an S-Block consists of two parts: a block header and a semantic block body, with the structure as follows: Figure 3 As shown. The S-Block head contains all the information of a traditional blockchain block structure, such as: Merkle Root, PrevHash, hash of the current block body, and timestamp. The Merkle Root is generated based on the hash of transaction data within the block, ensuring the immutability of transaction data within the block; PrevHash is the hash value of the previous block, ensuring the link between blocks; Hash is the unique identifier of the block, and the timestamp indicates the generation time of the block. In addition, an index Merkle Root is added to ensure the completeness of query results. The S-Block body contains a large number of semantic transactions;

[0041] Step 1.2: Define the components of semantic transactions to obtain the final blockchain storage model SBSM, which is divided by attributes and has semantics.

[0042] The semantic transaction is composed of: Key, which is a unique identifier of the semantic transaction and represents the attribute of the semantic transaction; Columns, which contain the attribute semantics and the corresponding semantic transaction attribute values, are as follows: Columns = {Ts = v1, SenID = v2, RecID = v3, Tname = v4, Attributesx}, where Ts is the timestamp of the semantic transaction, SenID is the initiator of the semantic transaction, RecID is the receiver of the semantic transaction, Tname is the semantic transaction type, and vi is the semantic transaction attribute value; Attributesx is a user-defined application-level attribute set and Attributesx = {attr1 = v5, attr2 = v6, ..., attrn = vm}, where attrj is the semantic transaction attribute, vi is the semantic transaction attribute value, and m is the number of semantic transaction attributes; different attribute sets are set for different application scenarios and semantic transaction types.

[0043] In this implementation, transportID is used as the key of the transport chain, and the semantic transaction's Attributesx = {vaccineID, hospital, temperature, vehicle} is as follows: Figure 3 As shown, in addition, columns in different types of semantic blockchains contain different attribute semantics and semantic transaction attribute values ​​corresponding to the attribute semantics. In the transportation chain, columns contain transportation information, and in the sales chain, columns contain sales information.

[0044] Step 2: Construct a two-layer blockchain index SBMI; the two-layer blockchain index consists of an inter-chain index S-BitmapIndex and an intra-chain index S-GTT Index;

[0045] In this embodiment, the inter-chain index S-Bitmap Index is used to accelerate inter-chain queries, and the intra-chain index S-GTTIndex is used to accelerate intra-chain queries while ensuring the integrity of query results. The specific structures are as follows: Figure 4 As shown, the build process is as follows: Figure 5 As shown, the specific process is as follows:

[0046] Step 2.1: Traverse the semantic transactions stored within the blockchain and construct the inter-chain index S-Bitmap Index;

[0047] Each inter-chain index S-Bitmap Index corresponds to a semantic transaction attribute. The inter-chain index includes several bitmaps, and each bitmap corresponds to a semantic transaction attribute value. The v-th bitmap indicates whether there is a semantic transaction with attrj of v-th value in each semantic blockchain. The i-th bit being '0' indicates that there is no semantic transaction with attrj of v-th value in the i-th semantic blockchain, and being '1' indicates that there is a semantic transaction with attrj of v-th value in the i-th semantic blockchain.

[0048] In this example, to accelerate inter-chain tracing queries, an inter-chain S-Bitmap Index is constructed. This index describes the distribution of each semantic transaction attribute value requiring tracing across all chains. Each semantic transaction attribute corresponds to a table-like S-Bitmap Index. The i-th bit in the v-th bitmap indicates whether the i-th semantic blockchain contains a transaction with the v-th attribute value. By scanning this index, all target semantic blockchains can be quickly obtained. A '0' value in the v-th bitmap indicates that the i-th semantic blockchain does not contain a semantic transaction with that attribute value, while a '1' value indicates that the i-th semantic blockchain contains a semantic transaction with that attribute value. Its structure is as follows: Figure 4 As shown in the upper left corner;

[0049] By obtaining the row corresponding to '010101' using the S-Bitmap Index, it can be seen that the information for vaccine ID1 is stored in production chain 2, transportation chain 2, and sales chain 2. Therefore, the target blockchain for this traceability query includes production chain 2, transportation chain 2, and sales chain 2.

[0050] Step 2.2: Traverse the semantic transactions within the blockchain, and construct the in-chain index S-GTT Index according to the Merkle prefix tree structure and the size of the v-th value of attrj;

[0051] The in-chain index includes several leaf nodes, which are the location information of the semantic transaction for taking the v-th value of attrj, including the block-id semantic block number and the position in the pn semantic block;

[0052] To accelerate in-chain tracing queries and provide proof of query result integrity in this implementation, an in-chain S-GTT Index is constructed. Within each blockchain, an S-GTT Index is built based on the specific semantic transaction attribute values ​​in the attr, and keyword filtering is achieved through a compressed prefix tree. The leaf nodes store the location information of global transactions, not transactions contained within that block, including: block-id (block number) and pn (position within the block). Finally, the node hash value is calculated using a bottom-up Merkle tree construction method, and its root node is stored in the block header. This avoids sequentially traversing all transactions within the block while ensuring query result integrity. Its structure is as follows: Figure 4 As shown on the right;

[0053] Step 3: Obtain the user's query conditions, perform the query based on the inter-chain index, and output the query results.

[0054] The process is as follows Figure 6 As shown, the specific process is as follows:

[0055] Step 3.1: Input a verifiable source tracing query Q = [key, track], where key is the unique identifier of the user's source tracing query object, and track represents the source tracing query;

[0056] In this example, the user inputs the query Q = [vaccineID = vaccineID1, track] based on the vaccine ID recorded on the vaccine and the blockchain where the vaccine manufacturer is located.

[0057] Step 3.2: Perform inter-chain queries based on the verifiable traceability query Q = [key, track] to obtain the S-Bitmap Index of the semantic transaction attribute corresponding to the key. Determine whether it is the target blockchain by whether the i-th bit in the v-th bitmap is '0' or '1'. Obtain the complete target blockchain in query Q. That is, when the corresponding bit is '1', it means that the corresponding blockchain is one of the target blockchains. When the corresponding bit is '0', skip the blockchain and obtain all the target semantic blockchains.

[0058] In this example, by obtaining the row corresponding to '100001000100' through the S-Bitmap Index, it can be seen that blockchains S-S1, S-T2, and S-V1 each contain partial information of the vaccine number vaccineID1. That is, the target blockchain for this traceability query includes chains S-S1, S-T2, and S-V1.

[0059] Step 3.3: Obtain the on-chain S-GTTIndex of the semantic transaction attribute value corresponding to the key on different target semantic blockchains. Traverse the index starting from the root node, determining whether the node meets the query conditions. If it meets the query conditions, further determine the node type. If it is an intermediate node, traverse its child nodes sequentially. If it is a leaf node, place it in the subquery result position information RLj, where j is the sequence number of the target semantic blockchain. If it does not meet the query conditions, place it in the subquery result integrity verification information VOcj. RLj contains the transaction position information of the semantic transaction attribute value.<block-id,pn> , where block-id is the semantic block number, pn is the position in the semantic block, and VOcj includes intermediate nodes, child nodes, and the corresponding hash of the nodes that do not meet the query conditions;

[0060] In this implementation, the node-corresponding hash is used to regenerate the Merkle Root index, ensuring the integrity of the query results; the leaf node of vaccineID = vaccineID1 is found through the S-GTT Index, and the sub-result position information RL = {(m,n),(q,n+4)} is obtained, and the query result integrity verification information VOc = {5e,de} is obtained.

[0061] Step 3.4: Based on the semantic block number block-id and the position pn within the semantic block in the sub-result location information RLj, obtain the complete semantic transaction and store it in the sub-query result Rj, and generate the sub-query result correctness verification information VOsj, which contains the hash values ​​of nodes that do not meet the query conditions;

[0062] In this implementation, VOs contains the hash values ​​of nodes that do not meet the query conditions to ensure the correctness of the query results.

[0063] Step 3.5: Collect the sub-query results Rj and sub-verification information VOj generated in each blockchain, take the union of the sets, generate and return the complete traceability query result R and verification information VO, terminate the current calculation and wait for the next call. The sub-verification information VOj includes sub-query result location information RLj, sub-query result integrity verification information VOcj, and sub-query result correctness verification information VOsj; the verification information VO includes query result location information RL, query result integrity verification information Voc, and query result correctness verification information VOs.

[0064] Step 3.6: After receiving the query results, the user regenerates the GTT root locally based on the query result location information RL and the query result integrity verification information VOc to verify the integrity of the transaction location information; and regenerates the Merkle root locally based on the source query result R and the query result correctness verification information VOs to verify the correctness of the transaction integrity information.

Claims

1. A verifiable traceability query method for multi-chain environments, characterized in that, Includes the following steps: Step 1: Construct a blockchain storage model (SBSM) that is attribute-based and semantically meaningful; Step 1 specifically includes the following steps: Step 1.1: Construct the Blockchain Storage Model (SBSM); The blockchain storage model SBSM comprises several semantic blockchains S, each consisting of several semantic blocks S-Blocks arranged chronologically, where S = S-Block1 + S-Block2 + S-Block3 + ... + S-Blockn, and S-Blocki is the i-th semantic block, and n is the number of semantic blocks. Each semantic block S-Block consists of a block header (S-Block head) and a block body (S-Block body). The block header includes a Merkle Root, a PrevHash (prev hash), a current block hash, a Timestamp, and an Index Merkle Root. The block body contains numerous semantic transactions, stored in the following format:<Key,Columns> ; Step 1.2: Define the composition of semantic transactions to obtain the final attribute-based and semantically-integrated blockchain storage model SBSM. The semantic transaction is composed of: Key, which is the unique identifier of the semantic transaction, representing the attribute of the semantic transaction; Columns, which contain the attribute semantics and the corresponding semantic transaction attribute values, are as follows: Columns={Ts=v1,SenID=v2,RecID=v3,Tname=v4,Attributesx}, where Ts is the timestamp of the semantic transaction, SenID is the initiator of the semantic transaction, RecID is the receiver of the semantic transaction, Tname is the semantic transaction type, vi is the semantic transaction attribute value, and m is the number of semantic transaction attributes; Attributesx is a user-defined application-level attribute set and Attributesx={attr1=v5,attr2=v6,..., attrn=vm}, where attrj is the semantic transaction attribute and vi is the semantic transaction attribute value; different attribute sets are set for different application scenarios and semantic transaction types. Step 2: Construct a two-layer blockchain index SBMI; the two-layer blockchain index consists of an inter-chain index S-Bitmap Index and an intra-chain index S-GTT Index; Step 2 specifically includes the following steps: Step 2.1: Traverse the semantic transactions stored within the blockchain and construct the inter-chain index S-Bitmap Index; Each inter-chain index S-Bitmap Index corresponds to a semantic transaction attribute. The inter-chain index includes several bitmaps, and each bitmap corresponds to a semantic transaction attribute value. The v-th bitmap indicates whether there is a semantic transaction with attrj of v-th value in each semantic blockchain. The i-th bit is '0', which means that there is no semantic transaction with attrj of v-th value in the i-th semantic blockchain, and '1' means that there is a semantic transaction with attrj of v-th value in the i-th semantic blockchain. Step 2.2: Traverse the semantic transactions within the blockchain, and construct the in-chain index S-GTT Index according to the Merkle prefix tree structure and the size of the v-th value of attrj; The in-chain index includes several leaf nodes, which are the location information of the semantic transaction for taking the v-th value of attrj, including the block-id semantic block number and the position in the pn semantic block; Step 3: Obtain the user's query conditions, perform the query based on the two-layer blockchain index SBMI, and output the query results.

2. The verifiable traceability query method for multi-chain environments according to claim 1, characterized in that, Step 3 specifically includes the following steps: Step 3.1: Input a verifiable traceability query Q=[key,track], where key is the unique identifier of the user's traceability query object, and track represents the traceability query; Step 3.2: Perform inter-chain queries based on the verifiable traceability query Q=[key,track] to obtain the S-Bitmap Index of the semantic transaction attribute corresponding to the key. Determine whether it is the target blockchain by whether the i-th bit in the v-th bitmap is '0' or '1'. Obtain the complete target blockchain in query Q. That is, when the corresponding bit is '1', it means that the corresponding blockchain is one of the target blockchains. When the corresponding bit is '0', skip the blockchain and obtain all the target semantic blockchains. Step 3.3: Obtain the on-chain S-GTT Index of the semantic transaction attribute value corresponding to the key on different target semantic blockchains. Traverse the index starting from the root node, and determine whether the node meets the query conditions. If it meets the query conditions, further determine the node type. If it is an intermediate node, traverse its child nodes in sequence. If it is a leaf node, put it into the sub-query result position information RLj, where j is the sequence number of the target semantic blockchain. If it does not meet the query conditions, put it into the sub-query result integrity verification information VOcj. The RLj contains the transaction position information of the semantic transaction attribute value.<block-id,pn> , where block-id is the semantic block number, pn is the position in the semantic block, and VOcj includes intermediate nodes, child nodes, and the corresponding hash of the nodes that do not meet the query conditions; Step 3.4: Based on the semantic block number block-id and the position pn within the semantic block in the sub-result location information RLj, obtain the complete semantic transaction and store it in the sub-query result Rj, and generate the sub-query result correctness verification information VOsj, which contains the hash values ​​of nodes that do not meet the query conditions; Step 3.5: Collect the subquery results Rj and subverification information VOj generated in each blockchain, take the union of them, generate and return the complete traceability query result R and verification information VO, terminate the current calculation and wait for the next call; The sub-verification information VOj includes sub-query result location information RLj, sub-query result integrity verification information VOcj, and sub-query result correctness verification information VOsj; the verification information VO includes query result location information RL, query result integrity verification information Voc, and query result correctness verification information VOs. Step 3.6: After receiving the query results, the user regenerates the GTT root locally based on the query result location information RL and the query result integrity verification information VOc, in order to verify the integrity of the transaction location information; Based on the source tracing query result R and the query result correctness verification information VOs, a Merkle root is regenerated locally to verify the correctness of the transaction integrity information.

Citation Information

Patent Citations

  • Verifiable query optimization method for reputation-behavior associated double block chains

    CN113535732A