A query and verification method for cross-chain transactions on alliance chains
By adopting the RSA cryptographic accumulator algorithm to construct a new chain structure in cross-chain transactions of the alliance chain, the problem of low efficiency of cross-chain transaction queries is solved, fast and batch query verification is achieved, and the legitimacy and efficiency of cross-chain transactions are ensured.
Patent Information
- Application Number
- CN202310904870.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2043-07-21
AI Technical Summary
In the existing technology, the data query efficiency and verification efficiency of cross-chain transactions in consortium chains are low, especially when the complete transaction copy of the target chain is not stored, the legitimacy of the cross-chain transaction cannot be effectively verified.
A query verification method for cross-chain transactions on alliance chains is adopted. The user query set is encapsulated through the source chain and sent to the target chain using the cross-chain gateway. The target chain generates a proof of the user query set and uses the RSA cryptographic accumulator algorithm to construct a new chain structure for batch verification. Finally, the verifier performs rapid verification on the source chain.
It realizes the rapid query and verification of cross-chain transactions, improves the efficiency of data query and verification, and can perform batch verification of user query sets to ensure the legitimacy and correctness of query results.
Smart Images

Figure CN116932650B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information technology, and in particular relates to a query and verification method for alliance chain cross-chain transactions. Background Art
[0002] Blockchain technology is increasingly being used in various fields, generating ever-increasing amounts of data. However, the primary challenge facing blockchain implementation is inefficient data querying and the resulting uncertainty surrounding the authenticity of query results. This is particularly true when it comes to cross-chain transaction queries. Traditional solutions rely on locally storing the target chain's data in real time to verify the legitimacy of the original cross-chain transaction. This approach requires nodes conducting cross-chain transactions to be legitimate users of both the source and target chains, meaning they must run both the source and target chains. This consumes significant storage and computing resources, and verification efficiency is low. Without storing a complete copy of the target chain's transactions, or even partial transaction data such as block headers and complete transaction hash lists, cross-chain transaction legitimacy verification is impossible, and transaction-by-transaction verification is inefficient. Therefore, ensuring the legitimacy of data verification and improving transaction verification efficiency are pressing challenges. Summary of the Invention
[0003] To address the low efficiency of cross-chain transaction verification on alliance chains, this paper proposes a query verification method for cross-chain transactions on alliance chains to ensure the legitimacy of data verification and improve transaction verification efficiency, including:
[0004] S1: The source chain encapsulates all cross-chain transaction query requests within the chain into a user query set, and then uses the cross-chain gateway to send the user query set to the target chain;
[0005] S2: The target chain queries the target block where the cross-chain transaction is located based on the cross-chain transaction query request in the user query set, encapsulates all the queried target blocks into a target block set, and sends the target block set to the constructor;
[0006] S3: The constructor parses all transactions in the target block set and encrypts the transactions in the target block set based on the RSA cryptographic accumulator algorithm to generate a new chain structure. It then batch-verifies the transactions corresponding to the user query set in the target block set based on the new chain structure to generate a proof of the user query set. The proof of the user query set is then returned to the target chain.
[0007] S4: The target chain sends the proof of the user query set to the source chain through the cross-chain gateway; the source chain sends the proof of the user query set to the validator, the validator verifies the proof of the user query set and returns the verification result to the source chain; the source chain uploads the verification result of the user query set proof to the chain and returns it to the user who initiated the cross-chain transaction query request.
[0008] Preferably, encrypting the transactions in the target block set based on the RSA cryptographic accumulator algorithm to generate a new chain structure includes:
[0009] S31: Let G T is a multiplicative cyclic group of prime order Q, g represents G T The generator of G T Randomly select large prime numbers p and q, and choose hash function Hash = Hash2prime();
[0010] S32: For each transaction Tx in the target block set i Generate its header information H i , that is, H i =Hash2Prime(Tx i );
[0011] S33: According to each transaction Tx in the target block set i The header information of the chain structure is generated by H head =∏H i and Tx i Represents the i-th transaction in the target block set;
[0012] S34: Calculate each transaction Tx in the target block set i Auxiliary accumulated value H j Represents the header information of the j-th transaction in the target block set;
[0013] S34: Generate a new chain structure according to the header information of the chain structure, the header information of each transaction in the target block set, and the auxiliary accumulated value, where mod N represents a modular operation on N, and N is the product of p and q.
[0014] Preferably, the step of performing batch verification on transactions corresponding to the user query set in the target block set according to the new chain structure to generate proof of the user query set includes:
[0015] S301: When the user query set contains only one transaction Tx s1 When , the constructor generates a proof of the user query set {Tx s1 ,H s1 ,acc s1}; Among them, H s1 Indicates transaction Tx s1 Header information, acc s1 Indicates transaction Tx s1 Auxiliary accumulated value of
[0016] When there are multiple transactions in the user query set, calculate in, Represents the jth transaction Tx in the user query set sj Header information;
[0017] S302: Determine gcd(H head ,μ) is 1, if gcd(H head ,μ) is 1, then execute step S303, otherwise execute step S304;
[0018] S303: Store all transactions in the user query set into set Set1 and generate a proof of the user query set {Set1, λ1, Flag1}, where λ1 = μ and Flag1 = FLASE;
[0019] S304: Calculate H head and The greatest common divisor of according to The decomposed prime number set and the header information of the transactions in the user query set are used to find the corresponding transactions. All the found transactions are put into the set Set2, and the first part of the proof of the user query set {Set2,λ2,Flag2} is generated. Flag2 = FLASE; and according to The decomposed prime number set and the header information of the transactions in the user query set are used to find the corresponding transactions, and all the found transactions are put into the member set Set3; the second part of the proof of the user query set {Set3,λ3,Flag3} is generated. Flag3=TURE; then the proof of the user query set includes: {Set2,λ2,Flag2} and {Set3,λ3,Flag3},Flag k It represents the commitment signature of the constructor to prove the user query set, k = 1, 2, 3, and Factor() represents the prime number factorization function.
[0020] Preferably, the validator verifies the proof of the user query set including:
[0021] When the user query set has only one transaction Tx s1 When , the validator obtains the header information H of the new chain structure head and w; and judge gcd(H head ,H s1 ) is 1, if gcd(H head ,H s1 ) is not 1, then judge Is it equal to w? If so, the verification is passed and {Tx s1 , TRUE′};
[0022] When the user query contains multiple transactions, the validator obtains the header information H of the new chain structure. head and w; map each transaction in the user query set to a prime number h sj =Hash2Prime(Set sj ), calculate θ = ∏h sj If Flag k Equal to TURE, judgment Is it true? If so, return {Set k ,λ k ,Flag k ,TURE′}, otherwise, return {Set k ,λ k ,Flag k ,FALSE′};
[0023] If Flag k Equal to FALSE, judge gcd(θ,H head )=1 is true, if true, return {Set k ,λ k ,Flag k ,TURE′}, otherwise, it returns {Set sj ,λ sj ,Flag sj ,FALSE′}, where TURE′ and FALSE′ represent the verifier’s commitment signature on the user’s query set proof.
[0024] Preferably, the validator and constructor are composed of multiple user client nodes in the target chain and the source chain respectively.
[0025] The present invention has at least the following beneficial effects:
[0026] The method of the present invention includes four main bodies: source chain, target chain, constructor and verifier, to realize fast query and verification of cross-chain transactions. By using RSA-based cryptographic accumulator, it can not only realize fast query and verification of single transactions, but also realize batch query and verification of user query sets, providing a new query method for cross-chain data query and improving the efficiency of query and verification.
[0027] The present invention implements a new chain structure construction based on RSA cryptographic accumulators, namely a constructor. The new chain structure provides proof of query results and can also divide the query set to distinguish whether the elements in the query set belong to the transaction of the target chain.
[0028] The verifier in the method of the present invention is a subject of a verification process, and the result proof sent by the target chain to the source chain can quickly verify its legality, correctness and effectiveness, thereby improving the efficiency of verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a schematic diagram of the process framework of the method of the present invention;
[0030] Figure 2 It is a schematic diagram of the chain structure of the present invention. DETAILED DESCRIPTION
[0031] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0032] Among them, the accompanying drawings are only for illustrative purposes and represent only schematic diagrams rather than actual pictures, and should not be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the dimensions of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the accompanying drawings.
[0033] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "back", etc. indicating directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0034] See also Figure 1 The present invention provides a query and verification method for cross-chain transactions on alliance chains, comprising:
[0035] S1: The source chain encapsulates all cross-chain transaction query requests within the chain into a user query set, and then uses the cross-chain gateway to send the user query set to the target chain;
[0036] In this embodiment, both the source chain and the target chain are consortium chains;
[0037] In this embodiment, the cross-chain transaction query request within the source chain is initiated by the user node in the source chain, which contains the target chain information, transaction information and query request information;
[0038] Preferably, the cross-chain gateway is primarily responsible for interaction and communication with the relay chain or other cross-chain gateways. All operations specific to the application chain are encapsulated within the application chain plug-in. A set of plug-in interfaces suitable for cross-chain interaction is defined based on the interaction requirements between the cross-chain gateway and the application chain. This allows the cross-chain gateway to connect to any new application chain without having to modify itself. Instead, a new application chain plug-in can be developed based on the defined interface.
[0039] Preferably, in this embodiment, the user query set includes cross-chain transaction query request information of one or more users;
[0040] S2: The target chain queries the target block where the cross-chain transaction is located based on the cross-chain transaction query request in the user query set, encapsulates all the queried target blocks into a target block set, and sends the target block set to the constructor;
[0041] S3: The constructor parses all transactions in the target block set and encrypts the transactions in the target block set based on the RSA cryptographic accumulator algorithm to generate a new chain structure. It then batch-verifies the transactions corresponding to the user query set in the target block set based on the new chain structure to generate a proof of the user query set. The proof of the user query set is then returned to the target chain.
[0042] See also Figure 2 Preferably, the step of encrypting the transactions in the target block set based on the RSA cryptographic accumulator algorithm to generate a new chain structure includes:
[0043] S31: Let G T is a multiplicative cyclic group of prime order Q, g represents G T The generator of G T Randomly select large prime numbers p and q, and choose hash function Hash = Hash2prime();
[0044] S32: For each transaction Tx in the target block set i Generate its header information H i , that is, H i =Hash2Prime(Tx i );
[0045] S33: According to each transaction Tx in the target block set iThe header information of the chain structure is generated by H head =∏H i and Tx i Represents the i-th transaction in the target block set;
[0046] S34: Calculate each transaction Tx in the target block set i Auxiliary accumulated value H j Represents the header information of the j-th transaction in the target block set;
[0047] S34: Generate a new chain structure according to the header information of the chain structure, the header information of each transaction in the target block set, and the auxiliary accumulated value, where modN represents a modular operation on N, and N is the product of p and q.
[0048] like Figure 2 As shown, the present invention will H head The header information of the chain structure composed of w and transaction Tx i Header information and transaction Tx i The auxiliary accumulated values are combined into a structure data, and the structure data of all transactions parsed in the target block set are arranged in sequence to generate a new chain structure.
[0049] Preferably, the step of performing batch verification on transactions corresponding to the user query set in the target block set according to the new chain structure to generate proof of the user query set includes:
[0050] S301: When the user query set contains only one transaction Tx s1 When , the constructor generates a proof of the user query set {Tx s1 ,H s1 ,acc s1}; Among them, H s1 Indicates transaction Tx s1 Header information, acc s1 Indicates transaction Tx s1 Auxiliary accumulated value of
[0051] When there are multiple transactions in the user query set, calculate in, Represents the jth transaction Tx in the user query set sj Header information;
[0052] S302: Determine gcd(H head ,μ) is 1, if gcd(H head ,μ) is 1, then execute step S303, otherwise execute step S304;
[0053] S303: Store all transactions in the user query set into set Set1 and generate a proof of the user query set {Set1, λ1, Flag1}, where λ1 = μ and Flag1 = FLASE;
[0054] S304: Calculate H head and The greatest common divisor of according to The decomposed prime number set and the header information of the transactions in the user query set are used to find the corresponding transactions. All the found transactions are put into the set Set2, and the first part of the proof of the user query set {Set2,λ2,Flag2} is generated. Flag2 = FLASE; and according to The decomposed prime number set and the header information of the transactions in the user query set are used to find the corresponding transactions, and all the found transactions are put into the member set Set3; the second part of the proof of the user query set {Set3,λ3,Flag3} is generated. Flag3=TURE; then the proof of the user query set includes: {Set2,λ2,Flag2} and {Set3,λ3,Flag3},Flag k It represents the commitment signature of the constructor to prove the user query set, k = 1, 2, 3, and Factor() represents the prime number factorization function.
[0055] In this embodiment, for example, the header information of transaction A, i.e. H A =Hash2prime(A), if The decomposed prime number contains the header information H of transaction A A , it proves that transaction A is not in the target chain. The constructor generates a commitment signature with an error FLASE; if The decomposed prime number contains the header information H of transaction A A , it proves that transaction A belongs to the target chain block, and generates the correct commitment signature TURE.
[0056] Preferably, in this embodiment, the constructor is composed of user nodes in multiple source chains and user nodes in multiple target chains; all user nodes in the constructor jointly perform batch verification on all transactions in the user query set to generate a proof of the user query set. When there is only one cross-chain transaction request in the user query set, the constructor directly returns the proof of the user query set.
[0057] S4: The target chain sends the proof of the user query set to the source chain through the cross-chain gateway; the source chain sends the proof of the user query set to the validator, the validator verifies the proof of the user query set and returns the verification result to the source chain; the source chain uploads the verification result of the user query set proof to the chain and returns it to the user who initiated the cross-chain transaction query request.
[0058] Preferably, the validator verifies the proof of the user query set including:
[0059] When the user query set has only one transaction Tx s1 When , the validator obtains the header information H of the new chain structure head and w; and judge gcd(H head ,H s1 ) is 1, if gcd(H head ,H s1 ) is not 1, then judge Is it equal to w? If so, the verification is passed and {Tx s1 , TRUE′};
[0060] When the user query contains multiple transactions, the validator obtains the header information H of the new chain structure. head and w; map each transaction in the user query set to a prime number h sj =Hash2Prime(Set sj ), calculate θ = ∏h sj If Flag k Equal to TURE, judgment Is it true? If so, return {Set k ,λ k ,Flag k ,TURE′}, otherwise, return {Set k ,λ k ,Flag k ,FALSE′};
[0061] If Flag k Equal to FALSE, judge gcd(θ,H head )=1 is true, if true, return {Set k ,λ k ,Flag k ,TURE′}, otherwise, it returns {Set sj ,λ sj ,flag sj ,FALSE′}, where TURE′ and FALSE′ represent the verifier’s commitment signature on the user’s query set proof.
[0062] The method of the present invention includes four main bodies: source chain, target chain, constructor and verifier, to realize fast query and verification of cross-chain transactions. By using RSA-based cryptographic accumulator, it can not only realize fast query and verification of single transactions, but also realize batch query and verification of user query sets, providing a new query method for cross-chain data query and improving the efficiency of query and verification.
[0063] The present invention implements a new chain structure construction based on RSA cryptographic accumulators, namely a constructor. The new chain structure provides proof of query results and can also divide the query set to distinguish whether the elements in the query set belong to the transaction of the target chain.
[0064] The verifier in the method of the present invention is a subject of a verification process, and the result proof sent by the target chain to the source chain can quickly verify its legality, correctness and effectiveness, thereby improving the efficiency of verification.
[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.
Claims
1. A query and verification method for cross-chain transactions on alliance chains, characterized in that: include: S1: The source chain encapsulates all cross-chain transaction query requests within the chain into a user query set, and then uses the cross-chain gateway to send the user query set to the target chain; S2: The target chain queries the target block where the cross-chain transaction is located based on the cross-chain transaction query request in the user query set, encapsulates all the queried target blocks into a target block set, and sends the target block set to the constructor; S3: The constructor parses all transactions in the target block set and encrypts the transactions in the target block set based on the RSA cryptographic accumulator algorithm to generate a new chain structure. It then batch-verifies the transactions corresponding to the user query set in the target block set based on the new chain structure to generate proof of the user query set. And return the proof of the user query set to the target chain; The process of encrypting the transactions in the target block set based on the RSA cryptographic accumulator algorithm to generate a new chain structure includes: S31: Let G T is a multiplicative cyclic group of prime order Q, g represents G T The generator of G T Randomly select large prime numbers p and q, and choose hash function Hash = Hash2prime(); S32: For each transaction Tx in the target block set i Generate its header information H i , that is, H i =Hash2Prime(Tx i ); S33: According to each transaction Tx in the target block set i The header information of the chain structure is generated by H head =∏H i and Tx i Represents the i-th transaction in the target block set; S34: Calculate each transaction Tx in the target block set i Auxiliary accumulated value H j Represents the header information of the j-th transaction in the target block set; S35: Generate a new chain structure according to the header information of the chain structure, the header information of each transaction in the target block set, and the auxiliary accumulated value, where modN represents a modulo operation on N, where N is the product of p and q; S4: The target chain sends the proof of the user query set to the source chain through the cross-chain gateway; the source chain sends the proof of the user query set to the validator, the validator verifies the proof of the user query set and returns the verification result to the source chain; the source chain uploads the verification result of the user query set proof to the chain and returns it to the user who initiated the cross-chain transaction query request.
2. A query and verification method for cross-chain transactions on alliance chains according to claim 1, characterized in that: The step of batch-verifying transactions corresponding to the user query set in the target block set according to the new chain structure to generate proof of the user query set includes: S301: When the user query set contains only one transaction Tx s1 When , the constructor generates a proof of the user query set {Tx s1 ,H s1 ,acc s1 }; Among them, H s1 Indicates transaction Tx s1 Header information, acc s1 Indicates transaction Tx s1 Auxiliary accumulated value of When there are multiple transactions in the user query set, calculate in, Represents the jth transaction Tx in the user query set sj Header information; S302: Determine gcd(H hea ,μ) is 1, if gcd(H head ,μ) is 1, then execute step S303, otherwise execute step S304; S303: Store all transactions in the user query set into set Set1 and generate a proof of the user query set {Set1, λ1, Flag1}, where λ1 = μ and Flag1 = FLASE; S304: Calculate H head and The greatest common divisor of according to The decomposed prime number set and the header information of the transactions in the user query set are used to find the corresponding transactions. All the found transactions are put into the set Set2, and the first part of the proof of the user query set {Set2,λ2,Flag2} is generated. Flag2 = FLASE; and according to The decomposed prime number set and the header information of the transactions in the user query set are used to find the corresponding transactions, and all the found transactions are put into the member set Set3; the second part of the proof of the user query set {Set3,λ3,Flag3} is generated. Flag3=TRUE; then the proof of the user query set includes: {Set2,λ2,Flag2} and {Set3,λ3,Flag3},Flag k It represents the commitment signature of the constructor to prove the user query set, k = 1, 2, 3, and Factor() represents the prime number factorization function.
3. A query and verification method for cross-chain transactions on alliance chains according to claim 2, characterized in that: The verifier verifies the proof of the user query set including: When the user query set has only one transaction Tx s1 When , the validator obtains the header information H of the new chain structure head and w; and judge gcd(H head ,H s1 ) is 1, if gcd(H head ,H s1 ) is not 1, then judge Is it equal to w? If so, the verification is passed and {Tx s1 , TRUE′}; When the user query contains multiple transactions, the validator obtains the header information H of the new chain structure. head and w; map each transaction in the user query set to a prime number h sj =Hash2Prime(Set sj ), calculate θ = ∏h sj If Flag k Equal to TURE, judgment Is it true? If so, return {Set k ,λ k ,Flag k ,TURE′}, otherwise, return {Set k ,λ k ,Flag k ,FALSE′}; If Flag k Equal to FALSE, judge gcd(θ,H head )=1 is true, if true, return {Set k ,λ k ,Flag k ,TURE′}, otherwise, it returns {Set sj ,λ sj ,Flag swj ,FALSE′}, where TURE′ and FALSE′ represent the verifier’s commitment signature on the user’s query set proof.
4. A query and verification method for cross-chain transactions on alliance chains according to claim 1, characterized in that: The validator and constructor are composed of multiple user client nodes in the target chain and the source chain respectively.
Citation Information
Patent Citations
Cross-chain data verification method and device, equipment and storage medium
CN112650742A
Block chain-based cross-border data flow and supervision system
CN115277122A