Task processing method, system and device based on block chain and computer equipment
By encrypting task-related data multiple times and using the proxy re-encryption contract of the blockchain network, the problem of low processing efficiency of computing tasks in existing technologies is solved, and the processing efficiency of computing tasks is improved while protecting privacy information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-11-15
- Publication Date
- 2026-05-15
AI Technical Summary
Existing differential privacy or multi-party secure computation methods require high computational and communication resources during the computation process to protect privacy-related information, resulting in low efficiency in processing computational tasks.
By encrypting the task-related data once and then encrypting it a second time to obtain a re-encryption key, and using the proxy re-encryption contract of the blockchain network to perform proxy re-encryption calculations, the security and integrity of the data during transmission and processing are ensured, while reducing the consumption of computing and communication resources.
While protecting the privacy of participants, it improves the efficiency of computing task processing and reduces the consumption of computing and communication resources.
Smart Images

Figure CN122053098A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a blockchain-based task processing method, system, device, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] With the development of blockchain technology, a blockchain-based computing task processing method has emerged. In this method, both the task initiator and the task computer act as blockchain nodes in the blockchain network. The task initiator uploads task information and computing data related to the computing task to the blockchain network, while the task computer retrieves the relevant task information and computing data from the blockchain network and executes the corresponding computing task to obtain the computing result. This method utilizes the blockchain network to ensure data security and transparency and improves overall computing efficiency.
[0003] In traditional technologies, when using blockchain networks for computational tasks, such as computational operations in privacy-preserving environments, to protect the identity information of participants, differential privacy or multi-party secure computation are commonly used. For example, differential privacy can provide availability while protecting privacy by introducing noise, while multi-party secure computation allows multiple participants to perform computations without sharing private data, thus ensuring the security of participants' privacy-related information.
[0004] However, current differential privacy or multi-party secure computation methods require high computational costs when protecting privacy-related information during the computation process. This means that a large amount of computing and communication resources are needed, and the efficiency of computing tasks remains low. Summary of the Invention
[0005] Therefore, it is necessary to address the aforementioned technical problems by providing a blockchain-based task processing method, system, device, computer equipment, computer-readable storage medium, and computer program product that can improve the computational processing efficiency of computational tasks with privacy-related information protection requirements.
[0006] In a first aspect, this application provides a blockchain-based task processing method, comprising: acquiring task-related data of a target computing task to be executed; encrypting the task-related data once to obtain first ciphertext data; encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computing task based on the task-related data.
[0007] Secondly, this application also provides a blockchain-based task processing device, comprising: a task-related data encryption module, used to acquire task-related data of a target computing task to be executed, encrypt the task-related data once to obtain first ciphertext data, and encrypt the first ciphertext data a second time to obtain second ciphertext data; an encrypted data packet acquisition module, used to encrypt the task executor's public key according to the task initiator's private key to obtain a re-encryption key, and package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; and a re-encryption calculation module, used to upload the encrypted data packet to the blockchain network when the encrypted data packet passes verification, and call the proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used for the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computing task based on the task-related data.
[0008] Thirdly, this application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring task-related data of a target computing task to be executed; encrypting the task-related data once to obtain first ciphertext data; and encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network; and performing proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computing task based on the task-related data.
[0009] Fourthly, this application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it performs the following steps: obtaining task-related data of a target computing task to be executed; encrypting the task-related data once to obtain first ciphertext data; and encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key and execute the target computing task based on the task-related data.
[0010] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps: acquiring task-related data of a target computing task to be executed; encrypting the task-related data once to obtain first ciphertext data; and encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computing task based on the task-related data.
[0011] In the aforementioned blockchain-based task processing methods, devices, computer equipment, computer-readable storage media, and computer program products, by acquiring the task-related data of the target computation task to be executed, encrypting the task-related data once to obtain first ciphertext data, and then encrypting the first ciphertext data a second time to obtain second ciphertext data, and encrypting the public key of the task executor based on the private key of the task initiator to obtain a re-encryption key, it is possible to securely perform multi-party computations without disclosing the specific information of the participants when executing computation tasks involving multiple parties, by encrypting the task-related data and the public key of the task executor, thereby enhancing the protection of privacy-related information. Furthermore, by packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet, and uploading the encrypted data packet to the blockchain network upon verification, a proxy re-encryption contract deployed on the blockchain network is invoked to perform proxy re-encryption computation on the second ciphertext data in the encrypted data packet based on the re-encryption key, thereby obtaining third ciphertext data. In this process, the task executor can decrypt the third ciphertext data and the first ciphertext data using the task executor's private key to obtain the task-related data. Based on the task-related data, the target computing task is executed to obtain the corresponding task computing result. This ensures the security and integrity of data during transmission and processing. At the same time, using blockchain for computing task processing can reduce computing and communication resources, thereby improving the efficiency of computing task processing.
[0012] Sixthly, this application also provides a blockchain-based task processing system, comprising a task initiator node, a task executor node, and a blockchain network. The blockchain network deploys a proxy re-encryption contract, wherein: the task initiator node is configured to: obtain task-related data of the target computation task to be executed; encrypt the task-related data once to obtain first ciphertext data; encrypt the first ciphertext data a second time to obtain second ciphertext data; encrypt the task executor's public key according to the task initiator's private key to obtain a re-encryption key; and encrypt the first ciphertext data, the second ciphertext data, and the re-encryption key. The process involves packaging the data into an encrypted data packet. Once the encrypted data packet passes verification, it is uploaded to the blockchain network. A proxy re-encryption contract deployed on the blockchain network is invoked to perform proxy re-encryption calculations on the second ciphertext data in the encrypted data packet using the re-encryption key, resulting in third ciphertext data. The task executor node is configured to: decrypt the third ciphertext data using its private key to obtain a decryption key; decrypt the first ciphertext data using the decryption key to obtain decrypted task-related data; and execute the target computation task according to the decrypted task-related data to obtain the task computation result.
[0013] In the aforementioned blockchain-based task processing system, the task initiating node obtains the task-related data of the target computation task to be executed, encrypts the task-related data once to obtain first ciphertext data, and then encrypts the first ciphertext data a second time to obtain second ciphertext data. Additionally, it encrypts the task executor's public key using the task initiating node's private key to obtain a re-encryption key. This allows for secure multi-party computation without leaking the specific information of the participants, enhancing the protection of privacy-related information, by encrypting the task-related data and the task executor's public key when executing computation tasks involving multiple parties. Furthermore, the task initiating node packages the first ciphertext data, the second ciphertext data, and the re-encryption key into an encrypted data packet. Upon successful verification, the encrypted data packet is uploaded to the blockchain network. This allows the node to invoke a proxy re-encryption contract deployed on the blockchain network, using the re-encryption key to perform proxy re-encryption computation on the second ciphertext data in the encrypted data packet, obtaining the third ciphertext data. The task executor node can decrypt the third ciphertext data using its private key to obtain the decryption key, and then decrypt the first ciphertext data using the decryption key to obtain the decrypted task-related data. It can then execute the target computation task according to the decrypted task-related data to obtain the task computation result. This ensures the security and integrity of data during transmission and processing, while using blockchain for computation task processing can reduce computing and communication resources and improve the efficiency of computation task processing. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is an application environment diagram of a blockchain-based task processing method in one embodiment;
[0016] Figure 2 This is a flowchart illustrating a blockchain-based task processing method in one embodiment;
[0017] Figure 3 This is a schematic diagram of the blockchain structure in one embodiment;
[0018] Figure 4 This is a flowchart illustrating a blockchain-based task processing method in another embodiment;
[0019] Figure 5 This is a schematic diagram of the architecture of a blockchain-based task processing system in one embodiment;
[0020] Figure 6 This is a timing diagram illustrating task processing in a blockchain-based task processing system according to one embodiment.
[0021] Figure 7 This is a schematic diagram of a blockchain-based task processing architecture in another embodiment;
[0022] Figure 8 This is a timing diagram illustrating task processing in another embodiment of a blockchain-based task processing system.
[0023] Figure 9 This is a structural block diagram of a blockchain-based task processing device in one embodiment;
[0024] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] The blockchain-based task processing method provided in this application embodiment can be applied to, for example... Figure 1The application environment shown includes a task initiator node 102, a task executor node 104, a blockchain network 106, and a proxy re-encryption contract 108 deployed within the blockchain network. The task initiator node 102 initiates the target computation task and obtains the corresponding task computation result from the blockchain network 106. Specifically, the task initiator node 102 obtains the task association data of the target computation task to be executed, encrypts the task association data once to obtain first ciphertext data, and then encrypts the first ciphertext data a second time to obtain second ciphertext data. Further, the task initiator node 102 encrypts the task executor's public key using the task initiator's private key to obtain a re-encryption key, and packages the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet. When the encrypted data packet passes verification, the task initiator node 102 uploads the encrypted data packet to the blockchain network and calls the proxy re-encryption contract 108 deployed on the blockchain network 106. Based on the re-encryption key, the proxy re-encryption calculation is performed on the second ciphertext data in the encrypted data packet to obtain third ciphertext data. The task executor node 104 can obtain three-ciphertext data and the first-ciphertext data from the blockchain network. Using its private key, it decrypts the third-ciphertext data to obtain a decryption key, and then decrypts the first-ciphertext data using this key to obtain the decrypted task-related data. This decrypted task-related data is then used to execute the target computation task and obtain the computation result. The task executor node 104 can further encrypt and upload the computation result to the blockchain network 106 for the task initiator node 102 to access and view. Both the task initiator node 102 and the task executor node 104 can be implemented through a terminal or a server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server can be a standalone server or a server cluster. The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0027] In one exemplary embodiment, such as Figure 2 As shown, a blockchain-based task processing method is provided, which can be applied to... Figure 1 Taking task initiator node 102 as an example, the explanation includes the following steps S202 to S206. Wherein:
[0028] Step S202: Obtain the task association data of the target computing task to be executed, encrypt the task association data once to obtain the first ciphertext data, and encrypt the first ciphertext data a second time to obtain the second ciphertext data.
[0029] In this context, the task initiator node can be understood as the party that initiates the target computation task. Specifically, the target computation task can be a computation task that requires the protection of privacy-related information. It needs to take encryption protection measures in the privacy computing environment to ensure that the participants' identity information and other privacy-related information are effectively protected when performing computation operations.
[0030] Specifically, after initiating a request for a target computation task, to prevent information leakage or leakage of specific data related to the computation task, the task initiating node can obtain the task-related data of the target computation task to be executed, and use a symmetric key to symmetrically encrypt the task-related data to obtain the first ciphertext data. The symmetric key can specifically be an AESKey (Advanced Encryption Standard Key), which uses the same key for both encryption and decryption.
[0031] Furthermore, for the first encrypted data, the task initiator node obtains its own task initiator public key and uses it to encrypt the first encrypted data a second time, obtaining the second encrypted data. The task initiator node's public and private keys, as well as the task executor's public and private keys, can all be dynamically distributed through a key management platform. This dynamic distribution and updating of keys ensures their security and reliability.
[0032] Step S204: Encrypt the public key of the task executor using the private key of the task initiator to obtain a re-encryption key. Package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet.
[0033] Specifically, the task initiator node obtains its own task initiator private key and the task executor's task executor public key, and encrypts the task executor's public key based on the task initiator's private key to obtain the re-encryption key.
[0034] Furthermore, the task initiating node packages the first ciphertext data, the second ciphertext data, and the re-encryption key into an encrypted data packet for uploading to the blockchain network for re-encryption computation. Before uploading the encrypted data packet to the blockchain network, it must be verified; if verification is successful, the encrypted data packet is then uploaded to the blockchain network.
[0035] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, it is a decentralized database, or a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. Specifically, a blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer. The blockchain underlying platform can include user management, basic services, and smart contract processing modules. The user management module is responsible for managing the identity information of all blockchain participants. The basic service module is deployed on all blockchain node devices to verify the validity of business requests and record valid requests in storage after consensus is reached. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Contract logic can be defined using a programming language, published to the blockchain for contract registration, and executed by calling keys or other events to complete the contract logic. The platform's product service layer provides basic capabilities and implementation frameworks for typical applications. Based on these basic capabilities, business characteristics can be added to complete the blockchain implementation of business logic. The application service layer can provide application services based on blockchain solutions for business participants to use. For example, business participants can call blockchain contracts deployed in the blockchain network (such as proxy re-encryption contracts) to perform business processing or task processing operations.
[0036] Step S206: When the encrypted data packet passes verification, the encrypted data packet is uploaded to the blockchain network, and the proxy re-encryption contract deployed on the blockchain network is invoked. Based on the re-encryption key, the proxy re-encryption calculation is performed on the second ciphertext data in the encrypted data packet to obtain the third ciphertext data. The third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key to obtain the task-related data, and to execute the target calculation task based on the task-related data.
[0037] In addition to verifying the integrity of the encrypted data packets, data integrity and source reliability verification are also required. Specifically, this can be achieved by verifying the encrypted data packets using pre-built polynomial commitments. For example, for data sources in computational tasks requiring privacy protection, polynomial commitments (such as KZG commitments, i.e., the KZG polynomial commitment scheme (or Carter polynomial commitment scheme)) can be used to prove the correctness of the data source provided by each data source provider. Upon successful verification, the encrypted data packet is uploaded to the blockchain network.
[0038] Specifically, when the encrypted data packet passes verification, the task initiating node uploads the encrypted data packet to the blockchain network and invokes the proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the encrypted data packet. Specifically, the task initiating node invokes the proxy re-encryption contract to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet based on the re-encryption key in the encrypted data packet, thereby obtaining the third ciphertext data.
[0039] Furthermore, the task initiating node stores the third ciphertext data obtained from the proxy re-encryption computation in the blockchain network. This allows the subsequent task executing node to retrieve the third ciphertext data from the blockchain network and the first ciphertext data from the encrypted data packet, based on the privacy computation task requirements of the task initiating node. The task initiating node can then decrypt the third ciphertext data and the first ciphertext data using its own task executing private key to obtain the decrypted task-related data. Based on this decrypted task-related data, the node can execute the target computation task and obtain the task execution result.
[0040] In one exemplary embodiment, such as Figure 3As shown, a blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values of the current block, the block header feature values of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks. Specific types of blockchains include public chains, private chains, and consortium chains. Among them, a public blockchain is a blockchain that is publicly available, with access and writing permissions open to everyone; a private blockchain is a blockchain that is privately owned, with access and writing permissions controlled only by a certain organization or institution; and a consortium blockchain is a blockchain formed by a consortium of institutions, with access and writing permissions only open to nodes that have joined the consortium. The difference between different types of blockchains lies in the access and writing permissions, as well as the degree of decentralization.
[0041] For example, the blockchain network used in this application embodiment can be a gas-free blockchain network, such as a consortium blockchain like Chang'an Chain, to reduce computational latency and failure risks caused by public chain resource limitations (such as gas fees). Gas refers to the computing unit on the Ethereum network, used to measure the amount of computation required to execute transactions or smart contracts on Ethereum. Gas-free means that the consortium blockchain has no limit on the amount of computation, avoiding situations where exceeding the gas limit leads to delays or failures in resource interaction operations across the entire blockchain network. This improves the efficiency of resource interaction execution on the blockchain network, enabling more efficient handling of large-scale data requests and adapting to enterprise applications requiring high throughput and low latency.
[0042] In an exemplary embodiment, the task executor node executes a target computation task based on the decrypted task-related data. The obtained task execution result can be further invoked by a proxy re-encryption contract deployed on the blockchain network. Using the re-encryption key in the encrypted data packet, the task computation result is re-encrypted by the proxy to obtain an encrypted computation result, which is then uploaded to the blockchain network. Further, after the task executor node uploads the encrypted computation result to the blockchain network, the task initiator node can obtain the encrypted computation result corresponding to the target computation task from the blockchain network and decrypt it using its own task initiator private key to obtain the decrypted task computation result.
[0043] In the blockchain-based task processing method described above, task-related data of the target computation task to be executed is obtained. This data is then encrypted once to obtain first ciphertext data, and further encrypted a second time to obtain second ciphertext data. Additionally, the public key of the task executor is encrypted using the private key of the task initiator to obtain a re-encryption key. This allows for secure multi-party computations without disclosing the specific information of the participants, enhancing the protection of privacy-related information, by encrypting the task-related data and the public key of the task executor when executing computational tasks involving multiple parties. Furthermore, the first ciphertext data, the second ciphertext data, and the re-encryption key are packaged to obtain an encrypted data packet. Upon successful verification, the encrypted data packet is uploaded to the blockchain network. A proxy re-encryption contract deployed on the blockchain network then performs proxy re-encryption computation on the second ciphertext data in the encrypted data packet using the re-encryption key to obtain third ciphertext data. In this process, the task executor can decrypt the third ciphertext data and the first ciphertext data using the task executor's private key to obtain the task-related data. Based on the task-related data, the target computing task is executed to obtain the corresponding task computing result. This ensures the security and integrity of data during transmission and processing. At the same time, using blockchain for computing task processing can reduce computing and communication resources, thereby improving the efficiency of computing task processing.
[0044] In one exemplary embodiment, such as Figure 4 As shown, a blockchain-based task processing method is provided, which can be applied to... Figure 1 Taking task initiator node 402 as an example, the explanation includes the following steps S402 to S412. Wherein:
[0045] Step S402: Obtain the task association data of the target computing task to be executed, encrypt the task association data once to obtain the first ciphertext data, and encrypt the first ciphertext data a second time to obtain the second ciphertext data.
[0046] Specifically, the task initiator node obtains the task association data of the target computing task to be executed, and uses a symmetric key to symmetrically encrypt the task association data to obtain the first ciphertext data. It also obtains its own task initiator public key and uses the task initiator public key to encrypt the first ciphertext data a second time to obtain the second ciphertext data.
[0047] Step S404: Encrypt the task executor's public key using the task initiator's private key to obtain a re-encryption key; package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet.
[0048] Specifically, the task initiator node obtains its own task initiator private key and the task executor's task executor public key. It then encrypts the task executor's public key using the task initiator's private key to obtain a re-encryption key. This key is used to further package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet for uploading to the blockchain network for re-encryption calculation.
[0049] Step S406: Calculate the multinomial commitment information corresponding to each data fragment in the encrypted data packet according to the pre-built multinomial commitment.
[0050] In this context, a polynomial commitment is a public value bound to the original message provided by the committer (i.e., binding), and the committer does not disclose the message (i.e., hiding the binding). Hiding means the commitment value does not reveal any information about the original message, while binding means the receiver can be certain that the received message corresponds to the commitment. Specifically, in a polynomial commitment: 1) In the commitment generation phase, the prover calculates the commitment about the polynomial f(x) and sends it to the verifier; 2) In the challenge and proof generation phase, the verifier selects a random number s as a challenge and sends it to the prover, who calculates f(s) = z and generates the corresponding proof; 3) In the verification phase, the verifier verifies that the prover indeed possesses f(x) based on the previous commitment and proof information.
[0051] Specifically, before verifying the encrypted data packet, the task initiating node needs to obtain a pre-built polynomial commitment to calculate the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to the pre-built polynomial commitment. The task initiating node can then send the polynomial commitment information to the prover during the polynomial commitment verification process and obtain the prover's feedback regarding the polynomial commitment information.
[0052] Step S408: Based on the preset proof information, verify the information of the polynomial commitment corresponding to each data shard.
[0053] Specifically, the task initiating node obtains preset proof information corresponding to the multinomial commitment information, and verifies the multinomial commitment information corresponding to each data shard based on the preset proof information to determine whether the multinomial commitment information corresponding to each data shard can pass the information verification. Verifying the multinomial commitment information corresponding to each data shard can be understood as verifying the correctness of the data source (i.e., data shard) provided by each data source provider based on the multinomial commitment information corresponding to each data shard. Multinomial commitments can be used to verify the integrity of the data, the correctness of the data source, and the legality of the data processing process. This allows for composite verification by combining on-chain and off-chain data processing characteristics, improving the protection of privacy-related information and ensuring data authenticity.
[0054] Step S410: If it is determined that each polynomial commitment information passes the information verification, then it is determined that the encrypted data packet passes the verification.
[0055] Specifically, if it is determined that the polynomial commitment information corresponding to each data shard passes the information verification, that is, it proves that the data integrity, data source correctness, and data processing legality of each data shard all meet the privacy-related information protection requirements in the computing task processing process, then the encrypted data packet is determined to have passed the verification.
[0056] Step S412: When the encrypted data packet passes verification, the encrypted data packet is uploaded to the blockchain network, and the proxy re-encryption contract deployed on the blockchain network is invoked. Based on the re-encryption key, the proxy re-encryption calculation is performed on the second ciphertext data in the encrypted data packet to obtain the third ciphertext data. The third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key to obtain the task-related data, and to execute the target calculation task based on the task-related data.
[0057] Specifically, when the encrypted data packet passes verification, the task initiating node uploads the encrypted data packet to the blockchain network and invokes the proxy re-encryption contract deployed on the blockchain network. Based on the re-encryption key in the encrypted data packet, it performs proxy re-encryption calculations on the second ciphertext data in the encrypted data packet to obtain the third ciphertext data. The task initiating node stores the third ciphertext data obtained from the proxy re-encryption calculations in the blockchain network. This allows subsequent task executing nodes to retrieve the third ciphertext data from the blockchain network and the first ciphertext data from the encrypted data packet, according to the privacy computing task requirements of the task initiating node. The task initiating node can then decrypt the third ciphertext data and the first ciphertext data using its own task executing private key to obtain the decrypted task-related data. Based on this decrypted task-related data, it executes the target computing task and obtains the task execution result.
[0058] In an exemplary embodiment, the task executor node specifically obtains its own task executor private key, and decrypts the third ciphertext data according to the task executor private key to obtain a decryption key. The first ciphertext data is then decrypted according to the decryption key to obtain the decrypted task-related data. The target computation task can then be executed according to the decrypted task-related data to obtain the task computation result.
[0059] In the blockchain-based task processing method, the task-related data of the target computation task to be executed is obtained. The task-related data is encrypted once to obtain the first ciphertext data. The first ciphertext data is then encrypted a second time to obtain the second ciphertext data. The task initiator's private key is used to encrypt the task executor's public key to obtain the re-encryption key. Thus, when executing computation tasks involving multiple parties, by encrypting the task-related data and the task executor's public key, multi-party computation can be securely performed without leaking the specific information of the participants, thereby enhancing the protection of privacy-related information. Furthermore, by packaging the first ciphertext data, the second ciphertext data, and the re-encryption key, an encrypted data packet is obtained. According to a pre-constructed multinomial commitment, the multinomial commitment information corresponding to each data fragment in the encrypted data packet is calculated. The multinomial commitment information corresponding to each data fragment is verified based on preset proof information. When it is determined that each multinomial commitment information passes verification, i.e., when the encrypted data packet passes verification, the encrypted data packet is uploaded to the blockchain network. Then, by calling the proxy re-encryption contract deployed on the blockchain network, the second ciphertext data in the encrypted data packet is re-encrypted using the re-encryption key to obtain the third ciphertext data. The task executor decrypts the third ciphertext data and the first ciphertext data using its private key to obtain task-related data. Based on this task-related data, the target computation task is executed to obtain the corresponding task computation result. This ensures the security and integrity of data during transmission and processing. Utilizing blockchain for computation task processing reduces computational and communication resources, thereby improving computation task processing efficiency.
[0060] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0061] In one exemplary embodiment, such as Figure 5 As shown, a blockchain-based task processing system is provided, referring to... Figure 5 It is known that the system includes a task initiator node 502, a task executor node 504, a blockchain network 506, and a proxy re-encryption contract 508 deployed on the blockchain network 506. Among them:
[0062] The task initiator node 502 is responsible for: obtaining the task-related data of the target computation task to be executed; encrypting the task-related data once to obtain the first ciphertext data; encrypting the first ciphertext data a second time to obtain the second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain the re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain the encrypted data packet; and uploading the encrypted data packet to the blockchain network 506 when the encrypted data packet passes verification, and calling the proxy re-encryption contract 508 deployed on the blockchain network 506 to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain the third ciphertext data.
[0063] Specifically, the task initiator node 502 obtains the task association data of the target computation task to be executed, performs symmetric encryption on the task association data using a symmetric key to obtain the first ciphertext data, and obtains its own task initiator public key to perform secondary encryption on the first ciphertext data to obtain the second ciphertext data. Furthermore, the task initiator node 502 also needs to obtain its own task initiator private key and the task executor's public key to encrypt the task executor's public key using the task initiator's private key to obtain the re-encryption key.
[0064] Furthermore, the task initiating node 502 packages the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet. It then performs data integrity and source reliability verification on the packaged encrypted data packet, specifically by verifying the encrypted data packet using a pre-built multinomial commitment. Upon confirming that the encrypted data packet passes verification, the task initiating node uploads the encrypted data packet to the blockchain network and invokes the proxy re-encryption contract deployed on the blockchain network. Based on the re-encryption key in the encrypted data packet, it re-encrypts the second ciphertext data to obtain the third ciphertext data, which is then stored in the blockchain network.
[0065] Task executor node 504 is used to: decrypt the third ciphertext data according to the task executor's private key to obtain the decryption key; decrypt the first ciphertext data according to the decryption key to obtain the decrypted task-related data; and execute the target calculation task according to the decrypted task-related data to obtain the task calculation result.
[0066] Specifically, task executor node 504 obtains third-party encrypted data from the blockchain network and decrypts it using its own task executor private key to obtain a decryption key. Further, task executor node 504 can decrypt first-party encrypted data using the decryption key to obtain decrypted task-related data. It then executes the target computation task according to the decrypted task-related data to obtain the task computation result. Regarding the task computation result, task executor node 504 invokes a proxy re-encryption contract deployed on the blockchain network to encrypt the task computation result using the re-encryption key in the encrypted data packet, obtaining an encrypted computation result, which is then stored in the blockchain network.
[0067] For example, the blockchain network used in this application embodiment can be a blockchain network without gas restrictions, such as a consortium blockchain like Chang'an Chain. Here, Gas refers to the unit of computation on the Ethereum network, used to measure the amount of computation required to execute transactions or smart contracts on Ethereum. No Gas restrictions mean that the consortium blockchain has no limit on the amount of computation, which avoids the situation where the resource interaction operation based on the blockchain network fails when the Gas limit is exceeded, thereby improving the efficiency of resource interaction execution processing based on the blockchain network.
[0068] In one exemplary embodiment, such as Figure 6 As shown, a task processing system based on blockchain is provided to perform task processing, referring to... Figure 6 It is known that the task processing involves a task initiator node, a task executor node, and a blockchain network, on which a proxy re-encryption contract is deployed. Specifically:
[0069] Step S601: The task initiator node obtains the task association data of the target computing task to be executed, encrypts the task association data once to obtain the first ciphertext data, and encrypts the first ciphertext data a second time to obtain the second ciphertext data.
[0070] Specifically, after initiating a request for a target computation task, the task initiating node, to prevent information leakage or leakage of specific data related to the computation task, can obtain the task-related data of the target computation task to be executed. It then uses a symmetric key to symmetrically encrypt the task-related data to obtain the first ciphertext data. Further, by obtaining its own task initiating public key, it performs a second encryption on the first ciphertext data to obtain the second ciphertext data. Here, the task initiating node can be understood as the party that initiates the target computation task. The target computation task can specifically be a computation task with privacy-related information protection requirements, which needs to take encryption protection measures in a privacy computing environment to ensure that the identity information and other privacy-related information of the participants are effectively protected during computation operations. The task-related data refers to the task data associated with the computation task with privacy-related information protection requirements, which may include the identity information of both parties involved in the computation task, the specific business data involved in the computation process, and the specific computation logic of the computation task.
[0071] In one example embodiment, the task initiator's public key and private key, and the task executor's public key and private key, can be dynamically distributed through a key management platform. The security and reliability of the keys are ensured through dynamic distribution and updating of the keys.
[0072] Specifically, when the key update conditions are met, such as when the fixed update cycle set by the key management platform is reached, or when the number of sessions (or session activity) processed by the key management platform reaches a preset threshold, it indicates that the key update conditions are met. When the key update conditions are met, a master key is generated according to the key generation logic. For example, a cryptographically secure pseudo-random number generator is used to generate the master key, and the key derivation function is called to derive multiple subkeys based on the generated master key, thereby providing additional security and key diversity.
[0073] Furthermore, the key management platform can distribute multiple generated subkeys to the task initiator node and the task executor node using an encrypted protocol channel. Upon receiving the key distributed by the key management platform, the task initiator node uses it as its own task initiator public key and task initiator private key. Similarly, upon receiving the key distributed by the key management platform, the task executor node uses it as its own task executor public key and task executor private key.
[0074] In step S602, the task initiator node encrypts the task executor node's public key using its own task initiator private key to obtain a re-encryption key. The first ciphertext data, the second ciphertext data, and the re-encryption key are then packaged to obtain an encrypted data packet.
[0075] Specifically, the task initiator node obtains its own private key and the task executor's public key. It then encrypts the task executor's public key using the task initiator's private key to obtain a re-encryption key. This re-encryption key is further packaged with the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet for uploading to the blockchain network for re-encryption computation. Before uploading the encrypted data packet to the blockchain network, it must be verified. If the verification is successful, the encrypted data packet is uploaded. The packaged encrypted data packet also undergoes data integrity and source reliability verification. This can be achieved by using pre-built multinomial commitments to verify the encrypted data packet. For example, for data sources in computation tasks requiring privacy protection, multinomial commitments (such as KZG commitments) can be used to prove the correctness of the data source provided by each data source provider. Upon successful verification, the encrypted data packet is uploaded to the blockchain network.
[0076] Step S603: When the encrypted data packet passes verification, the task initiator node uploads the encrypted data packet to the blockchain network.
[0077] Specifically, when it is determined that the multi-layered verification of the encrypted data packet passes according to the pre-built polynomial commitment, the task initiating node uploads the verified encrypted data packet to the blockchain network. The polynomial commitment is a public value bound to the original message provided by the submitter, and the submitter does not disclose the message. By calculating the polynomial commitment information corresponding to each data shard in the encrypted data packet according to the pre-built polynomial commitment, the polynomial commitment information can be calculated. Then, by obtaining the pre-set proof information corresponding to the polynomial commitment information, and based on the pre-set proof information, the polynomial commitment information corresponding to each data shard is verified separately to determine whether the polynomial commitment information corresponding to each data shard can pass the information verification. If it is determined that the polynomial commitment information corresponding to each data shard can pass the information verification, it indicates that the encrypted data packet has passed multi-layered verification.
[0078] In step S604, the task initiating node calls the proxy re-encryption contract deployed on the blockchain network, performs proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key, obtains the third ciphertext data, and stores the third ciphertext data in the blockchain network.
[0079] Specifically, once it is determined that the polynomial commitment information corresponding to each data shard has passed information verification, that is, when it is proven that the data integrity, data source correctness, and data processing legality of each data shard meet the privacy-related information protection requirements, the encrypted data packet is confirmed to have passed verification. Based on the verification of the encrypted data packet, the proxy re-encryption contract deployed on the blockchain network is invoked. According to the re-encryption key in the encrypted data packet, the proxy re-encryption calculation is performed on the second ciphertext data in the encrypted data packet to obtain the third ciphertext data, and the third ciphertext data is stored in the blockchain network.
[0080] In step S605, the task executor node obtains the first ciphertext data and the third ciphertext data from the blockchain network, and decrypts the third ciphertext data according to the task executor's private key to obtain the decryption key.
[0081] Specifically, the task executor node obtains third ciphertext data from the blockchain network and first ciphertext data from the encrypted data packet according to the privacy computing task requirements of the task initiator node, and decrypts the third ciphertext data using its own task executor private key to obtain the decryption key.
[0082] In step S606, the task execution node decrypts the first ciphertext data according to the decryption key to obtain the decrypted task-related data, executes the target calculation task according to the decrypted task-related data, and obtains the task calculation result.
[0083] Specifically, the task executor node decrypts the first ciphertext data using the decryption key to obtain the decrypted task-related data, such as the identity information of both parties involved in the computation task, the specific business data involved in the computation process, and the specific computation logic of the computation task. Then, it executes the target computation task according to the decrypted task-related data to obtain the task computation result.
[0084] In the aforementioned blockchain-based task processing system, the task initiating node obtains the task-related data of the target computation task to be executed, encrypts the task-related data once to obtain first ciphertext data, and then encrypts the first ciphertext data a second time to obtain second ciphertext data. Additionally, it encrypts the task executor's public key using the task initiating node's private key to obtain a re-encryption key. This allows for secure multi-party computation without leaking the specific information of the participants, enhancing the protection of privacy-related information, by encrypting the task-related data and the task executor's public key when executing computation tasks involving multiple parties. Furthermore, the task initiating node packages the first ciphertext data, the second ciphertext data, and the re-encryption key into an encrypted data packet. Upon successful verification, the encrypted data packet is uploaded to the blockchain network. This allows the node to invoke a proxy re-encryption contract deployed on the blockchain network, using the re-encryption key to perform proxy re-encryption computation on the second ciphertext data in the encrypted data packet, obtaining the third ciphertext data. The task executor node can decrypt the third ciphertext data using its private key to obtain the decryption key, and then decrypt the first ciphertext data using the decryption key to obtain the decrypted task-related data. It can then execute the target computation task according to the decrypted task-related data to obtain the task computation result. This ensures the security and integrity of data during transmission and processing, while using blockchain for computation task processing can reduce computing and communication resources and improve the efficiency of computation task processing.
[0085] In one exemplary embodiment, such as Figure 7 As shown, a blockchain-based task processing system is provided, referring to... Figure 7 It is known that the system includes a task initiator node 502, a task executor node 504, a blockchain network 506, a proxy re-encryption contract 508 deployed on the blockchain network 506, and a key management platform 510. Among them:
[0086] The task initiator node 502 is used to: obtain the task-related data of the target computation task to be executed; encrypt the task-related data once to obtain the first ciphertext data; encrypt the first ciphertext data a second time to obtain the second ciphertext data; encrypt the task executor's public key according to the task initiator's private key to obtain the re-encryption key; package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain the encrypted data packet; when the encrypted data packet passes verification, upload the encrypted data packet to the blockchain network 706, and call the proxy re-encryption contract 708 deployed on the blockchain network 706 to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain the third ciphertext data.
[0087] Task executor node 504 is used to: decrypt the third ciphertext data according to the task executor's private key to obtain the decryption key; decrypt the first ciphertext data according to the decryption key to obtain the decrypted task-related data; and execute the target calculation task according to the decrypted task-related data to obtain the task calculation result.
[0088] The key management platform 510 is used to: generate a master key according to the key generation logic when the key update conditions are met; derive multiple subkeys based on the master key according to the key derivation function; and distribute the generated multiple subkeys to the task initiator node 502 and the task executor node 504 through the encryption protocol channel.
[0089] The key update mechanism in the key management platform 510 includes two mechanisms: a time-triggered update mechanism and a session-triggered update mechanism. The time-triggered mechanism sets a fixed update cycle (e.g., every 24 hours), automatically triggering the key update process at the end of this cycle. Time-triggered mechanisms are suitable for situations where the predicted load is relatively stable. Session-triggered mechanisms, on the other hand, trigger key updates based on the number of sessions or session activity. For example, an update is triggered every 1000 sessions processed, or when session activity reaches a certain data threshold. Session-triggered mechanisms are suitable for situations where transaction volume or activity fluctuates significantly.
[0090] Specifically, when the key update conditions are met, such as when the fixed update cycle set by the key management platform 510 is reached, or when the number of sessions (or session activity) processed by the key management platform 510 reaches a preset threshold, it indicates that the key update conditions are met. When the key update conditions are met, the master key is generated according to the key generation logic. For example, the master key is generated using a cryptographically secure pseudo-random number generator (such as CSPRNG, which stands for Cryptographically Secure Pseudo-RandomNumber Generator, which can convert variable-length information into fixed-length 128-bit or 160-bit binary random numbers, thereby achieving the purpose of randomly generating multiple keys).
[0091] For each master key generated, the key management platform 510 can also increase the difficulty of key generation by calling key derivation functions (such as the PBKDF2 key derivation function, which is designed to derive encryption keys from passwords and salt values, and perform multiple rounds of iteration using configurable pseudo-random functions (such as HMAC, which is a hash-based message authentication code associated with the key) and the Argon2 key derivation function, which can also use pseudo-random functions to derive one or more subkeys from a secret value (such as a master key, password, or passphrase), such as stretching the key into a longer key or further obtaining a key in the required format), thereby providing additional security and key diversity.
[0092] Furthermore, the key management platform 510 can distribute multiple generated subkeys to the task initiator node 502 and the task executor node 504 via an encrypted protocol channel. Upon receiving the key distributed by the key management platform 510, the task initiator node 502 uses it as its own task initiator public key and task initiator private key. Similarly, upon receiving the key distributed by the key management platform 510, the task executor node 504 uses it as its own task executor public key and task executor private key. The old key in the key management platform 510 is revoked after a certain transition period to ensure that all system components complete the transition to the new key. During the key rotation process, compatibility between the old and new keys needs to be maintained to avoid service interruptions. When updating the key, the key management platform 510 can also send update notifications to all components using the key (such as the task initiator node 502 and the task executor node 504) to ensure that each component can complete preparation work before the new key takes effect. Meanwhile, key update events are recorded in the security log for auditing and monitoring, facilitating key lifecycle management and security event monitoring and management. This dynamic management approach provides more precise privacy protection for key security in distributed systems and is suitable for multi-user, high-security computing environments.
[0093] In an exemplary embodiment, the task executor node 504 is further configured to: invoke the proxy re-encryption contract 508 deployed on the blockchain network 506, perform proxy re-encryption on the task calculation result according to the re-encryption key, obtain the encrypted calculation result, and upload the encrypted calculation result to the blockchain network 506.
[0094] Furthermore, the task initiator node 502 is also used to: obtain the encrypted calculation result from the blockchain network 506, and decrypt the encrypted calculation result according to the task initiator's private key to obtain the decrypted task calculation result.
[0095] In this process, the task executor node 504, after obtaining the task calculation result by executing the target calculation task, calls the proxy re-encryption contract 508 deployed on the blockchain 506 network. Based on the re-encryption key, it performs proxy re-encryption on the task calculation result to obtain the encrypted calculation result, and uploads the encrypted calculation result to the blockchain network 506. The task initiator node 502 can obtain the encrypted calculation result from the blockchain network 506 and decrypt the encrypted calculation result based on its own task initiator private key, thereby obtaining the decrypted task calculation result.
[0096] In one exemplary embodiment, such as Figure 8 As shown, a task processing system based on blockchain is provided to perform task processing, referring to... Figure 8 It is known that the task processing involves a task initiator node, a task executor node, a key management platform, and a blockchain network, on which a proxy re-encryption contract is deployed. Specifically:
[0097] In step S801, when the key update conditions are met, the key management platform generates a master key according to the key generation logic, and derives multiple subkeys based on the master key according to the key derivation function.
[0098] Specifically, when the key update conditions are met, such as when the fixed update cycle set by the key management platform is reached, or when the number of sessions (or session activity) processed by the key management platform reaches a preset threshold, it indicates that the key update conditions are met. When the key update conditions are met, a master key is generated according to the key generation logic, such as generating multiple master keys based on a cryptographically secure pseudo-random number generator.
[0099] The key update mechanism in the key management platform specifically includes a time-triggered update mechanism and a session-triggered update mechanism. A time-triggered mechanism refers to setting a fixed update cycle (e.g., every 24 hours), at which point the key update process is automatically triggered. Time-triggered mechanisms are suitable for situations where the predicted load is relatively stable. Session-triggered mechanisms, on the other hand, trigger key updates based on the number of sessions or session activity. For example, an update is triggered every 1000 sessions processed, or when session activity reaches a certain data threshold. Session-triggered mechanisms are suitable for situations where transaction volume or activity fluctuates significantly.
[0100] In step S802, the key management platform distributes the generated multiple subkeys to the task initiator node and the task executor node through the encryption protocol channel.
[0101] Specifically, the key management platform can distribute the generated keys to the participants in the computing task, including the task initiator node and the task executor node, through an encrypted protocol channel. The sub-keys distributed by the key management platform serve as the task initiator's public and private keys for the task initiator node, and the task executor's public and private keys for the task executor node.
[0102] In step S803, the task initiator node obtains the task association data of the target computing task to be executed, performs symmetric encryption on the task association data according to the symmetric key to obtain the first ciphertext data, and performs secondary encryption on the first ciphertext data according to its own task initiator public key to obtain the second ciphertext data.
[0103] Specifically, after initiating a request for a target computation task, to prevent information leakage or leakage of specific data related to the computation task, the task initiating node can obtain the task-related data of the target computation task to be executed, and use a symmetric key to symmetrically encrypt the task-related data to obtain the first ciphertext data. Further, by obtaining its own task initiating public key, the node encrypts the first ciphertext data a second time using the task initiating public key to obtain the second ciphertext data.
[0104] In step S804, the task initiator node encrypts the task executor node's public key using its own task initiator private key to obtain a re-encryption key. The first ciphertext data, the second ciphertext data, and the re-encryption key are then packaged to obtain an encrypted data packet.
[0105] Specifically, the task initiator node obtains its own private key and the task executor's public key. It then encrypts the task executor's public key using the task initiator's private key to obtain a re-encryption key. This re-encryption key is further packaged with the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet used for re-encryption calculations on the blockchain network. Before uploading the encrypted data packet to the blockchain network, it must be verified. If the verification is successful, the encrypted data packet is uploaded to the blockchain network.
[0106] Step S805: Once the encrypted data packet passes verification, the task initiator node uploads the encrypted data packet to the blockchain network.
[0107] Specifically, for the encrypted data packets obtained from the packaging, data integrity verification and source reliability verification are also required. This can be achieved by using pre-built polynomial commitments to verify the encrypted data packets. For example, for data sources of computing tasks that require the protection of privacy-related information, polynomial commitments can be used to prove the correctness of the data sources provided by each data source provider.
[0108] Specifically, this involves calculating the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to a pre-constructed polynomial commitment, obtaining the preset proof information corresponding to the polynomial commitment information, and then verifying the polynomial commitment information corresponding to each data fragment based on the preset proof information to determine whether the polynomial commitment information corresponding to each data fragment can pass the information verification. If it is determined that the polynomial commitment information corresponding to each data fragment can pass the information verification, it indicates that the encrypted data packet has passed multi-layer verification.
[0109] In step S806, the task initiating node calls the proxy re-encryption contract deployed on the blockchain network, performs proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key, obtains the third ciphertext data, and stores the third ciphertext data in the blockchain network.
[0110] Specifically, after the encrypted data packet passes verification, the task initiator node calls the proxy re-encryption contract deployed on the blockchain network. Based on the re-encryption key in the encrypted data packet, it performs proxy re-encryption calculation on the second ciphertext data in the encrypted data packet to obtain the third ciphertext data, and stores the third ciphertext data in the blockchain network.
[0111] In step S807, the task executor node obtains the first ciphertext data and the third ciphertext data from the blockchain network, and decrypts the third ciphertext data according to the task executor's private key to obtain the decryption key.
[0112] Specifically, the task executor node obtains third ciphertext data from the blockchain network and first ciphertext data from the encrypted data packet according to the privacy computing task requirements of the task initiator node, and decrypts the third ciphertext data using its own task executor private key to obtain the decryption key.
[0113] In step S808, the task executor node decrypts the first ciphertext data according to the decryption key to obtain the decrypted task-related data, executes the target calculation task according to the decrypted task-related data, and obtains the task calculation result.
[0114] Specifically, the task executor node decrypts the first ciphertext data using the decryption key to obtain the decrypted task-related data, such as the identity information of both parties involved in the computation task, the specific business data involved in the computation process, and the specific computation logic of the computation task. Then, it executes the target computation task according to the decrypted task-related data to obtain the task computation result.
[0115] In step S809, the task executor node calls the proxy re-encryption contract deployed on the blockchain network, performs proxy re-encryption on the task calculation result according to the re-encryption key, obtains the encrypted calculation result, and uploads the encrypted calculation result to the blockchain network.
[0116] Specifically, after the task execution node obtains the task calculation result by executing the target calculation task, it calls the proxy re-encryption contract deployed on the blockchain network, performs proxy re-encryption on the task calculation result according to the re-encryption key, obtains the encrypted calculation result, and uploads the encrypted calculation result to the blockchain network.
[0117] In step S810, the task initiator node obtains the encrypted calculation result from the blockchain network and decrypts the encrypted calculation result according to the task initiator's private key to obtain the decrypted task calculation result.
[0118] Specifically, the task initiating node obtains the encrypted calculation result from the blockchain network and decrypts the encrypted calculation result using its own task initiating private key, thereby obtaining the decrypted task calculation result.
[0119] In the aforementioned blockchain-based task processing system, a key management platform generates a master key according to the key generation logic when the key update conditions are met. Based on the key derivation function, multiple subkeys are derived from the master key. These subkeys are then distributed to the task initiator node and the task executor node through an encrypted protocol channel. By using a strategy of dynamically generating keys when the key update conditions are met, the system addresses potential key leakage or long-term security risks, further enhancing the security and flexibility of key generation and distribution. Furthermore, the task initiator node obtains the task association data of the target computation task to be executed, encrypts the task association data once to obtain the first ciphertext data, encrypts the first ciphertext data a second time to obtain the second ciphertext data, and encrypts the task executor's public key distributed by the key management platform according to the task initiator's private key to obtain the re-encryption key. The first ciphertext data, the second ciphertext data, and the re-encryption key are packaged to obtain an encrypted data packet. When the encrypted data packet passes verification, it can be uploaded to the blockchain network. Then, by calling the proxy re-encryption contract deployed on the blockchain network, the second ciphertext data in the encrypted data packet is re-encrypted according to the re-encryption key to obtain the third ciphertext data. The task executor node can decrypt the third ciphertext data using its private key to obtain the decryption key, and then decrypt the first ciphertext data using the decryption key to obtain the decrypted task-related data. It can then execute the target computation task according to the decrypted task-related data to obtain the task computation result. This ensures the security and integrity of data during transmission and processing, while using blockchain for computation task processing can reduce computing and communication resources and improve the efficiency of computation task processing.
[0120] Based on the same inventive concept, this application also provides a blockchain-based task processing device for implementing the blockchain-based task processing method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the blockchain-based task processing device provided below can be found in the limitations of the blockchain-based task processing method described above, and will not be repeated here.
[0121] In one exemplary embodiment, such as Figure 9 As shown, a blockchain-based task processing device is provided, comprising: a task-related data encryption module 902, an encrypted data packet acquisition module 904, and a re-encryption calculation module 906, wherein:
[0122] The task-related data encryption module 902 is used to obtain the task-related data of the target computation task to be executed, encrypt the task-related data once to obtain the first ciphertext data, and encrypt the first ciphertext data a second time to obtain the second ciphertext data. The encrypted data packet acquisition module 904 is used to encrypt the task executor's public key according to the task initiator's private key to obtain the re-encryption key, and package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain the encrypted data packet. The re-encryption calculation module 906 is used to upload the encrypted data packet to the blockchain network when the encrypted data packet passes verification, and call the proxy re-encryption contract deployed on the blockchain network. According to the re-encryption key, it performs proxy re-encryption calculation on the second ciphertext data in the encrypted data packet to obtain the third ciphertext data. The third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key to obtain the task-related data, and to execute the target computation task based on the task-related data.
[0123] In the blockchain-based task processing method described above, task-related data of the target computation task to be executed is obtained. This data is then encrypted once to obtain first ciphertext data, and further encrypted a second time to obtain second ciphertext data. Additionally, the public key of the task executor is encrypted using the private key of the task initiator to obtain a re-encryption key. This allows for secure multi-party computations without disclosing the specific information of the participants, enhancing the protection of privacy-related information, by encrypting the task-related data and the public key of the task executor when executing computational tasks involving multiple parties. Furthermore, the first ciphertext data, the second ciphertext data, and the re-encryption key are packaged to obtain an encrypted data packet. Upon successful verification, the encrypted data packet is uploaded to the blockchain network. A proxy re-encryption contract deployed on the blockchain network then performs proxy re-encryption computation on the second ciphertext data in the encrypted data packet using the re-encryption key to obtain third ciphertext data. In this process, the task executor can decrypt the third ciphertext data and the first ciphertext data using the task executor's private key to obtain the task-related data. Based on the task-related data, the target computing task is executed to obtain the corresponding task computing result. This ensures the security and integrity of data during transmission and processing. At the same time, using blockchain for computing task processing can reduce computing and communication resources, thereby improving the efficiency of computing task processing.
[0124] In an exemplary embodiment, the task-related data encryption module is further configured to: perform symmetric encryption on the task-related data to obtain first ciphertext data; and perform secondary encryption on the first ciphertext data based on the public key of the task initiator to obtain second ciphertext data.
[0125] In one exemplary embodiment, a blockchain-based task processing device is provided, which further includes an encrypted data packet verification module, configured to: calculate the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to a pre-built polynomial commitment; verify the information of the polynomial commitment information corresponding to each data fragment according to preset proof information; and determine that the encrypted data packet has passed verification if it is determined that each polynomial commitment information has passed the information verification.
[0126] In one exemplary embodiment, a blockchain-based task processing device is provided, further comprising a calculation result decryption module, configured to: obtain, from the blockchain network, an encrypted calculation result corresponding to a target calculation task; wherein, the encrypted calculation result is obtained by the task executor calling a proxy re-encryption contract to perform proxy re-encryption on the task calculation result corresponding to the target calculation task according to the re-encryption key; and decrypt the encrypted calculation result according to the private key of the task initiator to obtain the decrypted task calculation result.
[0127] The modules in the aforementioned blockchain-based task processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0128] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as the target computational task to be executed, task-related data, first encrypted data, second encrypted data, the task initiator's private key, the task executor's public key, re-encryption keys, encrypted data packets, proxy re-encryption contracts, and third encrypted data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a blockchain-based task processing method.
[0129] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0130] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring task-related data of a target computing task to be executed; encrypting the task-related data once to obtain first ciphertext data; encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network; performing proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computing task based on the task-related data.
[0131] In one embodiment, when the processor executes the computer program, it further performs the following steps: symmetric encryption of the task-related data to obtain first ciphertext data; and secondary encryption of the first ciphertext data based on the public key of the task initiator to obtain second ciphertext data.
[0132] In one embodiment, when the processor executes the computer program, it further performs the following steps: calculating the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to the pre-built polynomial commitment; verifying the polynomial commitment information corresponding to each data fragment according to the preset proof information; and determining that the encrypted data packet has passed the verification if it is determined that each polynomial commitment information has passed the information verification.
[0133] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the encrypted computation result corresponding to the target computation task from the blockchain network; wherein, the encrypted computation result is obtained by the task executor calling the proxy re-encryption contract and performing proxy re-encryption on the task computation result corresponding to the target computation task according to the re-encryption key; and decrypting the encrypted computation result according to the private key of the task initiator to obtain the decrypted task computation result.
[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: acquiring task-related data of a target computation task to be executed; encrypting the task-related data once to obtain first ciphertext data; encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network; performing proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computation task based on the task-related data.
[0135] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: symmetric encryption of the task-related data to obtain first ciphertext data; and secondary encryption of the first ciphertext data based on the public key of the task initiator to obtain second ciphertext data.
[0136] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: calculating the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to the pre-constructed polynomial commitment; verifying the polynomial commitment information corresponding to each data fragment according to the preset proof information; and determining that the encrypted data packet has passed the verification if it is determined that each polynomial commitment information has passed the information verification.
[0137] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the encrypted computation result corresponding to the target computation task from the blockchain network; wherein, the encrypted computation result is obtained by the task executor calling the proxy re-encryption contract to perform proxy re-encryption on the task computation result corresponding to the target computation task according to the re-encryption key; and decrypting the encrypted computation result according to the private key of the task initiator to obtain the decrypted task computation result.
[0138] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: acquiring task-related data of a target computational task to be executed; encrypting the task-related data once to obtain first ciphertext data; and encrypting the first ciphertext data a second time to obtain second ciphertext data; encrypting the task executor's public key according to the task initiator's private key to obtain a re-encryption key; packaging the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, uploading the encrypted data packet to a blockchain network, and calling a proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; wherein the third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key and execute the target computational task based on the task-related data.
[0139] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: symmetric encryption of the task-related data to obtain first ciphertext data; and secondary encryption of the first ciphertext data based on the public key of the task initiator to obtain second ciphertext data.
[0140] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: calculating the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to the pre-constructed polynomial commitment; verifying the polynomial commitment information corresponding to each data fragment according to the preset proof information; and determining that the encrypted data packet has passed the verification if it is determined that each polynomial commitment information has passed the information verification.
[0141] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the encrypted computation result corresponding to the target computation task from the blockchain network; wherein, the encrypted computation result is obtained by the task executor calling the proxy re-encryption contract to perform proxy re-encryption on the task computation result corresponding to the target computation task according to the re-encryption key; and decrypting the encrypted computation result according to the private key of the task initiator to obtain the decrypted task computation result.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0145] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A task processing method based on blockchain, characterized in that, The method includes: Obtain the task association data of the target computing task to be executed, encrypt the task association data once to obtain the first ciphertext data, and encrypt the first ciphertext data a second time to obtain the second ciphertext data; The task initiator's private key is used to encrypt the task executor's public key to obtain a re-encryption key. The first ciphertext data, the second ciphertext data, and the re-encryption key are then packaged to obtain an encrypted data packet. When the encrypted data packet passes verification, it is uploaded to the blockchain network, and the proxy re-encryption contract deployed on the blockchain network is invoked. Based on the re-encryption key, the second ciphertext data in the encrypted data packet is re-encrypted by proxy to obtain the third ciphertext data. The third ciphertext data and the first ciphertext data are used by the task executor node to decrypt the task-related data using the task executor's private key, and to execute the target computation task based on the task-related data.
2. The method according to claim 1, characterized in that, The process of encrypting the task-related data once to obtain first ciphertext data, and then encrypting the first ciphertext data a second time to obtain second ciphertext data, includes: The task-related data is symmetrically encrypted to obtain the first ciphertext data; Based on the public key of the task initiator, the first ciphertext data is encrypted a second time to obtain the second ciphertext data.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Calculate the polynomial commitment information corresponding to each data fragment in the encrypted data packet according to the pre-constructed polynomial commitment; Based on the preset proof information, the information verification is performed on the polynomial commitment information corresponding to each data segment; If it is determined that each of the polynomial commitment information passes the information verification, then the encrypted data packet is determined to have passed the verification.
4. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the encrypted computation result corresponding to the target computation task from the blockchain network; wherein, the encrypted computation result is obtained by the task execution node by calling the proxy re-encryption contract and performing proxy re-encryption on the task computation result corresponding to the target computation task according to the re-encryption key; The encrypted calculation result is decrypted using the private key of the task initiator to obtain the decrypted task calculation result.
5. A blockchain-based task processing system, characterized in that, The system includes task initiator nodes, task executor nodes, and a blockchain network. The blockchain network deploys proxy re-encryption contracts, wherein: The task initiator node is configured to: acquire task-related data of the target computation task to be executed; encrypt the task-related data once to obtain first ciphertext data; encrypt the first ciphertext data a second time to obtain second ciphertext data; encrypt the task executor's public key according to the task initiator's private key to obtain a re-encryption key; package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; when the encrypted data packet passes verification, upload the encrypted data packet to the blockchain network, and call the proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain third ciphertext data; The task executor node is configured to: decrypt the third ciphertext data according to the task executor's private key to obtain a decryption key; decrypt the first ciphertext data according to the decryption key to obtain decrypted task-related data; and execute the target computation task according to the decrypted task-related data to obtain the task computation result.
6. The system according to claim 5, characterized in that, The task executor node is further configured to: invoke the proxy re-encryption contract deployed on the blockchain network, perform proxy re-encryption on the task calculation result according to the re-encryption key, obtain the encrypted calculation result, and upload the encrypted calculation result to the blockchain network; The task initiator node is further configured to: obtain the encrypted calculation result from the blockchain network, and decrypt the encrypted calculation result according to the task initiator's private key to obtain the decrypted task calculation result.
7. The system according to claim 5 or 6, characterized in that, The system also includes a key management platform for: When the key update conditions are met, the master key is generated according to the key generation logic; Based on the master key, multiple subkeys are derived using the key derivation function. The generated subkeys are distributed to the task initiator node and the task executor node through an encrypted protocol channel.
8. A blockchain-based task processing device, characterized in that, The device includes: The task-related data encryption module is used to obtain the task-related data of the target computing task to be executed, encrypt the task-related data once to obtain the first ciphertext data, and encrypt the first ciphertext data a second time to obtain the second ciphertext data. The encrypted data packet acquisition module is used to encrypt the task executor's public key based on the task initiator's private key to obtain a re-encryption key, and package the first ciphertext data, the second ciphertext data, and the re-encryption key to obtain an encrypted data packet; The re-encryption calculation module is used to upload the encrypted data packet to the blockchain network when the encrypted data packet passes verification, and to call the proxy re-encryption contract deployed on the blockchain network to perform proxy re-encryption calculation on the second ciphertext data in the encrypted data packet according to the re-encryption key to obtain the third ciphertext data; wherein, the third ciphertext data and the first ciphertext data are used for the task executor node to decrypt the task-related data using the task executor's private key to obtain the task-related data, and to execute the target calculation task based on the task-related data.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.