Cross-chain data transmission method and system
By applying attribute access strategies in cross-chain data transmission to generate a linear key matrix and encrypting data, combining with multi-layer blockchain architecture for storage and transmission, the contradiction between cross-chain data transmission efficiency and security is solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411648209.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-18
AI Technical Summary
How to improve data transmission efficiency while ensuring the security of cross-chain data transmission has become a key challenge in fields such as smart factories.
By generating a linear key matrix according to the access strategy of each attribute, encrypting the data to be transmitted in combination with a secure vector set, the target encrypted cryptographic text is obtained, and stored and transmitted through a multi-layer blockchain architecture of the main chain, parachain and relay chain.
It realizes the improvement of data transmission efficiency while ensuring data transmission security, and improves the overall execution efficiency, computing performance and system security of the blockchain network.
Smart Images

Figure CN119519962A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a cross-chain data transmission method and system. Background Art
[0002] With the advancement and development of science and technology, traditional factories, logistics and transportation, traditional agriculture and other fields have undergone digital transformation. In this digital transformation process, various IOT sensor data are crucial. These data provide key information such as the environment and operating status of the equipment. The correct use and analysis of data by professional and technical personnel can improve production technology, optimize resource allocation, fully improve the efficiency of factory product production and transportation, and improve service quality. Through different types of data, more information can be obtained, which has led to many demands for data transmission. Therefore, in order to better utilize data, data management and cross-platform transmission have become key challenges in areas such as smart factories.
[0003] As an innovative technology that has emerged with the introduction of digital currency, blockchain is becoming a revolutionary force that reshapes various industries. In essence, blockchain is a distributed, decentralized accounting system that securely and publicly records various transactions in a computer network. Each part of the chain contains a timestamp and an encrypted reference to the previous block, forming an unchangeable and chronological sequence. This sophisticated design ensures the integrity of the data. Based on the above characteristics, blockchain is very suitable as a distributed storage system to store various IOT data. In addition, the rise of cross-chain technology allows asset transfer and information sharing between different blockchains, further enhancing the interoperability of blockchain networks and providing a relatively safe and reliable platform for data transmission. At present, different smart factories mostly use data transmission methods based on cross-chain technology. Therefore, how to improve data transmission efficiency while ensuring the security of cross-chain data transmission has become an urgent problem to be solved. Summary of the invention
[0004] The main purpose of this application is to provide a cross-chain data transmission method and system, aiming to solve the technical problem of how to improve data transmission efficiency while ensuring the security of cross-chain data transmission.
[0005] To achieve the above objectives, the present application proposes a cross-chain data transmission method, which is applied to the data owner, and includes: Generate the corresponding linear key matrix according to the access strategy of each attribute; Encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain a target encrypted ciphertext; The target encrypted ciphertext is sent to the main chain, and the target encrypted ciphertext is stored in the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
[0006] In one embodiment, the step of encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain a target encrypted ciphertext includes: Get the secret value and obtain the master key generated by the key generation end on the parallel chain; The data to be transmitted is encrypted according to the security vector set, the confidential value, the master key and the linear key matrix to obtain a target encrypted ciphertext.
[0007] In one embodiment, the step of encrypting the data to be transmitted according to the security vector set, the confidentiality value, the master key and the linear key matrix to obtain a target encrypted ciphertext includes: Generate a first calculated ciphertext according to the security vector set, the confidential value and the master key; Generate a second calculated ciphertext according to the linear key matrix; Determine a target attribute ciphertext according to the first calculated ciphertext, the second calculated ciphertext, and the attribute calculated ciphertext; The data to be transmitted is encrypted according to the target attribute ciphertext to obtain a target encrypted ciphertext.
[0008] In one embodiment, before the step of encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext, the step further includes: Send the identity code to the key generation end for identity authentication and obtain the identity authentication result; When the identity authentication result is a verification pass result, a security vector set sent by the key generation end is obtained.
[0009] To achieve the above objectives, the present application proposes a cross-chain data transmission method, which is applied to a data user, and includes: Sending a data transmission request to the relay chain, and performing blockchain authentication on the data transmission request through the relay chain; When the blockchain authentication result is a passed authentication result, obtain the data summary and data address; Based on the data summary and the data address, the target encrypted ciphertext is obtained at the target storage location through the relay chain and the parallel chain.
[0010] In one embodiment, when the blockchain authentication result is an authentication pass result, the step of obtaining the data summary and the data address includes: When the blockchain authentication result is a pass result, data is locked based on the time lock and the preset hash lock, and a locked data packet is generated according to the attribute encryption strategy; When the data confirmation information fed back by the preset proportion of target nodes is received, the locked data packet is decrypted based on the preset subkey to obtain the data summary and the data address.
[0011] In one embodiment, after the step of obtaining the target encrypted ciphertext at the target storage location through the relay chain and the parachain based on the data summary and the data address, it also includes: When the data usage condition is met, the target encrypted ciphertext is decrypted and calculated according to the subkey set fed back by the key generation end to obtain the decrypted plaintext data; When the decrypted plaintext data is equal to the preset plaintext data, determining that the current decryption result is a successful decryption result; The data to be transmitted corresponding to the target encrypted ciphertext is obtained according to the successful decryption result.
[0012] To achieve the above objectives, the present application proposes a cross-chain data transmission method, which is applied to a key generation end and includes: Perform initialization processing according to the global attribute base and security parameters to determine the initialization result; When the initialization result is a success result, determining an attribute description matrix of each attribute based on a preset matrix function and an attribute set; Generate a corresponding master key according to the attribute description matrix and send it to the relay chain, so that the master key can be sent to the parallel chain through the relay chain.
[0013] In one embodiment, the cross-chain data transmission method further includes: When the target attribute exists in the user attribute set, determining the target attribute vector according to a preset vector function and the user attribute set; Generate a subkey for each attribute according to the target attribute vector and the target random vector; The subkeys of each attribute are aggregated to obtain a subkey set, and the subkey set is sent to the data user end, so that the data user end decrypts the target encrypted ciphertext according to the subkey set.
[0014] In addition, to achieve the above purpose, the present application also proposes a cross-chain data transmission device, which includes: A generation module, used to generate a corresponding linear key matrix according to the access strategy of each attribute; An encryption module, used for encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain a target encrypted ciphertext; The transmission module is used to send the target encrypted ciphertext to the main chain, and store the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
[0015] In addition, to achieve the above-mentioned objectives, the present application also proposes a cross-chain data transmission device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the cross-chain data transmission method described above.
[0016] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the cross-chain data transmission method described above are implemented.
[0017] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the cross-chain data transmission method as described above.
[0018] In addition, to achieve the above-mentioned objectives, the present application also provides a cross-chain data transmission system, which includes a data owning end, a data using end and a key generating end, the data owning end executes the cross-chain data transmission method described in any one of claims 1 to 4, the data using end executes the cross-chain data transmission method described in any one of claims 5 to 7, and the key generating end executes the cross-chain data transmission method described in claims 8 to 9.
[0019] This application generates a corresponding linear key matrix according to the access strategy of each attribute; encrypts the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext; sends the target encrypted ciphertext to the main chain, and stores the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain. The blockchain in the data transmission system is divided into the main chain, the parallel chain and the relay chain. Then the data is stored on the distributed storage network. Finally, the attribute-based encryption algorithm is used to resist quantum attacks to ensure the data security during the transmission process, thereby improving the overall execution efficiency, computing performance and system security of the blockchain network data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 A flowchart diagram of the first embodiment of the cross-chain data transmission method applied to the data owner of the present application; Figure 2 A schematic diagram of the overall structure of a multi-layer blockchain data transmission system provided in Example 1 of the cross-chain data transmission method applied to the data owner of the present application; Figure 3 A schematic diagram of cross-chain data participants provided in Embodiment 1 of the cross-chain data transmission method applied to the data owner of the present application; Figure 4 A schematic diagram of the encryption and upload process provided in Embodiment 1 of the cross-chain data transmission method of the present application applied to the data owner; Figure 5 A flowchart of a cross-chain data transmission method embodiment 1 of the present application applied to a data user; Figure 6 A flowchart diagram of a cross-chain data transmission method embodiment 1 of the present application applied to a key generation end; Figure 7 A brief flowchart of the cross-chain data transmission method provided in Example 1 of the present application; Figure 8 This is a schematic diagram of the module structure of the cross-chain data transmission device according to an embodiment of the present application; Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the cross-chain data transmission method in an embodiment of the present application.
[0023] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0024] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0025] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0026] The main solution of the embodiment of the present application is: generate a corresponding linear key matrix according to the access strategy of each attribute; encrypt the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext; send the target encrypted ciphertext to the main chain, and store the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
[0027] With the advancement and development of science and technology, traditional factories, logistics and transportation, traditional agriculture and other fields have undergone digital transformation. In this digital transformation process, various IOT sensor data are crucial. These data provide key information such as the environment and operating status of the equipment. The correct use and analysis of data by professional and technical personnel can improve production technology, optimize resource allocation, fully improve the efficiency of factory product production and transportation, and improve service quality. Through different types of data, more information can be obtained, which has led to many demands for data transmission. Therefore, in order to better utilize data, data management and cross-platform transmission have become key challenges in areas such as smart factories.
[0028] As an innovative technology that has emerged with the introduction of digital currency, blockchain is becoming a revolutionary force that reshapes various industries. In essence, blockchain is a distributed, decentralized accounting system that securely and publicly records various transactions in a computer network. Each part of the chain contains a timestamp and an encrypted reference to the previous block, forming an unchangeable and chronological sequence. This sophisticated design ensures the integrity of the data. Based on the above characteristics, blockchain is very suitable as a distributed storage system to store various IOT data. In addition, the rise of cross-chain technology allows asset transfer and information sharing between different blockchains, further enhancing the interoperability of blockchain networks and providing a relatively safe and reliable platform for data transmission. At present, different smart factories mostly use data transmission methods based on cross-chain technology. Therefore, how to improve data transmission efficiency while ensuring the security of cross-chain data transmission has become an urgent problem to be solved.
[0029] This application proposes to generate a corresponding linear key matrix according to the access strategy of each attribute; encrypt the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext; send the target encrypted ciphertext to the main chain, and store the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain. The blockchain in the data transmission system is divided into the main chain, the parallel chain and the relay chain. Then the data is stored on the distributed storage network. Finally, the attribute-based encryption algorithm is used to resist quantum attacks to ensure the data security during the transmission process, thereby improving the overall execution efficiency, computing performance and system security of the blockchain network data transmission.
[0030] Based on this, the embodiment of the present application provides a cross-chain data transmission method, which is applied to the data owner, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the cross-chain data transmission method of the present application.
[0031] In this embodiment, the cross-chain data transmission method includes steps S10 to S40: Step S10, generating a corresponding linear key matrix according to the access strategy of each attribute; It should be noted that this embodiment proposes a quantum cross-chain data transmission method based on attribute encryption. First, this proposal designs a layered blockchain architecture, dividing the blockchain in the data transmission system into three layers, namely the main chain, the parallel chain, and the relay chain. Then, this proposal transfers the data storage from the blockchain itself to a distributed storage network called Swarm (a decentralized storage and communication system), and only retains the hash value of the data on the blockchain. Finally, this proposal proposes a new attribute-based encryption algorithm to resist quantum attacks to ensure data security during transmission. This proposal implements a cross-chain data transmission system, which improves the overall execution efficiency, computing performance, and system security of blockchain network data transmission.
[0032] It can be understood that this embodiment is illustrated by taking the data owner as the execution subject, the access policy refers to a set of access permission management schemes set by the data owner according to certain rules and conditions, and the linear key matrix refers to the linear secret-sharing scheme matrix (LSSS).
[0033] In the specific implementation, the data owner chooses , , and . And formulate The access policy K of attributes generates the linear key sharing scheme (LSSS) matrix Finally, to publish.
[0034] It should be noted that if Figure 2 As shown in the figure, based on the flow of cross-chain data, this embodiment divides data into shared public data, shared private data and basic data. According to different data classifications, the blockchain structure in cross-chain transmission has three layers: main chain, relay chain and parallel chain. Among them, the main chain node is the core of the entire cross-chain transmission system, and its main responsibilities include: (1) Processing and storing shared public data: This data is accessible to all users and nodes, such as transaction records, smart contract codes, etc. (2) Processing and storing private shared data: Although this part of data is visible to some users or nodes, it still maintains a certain degree of privacy, such as business contracts between enterprises or personal identity information. (3) Maintaining the security and consistency of the network: Through the consensus mechanism, all nodes are guaranteed to maintain consistency in data processing and storage to prevent security issues such as double payment; Parallel chains are designed to improve system performance and scalability. Their main functions are: (1) Processing and storing basic data: This data is usually large and frequently changes, such as user account information, asset transfer records, etc. Parallel chains can disperse the pressure on the main chain. (2) Improving system throughput: Through parallel processing, the data processing capability of the entire blockchain system can be significantly improved. (3) Achieve vertical expansion capabilities: Without changing the existing blockchain architecture, performance can be improved by adding nodes or optimizing algorithms, and the expansion process has little impact on the existing blockchain network; Finally, the relay chain, as a bridge connecting different blockchains, is mainly responsible for: (1) Managing cross-chain data transmission: The relay chain is responsible for transmitting data between different blockchains, allowing users and nodes on different chains to communicate with each other. (2) Ensure the security of cross-chain data transmission: Through complex encryption and verification mechanisms, the relay chain ensures that cross-chain data is not tampered with and prevents malicious attacks. In the multi-layer blockchain data transmission system, a storage model combining blockchain and Swarm is also used to obtain high-performance storage of system data.
[0035] It is understandable that if Figure 3As shown, in order to facilitate the understanding of the data flow process in this embodiment, the system model is divided into multiple participating entities such as a distributed key generation system (key generation end), a data owner (data ownership end), a data user (data usage end), a cross-chain physical model, and a distributed storage system. Specifically, (1) the distributed key generation system collaborates to generate public parameters, builds a main chain, and develops smart contracts for data sharing in the main chain; (2) the data owner uses specific technologies and tools to collect the required data from industrially generated sensors, and further sorts and analyzes the data, clearly sets access conditions, formulates access policies, and specifies which users have the right to access specific data under what circumstances. At the same time, in order to ensure the security and confidentiality of the data, this proposal provides a new encryption algorithm that the data owner can use to encrypt the data. This process can convert the data into a form that is difficult for unauthorized personnel to understand and obtain, and can resist quantum attacks, greatly reducing the risk of data leakage and abuse. Finally, the encrypted data will be uploaded to the main chain through secure and reliable communication channels and technical means. The main chain usually has higher security and stability, and can better store and manage these important data; (3) Data users in this proposal are the ultimate beneficiaries of the data and the main users of this system, responsible for receiving, processing and analyzing data. Data users apply for cross-chain data, obtain the data address, and download encrypted data from the high-performance storage system according to the data address and transfer it to the target chain. Finally, data users obtain decryption keys and public data from multiple nodes of the distributed key generation system, and use the encryption algorithm proposed in this proposal to restore the original data and obtain the required information.
[0036] Step S20, encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain a target encrypted ciphertext; It can be understood that the security vector set refers to a set of security vectors randomly generated by the distributed key generation system for the attribute elements in the attribute set, the data to be transmitted refers to the data to be transmitted by the data owner to the data user, and the target encrypted ciphertext refers to the ciphertext after the encryption processing of the data to be transmitted.
[0037] In the specific implementation, the data owner identifies his / her Sent to the distributed key generation system for verification. The distributed key generation system randomly generates a security vector for the attribute elements in the set U, denoted as . And the security vector set It is sent to the data owner to obtain a set of security vectors, which are then used in conjunction with the linear key sharing scheme matrix to encrypt the data to be transmitted. Finally, the ciphertext of the encrypted data to be transmitted is obtained, i.e., the target encrypted ciphertext.
[0038] In a feasible implementation, step S20 may include steps A21-A22: Step A21, obtain the confidential value, and obtain the master key generated by the key generation end on the parallel chain; It should be noted that the confidential value refers to the private data used in the encryption or authentication process, the key generation end refers to the distributed key generation system, and the master key refers to the root key used to generate or derive other keys, which is used to encrypt the data to be transmitted in this implementation.
[0039] In the specific implementation, after the distributed key generation system is initialized, a master key is generated and distributed to each parallel chain through the relay chain, and then the data owner obtains the master key through the blockchain architecture. The confidential value is a randomly generated value used to generate keys, signatures, or perform other security operations.
[0040] Step A22: encrypt the data to be transmitted according to the security vector set, the confidential value, the master key and the linear key matrix to obtain a target encrypted ciphertext.
[0041] It can be understood that based on the distributed key generation system, a set of security vectors randomly generated for the attribute elements in the attribute set, private data used in the encryption or authentication process, a root key used to generate or derive other keys, and a linear key sharing scheme matrix are used to encrypt the data to be transmitted, and finally the ciphertext of the encrypted data to be transmitted, i.e., the target encrypted ciphertext, is obtained.
[0042] In a feasible implementation, step A22 may include steps B221 to B224: Step B221, generating a first calculated ciphertext according to the security vector set, the confidential value and the master key; It can be understood that the first calculated ciphertext refers to the calculated ciphertext corresponding to the confidential value, which is calculated by combining a distributed key generation system to randomly generate a set of security vectors for the attribute elements in the attribute set, private data used in the encryption or authentication process, and a root key used to generate or derive other keys. Finally, the calculated ciphertext corresponding to the confidential value is obtained according to the calculation result, that is, the first calculated ciphertext.
[0043] Step B222, generating a second calculated ciphertext according to the linear key matrix; In a specific implementation, the second calculated ciphertext refers to the ciphertext corresponding to the linear key sharing scheme matrix. This embodiment performs ciphertext calculation based on the calculated linear key sharing scheme matrix, and finally obtains the calculated ciphertext of the linear key sharing scheme matrix based on the calculation result, that is, the second calculated ciphertext.
[0044] Step B223, determining a target attribute ciphertext according to the first calculated ciphertext, the second calculated ciphertext, and the attribute calculated ciphertext; It can be understood that the attribute calculation ciphertext refers to the ciphertext corresponding to whether the attribute appears in the access policy for the first time, and the target attribute ciphertext refers to the ciphertext obtained by combining the first calculation ciphertext, the second calculation ciphertext and the attribute calculation ciphertext.
[0045] In a specific implementation, the calculated ciphertext corresponding to the confidential value, the ciphertext corresponding to the linear key sharing scheme matrix, and the ciphertext corresponding to whether the attribute appears in the access policy for the first time are combined to obtain the target attribute ciphertext.
[0046] Step B224, encrypt the data to be transmitted according to the target attribute ciphertext to obtain the target encrypted ciphertext.
[0047] In a specific implementation, the data to be transmitted is encrypted using the ciphertext obtained by combining the first calculation ciphertext, the second calculation ciphertext and the attribute calculation ciphertext, thereby obtaining the ciphertext corresponding to the data to be transmitted, namely the target encrypted ciphertext.
[0048] In a feasible implementation manner, step S20 may include steps C21 to C22: Step C21, sending the identity identification code to the key generation end for identity authentication, and obtaining the identity authentication result; It can be understood that the identity code refers to the identity code of the data owner, and the identity authentication result refers to the result of whether the identity authentication is passed.
[0049] In the specific implementation, the data owner identifies its own identity The result is sent to the distributed key generation system for verification to determine whether the identity authentication of the data owner is passed, that is, the identity authentication result.
[0050] Step C22, when the identity authentication result is a verification pass result, obtain a security vector set sent by the key generation end.
[0051] In a specific implementation, when the identity authentication result is a verification pass result, it indicates that the distributed key generation system will randomly generate security vectors for the attribute elements in the attribute set, and then aggregate them into a security vector set, and send it to the data owner. Then, after the identity authentication is passed, the data owner will obtain the security vector set sent by the distributed key generation system.
[0052] Step S30, sending the target encrypted ciphertext to the main chain, and storing the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
[0053] It can be understood that the target storage location refers to the distributed storage system. After the data to be transmitted is encrypted, the data owner uploads the encrypted ciphertext to the main chain in the blockchain system, and only saves the hash value on the blockchain. The encrypted ciphertext is sent to the parallel chain through the relay chain and stored in the distributed storage system, so that the data user can obtain the target encrypted ciphertext through the relay chain and parallel chain in the blockchain system when there is a data transmission request.
[0054] It should be noted that the data encryption process in this embodiment is as follows Figure 4 As shown, the encryption algorithm proposed in this embodiment performs the following steps on the data: Encryption. Step 1: The data owner passes the identity verification on the main chain and obtains the security vector. The data owner identifies his / her identity. Sent to the distributed key generation system for verification. The distributed key generation system randomly generates a security vector for the attribute elements in the set U, denoted as . And the security vector set Send to the data owner. Step 2: The data owner generates the LSSS matrix according to the access policy and selects the confidential value for calculation. The data owner selects , , and . And formulate The access policy K of attributes generates the linear key sharing scheme (LSSS) matrix Finally, The data owner randomly selects a confidential value To calculate . Data owner obtains matrix Each row of , Then calculate ,in Step 3: Upload the encrypted ciphertext to the corresponding blockchain storage layer. Represented as a sequence number in a collection of attributes, When the attribute When it first appears in policy K, the data owner extracts the vector, which can be expressed as and When the attribute When it appears again, the index of the first occurrence is recorded as , at this time the data owner will ciphertext Assign to And send it to the blockchain. The data owner will Upload to blockchain ( is the number of repeated attributes in the access policy), and stores and .
[0055] This embodiment generates a corresponding linear key matrix according to the access strategy of each attribute; encrypts the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext; sends the target encrypted ciphertext to the main chain, and stores the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain. The blockchain in the data transmission system is divided into the main chain, the parallel chain and the relay chain. Then the data is stored on the distributed storage network. Finally, the attribute-based encryption algorithm is used to resist quantum attacks to ensure the data security during the transmission process, thereby improving the overall execution efficiency, computing performance and system security of the blockchain network data transmission.
[0056] Based on the first embodiment of the present application applied to the data owner, in the first embodiment of the present application applied to the data user, the same or similar contents as those in the first embodiment applied to the data owner can be referred to the above introduction, and will not be repeated in the following. Figure 5 , the cross-chain data transmission method is applied to the data user end, and the method also includes steps S11~S13: Step S11, sending a data transmission request to the relay chain, and performing blockchain authentication on the data transmission request through the relay chain; It can be understood that in this embodiment, the data owner (data user) is used as an example for the execution subject, and the data transmission request refers to a formal request issued by the data user to the data owner, requesting the owner to transmit specific data.
[0057] In the specific implementation, before cross-chain interaction, users and regulators send registration requests in the blockchain system and conduct blockchain authentication to obtain blockchain authentication results. The nodes on the main chain use data collection devices to collect data and use smart contracts to (Contract Chaincode A, contract chain code A) and (Contract Chaincode B, Contract Chaincode B) to facilitate cross-chain data transmission. In blockchain technology, chaincode refers to the smart contract deployed on the blockchain network. Chaincode usually contains business logic and data processing functions to achieve specific business needs. Contract Chaincode refers to the part of these chaincodes that specifically implements a contract function.
[0058] Step S12, when the blockchain authentication result is a passed authentication result, obtain the data summary and data address; It can be understood that the data summary refers to a string of fixed length obtained by performing a hash function calculation on the original data, and the data address refers to a unique identifier used to locate and access data.
[0059] In the specific implementation, the request initiator uses To verify identity and process the data to obtain a dataset and data summary . Use time lock and hash lock Lock the data and generate data packets using attribute-based encryption algorithms. Transmit the packet to the relay chain, where nodes A consensus is reached within 10 seconds and the weights are recombined. When half of the nodes return the results, Call the private key to recover the data in advance And return address , that is, get the data summary and data address.
[0060] In a feasible implementation, step S12 may include steps A121-A122: Step A121, when the blockchain authentication result is an authentication pass result, data is locked based on a time lock and a preset hash lock, and a locking data packet is generated according to an attribute encryption strategy; It can be understood that time lock refers to a locking mechanism that allows transactions or data to be unlocked after a specific point in time or period of time, preset hash lock refers to a locking mechanism that allows transactions or data to be unlocked when the correct hash value is provided, attribute encryption strategy refers to an attribute-based encryption algorithm, and locked data packet refers to a data packet generated by an attribute-based encryption algorithm.
[0061] In the specific implementation, the request initiator uses To verify identity and process the data to obtain a dataset and data summary . Use time lock and hash lock Lock the data and generate data packets using attribute-based encryption algorithms.
[0062] Step A122, when receiving the data confirmation information fed back by the preset proportion of target nodes, decrypt the locked data packet based on the preset subkey to obtain the data summary and data address.
[0063] It can be understood that the preset ratio refers to a preset node ratio. In this embodiment, 50% is taken as an example. The preset subkey refers to a preset private key, and the data confirmation information refers to information confirming receipt of the data.
[0064] In the specific implementation, when 50% of the target nodes receive the confirmation information of receiving the data, the pre-set private key is called to pre-decrypt the data to obtain the data summary and data address. That is, when half of the nodes return the result Call the private key to recover the data in advance And return address .
[0065] Step S13, based on the data summary and the data address, obtain the target encrypted ciphertext at the target storage location through the relay chain and the parallel chain.
[0066] In the specific implementation, according to the obtained data summary and data address, the target encrypted ciphertext stored in the distributed storage system is obtained through the relay chain and parallel chain in the multi-layer blockchain data transmission system.
[0067] In a feasible implementation manner, step S13 may further include steps A131 to A133: Step A131, when the data use condition is met, the target encrypted ciphertext is decrypted and calculated according to the subkey set fed back by the key generation end to obtain decrypted plaintext data; It can be understood that data usage conditions refer to a series of rules and restrictions that data users must abide by to ensure the security, privacy and compliance of the data, the subkey set refers to the key set used to decrypt each attribute, and the decrypted plaintext data refers to the original data obtained by the decryption process.
[0068] In a specific implementation, when the data usage condition is met at the data usage end, the target encrypted ciphertext is decrypted according to the subkey set fed back by the key generation end to obtain the original data after decryption, that is, the decrypted plaintext data.
[0069] Step A132, when the decrypted plaintext data is equal to the preset plaintext data, determining that the current decryption result is a successful decryption result; It can be understood that the preset plaintext data refers to the original data that has not been encrypted, that is, when the decrypted data is consistent with the original data that has not been encrypted, it indicates that the current decryption result is a successful decryption result.
[0070] Step A133, obtaining the data to be transmitted corresponding to the target encrypted ciphertext according to the successful decryption result.
[0071] In a specific implementation, when the decryption process is successful, it indicates that the data user has obtained the data to be transmitted corresponding to the target encrypted ciphertext, that is, the data transmission is completed.
[0072] It should be noted that the data user generates the corresponding key through user attribute verification and traverses the access policy for calculation. Assuming that the data user meets the conditions , we can calculate Make , the user can further calculate Assuming that the data user meets the usage conditions, the result Equivalent to plain text , the data can be accessed.
[0073] It should be noted that this embodiment optimizes and innovates the cross-chain data transmission process based on the ideas of hash time lock contract (HTLC) and relay chain to achieve cross-chain data transmission and supervision. The specific operation steps are as follows: Step 1: Preparation for cross-chain data transmission: (1) Before cross-chain interaction, users and regulators send registration requests in the blockchain system and obtain blockchain certification. (2) Nodes on the main chain use data collection devices to collect data and use smart contracts to and To facilitate cross-chain data transmission. Step 2: Data locking and transmission. In this process, the Hash Time Lock Contract (HTLC) is used to lock the data on the relay chain to ensure the security of the data during cross-chain transmission. At the same time, the relay chain is used to coordinate the data transmission between the main chain and the parallel chain to ensure the consistency and integrity of the data during the transmission process. (1) The request initiator uses To verify identity and process the data to obtain a dataset and data summary . (2) Use time lock and hash lock Lock the data and generate data packets using attribute-based encryption algorithms. (3) Transmit the packet to the relay chain, where nodes A consensus is reached within 10 seconds and the weights are recombined. (4) When half of the nodes return the results Call the private key to recover the data in advance And return address (5)Address Use the same hash lock locking, and The mutual calls between them realize the unlocking of data within the specified time. (6) For cross-chain regulatory data, the main chain regulatory node initiates a data viewing request and uses a smart contract and To record and supervise cross-chain data. (7) Verify the regulator, send the regulatory request to the parachain, and normalize the request data (8) Parallel chains use the Scalable Practical Byzantine Fault Tolerance (SPBFT) consensus mechanism to transfer data to . Set a hash lock for the data and time lock , encrypt it, and upload it to the relay chain. (9) The winning node in the relay chain game sorts the data and sends it to . After pre-decryption, Use the same hash lock to lock the supervisor's call information . (10) pass and The mutual calls between them are used to unlock the data. The data Sent to regulatory authorities, The call information of the regulatory department Stored on a parallel blockchain, it enables the supervision and storage of data interaction records.
[0074] It is understandable that during the cross-chain data transmission process, the consensus mechanism is implemented through the relay chain to ensure that all participants reach a consensus on the consistency of data transmission. After the data is verified to be correct, it is unlocked on the parachain, and users can access the decrypted data. During the cross-chain data transmission process, the regulator monitors the entire process of cross-chain data transmission through the relay chain to ensure compliance. All records and status updates of cross-chain data transmission are audited and recorded on the main chain.
[0075] This embodiment sends a data transmission request to the relay chain, and the data transmission request is authenticated by the blockchain through the relay chain; when the blockchain authentication result is a pass result, the data summary and data address are obtained; based on the data summary and the data address, the target encrypted ciphertext is obtained at the target storage location through the relay chain and the parallel chain. In the above manner, that is, a multi-layer blockchain architecture is adopted, the data transmission process is simplified, data transmission between different levels is realized, and the flexibility and efficiency of data flow are guaranteed. The relay chain is used based on the HTLC mechanism to optimize the cross-blockchain data transmission process and ensure the security of real-time data transmission within the multi-layer blockchain system. At the same time, HTLC imposes time limits on transactions to prevent malicious activities.
[0076] Based on the first embodiment of the present application applied to the data owner and / or the first embodiment of the present application applied to the data user, in the first embodiment of the present application applied to the key generation end, the same or similar contents as those in the above-mentioned embodiment 1 applied to the data owner and / or the embodiment 1 applied to the data user can be referred to the above introduction and will not be repeated in the following. Figure 6 , the cross-chain data transmission method is applied to the key generation end, and the method also includes steps S21~S23: Step S21, performing initialization processing according to the global attribute base and security parameters, and determining the initialization result; It can be understood that in this embodiment, the key generation end (distributed key generation system) is used as an example for the execution entity. The global attribute base refers to a set of attributes and their related parameters defined and managed throughout the entire system, and the security parameters refer to the key values used to measure and control the security of the encryption system.
[0077] In a specific implementation, the distributed key generation system determines a global attribute base and selects security parameters for initialization processing, thereby determining an initialization result of the distributed key generation system.
[0078] Step S22, when the initialization result is a success result, determining an attribute description matrix of each attribute based on a preset matrix function and an attribute set; It is understood that the preset matrix function refers to Function (trap generation function), attribute description matrix refers to the matrix used to describe the attributes.
[0079] In a specific implementation, when the distributed key generation system is initialized successfully, based on The function obtains the matrix description of each attribute in the attribute set to obtain the attribute description matrix.
[0080] Step S23, generate a corresponding master key according to the attribute description matrix and send it to the relay chain, so as to send the master key to the parallel chain through the relay chain.
[0081] In the specific implementation, the distributed generation system is The function obtains the matrix description of each attribute in the attribute set and generates a master key, and then distributes the generated master key and attribute matrix to each parallel chain through the relay chain.
[0082] It should be noted that the distributed key generation system determines the global attribute base , and select security parameters and ,in represents the number of attributes in U, , and . Distributed key generation system uses Function to obtain the matrix description of each attribute in the attribute set U and , and generate a master key . The generated master key and attribute matrix are distributed to each parallel chain through the relay chain.
[0083] In a feasible implementation, the cross-chain data transmission method is applied to the key generation end, and the method further includes steps S221 to S223: Step S221, when there is a target attribute in the user attribute set, determining a target attribute vector according to a preset vector function and the user attribute set; It can be understood that the target attribute refers to a preset data attribute, the preset vector function refers to a preset sample preprocessing function (SamplePre), and the target attribute vector refers to a vector corresponding to the attribute set.
[0084] In the specific implementation, if the user has the attribute , distributed key generation system execution function To obtain , that is, the target attribute vector is obtained.
[0085] Step S222, generating a subkey of each attribute according to the target attribute vector and the target random vector; In a specific implementation, the target random vector refers to a vector randomly selected by the distributed key generation system. as the user identifier, and for each attribute generate , which is the subkey of each attribute.
[0086] Step S223, the subkeys of each attribute are aggregated to obtain a subkey set, and the subkey set is sent to the data user end, so that the data user end decrypts the target encrypted ciphertext according to the subkey set.
[0087] In a specific implementation, a subkey set is obtained by summarizing the subkeys of each attribute, and then the subkey set is provided to the data user, so that the data user can decrypt the target encrypted ciphertext according to the subkey set to obtain the data to be transmitted, and finally complete the data transmission.
[0088] It should be noted that if a user has the attribute , distributed key generation system execution function To obtain Otherwise, the distributed key generation system will choose to ensure The distributed key generation system is obtained ,in It is a satisfying Random Gaussian parameters. Distributed key generation system randomly selects vectors and obtain . Distributed Key Generation System Random Selection as the user identifier, and for each attribute generate For each access condition in the access policy K, the distributed key generation system traverses the entire attribute set U and performs the following computation ,in , the distributed key generation system will Provide to data users and publish .
[0089] This embodiment determines the target attribute vector according to the preset vector function and the user attribute set when the target attribute exists in the user attribute set; generates the subkey of each attribute according to the target attribute vector and the target random vector; summarizes the subkeys of each attribute to obtain a subkey set, and sends the subkey set to the data user end, so that the data user end decrypts the target encrypted ciphertext according to the subkey set. In the above manner, the encryption algorithm is improved, the size of the ciphertext set is reduced and the ciphertext set is reused, the efficiency of encryption and decryption is improved, and data transmission is more efficient. Attribute encryption based on lattice theory can ensure the post-quantum security of data transmission and effectively resist quantum attacks.
[0090] This embodiment determines the initialization result by performing initialization processing according to the global attribute base and security parameters; when the initialization result is a successful result, the attribute description matrix of each attribute is determined based on the preset matrix function and the attribute set; the corresponding master key is generated according to the attribute description matrix and sent to the relay chain, so that the master key is sent to the parallel chain through the relay chain. By combining the distributed storage model with the blockchain, the data reading and writing performance is improved, and the scalability of massive data is supported. At the same time, the special data partitioning mechanism, access control strategy and attribute encryption are combined to achieve sophisticated data storage and access control, and improve the efficiency of encryption and decryption, making data transmission more efficient.
[0091] For example, in order to help understand the implementation process of the cross-chain data transmission method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 7 , Figure 7A brief flow chart of a cross-chain data transmission method is provided. Specifically, in the algorithm initialization phase, the distributed key generation system first determines the global attribute base and selects security parameters, and then generates a matrix description and a master key for each attribute in the attribute set U. In the data encryption process, the data owner obtains the security vector through identity authentication, formulates an access policy to generate the LSSS matrix, randomly selects a confidential value for calculation, and uploads the processed ciphertext to the blockchain. In the key generation phase, the corresponding key is generated by user attribute verification, and the access policy is traversed for calculation. The cross-chain data transmission mechanism draws on the ideas of hash time lock contracts and relay chains to ensure the security and supervision of data in cross-chain transmission, involving steps such as identity authentication, data locking, consensus reaching, and data unlocking. Finally, in the data decryption phase, assuming that the data user meets the conditions, the plaintext result can be calculated.
[0092] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the cross-chain data transmission method of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.
[0093] This application also provides a cross-chain data transmission device, please refer to Figure 8 , the cross-chain data transmission device is applied to the data owner, and the device includes: A generating module 10, for generating a corresponding linear key matrix according to the access strategy of each attribute; An encryption module 20, configured to encrypt the data to be transmitted according to the security vector set and the linear key matrix to obtain a target encrypted ciphertext; The transmission module 30 is used to send the target encrypted ciphertext to the main chain, and store the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
[0094] Optionally, the encryption module 20 is further used for: Get the secret value and obtain the master key generated by the key generation end on the parallel chain; The data to be transmitted is encrypted according to the security vector set, the confidential value, the master key and the linear key matrix to obtain a target encrypted ciphertext.
[0095] Optionally, the encryption module 20 is further used for: Generate a first calculated ciphertext according to the security vector set, the confidential value and the master key; Generate a second calculated ciphertext according to the linear key matrix; Determine a target attribute ciphertext according to the first calculated ciphertext, the second calculated ciphertext, and the attribute calculated ciphertext; The data to be transmitted is encrypted according to the target attribute ciphertext to obtain a target encrypted ciphertext.
[0096] Optionally, the encryption module 20 is further used for: Send the identity code to the key generation end for identity authentication and obtain the identity authentication result; When the identity authentication result is a verification pass result, a security vector set sent by the key generation end is obtained.
[0097] The present application also provides a cross-chain data transmission device, which is applied to a data user end, and the device includes: An authentication module, used to send a data transmission request to a relay chain, and perform blockchain authentication on the data transmission request through the relay chain; The acquisition module is used to obtain the data summary and data address when the blockchain authentication result is a passed authentication result; The acquisition module is also used to obtain the target encrypted ciphertext at the target storage location through the relay chain and the parallel chain based on the data summary and the data address.
[0098] Optionally, the acquisition module is further used to: When the blockchain authentication result is a pass result, data is locked based on the time lock and the preset hash lock, and a locked data packet is generated according to the attribute encryption strategy; When the data confirmation information fed back by the preset proportion of target nodes is received, the locked data packet is decrypted based on the preset subkey to obtain the data summary and the data address.
[0099] Optionally, the acquisition module is further used to: When the data usage condition is met, the target encrypted ciphertext is decrypted and calculated according to the subkey set fed back by the key generation end to obtain the decrypted plaintext data; When the decrypted plaintext data is equal to the preset plaintext data, determining that the current decryption result is a successful decryption result; The data to be transmitted corresponding to the target encrypted ciphertext is obtained according to the successful decryption result.
[0100] The present application also provides a cross-chain data transmission device, which is applied to a key generation end, and the device includes: An initialization module is used to perform initialization processing according to a global attribute base and security parameters and determine an initialization result; A processing module, configured to determine an attribute description matrix of each attribute based on a preset matrix function and an attribute set when the initialization result is a success result; A sending module is used to generate a corresponding master key according to the attribute description matrix and send it to the relay chain, so as to send the master key to the parallel chain through the relay chain.
[0101] Optionally, the processing module is further used to: When the target attribute exists in the user attribute set, determining the target attribute vector according to a preset vector function and the user attribute set; Generate a subkey for each attribute according to the target attribute vector and the target random vector; The subkeys of each attribute are aggregated to obtain a subkey set, and the subkey set is sent to the data user end, so that the data user end decrypts the target encrypted ciphertext according to the subkey set.
[0102] The cross-chain data transmission device provided by the present application adopts the cross-chain data transmission method in the above embodiment, which can solve the technical problem of how to improve the efficiency of data transmission while ensuring the security of cross-chain data transmission. Compared with the prior art, the beneficial effects of the cross-chain data transmission device provided by the present application are the same as the beneficial effects of the cross-chain data transmission method provided by the above embodiment, and other technical features in the cross-chain data transmission device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0103] The present application provides a cross-chain data transmission device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cross-chain data transmission method in the above-mentioned embodiment one.
[0104] Reference below Fig. 9 , which shows a schematic diagram of the structure of a cross-chain data transmission device suitable for implementing the embodiment of the present application. The cross-chain data transmission device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The cross-chain data transmission device shown is merely an example and should not bring any limitations to the functions and scope of use of the embodiments of the present application.
[0105] like Fig. 9As shown, the cross-chain data transmission device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the cross-chain data transmission device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the cross-chain data transmission device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a cross-chain data transmission device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0106] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0107] The cross-chain data transmission device provided by this application adopts the cross-chain data transmission method in the above embodiment, which can solve the technical problem of how to improve the efficiency of data transmission while ensuring the security of cross-chain data transmission. Compared with the prior art, the beneficial effects of the cross-chain data transmission device provided by this application are the same as the beneficial effects of the cross-chain data transmission method provided by the above embodiment, and the other technical features in the cross-chain data transmission device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0108] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0110] In addition, to achieve the above objectives, the present invention also proposes a cross-chain data transmission system, which includes the data owning end, data using end and key generating end mentioned above.
[0111] Since the cross-chain data transmission system adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.
[0112] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the cross-chain data transmission method in the above-mentioned embodiment.
[0113] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0114] The above-mentioned computer-readable storage medium may be included in the cross-chain data transmission device; or it may exist independently without being assembled into the cross-chain data transmission device.
[0115] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the cross-chain data transmission device, the cross-chain data transmission device: generates a corresponding linear key matrix according to the access strategy of each attribute; encrypts the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext; sends the target encrypted ciphertext to the main chain, and stores the target encrypted ciphertext to the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
[0116] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0118] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0119] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned cross-chain data transmission method, and can solve the technical problem of how to improve the efficiency of data transmission while ensuring the security of cross-chain data transmission. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the cross-chain data transmission method provided in the above-mentioned embodiment, and will not be repeated here.
[0120] The present application also provides a computer program product, including a computer program, which implements the steps of the cross-chain data transmission method as described above when the computer program is executed by a processor.
[0121] The computer program product provided by this application can solve the technical problem of how to improve the efficiency of data transmission while ensuring the security of cross-chain data transmission. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the cross-chain data transmission method provided by the above embodiment, which will not be repeated here.
[0122] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A cross-chain data transmission method, characterized in that: The cross-chain data transmission method is applied to the data owner, and the method includes: Generate the corresponding linear key matrix according to the access strategy of each attribute; Encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain a target encrypted ciphertext; The target encrypted ciphertext is sent to the main chain, and the target encrypted ciphertext is stored in the target storage location through the main chain, so that the data user can obtain the target encrypted ciphertext through the relay chain and the parallel chain.
2. The method according to claim 1, characterized in that The step of encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext comprises: Get the secret value and obtain the master key generated by the key generation end on the parallel chain; The data to be transmitted is encrypted according to the security vector set, the confidential value, the master key and the linear key matrix to obtain a target encrypted ciphertext.
3. The method according to claim 2, characterized in that The step of encrypting the data to be transmitted according to the security vector set, the confidential value, the master key and the linear key matrix to obtain a target encrypted ciphertext includes: Generate a first calculated ciphertext according to the security vector set, the confidential value and the master key; Generate a second calculated ciphertext according to the linear key matrix; Determine a target attribute ciphertext according to the first calculated ciphertext, the second calculated ciphertext, and the attribute calculated ciphertext; The data to be transmitted is encrypted according to the target attribute ciphertext to obtain a target encrypted ciphertext.
4. The method according to claim 1, characterized in that Before the step of encrypting the data to be transmitted according to the security vector set and the linear key matrix to obtain the target encrypted ciphertext, the method further includes: Send the identity code to the key generation end for identity authentication and obtain the identity authentication result; When the identity authentication result is a verification pass result, a security vector set sent by the key generation end is obtained.
5. A cross-chain data transmission method, characterized in that: The cross-chain data transmission method is applied to the data user end, and the method includes: Sending a data transmission request to the relay chain, and performing blockchain authentication on the data transmission request through the relay chain; When the blockchain authentication result is a passed authentication result, obtain the data summary and data address; Based on the data summary and the data address, the target encrypted ciphertext is obtained at the target storage location through the relay chain and the parallel chain.
6. The method according to claim 5, characterized in that When the blockchain authentication result is an authentication pass result, the step of obtaining the data summary and the data address includes: When the blockchain authentication result is a pass result, data is locked based on the time lock and the preset hash lock, and a locked data packet is generated according to the attribute encryption strategy; When the data confirmation information fed back by the preset proportion of target nodes is received, the locked data packet is decrypted based on the preset subkey to obtain the data summary and the data address.
7. The method according to claim 5, characterized in that After the step of obtaining the target encrypted ciphertext at the target storage location through the relay chain and the parallel chain based on the data summary and the data address, it also includes: When the data usage condition is met, the target encrypted ciphertext is decrypted and calculated according to the subkey set fed back by the key generation end to obtain the decrypted plaintext data; When the decrypted plaintext data is equal to the preset plaintext data, determining that the current decryption result is a successful decryption result; The data to be transmitted corresponding to the target encrypted ciphertext is obtained according to the successful decryption result.
8. A cross-chain data transmission method, characterized in that: The cross-chain data transmission method is applied to the key generation end, and the method includes: Perform initialization processing according to the global attribute base and security parameters to determine the initialization result; When the initialization result is a success result, determining an attribute description matrix of each attribute based on a preset matrix function and an attribute set; Generate a corresponding master key according to the attribute description matrix and send it to the relay chain, so that the master key can be sent to the parallel chain through the relay chain.
9. The method according to claim 8, characterized in that The cross-chain data transmission method further includes: When the target attribute exists in the user attribute set, determining the target attribute vector according to a preset vector function and the user attribute set; Generate a subkey for each attribute according to the target attribute vector and the target random vector; The subkeys of each attribute are aggregated to obtain a subkey set, and the subkey set is sent to the data user end, so that the data user end decrypts the target encrypted ciphertext according to the subkey set.
10. A cross-chain data transmission system, characterized in that: The cross-chain data transmission system includes a data owning end, a data using end, and a key generating end. The data owning end executes the cross-chain data transmission method as described in any one of claims 1 to 4 above, the data using end executes the cross-chain data transmission method as described in any one of claims 5 to 7 above, and the key generating end executes the cross-chain data transmission method as described in claims 8 to 9 above.
Citation Information
Patent Citations
Cloud data sharing method based on block chain
CN112019591A
Energy data fine-grained access control method based on block chain
CN112487443A
Data sharing method and system based on blockchain and attribute-based encryption, and computer readable storage medium
CN112637278A
Data processing method and device, computer equipment and storage medium
CN113837760A
Green electricity transaction data sharing method and device based on block chain
CN117555900A