Cross-account cross-block chain platform data transaction auditing method
Through block verification and symmetric encryption technology, security and efficiency issues in blockchain cross-chain data transactions are solved, and efficient and secure data audits are achieved, suitable for finance, supply chain, medical and health fields.
Patent Information
- Application Number
- CN202410958316.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-15
AI Technical Summary
In the blockchain cross-chain scenario, the security, privacy and efficiency of data transactions are difficult to effectively solve. The existing technology has large computing overhead and communication overhead, which cannot meet the needs of cross-chain data transactions.
Use block verification to ensure data accuracy, and use symmetric encryption technology to protect transaction data privacy. Record audit trajectory through relay chains to ensure transparency and immutability of the audit process, including parameter initialization, data preprocessing, and data correctness audit , data integrity audit and data decryption and other links.
It realizes an efficient and secure data audit framework, improves the accuracy, integrity and privacy protection of cross-chain data transactions, reduces computing resource consumption and communication load, and is suitable for finance, supply chain, medical and health fields.
Smart Images

Figure CN118967316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a cross-account and cross-blockchain platform data transaction audit method, belonging to the technical field of cross-blockchain transaction data audit. Background Art
[0002] In recent years, blockchain technology has been evolving as a revolutionary technology and has brought tremendous changes to all walks of life. One of the core characteristics of blockchain is its decentralization and immutability, which provides a transparent distributed database for user nodes and has great potential in data transactions and asset transfers. However, the limitations of a single blockchain network are becoming increasingly prominent, such as performance bottlenecks, application restrictions, and the "data island" problem caused by the difficulty of interoperability between different blockchain networks. In order to solve these challenges, blockchain cross-chain technology came into being.
[0003] The cross-chain technology of blockchain aims to realize the data transmission and exchange between different blockchain networks, thereby promoting the development of multi-chain interconnection. The emergence of this technology has provided huge opportunities for various industries. For example, in the fields of finance, supply chain management, and medical health, cross-chain technology of blockchain can be used to realize functions such as data sharing and asset transfer, thereby improving efficiency, reducing costs, and creating a new business model. Specifically, in the financial industry, cross-chain data transactions can realize the intercommunication of user information between different financial institutions, promote the transfer and settlement of assets and the improvement of user information; in the logistics industry, cross-chain data transactions can realize the intercommunication of product information on different supply chains and improve the collaborative management capabilities of all parties; in the field of medical health, cross-chain data transactions can realize the intercommunication of patient information between different medical institutions, forming a more comprehensive information management system for patients.
[0004] However, when it comes to data transactions in cross-chain scenarios, designing an audit solution for cross-chain data transactions faces many challenges, including security, privacy protection, and transaction efficiency. For example, in terms of security and privacy, the data receiver must ensure that the correct data is received and the data itself will not be leaked or intercepted during the transaction, while the data sender must be able to ensure that the data receiver cannot deny receiving the correct data. In addition, due to the performance limitations of blockchain and cross-chain blockchain technology itself, the cross-chain network information throughput is relatively low, resulting in transaction efficiency and overhead becoming a challenging issue in designing a cross-chain data transaction audit solution.
[0005] In order to solve the security and privacy of data auditing, domestic and foreign scholars have proposed some data auditing methods using various encryption tools, such as homomorphic encryption systems and zero-knowledge proof systems. However, since these data auditing solutions based on traditional time-consuming cryptographic tools have large computational and communication overheads, they cannot be well applied to cross-chain scenarios. Therefore, there is still a need for an auditing solution suitable for cross-chain data transactions. Summary of the invention
[0006] In view of this, the present invention provides a data transaction audit method for cross-blockchains, which ensures data correctness through block verification, uses symmetric encryption technology to protect transaction data privacy, and records audit tracks on the relay chain to ensure the transparency and non-tamperability of the audit process.
[0007] The technical solution for implementing the present invention is as follows:
[0008] In order to achieve the above object, the present invention adopts the following technical solutions to achieve
[0009] A data transaction audit method for cross-blockchains, where the data sender and data receiver are located in different blockchains, includes the following five steps: parameter initialization, data preprocessing, data correctness audit, data integrity audit, and data decryption;
[0010] Parameter initialization: generate initial parameters and smart contracts;
[0011] Data preprocessing: The data receiver sends a transaction request and pledges assets; when the data sender agrees to the transaction request, the data is divided into blocks and encrypted, the encryption key and encrypted data blocks are hashed, and the processing results are uploaded to the relay chain; the data sender also generates labels for the encrypted database, generates file metadata, and uploads it to the relay chain;
[0012] Data correctness audit: The data receiver generates a random number set; the data sender sends the auxiliary information corresponding to the secret key and the verification key in the random number set, as well as the corresponding encrypted data and the auxiliary information for verifying the encrypted data file to the data receiver; the data receiver checks the correctness of the secret key and the encrypted data based on the auxiliary information and the hash processing result stored in the relay chain, and further confirms whether to continue the transaction. If it is confirmed to continue the transaction, the data sender sends all the encrypted data file blocks;
[0013] Data integrity audit: The data sender sends an audit request and sends the response data to the blockchain; the data receiver generates an integrity certificate according to the data sender's requirements; the cross-chain gateway publishes the verification results of the certificate;
[0014] Data decryption: The data sender sends the key used when encrypting the data file block and verifies the merkle tree root generated by the key. If it is correct, the data sender can transfer the tokens paid by the data sender from the smart contract.
[0015] Furthermore, the initial parameter generation in the parameter initialization phase of the present invention is implemented using the Setup and KeyGen algorithms, wherein the administrator executes the Setup algorithm to generate the initial parameters {e, g1, g2, q, H0, H1, H2}, and the data sender executes the KeyGen algorithm to generate a key pair (U, α).
[0016] Furthermore, in the data preprocessing process of the present invention, when the data sender agrees to the transaction request, the data is divided into blocks and encrypted, the encryption key and the encrypted data block are hashed, and the processing result is uploaded to the relay chain. The specific process is as follows:
[0017] First, the data sender divides the data into blocks, divides the data F into n blocks, and denotes the i-th block as f i ;
[0018] Secondly, encrypt with AES, using the generated encryption key k i Encrypted file i Get the encrypted data block ef i , and use the hash function H2 in the initial parameters to encrypt the secret key k i and encrypted data block ef i Processing is performed, and the processing results are used as leaf nodes of the merkle tree. Merkle trees are constructed for the two groups of leaf nodes respectively;
[0019] {H2(ef i )|i=1, 2,..., n}, {H2(k i )|i=1,2,...,n},
[0020] Finally, the file root hash H is encrypted on the relay chain ef and the key root hash H k .
[0021] Furthermore, in the data preprocessing process of the present invention, the data sender also generates labels for the encrypted database and file metadata at the same time. The specific process is as follows:
[0022] First, calculate the timestamp factor Where t is the timestamp and H0 is the hash function;
[0023] Second, randomly select And based on the private key α, each encrypted data block ef i Calculate label σi ,
[0024]
[0025] Among them, fname is the name of the file, H1 is the hash function;
[0026] Finally, calculate the file metadata K = fname||n||u, where n is the number of data blocks; upload to the relay chain ({σ i}, K).
[0027] Furthermore, in the data correctness audit phase of the present invention, the data sender sends the secret key k corresponding to the random number set. i and auxiliary information of the verification key And the corresponding encrypted data ef i and auxiliary information for verifying encrypted data files The recipient of the sent data (sent off-chain), the auxiliary information of the verification key To verify k through the root hash i The path information required for the verification of the encrypted data file To verify EF by root hash i The path information required.
[0028] Furthermore, in the data correctness audit stage of the present invention, the data receiver checks the correctness of the secret key and the encrypted data based on the auxiliary information and the hash processing result stored in the relay chain. The specific process is as follows: the data receiver passes the encrypted data file ef i Auxiliary information With H2(ef i ) generates a root hash and compares it with the H ef Compare and determine whether the two are consistent to check the encrypted data file ef i The data receiver passes the secret key k i Auxiliary information With H2(k i ) generates a root hash and compares it with the key root hash H k Compare and determine whether the two are consistent to check the secret key k i correctness.
[0029] Furthermore, in the data correctness audit stage, the present invention decrypts ef i Get f i , by checking f iAfter checking whether the content meets the requirements, if the data recipient is willing to continue the transaction, the transaction identifier is returned, the transaction token is pledged in the on-chain smart contract, and the address of the data recipient is entered. The data sender sends (off-chain) all encrypted data file blocks to the data recipient. i , metadata κ and timestamp factor If the data recipient is unwilling to continue the transaction, a no-transaction flag is returned.
[0030] Furthermore, in the data integrity audit stage of the present invention, the data receiver generates an integrity certificate according to the requirements of the data sender. The specific process is as follows:
[0031] The data encryptor randomly generates a corresponding random number for each encrypted data block and obtains a random number set Q;
[0032] The data receiver receives the encrypted data block ef i , encrypted data block mark σ i and timestamp factor Combined with the random number set, the Response2 response function is used for calculation to generate integrity proof parameters.
[0033] Furthermore, in the data decryption phase of the present invention, when the verification result of the cross-chain gateway’s published proof is verified as passed, the data sender sends a packet containing all the encryption keys k i transactions; the cross-chain gateway is composed of {k i |i=1,2,...,n} to form a merkle tree with root hash h k Verification, if h k ≠H k , the verification fails; otherwise, the verification succeeds.
[0034] Furthermore, after successful verification, the smart contract will send the token to the data sender's account after a set period of time. Within the set period of time, if the data receiver believes that the key has not been successfully decrypted, he can submit a request containing the corresponding key k. i With encrypted file ef i After the transaction is verified by the cross-chain gateway, you can retrieve your own tokens.
[0035] Beneficial Effects
[0036] First, the present invention aims to make up for the defects of existing cross-chain data auditing technology, especially the auditing problems faced in processing cross-chain data transactions of blockchain, such as poor security, lack of privacy protection, and low efficiency. An efficient and secure data auditing framework is constructed using the theoretical basis of bilinear mapping and cryptographic problems. This framework ensures data correctness through block verification, uses symmetric encryption technology to protect transaction data privacy, and records audit tracks on the relay chain to ensure the transparency and non-tamperability of the audit process. Compared with the existing technology, the present invention has significant advantages in the correctness, integrity, data privacy protection and transaction efficiency of cross-chain data transactions.
[0037] Second, the present invention not only improves the audit efficiency of cross-chain data transactions, but also enhances data privacy protection. It is shown through theoretical analysis and experimental verification that it performs well in terms of computing resource consumption, communication load and storage requirements, and has the feasibility of practical application. The present invention provides an effective way to achieve efficient, secure and low-cost data auditing in a cross-chain environment, promotes multi-chain data sharing and asset flow, and is particularly suitable for finance, supply chain, medical health and other fields, which is of great significance to promoting the practical application of blockchain technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a scenario to which the method of the present invention is applicable. DETAILED DESCRIPTION
[0040] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0041] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.
[0042] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0043] Definitions of relevant terms:
[0044] Definition 1: Blockchain
[0045] Blockchain is a distributed database that stores data in the form of blocks and uses cryptography to ensure the security and integrity of the data. Each block contains a certain number of transaction records, which are linked to previous blocks to form an immutable chain.
[0046] Definition 2: Data sender
[0047] The data sender is a user on a certain blockchain A who has access to the data on chain A and has the power and willingness to sell the data on chain A to entities outside chain A and receive tokens as benefits. The data sender is considered to be potentially malicious and may deliberately send wrong or useless data to deceive the data recipient and collect the amount.
[0048] Definition 3: Data receiver
[0049] The data receiver is a user on a blockchain B who cannot access blockchain A, but has the willingness and funds to purchase the data on chain A. The data receiver is also considered to be potentially malicious and may try to obtain the transaction data in advance during the transaction and pay no or less. In addition, after the transaction is completed, it also attempts to recover the paid assets by denying the receipt of complete data or denying the receipt of correct data.
[0050] Definition 4: Relay chain
[0051] The relay chain is a bridge connecting blockchains A and B. It can monitor cross-chain transaction requests and cross-chain transaction processing results on chains A and B through the gateway, and record cross-chain transactions in the block. However, the nodes on the relay chain cannot directly obtain data on chain A or chain B. The cross-chain gateway is a bridge between the relay chain and the application chain, responsible for verifying and packaging cross-chain transactions on the application chain. The relay chain is defined as a neutral party. It is a decentralized distributed ledger. The nodes on the relay chain transmit cross-chain messages through a certain consensus or mechanism. The cross-chain gateway is considered to be an honest but curious party, responsible for verifying the audit results. In our solution, we take into account that some of them may return incorrect verification results, while most gateway nodes are considered honest.
[0052] Definition 5: Smart contract
[0053] A smart contract is an automated contract based on blockchain technology that defines and executes contract terms in the form of code.
[0054] Table 1 lists the key symbols of a cross-blockchain data transaction audit method.
[0055]
[0056]
[0057] like Figure 1 As shown, this embodiment provides a data transaction audit method for cross-blockchains, which is applicable to the scenario where the data sender is on data chain A, the data receiver is on data chain B, and both data chain A and data chain B can communicate with the relay chain. The method includes the following steps:
[0058] Step 1: Parameter initialization
[0059] In the initialization phase, the system administrator first provides appropriate security parameters and completes the generation of system parameters. Next, the administrator creates the solution's smart contract and publishes it on the blockchain network.
[0060] The parameter initialization in this embodiment can be implemented by using the following algorithm:
[0061] Setup(1 λ )→(pp). The algorithm outputs a public parameter set pp according to the input security parameter λ. First, the algorithm determines the parameters used to calculate the bilinear mapping according to the security parameter λ. Then, choose a hash function H0: {0, 1} * →Z q (q is the order of the bilinear group), H1: {0, 1} *→G1, and H2: {0, 1} * →{0, 1} * Finally, it publishes a set of public parameters pp = {e, g1, g2, q, H0, H1, H2}, where g1 and g2 are group This step is used to generate the system parameters required in each stage of the execution of the solution.
[0062] KeyGen(1 λ , pp)→(U, α). This algorithm is run by the data sender on data chain A to generate the audit key. It requires λ and pp as input, and then the algorithm generates the audit public-private key pair (U, α), where The public and private key pairs generated by the algorithm will be used in the calculations of the subsequent data preprocessing and data integrity audit stages.
[0063] Step 2: Data Preprocessing
[0064] In the data preprocessing stage, the data sender needs to perform calculations locally, preprocess the data files, and generate encrypted data file blocks and corresponding file block labels. In addition, other corresponding audit parameters need to be calculated and uploaded to the relay chain.
[0065] In this embodiment, this stage can be implemented using the following specific algorithm:
[0066] Quest(address)→{0 / 1}. The data receiver on data chain B initiates a cross-chain transaction request to the data sender on data chain A, and pledges tokens to prevent malicious consumption of the data sender's computing resources. The data sender returns a 0 or 1 flag to decide whether to conduct the transaction.
[0067] PreCompute(F,n,k i )→(f i , ef i , H ef , H k ). When the data sender agrees to the data transaction, the data is preprocessed according to this algorithm. First, the data sender divides the data into blocks, divides the data F into n blocks, and represents the i-th block as f i Then, encrypt it with AES using the generated encryption key k i Encrypted file i Get the encrypted data block ef i , and use the hash function H2 to encrypt the secret key k i and encrypted data block ef i Processing is performed, and the processing results are used as leaf nodes of the merkle tree. Merkle trees are constructed for the two groups of leaf nodes respectively;
[0068] {H2(ef i )|i=1, 2,..., n}, {H2(k i )|i=1,2,...,n},
[0069] Finally, upload the encrypted file root hash H on the relay chain ef (ie H2(ef i )Root Hash ef ) and the key root hash H k (i.e. H2(k i )Root Hash k ). This step mainly processes the data file itself and uses hashing to leave traces of the processing process to prevent the data sender from making changes to the data file later.
[0070] TagGen(ef i ,α,t)→({σ i},κ). The data sender generates a label for the encrypted data block according to this algorithm. First, calculate Where t is the timestamp, then randomly select And based on the private key α, each encrypted data block ef i Calculate label σ i ,
[0071]
[0072] Among them, fname is the name of the file. Finally, calculate the file metadata K = fname||n||u, n is the number of data blocks, and finally upload it on the relay chain ({σ i This step mainly generates tags for encrypted data file blocks, which are used by data receivers to calculate integrity proof.
[0073] Step 3: Data Correctness Audit
[0074] During the data correctness audit phase, the data receiver will randomly request the data sender to display the data file, so as to conduct a correctness audit on the encryption key and file content of the encrypted data file.
[0075] In this embodiment, this stage can be implemented using the following specific algorithm:
[0076] Challenge1(|I|, seed)→(I). The data receiver uses the seed to generate a random number set I, |I|<n, and sends it to the data sender, and burns tokens related to the size of |I|.
[0077] The data sender puts the secret key k corresponding to the random number set I i and verification key ki Auxiliary information (i.e. verify k by root hash i The path information required when sending the encrypted data file to the data recipient i Auxiliary information related to verifying encrypted data files (i.e. verifying ef by root hash i This step responds to the challenge set I sent by the data receiver and sends the corresponding information to it.
[0078] The data receiver checks k by calculating the hash i With ef i The correctness of the i , check f i After verification, if the data receiver is willing to continue the transaction, it returns 1, pledges the transaction token in the on-chain smart contract, and enters the address of the data sender. The data sender sends all the encrypted data file blocks, metadata K and timestamp factors to the data receiver. If the data recipient does not want to continue the transaction, it returns 0. i Auxiliary information With H2(ef i ) generates a root hash and compares it with the H ef Compare and determine whether the two are consistent to check the encrypted data file ef i The data receiver passes the secret key k i Auxiliary information With H2(k i ) generates a root hash and compares it with the key root hash H k Compare and determine whether the two are consistent to check the secret key k i This step efficiently checks whether the data sender has changed the data through the merkle tree root.
[0079] Step 4: Data Integrity Audit
[0080] In the data integrity audit phase, the data sender requires the data receiver to provide proof that the complete encrypted data has been received. First, the data sender sends an audit request and sends the corresponding data to the blockchain. Subsequently, the data receiver generates an integrity proof according to the data sender's request. Finally, the cross-chain gateway publishes the verification result of the proof.
[0081] In this embodiment, this stage can be implemented using the following specific algorithm:
[0082] Challenge2(seed)→(Q). The data sender generates a check to see if the data receiver has received the complete encrypted data. The data sender randomly generates a corresponding η for each encrypted data block efi according to the seed. i ∈Z q , and the set {η i} is represented as Q. Then, the data sender forwards the transaction including Q.
[0083] The data receiver receives the encrypted data block ef i , encrypted data block mark σ i And the timestamp factor When the data receiver has the complete encrypted data, it calculates in sequence:
[0084]
[0085]
[0086] Calculate and prove π=(E a , E r , E′ a , E′ r , μ, d, ζ). Let ε denote ε i Represents ε / η i The data recipient then sends a transaction containing π and the metadata K of the encrypted file.
[0087] Check2(π,κ,{σ i})→{0 / 1}. The cross-chain gateway first verifies whether the following formula is equal,
[0088] e(E′ a , E a )=e(g1,g2)∧(E′ r , E r ) = e(g1, g2)
[0089] If the above formula is not true, the verification fails; otherwise, continue to verify whether the following formula is equal.
[0090]
[0091] If the above formula does not hold, the verification fails; otherwise, the verification succeeds.
[0092] The cross-chain gateway creates a corresponding transaction based on the verification result to inform the data sender whether Check2 has passed the verification.
[0093] Step 5: Data Decryption
[0094] During the data decryption phase, the data sender sends the key used to encrypt the data file block and verifies the merkle tree root generated by the key. If it is correct, the data sender can transfer the tokens paid by the data sender from the smart contract.
[0095] In this embodiment, this stage can be implemented using the following specific algorithm:
[0096] Check3({k i})→{0 / 1}. When Check2 passes the verification, the data sender sends a i The cross-chain gateway pair consists of {k i |i=1,2,...,n} to form a merkle tree with root hash h k Verification, if h k ≠H k , the verification fails; otherwise, the verification succeeds.
[0097] The gateway creates a corresponding transaction based on the verification result: the data sender enters the gateway verification result transaction of check2 and check3 into the smart contract. If both verification results are successful, the smart contract will send the token to the data sender's account after a period of time. During this period, if the data receiver believes that the key has not been successfully decrypted, he can submit a packet containing the corresponding key k. i With encrypted file ef i After the transaction is verified by the cross-chain gateway, you can retrieve your own assets (tokens).
[0098] The embodiment of the present application uses bilinear mapping technology to implement data auditing on the relay chain to ensure the correctness and integrity of data transactions, and uses symmetric encryption technology to protect the privacy and security of transaction data. Through a phased design (including initialization, data preprocessing, correctness auditing, integrity auditing, and data decryption stages), the audit process of data transactions is systematically implemented. In addition, the scheme demonstrates its efficiency in computing costs, communication overhead, and storage overhead through theoretical analysis and experimental evaluation. This method provides a reliable and efficient auditing method for cross-chain data transactions, enhances the transparency and security of data transactions, especially in application scenarios such as finance, supply chain management, and healthcare, which can significantly improve the efficiency of data sharing and asset transfer and reduce transaction costs.
[0099] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A data transaction audit method for cross-blockchains, where the data sender and data receiver are located in different blockchains, characterized in that: It includes the following five steps: parameter initialization, data preprocessing, data correctness audit, data integrity audit and data decryption; Parameter initialization: generate initial parameters and smart contracts; Data preprocessing: The data recipient sends a transaction request and pledges assets; When the data sender agrees to the transaction request, the data is divided into blocks and encrypted, the encryption key and encrypted data blocks are hashed, and the processing results are uploaded to the relay chain; The data sender also generates tags for the encrypted database, generates file metadata, and uploads it to the relay chain; Data correctness audit: The data receiver generates a random number set; the data sender sends the auxiliary information corresponding to the secret key and the verification key in the random number set, as well as the corresponding encrypted data and the auxiliary information for verifying the encrypted data file to the data receiver; the data receiver checks the correctness of the secret key and the encrypted data based on the auxiliary information and the hash processing result stored in the relay chain, and further confirms whether to continue the transaction. When confirming to continue the transaction, the data sender sends all the encrypted data file blocks; Data integrity audit: The data sender sends an audit request and sends the corresponding data to the blockchain; the data receiver generates an integrity certificate according to the data sender's requirements; The cross-chain gateway publishes the verification results of the proof; Data decryption: The data sender sends the key used when encrypting the data file block and verifies the merkle tree root generated by the key. If it is correct, the data sender can transfer the tokens paid by the data sender from the smart contract.
2. According to the cross-blockchain data transaction audit method of claim 1, it is characterized in that: The initial parameter generation in the parameter initialization phase is implemented using the Setup and KeyGen algorithms, where the administrator executes the Setup algorithm to generate the initial parameters {e, g1, g2, q, H0, H1, H2}, and the data sender executes the KeyGen algorithm to generate a key pair (U, α).
3. According to the cross-blockchain data transaction audit method of claim 2, it is characterized in that: During the data preprocessing process, when the data sender agrees to the transaction request, the data is divided into blocks and encrypted, the encryption key and the encrypted data block are hashed, and the processing result is uploaded to the relay chain. The specific process is as follows: First, the data sender divides the data into blocks, divides the data F into n blocks, and denotes the i-th block as f i ; Secondly, encrypt with AES, using the generated encryption key k i Encrypted file i Get the encrypted data block ef i , and use the hash function H2 in the initial parameters to encrypt the secret key k i and encrypted data block ef i Processing is performed, and the processing results are used as leaf nodes of the merkle tree. Merkle trees are constructed for the two groups of leaf nodes respectively; {H2(ef i )|i=1,2,…,n},{H2(k i )|i=1,2,…,n}, Finally, upload the encrypted file root hash H on the relay chain ef and the key root hash H k .
4. According to the cross-blockchain data transaction audit method of claim 3, it is characterized in that: During the data preprocessing process, the data sender also generates labels for the encrypted database and file metadata. The specific process is as follows: First, calculate the timestamp factor Where t is the timestamp and H0 is the hash function; Second, randomly select And based on the private key α, each encrypted data block ef i Calculate label σ i , Among them, fname is the name of the file, H1 is the hash function; Finally, calculate the file metadata κ = fname||n||u, where n is the number of data blocks; upload it to the relay chain ({σ i },κ).
5. According to the cross-blockchain data transaction audit method of claim 3, it is characterized in that: In the data correctness audit phase, the data sender sends the secret key k corresponding to the random number set. i and auxiliary information of the verification key And the corresponding encrypted data ef i and auxiliary information for verifying encrypted data files The recipient of the sent data, the auxiliary information of the verification key To verify k through the root hash i The path information required for the verification of the encrypted data file To verify EF by root hash i The path information required.
6. The cross-blockchain data transaction audit method according to claim 5 is characterized in that: In the data correctness audit phase, the data receiver checks the correctness of the secret key and the encrypted data based on the auxiliary information and the hash processing results stored in the relay chain. The specific process is as follows: the data receiver passes the encrypted data file ef i Auxiliary information With H2(ef i ) generates a root hash and compares it with the H ef Compare and determine whether the two are consistent to check the encrypted data file ef i Correctness; The data receiver passes the secret key k i Auxiliary information With H2(k i ) generates a root hash and compares it with the key root hash H k Compare and determine whether the two are consistent to check the secret key k i correctness.
7. The cross-blockchain data transaction audit method according to claim 5 is characterized in that: In the data correctness audit phase, by decrypting ef i Get f i , by checking f i After checking whether the content meets the requirements, if the data recipient is willing to continue the transaction, the transaction identifier is returned, the transaction token is pledged in the on-chain smart contract, and the address of the data recipient is entered. The data sender sends all the encrypted data file blocks, metadata κ and timestamp factors to the data recipient. If the data recipient is unwilling to continue the transaction, a no-transaction flag is returned.
8. The cross-blockchain data transaction audit method according to claim 3 is characterized in that: During the data integrity audit phase, the data receiver generates an integrity certificate according to the requirements of the data sender. The specific process is as follows: The data encryptor randomly generates a corresponding random number for each encrypted data block and obtains a random number set Q; The data receiver receives the encrypted data block ef i , encrypted data block mark σ i and timestamp factor Combined with the random number set, the Response2 response function is used for calculation to generate the integrity proof parameter π.
9. The cross-blockchain data transaction audit method according to claim 1 is characterized in that: In the data decryption phase, the cross-chain gateway verifies based on the integrity proof parameter π and the metadata κ of the encrypted file. When the cross-chain gateway verifies successfully, the data sender sends a data packet containing all the encryption keys k. i transactions; The cross-chain gateway pair consists of {k i |i=1,2,…,n} to form a merkle tree with root hash h k Verification, if h k ≠H k , the verification fails; otherwise, the verification succeeds.
10. The cross-blockchain data transaction audit method according to claim 9 is characterized in that: After successful verification, the smart contract will send the token to the data sender's account after a set period of time. Within the set period of time, if the data receiver believes that the key has not been successfully decrypted, he can submit a request containing the corresponding key k. i With encrypted file ef i After the transaction is verified by the cross-chain gateway, you can retrieve your own tokens.
Citation Information
Cited By
Cross-chain transaction method and device, electronic equipment and storage medium
CN119398784A
Cross-chain transaction method, device, electronic device and storage medium
CN119398784B
Forest and grass Internet of Things independent security auditing method and system based on smart contract
CN119561781A
