Block chain cross-chain access method, readable storage medium and equipment
By using zero-knowledge proof and data shard identification in the blockchain cross-chain access system to verify the authenticity and consistency of data, and performing re-encryption updates, the problem of inefficiency caused by error-prone access data verification by blockchain cross-chain access data and user repeated re-encryption is solved, and efficient multi-user access control is achieved.
Patent Information
- Application Number
- CN202411590713.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-28
AI Technical Summary
Currently, blockchain cross-chain access data verification is prone to errors, and users' repeated re-encryption leads to inefficient access.
By obtaining the zero-knowledge proof and data shard identification generated when storing the original data in the source chain, the authenticity and consistency of the data shards are verified, and re-encrypted updates are performed based on ciphertext metadata and re-encrypted credentials to generate re-encrypted sub-ciphertexts that meet the quantity requirements, and finally combined them to obtain the re-encrypted ciphertext used for decryption of the target chain to obtain the original data.
Ensure that the data can be correctly obtained and used by the recipient, improve the efficiency of re-encryption processing for multi-user access, and solve the problems of inefficient access caused by data verification errors and user repeated re-encryption.
Smart Images

Figure CN119720142A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a blockchain cross-chain access method, a readable storage medium and a device, and belongs to the technical field of blockchain. Background Art
[0002] Currently, the design of cross-chain access control mechanisms in blockchain still faces many challenges. Since the data during cross-chain transmission is provided by users of other chains, data users are usually unable to obtain verification data in a timely manner. Even if encryption is adopted, if the data is untrue or the data provided before and after are inconsistent, it may cause decrypted data errors or the data cannot be found. Moreover, proxy re-encryption is based on a one-to-one access control method. For the same data, whether it is a single user or multiple users, it needs to be re-encrypted multiple times. It takes more time to process access control for multiple users, which limits the efficiency of access control and makes it difficult to meet the access control needs of multiple users. Summary of the invention
[0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a blockchain cross-chain access method, a readable storage medium and a device, which can ensure that data can be correctly acquired and used by the recipient, improve the efficiency of re-encryption processing for multi-user access, and solve the current problems of error-prone blockchain cross-chain access data verification and low access efficiency caused by repeated re-encryption by users.
[0004] In order to achieve the above purpose / solve the above technical problems, the present invention is implemented by adopting the following technical solutions: On one hand, the present invention provides a blockchain cross-chain access method, which is applied to a blockchain cross-chain access system, wherein the blockchain cross-chain access system includes a source chain, an IPFS network, a relay chain, and a target chain, and the method includes: Obtain the zero-knowledge proof and data sharding identifier generated when the source chain stores the original data; Verify the authenticity and consistency of data shards based on zero-knowledge proof and data shard identification; If the verification is successful, the ciphertext metadata and re-encryption certificate corresponding to the original data are obtained; Perform re-encryption update based on the ciphertext metadata and re-encryption credentials to generate re-encrypted sub-ciphertexts that meet the quantity requirements; The generated re-encrypted sub-ciphertexts are combined and calculated to obtain the re-encrypted ciphertext used for decrypting the target chain to obtain the original data.
[0005] Furthermore, the generation of the zero-knowledge proof and the data sharding identifier generated when the source chain stores the original data includes: Store the original data in the IPFS network, generate data shard identifiers and content identifiers corresponding to data content and storage addresses; Based on the content identifier, a zero-knowledge proof is generated.
[0006] Furthermore, generating a zero-knowledge proof according to the content identifier includes: The zero-knowledge proof is generated by the following conversion: ; ; ; ; in: represents the first zero-knowledge proof, represents the second zero-knowledge proof, Represents the third zero-knowledge proof, denotes the fourth zero-knowledge proof; Represents a secret, which is a numeric hash of the content identifier; r The module is p Generators of the multiplicative cyclic group of ; Represents a large prime number p Do modular operations; m Indicates the random number selected to generate the zero-knowledge proof; Indicates the challenge of generating a zero-knowledge proof; Express and Hash operation.
[0007] Furthermore, the verifying of data shards based on zero-knowledge proof and data shard identification includes: The following calculation is used to prove the comparison: ; in: The comparison proves that r The module is p Generators of the multiplicative cyclic group of ; represents the first zero-knowledge proof, represents the second zero-knowledge proof, Represents the third zero-knowledge proof, Represents the fourth zero-knowledge proof; Will and For comparison, if = , the data authenticity verification is passed; Calculate the hash value of the data shard identifier. If the hash value of the data shard identifier is correct, the data consistency verification passes. If both the data authenticity verification and the data consistency verification pass, the verification passes.
[0008] Furthermore, the obtaining of ciphertext metadata and re-encryption credentials corresponding to the original data includes: The ciphertext metadata corresponding to the original data is calculated by the following formula: ; Among them: In the encryption process of the original data, a security parameter is selected , define the bilinear map , , Represents prime order q The multiplicative cyclic group of , Output common parameters , and according to the public parameters Generate the public and private keys of the source chain 、Public and private keys of the target chain ; Hash function , hash function ; , T represents a bilinear map, ; a Represents the private key of the data owner, b Represents the private key of the data user, , Contains all q And with q Coprime non-negative integers; p Represents the selected large prime number; Represents a multiplicative cyclic group The generator of ; Indicates the ciphertext metadata corresponding to the original data. represents the product of two terms, , u represents the random coefficient, Metadata representing the original text data; Calculate the re-encryption key corresponding to the ciphertext metadata: ; in: Represents the re-encryption key, represents the product of two terms, , v Represents a random number, , Indicates that all less than q A non-negative integer; Calculate the re-encryption certificate based on the re-encryption key: ; ; ; ; in: Re-encryption certificate. Represents a set of re-encryption subkeys; Represents a tuple consisting of user address, user ID, and user public key. Indicates i re-encryption subkey, N Indicates the shares into which the re-encryption key is split; Indicates i indivual x When taking value value, Indicates t - 1 randomly selected coefficient a , x Represents each point used to take values; t Represents the order of the polynomial, which represents the minimum number of shares required to recover the key.
[0009] Furthermore, the re-encryption update is performed based on the ciphertext metadata and the re-encryption credential to generate the re-encrypted sub-ciphertext that meets the quantity requirement, including: Initialize the pre-built mapping group for storing re-encrypted records. The mapping group is represented as: ; in: Represents a key value. Display key The corresponding mapping value; Verify the validity of each re-encryption subkey in the re-encryption credential. If the verification succeeds, calculate the key value corresponding to the ciphertext metadata. If the key value corresponding to the ciphertext metadata is not recorded by the mapping group, the key value corresponding to the ciphertext metadata is recorded, and the re-encrypted ciphertext is calculated according to the re-encryption sub-key corresponding to the ciphertext metadata to obtain the re-encrypted sub-ciphertext.
[0010] Furthermore, if the key value corresponding to the ciphertext metadata is not recorded by the mapping group, the key value corresponding to the ciphertext metadata is recorded, and the re-encrypted ciphertext is calculated according to the re-encrypted subkey corresponding to the ciphertext metadata to obtain the re-encrypted sub-ciphertext, including: calculating the re-encrypted sub-ciphertext by the following formula: ; ; in: Indicates the relay chain i The node currently holdsi re-encrypted sub-ciphertexts, Indicates the relay chain i The proxy node holds i A partial ciphertext calculated based on a bilinear map, T represents a bilinear map, T represents a bilinear map, ; Indicates i indivual x When taking value value, represents the Lagrange basis polynomial, Metadata representing the original data, u represents the random coefficient.
[0011] Furthermore, the combining calculation of the generated re-encrypted sub-ciphertexts to obtain the re-encrypted ciphertexts for decrypting the target chain to obtain the original data includes combining the calculation of the re-encrypted sub-ciphertexts by the following formula: ; ; in: Represents the re-encrypted ciphertext obtained after calculation; Represents the ciphertext after the re-encrypted sub-ciphertexts that meet the quantity requirement are combined; represents the product of two terms, , b Represents the private key of the data user, v represents the random coefficient.
[0012] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned blockchain cross-chain access method.
[0013] The present invention also provides a computer device, comprising: A memory for storing instructions; The processor is used to execute the instructions so that the device executes the above-mentioned blockchain cross-chain access method.
[0014] Compared with the prior art, the present invention has the following beneficial effects: The present invention uses the pre-generated zero-knowledge proof and data shard identifier of the original data to verify the authenticity and consistency of the data shards, ensuring that the data can be correctly acquired and used by the recipient. After the data verification is passed, the data is re-encrypted and updated based on the ciphertext metadata and the re-encryption credential, avoiding the user from performing re-encryption calculations multiple times, improving the re-encryption processing efficiency of multi-user access, and solving the current problems of error-prone cross-chain access data verification in blockchains and low access efficiency caused by repeated re-encryption by users. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of a blockchain cross-chain access method according to an embodiment of the present invention; Figure 2 This is a flowchart of a blockchain cross-chain access method according to an embodiment of the present invention; Figure 3 This is a comparison chart of the time overhead of IPFS storage and reading under different data sizes in a blockchain cross-chain access method according to an embodiment of the present invention; Figure 4 This is a comparison chart of the storage overhead of a blockchain cross-chain access method and a traditional chain in an embodiment of the present invention; Figure 5 This is a schematic diagram of the amount of Gas consumed by a blockchain cross-chain access method according to an embodiment of the present invention; Figure 6 This is a comparison chart of encryption time overhead between a blockchain cross-chain access method according to an embodiment of the present invention and an existing method; Figure 7 This is a comparison chart of decryption time overhead between a blockchain cross-chain access method according to an embodiment of the present invention and an existing method; Figure 8 This is a comparison chart of the re-encryption time overhead between a blockchain cross-chain access method according to an embodiment of the present invention and an existing method; Fig. 9 This is a schematic diagram of cross-chain transaction delay of a blockchain cross-chain access method according to an embodiment of the present invention; Fig.10 This is a schematic diagram of the cross-chain transaction throughput of a blockchain cross-chain access method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention. Example
[0017] A blockchain cross-chain access method is applied to a blockchain cross-chain access system, such as Figure 1 As shown in the figure, the blockchain cross-chain access system includes the source chain, IPFS network, relay chain and target chain. It should be noted that: The data owner (DO) is the initiator of the transaction and has ownership of personal data; The data user (DU) is the user of the data. During the cross-chain process, it receives the data and uses the private key to decrypt the metadata to obtain the content identifier and symmetric key. Finally, it performs data addressing and original data decryption based on the content identifier.
[0018] IPFS is a distributed file system that mainly stores data in a distributed manner through various storage nodes. When data larger than 256KB is added to the IPFS network, the data will be automatically divided into multiple shards and saved to various storage nodes according to certain rules. This segmentation process is the process of generating the Merkle tree DAG. In addition, each shard will undergo certain operations to obtain its corresponding shard identifier, which can be viewed by each storage node and uploading user. Since data is stored in shards, the upload and reading speed of IPFS is also very impressive. Storing data in IPFS can effectively reduce the storage pressure on the chain. This embodiment achieves higher storage security by building a private IPFS network.
[0019] like Figure 2 As shown, the method includes: Obtain the zero-knowledge proof and data sharding identifier generated when the source chain stores the original data. The generation of the zero-knowledge proof and data sharding identifier generated when the source chain stores the original data is as follows: Store the original data in the IPFS network, generate data shard identifiers and content identifiers corresponding to data content and storage addresses; Generate a zero-knowledge proof according to the content identifier, including: Generate a zero-knowledge proof by converting the following formula: ; ; ; ; Among them: Zero-knowledge proof consists of four parts, namely , , and , represents the first zero-knowledge proof, represents the second zero-knowledge proof, Represents the third zero-knowledge proof, denotes the fourth zero-knowledge proof; Represents a secret, which is a numeric hash of the content identifier; r The module is p Generators of the multiplicative cyclic group of ; Represents a large prime number p Do modular operations; m Indicates the random number selected to generate the zero-knowledge proof; Indicates the challenge of generating a zero-knowledge proof; Express and Hash operation.
[0020] Based on zero-knowledge proof and data shard identification, the authenticity and consistency of data shards are verified. Specifically, the following calculation and comparison proof is used:
[0021] in: It indicates comparative proof; Will and For comparison, if = , the data authenticity verification is passed; Calculate the hash value of the data shard identifier. If the hash value of the data shard identifier is correct, the data consistency verification passes. If both the data authenticity verification and the data consistency verification pass, the verification passes.
[0022] If the verification is successful, the ciphertext metadata and re-encryption certificate corresponding to the original data are obtained, including: The ciphertext metadata corresponding to the original data is calculated by the following formula:
[0023] Among them: In the encryption process of the original data, a security parameter is selected , define the bilinear map , , Represents prime order q The multiplicative cyclic group of , Output common parameters , and according to the public parameters Generate the public and private keys of the source chain 、Public and private keys of the target chain ; Hash function , hash function ; , T represents a bilinear map, ; a Represents the private key of the data owner, b Represents the private key of the data user, , Represents a range of values, which includes all values less than q And with q Coprime non-negative integers; p Represents the selected large prime number; Represents a multiplicative cyclic group The generator of ; Indicates the ciphertext metadata corresponding to the original data. ,u represents a random coefficient, represents the product of two terms, Metadata representing the original text data; Calculate the re-encryption key corresponding to the ciphertext metadata:
[0024] in: Represents the re-encryption key, , v Represents a random number, , Represents a range of values that includes values less than q All non-negative integers of ; Calculate the re-encryption certificate based on the re-encryption key: ; ; ; ; in: Re-encryption certificate. represents the set of re-encryption subkeys, Represents a tuple consisting of user address, user ID, and user public key. Indicates i re-encryption subkey, N Indicates the shares into which the re-encryption key is divided, Indicates i indivual x When taking value value, Indicates t - 1 randomly selected coefficient a ; x Represents each point used to take values; t Represents the order of the polynomial, which represents the minimum number of shares required to recover the key.
[0025] Re-encrypt and update based on the ciphertext metadata and re-encryption credentials to generate re-encrypted sub-ciphertexts that meet the quantity requirements. Specifically: Initialize the pre-built mapping group for storing re-encrypted records. The mapping group is represented as: ; in: Represents a key value. Display key The corresponding mapping value; Verify the validity of each re-encryption subkey in the re-encryption credential. If the verification succeeds, calculate the key value corresponding to the ciphertext metadata. If the key value corresponding to the ciphertext metadata is not recorded by the mapping group, the key value corresponding to the ciphertext metadata is recorded, and the re-encrypted ciphertext is calculated according to the re-encryption subkey corresponding to the ciphertext metadata to obtain the re-encrypted sub-ciphertext; If the key value corresponding to the ciphertext metadata is not recorded by the mapping group, the key value corresponding to the ciphertext metadata is recorded, and the re-encrypted ciphertext is calculated according to the re-encrypted sub-key corresponding to the ciphertext metadata to obtain the re-encrypted sub-ciphertext, including: calculating the re-encrypted sub-ciphertext by the following formula: ; ; in: Indicates the relay chain i The node currently holds i re-encrypted sub-ciphertexts, Indicates the relay chain i The i-th partial ciphertext calculated based on bilinear mapping held by the proxy node, represents the Lagrange basis polynomial, Metadata representing the original data, u represents the random coefficient.
[0026] The generated re-encrypted sub-ciphertexts are combined and calculated to obtain the re-encrypted ciphertexts used for decrypting the target chain to obtain the original data, including combining and calculating the re-encrypted sub-ciphertexts by the following formula: ; ; in: Represents the re-encrypted ciphertext obtained after calculation; Represents the ciphertext after the re-encrypted sub-ciphertexts that meet the quantity requirement are combined.
[0027] After the ciphertext calculation is completed, the final re-encrypted ciphertext F is sent to the target chain and received by DU. DU can decrypt the re-encrypted ciphertext according to its own private key to obtain metadata. According to the content identifier and symmetric key in the metadata M, DU can download the original data from IPFS and use the symmetric key to decrypt it to obtain the plaintext data.
[0028] In order to evaluate the performance in the multi-user concurrent access control scenario, the proposed threshold proxy re-encryption method is compared with the other three comparison methods in terms of encryption time, re-encryption time, and decryption time: PBTPRE, ABPRE, and IBTPRE. Among them, PBTPRE, ABPRE, and IBTPRE are all suitable for blockchain networks. The reasons for their selection are as follows: PBTPRE: This scheme proposes a threshold proxy re-encryption method that can change the proxy share. In order to solve the problem of possible sharing leakage when the proxy leaves or joins the network, the scheme changes the proxy share regularly without changing the secret, reducing the possibility of attacking the distributed sharing of the proxy and thus achieving secure access control; ABTPRE: This scheme adopts attribute-based threshold proxy re-encryption, adds single-hop key policy attributes to the proxy re-encryption process, and actively updates the proxy's share through the attribute to prevent the re-encryption key share from being invalidated due to the change of the proxy. The scheme proves its security against honest re-encryption attacks under the learning with errors (LWE) assumption. IBTPRE: This scheme proposes a threshold proxy re-encryption method based on identity encryption. The scheme uses identity encryption to replace the encryption stage of threshold proxy re-encryption to eliminate public key certificates, and identifies malicious agents through lattice-based fully homomorphic signatures. The scheme is applied in blockchain-based file sharing systems.
[0029] make Indicates the time consumed by DO to encrypt: ; Indicates the timestamp when DO starts encrypting metadata. Indicates the timestamp when DO encryption is completed.
[0030] make Indicates the time taken by all DUs to decrypt: ; Indicates the timestamp when DU obtains the re-encrypted data and starts decrypting. Indicates the timestamp when DU completes decryption.
[0031] make Indicates the time it takes for the proxy node to perform threshold proxy re-encryption: ; Indicates the timestamp when the proxy node starts encryption after receiving the ciphertext and re-encryption key fragments. Indicates the timestamp when encryption is completed for each proxy node on the relay chain.
[0032] make and Respectively represent the latency and throughput of cross-chain transactions: ; ; in Indicates the transaction confirmation time. Indicates the transaction commit time. Indicates time period The total number of transactions within Since this embodiment uses IPFS to store complete data in a distributed manner, the read and write rate of the data determines the efficiency of obtaining the data. In order to evaluate the time overhead performance of IPFS in storing and reading under different test data sizes, the test data Set them to 1MB, 10MB, 50MB and 100MB respectively, such as Figure 3 As shown in the figure, when the test data file is larger, it takes more time to store, but the time to read the data does not increase much, and the overall reading time is kept within a short time range. Therefore, the service of storing and reading with IPFS is feasible and efficient. Since this embodiment adopts the on-chain and off-chain hybrid storage method of IPFS+blockchain, in order to show the advantages compared with traditional on-chain storage, an experiment is conducted to test the storage overhead of the two methods: on-chain storage and on-chain and off-chain hybrid storage. Figure 4 As shown in the figure, with the same amount of data, the overhead of hybrid storage is much smaller than that of traditional on-chain storage. This is because hybrid storage does not directly store all ciphertext data, but stores key information, which can reduce the storage load pressure on the blockchain. In addition, the increase in the amount of data has a greater impact on the overhead of on-chain storage, but a smaller impact on the overhead of hybrid storage. Compared with on-chain storage, the average overhead of hybrid storage is reduced by 35%. This example involves three stages: zero-knowledge proof generation, data sharding verification, and re-encryption update. The algorithms corresponding to the three stages are compiled on the Remix compiler provided by Ethereum to test the amount of Gas consumed by the deployment, such as Figure 5 As shown in the figure, the amount of Gas consumed by zero-knowledge proof generation, data sharding verification, and re-encryption update deployment is quite considerable; the overhead of zero-knowledge proof generation and re-encryption update is mostly transaction calls, which will generate transactions to change the state on the chain. Re-encryption update also involves complex operations such as key management and transaction update, so the Gas consumption is higher, but it is still within an acceptable range; Table 1 shows the time and storage overhead of related operations in data verification, where the average time and storage overhead are the results of repeated runs for 20 times; since the content identifier returned by IPFS is fixed to 46 bytes, the size of the generated secret is also fixed. In addition, the main proof generation and verification of data verification only take 0.35ms and 0.14ms, which shows that the proposed data verification method is efficient and secure; Content Identifier Data shard identifier (single) secret Random Number Challenge Zero-knowledge proof generation verify AverageTime(ms) N / A N / A 0.27 0.04 0.35 0.15 Size(bytes) 46 46 111 9 80 N / A Table 1. Time and storage overhead of data verification Table 2 shows the comparison of the computational overhead of this scheme with other existing schemes, which is mainly divided into three stages: encryption, re-encryption (single proxy), and decryption. The operators are defined as follows: represents the elliptic curve addition operation, represents the bilinear pairing operation, represents modular exponentiation, Represents a hash operation, represents the modular inverse operation, Represents bitwise operations, represents the matrix multiplication operation, represents the elliptic curve point multiplication operation, In this scheme, the encryption process includes a bilinear pairing operation, a modular exponentiation operation, and two elliptic curve point multiplication operations. Therefore, the overall computational cost of the encryption process is + +2 ; The re-encryption process of a single agent includes a bilinear pairing operation and two modular exponentiation operations, so the overall computational cost of re-encryption of a single agent is +2 ; The decryption process includes two elliptic curve point multiplication operations, two modular exponentiation operations, and one bilinear pairing operation, so the overall computational overhead of the decryption process is +2 +2 ; The total cost of this solution is 3 +5 +4 ;
[0033] Table 2 Computational cost comparison The time overhead of the method proposed in this embodiment is compared with other re-encryption schemes, which is mainly divided into three steps: encryption, re-encryption and decryption: Encryption steps comparison Figure 6 As shown, when the number of DU As the number of DUs increases, the time overhead of the encryption step increases with the number of DUs, because DO needs to perform multiple encryption operations accordingly. And increase; among the compared schemes, IBTPRE has the largest time overhead; On the other hand, the method proposed in this embodiment has the least time overhead and is superior to the other three solutions. When the number of encryption steps increases to 20, the time overhead of the encryption step is only 320ms, which is acceptable.
[0034] Decryption steps comparison Figure 7 As shown, the time cost of the decryption step of PBTPRE increases as The time overhead of ABTPRE, IBTPRE and the proposed method in the decryption step changes slightly, and the proposed method also presents the lowest decryption time overhead, which is lower than that of the methods proposed by ABTPRE and IBTPRE in =20, the decryption time is 34ms, which is more efficient than other solutions.
[0035] Re-encryption steps are compared Figure 8 As shown in the figure, the overall re-encryption time overhead of all schemes increases with The decryption time overhead of IBTPRE increases with the increase of The increase of is the largest, while the proposed method presents the smallest change in re-encryption time overhead, which is lower than ABTPRE and PBTPRE; when =20, the re-encryption efficiency of the proposed method is improved by 34% and 44% compared with ABTPRE and PBTPRE, respectively. Although all schemes require multiple re-encryptions, the proposed method has more advantages than other schemes when performing access control with multiple DUs, so the access control efficiency is improved.
[0036] JavaDemoSDK is used to test the throughput and latency of cross-chain transactions. In order to compare the throughput and latency under different transaction numbers, this example uses the total number of transactions. Set to 5000, 7500 and 10000 respectively; Fig. 9 and Fig.10 The reflected latency and throughput increase with the increase of transaction rate and total transaction volume. However, considering the fluctuation of blockchain network status, transaction processing failure and system processing capacity changes, there are occasional decreases, but overall it still shows an upward trend. like Fig. 9 As shown, at the same transaction sending rate The larger the value, the greater the delay, which means It is one of the factors that affect the delay. In addition, the surge in the transaction rate will also lead to the instability of the cross-chain network, which will cause the delay to vary greatly and fluctuate significantly. However, even when the total number of transactions is 10,000 and the transaction rate is 3,000, the delay is only about 1,841ms. Considering that cross-chain transactions involve status updates and transaction processing of multiple chains, this delay is acceptable. like Fig.10 As shown in Figure 2, throughput also increases with the increase in the total amount of cross-chain transactions and the sending rate, but it is worth noting that The increase in transaction rate did not significantly increase the throughput, while the increase in the transaction rate did increase the throughput to a certain extent. When the total transaction volume was 5000 and the transaction rate was 2500, the throughput reached a maximum of about 1903tx / s, which shows that When the size is not large but the sending rate is high, the system processing capacity is relatively strong and the throughput advantage can be effectively exerted; According to the above throughput and delay tests, it can be seen that the method proposed in this embodiment has relatively impressive performance in terms of throughput and delay. Example
[0037] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the following method: Obtain the pre-generated zero-knowledge proof and data sharding identifier of the original data stored in the source chain; Verify the authenticity and consistency of data shards based on zero-knowledge proof and data shard identification; If the verification is successful, the ciphertext metadata and re-encryption certificate corresponding to the original data are obtained; Perform re-encryption update based on the ciphertext metadata and re-encryption credentials to generate re-encrypted sub-ciphertexts that meet the quantity requirements; The generated re-encrypted sub-ciphertexts are combined and calculated to obtain the re-encrypted ciphertext used for decrypting the target chain to obtain the original data. Example
[0038] A computer device comprising: A memory for storing instructions; The processor is used to execute instructions so that the device performs the steps of implementing the following method: Obtain the pre-generated zero-knowledge proof and data sharding identifier of the original data stored in the source chain; Verify the authenticity and consistency of data shards based on zero-knowledge proof and data shard identification; If the verification is successful, the ciphertext metadata and re-encryption certificate corresponding to the original data are obtained; Perform re-encryption update based on the ciphertext metadata and re-encryption credentials to generate re-encrypted sub-ciphertexts that meet the quantity requirements; The generated re-encrypted sub-ciphertexts are combined and calculated to obtain the re-encrypted ciphertext used for decrypting the target chain to obtain the original data.
[0039] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0040] The present application is described with reference to the flowcharts of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0041] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.
[0042] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.
[0043] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A blockchain cross-chain access method, applied to a blockchain cross-chain access system, wherein the blockchain cross-chain access system includes a source chain, an IPFS network, a relay chain, and a target chain, characterized in that: The method comprises: Obtain the zero-knowledge proof and data sharding identifier generated when the source chain stores the original data; Verify the authenticity and consistency of data shards based on zero-knowledge proof and data shard identification; If the verification is successful, the ciphertext metadata and re-encryption certificate corresponding to the original data are obtained; Perform re-encryption update based on the ciphertext metadata and re-encryption credentials to generate re-encrypted sub-ciphertexts that meet the quantity requirements; The generated re-encrypted sub-ciphertexts are combined and calculated to obtain the re-encrypted ciphertext used for decrypting the target chain to obtain the original data.
2. The blockchain cross-chain access method according to claim 1, characterized in that: The generation of the zero-knowledge proof and data sharding identifier generated when the source chain stores the original data includes: Store the original data in the IPFS network, generate data shard identifiers and content identifiers corresponding to data content and storage addresses; Based on the content identifier, a zero-knowledge proof is generated.
3. The blockchain cross-chain access method according to claim 2, characterized in that: The generating of the zero-knowledge proof according to the content identifier includes: The zero-knowledge proof is generated by the following conversion: ; ; ; ; in: represents the first zero-knowledge proof, represents the second zero-knowledge proof, Represents the third zero-knowledge proof, denotes the fourth zero-knowledge proof; Represents a secret, which is a numeric hash of the content identifier; r The module is p Generators of the multiplicative cyclic group of ; Represents a large prime number p Do modular operations; m Indicates the random number selected to generate the zero-knowledge proof; Indicates the challenge of generating a zero-knowledge proof; Express and Hash operation.
4. The blockchain cross-chain access method according to claim 1, characterized in that: The method of verifying data shards based on zero-knowledge proof and data shard identification includes: The following calculation is used to prove the comparison: ; in: The comparison proves that r The module is p Generators of the multiplicative cyclic group of ; represents the first zero-knowledge proof, represents the second zero-knowledge proof, Represents the third zero-knowledge proof, denotes the fourth zero-knowledge proof; Will and For comparison, if = , the data authenticity verification is passed; Calculate the hash value of the data shard identifier. If the hash value of the data shard identifier is correct, the data consistency verification passes. If both the data authenticity verification and the data consistency verification pass, the verification passes.
5. The blockchain cross-chain access method according to claim 1, characterized in that: The obtaining of ciphertext metadata and re-encryption credentials corresponding to the original data includes: The ciphertext metadata corresponding to the original data is calculated by the following formula: ; Among them: In the encryption process of the original data, a security parameter is selected , define the bilinear map , , Represents prime order q The multiplicative cyclic group of , Output common parameters , and according to the public parameters Generate the public and private keys of the source chain 、Public and private keys of the target chain ; Hash function , hash function ; , T represents a bilinear map, ; a Represents the private key of the data owner, b Represents the private key of the data user, , Indicates that all values less than q And with q Coprime non-negative integers; p Represents the selected large prime number; Represents a multiplicative cyclic group The generator of ; Indicates the ciphertext metadata corresponding to the original data. represents the product of two terms, , u represents the random coefficient, Metadata representing the original text data; Calculate the re-encryption key corresponding to the ciphertext metadata: ; in: Represents the re-encryption key, represents the product of two terms, , v Represents a random number, , Indicates that all less than q A non-negative integer; Calculate the re-encryption certificate based on the re-encryption key: ; ; ; ; in: Re-encryption certificate. Represents a set of re-encryption subkeys; Represents a tuple consisting of user address, user ID, and user public key. Indicates i re-encryption subkey, N Indicates the shares into which the re-encryption key is split; Indicates i indivual x When taking value value, Indicates t - 1 randomly selected coefficient a , x Represents each point used to take values; t Represents the order of the polynomial, which represents the minimum number of shares required to recover the key.
6. The blockchain cross-chain access method according to claim 5, characterized in that: The re-encryption update is performed based on the ciphertext metadata and the re-encryption credential to generate re-encrypted sub-ciphertexts that meet the quantity requirements, including: Initialize the pre-built mapping group for storing re-encrypted records. The mapping group is represented as: ; in: Represents a key value. Display key The corresponding mapping value; Verify the validity of each re-encryption subkey in the re-encryption credential. If the verification succeeds, calculate the key value corresponding to the ciphertext metadata. If the key value corresponding to the ciphertext metadata is not recorded by the mapping group, the key value corresponding to the ciphertext metadata is recorded, and the re-encrypted ciphertext is calculated according to the re-encryption sub-key corresponding to the ciphertext metadata to obtain the re-encrypted sub-ciphertext.
7. The blockchain cross-chain access method according to claim 6, characterized in that: If the key value corresponding to the ciphertext metadata is not recorded by the mapping group, the key value corresponding to the ciphertext metadata is recorded, and the re-encrypted ciphertext is calculated according to the re-encrypted sub-key corresponding to the ciphertext metadata to obtain the re-encrypted sub-ciphertext, including: calculating the re-encrypted sub-ciphertext by the following formula: ; ; in: Indicates the relay chain i The node currently holds i re-encrypted sub-ciphertexts, Indicates the relay chain i The proxy node holds i A partial ciphertext calculated based on a bilinear map, T represents a bilinear map, T represents a bilinear map, ; Indicates i indivual x When taking value value, represents the Lagrange basis polynomial, Metadata representing the original data, u represents the random coefficient.
8. The blockchain cross-chain access method according to claim 5, characterized in that: The combining calculation of the generated re-encrypted sub-ciphertexts to obtain the re-encrypted ciphertexts used for decrypting the target chain to obtain the original data includes combining the calculation of the re-encrypted sub-ciphertexts by the following formula: ; ; in: Represents the re-encrypted ciphertext obtained after calculation; Represents the ciphertext after the re-encrypted sub-ciphertexts that meet the quantity requirement are combined; represents the product of two terms, , b Represents the private key of the data user, v represents the random coefficient.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the blockchain cross-chain access method as described in any one of claims 1 to 8 is implemented.
10. A computer device, characterized in that: include: A memory for storing instructions; A processor is used to execute the instruction so that the device implements the blockchain cross-chain access method as described in any one of claims 1 to 8.
Citation Information
Cited By
Financial data privacy protection system based on block chain security multi-party computing
CN120658399A
Blockchain-based secure multi-party computation financial data privacy protection system
CN120658399B