A data processing task result verification method and system based on smart contract
Through a smart contract-based method, using trusted authoritative institutions and blockchain technology to generate and verify data processing task results, the problems of low reliability and sensitive information protection of data processing task results are solved, and the verification of data processing task results with reliability and privacy is achieved.
Patent Information
- Application Number
- CN202510383488.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The lack of a complete verification process for data processing task results in the prior art, resulting in low reliability of data processing task results, and lack of protection for sensitive information, which poses a risk of identity inference.
Using a smart contract-based method, the system key parameters are generated by trusted authoritative organizations and initialize the smart contract, the publishing device generates the requirement ciphertext and CPABE ciphertext, the device performs decryption and verification, and the blockchain is used to transmit information and confirm the verification results, ensuring the reliability of the data processing task results and the publisher's privacy and security.
It improves the reliability of data processing task results, protects the publisher's sensitive information, prevents identity inference, and realizes trustworthy verification of data processing task results.
Smart Images

Figure CN120238351B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain and cloud computing technology, and in particular to a method and system for verifying data processing task results based on smart contracts. Background Art
[0002] With the rapid development of technologies such as big data and cloud computing, more and more companies and individuals prefer to purchase cloud services due to their large storage capacity and huge computing power, and even outsource data processing tasks to cloud servers with powerful computing power. Currently, the traditional data processing task outsourcing solution is that the publisher of the data processing task publishes the data processing task to the platform, and the executor of the data processing task receives the corresponding data processing task on the platform and receives corresponding remuneration after completing the task. Among them, the computing model of data processing task outsourcing basically defines a data processing outsourcing task T=<f,D,V> , the task T represents a function of evaluating the dataset D, i.e. f:D→V, where the domain V represents a set of data that the publisher of the data processing task is interested in. The task of the executor of the data processing task is Evaluate f(x) and return all values of x such that f(x)∈V.
[0003] However, there's no comprehensive correctness verification process for the data processing task results returned by the executors, resulting in low reliability. Furthermore, the task requirements of the publisher of the data processing task and the matching information of the executors are both sensitive information. Due to the lack of protection for these information, a malicious server could potentially infer the identities of the publisher and executors based on these information. However, while protecting sensitive information, it's important to avoid disrupting the inherent multi-user nature of the system.
[0004] Therefore, how to verify the data processing task results returned by the executor is an urgent problem that those skilled in the art need to solve. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides a data processing task result verification method and system based on smart contracts to solve the problem of how to verify the data processing task results returned by the executor in the existing technology; that is, the embodiment of the present invention can improve the reliability of the data processing task results.
[0006] According to one aspect of the present invention, a method for verifying the results of data processing tasks based on smart contracts is provided, and the method for verifying the results of data processing tasks based on smart contracts includes: a trusted authority generates system key parameters, and initializes system variables according to the initialization smart contract, wherein the system key parameters include a system public key and a system private key; the trusted authority obtains the attribute set and computing capability keywords input by the executor, and generates an attribute private key and a capability private key according to the attribute set and the computing capability keywords; the publishing device generates a first public-private key pair based on the first public-private key pair acquisition operation in response to the first public-private key pair acquisition operation performed by the publisher, and the executing device generates a second public-private key pair based on the second public-private key pair acquisition operation in response to the second public-private key pair acquisition operation performed by the executor; the publishing device generates a required ciphertext and a CPABE ciphertext based on the ciphertext acquisition operation in response to the ciphertext acquisition operation performed by the publisher, and generates a required ciphertext and a CPABE ciphertext based on the required ciphertext and the computing capability keywords. The CPABE ciphertext publishes the data processing task; the execution device obtains the CPABE ciphertext based on the data processing task matching operation performed by the executor in response to the data processing task matching operation; the issuing device obtains the second public key in the second public-private key pair based on the second public key acquisition operation in response to the second public key acquisition operation performed by the publisher, generates an accumulator value and auxiliary information according to the second public key, and uploads the accumulator value and the auxiliary information to the blockchain; the execution device receives the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculates a solution proof set based on the decryption set and the auxiliary information; the execution device receives the accumulator value sent by the blockchain, and in response to the verification operation performed by the executor, verifies the accumulator value and the solution proof set to obtain a verification result.
[0007] In one embodiment, the trusted authority obtains the attribute set and computing capability keyword input by the executor, and generates an attribute private key and a capability private key based on the attribute set and the computing capability keyword, including: the trusted authority determines a first value, and generates the attribute private key based on the first value; the trusted authority determines a second value, calculates a target value based on the second value, and generates the capability private key based on the target value and the computing capability keyword.
[0008] In one embodiment, the execution device obtains the CPABE ciphertext based on the data processing task matching operation performed by the executor in response to the data processing task matching operation, including: the execution device receives the capability private key sent by the trusted authority, and in response to the data processing task matching operation performed by the executor, determines an eighth value based on the data processing task matching operation, and generates a matching trapdoor based on the capability private key and the eighth value; the execution device obtains a first blockchain address based on the recording operation in response to the recording operation performed by the executor, and obtains the CPABE ciphertext based on the first blockchain address, the matching trapdoor, and the second public key.
[0009] In one embodiment, the issuing device responds to a second public key acquisition operation performed by the publisher, obtains the second public key in the second public-private key pair based on the second public key acquisition operation, generates an accumulator value and auxiliary information based on the second public key, and uploads the accumulator value and auxiliary information to the blockchain, including: the issuing device responds to a second public key acquisition operation performed by the publisher, obtains the second public key based on the second public key acquisition operation, generates the accumulator value and the auxiliary information based on the second public key; the issuing device responds to an upload operation performed by the publisher, and uploads the accumulator value and the auxiliary information to the blockchain based on the upload operation.
[0010] In one embodiment, the execution device receives the auxiliary information sent by the blockchain, and in response to a decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculates a solution proof set based on the decryption set and the auxiliary information, including: the execution device receives the attribute private key sent by the trusted authority, and in response to the decryption operation performed by the executor, decrypts the CPABE ciphertext based on the attribute private key to obtain a decrypted data set; the execution device responds to the information acquisition operation performed by the executor and returns the auxiliary information and the first public key in the first public-private key pair based on the first blockchain address; the execution device receives the value range sent by the blockchain, and in response to the data processing operation performed by the executor, processes the decrypted data set, the data task function and the value range to obtain a decryption set; the execution device responds to the data calculation operation performed by the executor and calculates the solution proof set based on the decryption set and the auxiliary information.
[0011] In one embodiment, the capability private key is generated according to the target value and the computing capability keyword, and the capability private key is:
[0012] AK=(F1,F2,Q)
[0013] Among them, F1 is the first item of the capability private key, F2 is the second item of the capability private key, Q is the third item of the ability private key, Q = H1 (ability) c , g is the generator of G, h(u')=a+b·u', L u',{u',u} (0) is the Lagrange interpolation polynomial about u', L u,{u',u} (0) is the Lagrange interpolation polynomial about u, c is Z p In the random number, u' is the second value, H1 is the first hash function, and ability is the computing ability keyword.
[0014] In one embodiment, the matching trapdoor is generated according to the capability private key and the eighth value, and the matching trapdoor is:
[0015] T=(T1,T2,T3)
[0016] Among them, T1 is the first item of the matching trapdoor, T1=F1 r' W, T2 is the second item of the matching trapdoor, T2 = F2 r' , T3 is the third item of the matching trapdoor, T3=g r' , F1 is the first item of the capability private key, F2 is the second item of the capability private key, Q is the third item of the capability private key, r' is the eighth value, and g is the generator of G.
[0017] In one embodiment, the accumulator value is generated according to the second public key, and the accumulator value is:
[0018]
[0019] Where e is a symmetric bilinear pairing G×G→G T , g is the generator of G, pk B is the second public key, H2 is the second hash function, y is the first private key, μ is the seventh value, z is the fifth value, is the i3th value in the range V, and n is a random integer.
[0020] In one embodiment, the solution proof set is calculated based on the decryption set and the auxiliary information, and the solution proof set is:
[0021]
[0022] in, H3 is the third hash function, d is a random integer, and j is a random integer.
[0023] According to another aspect of the present invention, a data processing task result verification system based on a smart contract is provided, and the data processing task result verification system based on the smart contract includes: a trusted authority for generating system key parameters and initializing system variables according to the initialization smart contract, wherein the system key parameters include a system public key and a system private key; and the trusted authority for obtaining a property set and a computing capability keyword input by an executor, and generating a property private key and a capability private key based on the property set and the computing capability keyword; a publishing device for generating a first public-private key pair based on the first public-private key pair acquisition operation in response to a first public-private key pair acquisition operation performed by the publisher; and the publishing device for generating a required ciphertext and a CPABE ciphertext based on the ciphertext acquisition operation in response to a ciphertext acquisition operation performed by the publisher, and publishing the data processing task according to the required ciphertext and the CPABE ciphertext; an execution device for generating a second public-private key pair based on the second public-private key pair acquisition operation performed by the executor. The second public-private key pair acquisition operation generates a second public-private key pair; and the execution device is used to obtain the CPABE ciphertext based on the data processing task matching operation in response to the data processing task matching operation performed by the executor; the publishing device is also used to obtain the second public key in the second public-private key pair based on the second public key acquisition operation in response to the second public key acquisition operation performed by the publisher, generate an accumulator value and auxiliary information according to the second public key, and upload the accumulator value and the auxiliary information to the blockchain; the execution device is also used to receive the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, process the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculate a solution proof set based on the decryption set and the auxiliary information; and the execution device is used to receive the accumulator value sent by the blockchain, and in response to the verification operation performed by the executor, verify according to the accumulator value and the solution proof set to obtain a verification result.
[0024] In summary, in this embodiment of the present invention, the execution device receives the auxiliary information sent by the blockchain and, in response to a decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set. The solution proof set is calculated based on the decryption set and the auxiliary information. The execution device receives the accumulator value sent by the blockchain and, in response to a verification operation performed by the executor, verifies the accumulator value and the solution proof set to obtain a verification result, thereby improving the reliability of the data processing task results. Simultaneously, the publishing device, in response to a ciphertext acquisition operation performed by the publisher, generates the required ciphertext and CPABE ciphertext based on the ciphertext acquisition operation, and publishes the data processing task based on the required ciphertext and CPABE ciphertext, thereby ensuring the privacy and security of the publisher's input data set D. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Further details, features and advantages of the present invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0026] Figure 1 A flowchart of a method for verifying data processing task results based on smart contracts disclosed in an embodiment of the present application is shown;
[0027] Figure 2 Shown Figure 1 The schematic diagram of the step flow of step S120 is shown;
[0028] Figure 3 Shown Figure 1 The schematic diagram of the step flow of step S130 is shown;
[0029] Figure 4 Shown Figure 1 The schematic diagram of the step flow of step S140 is shown;
[0030] Figure 5 Shown Figure 1 The schematic diagram of the step flow of step S150 is shown;
[0031] Figure 6 Shown Figure 1 The schematic diagram of the step flow of step S160 is shown;
[0032] Figure 7 Shown Figure 1 The schematic diagram of the step flow of step S170 is shown;
[0033] Figure 8 A structural diagram of a data processing task result verification system based on a smart contract disclosed in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0034] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0035] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0036] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0037] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0038] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0039] It should be noted that the execution subject of the method for verifying the result of a data processing task based on a smart contract provided by an embodiment of the present invention can be one or more electronic devices, which is not limited by the present invention; wherein, the electronic device can be a terminal (i.e., a client) or a server. Then, when the execution subject includes multiple electronic devices, and the multiple electronic devices include at least one terminal and at least one server, the method for verifying the result of a data processing task based on a smart contract provided by an embodiment of the present invention can be jointly executed by the terminal and the server. Accordingly, the terminals mentioned here can include but are not limited to: smartphones, tablets, laptops, desktop computers, smart watches, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The server mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing (cloud computing), cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as basic cloud computing services such as big data and artificial intelligence platforms, etc.
[0040] Based on the above description, an embodiment of the present invention proposes a method for verifying the results of a data processing task based on a smart contract. This method can be executed by the electronic device (terminal or server) mentioned above; alternatively, this method can be executed jointly by the terminal and the server. For ease of explanation, the following description will take the execution of this method for verifying the results of a data processing task based on a smart contract by an electronic device as an example.
[0041] See also Figure 1 , which is a flow chart of a data processing task result verification method based on smart contracts disclosed in an embodiment of the present application. The data processing task result verification method based on smart contracts solves the problem of how to verify the data processing task result returned by the executor, thereby improving the reliability of the data processing task result. It should be noted that the data processing task result verification method based on smart contracts in the embodiment of the present application is not limited to Figure 1 The steps and order in the flowchart shown. According to different needs, the steps in the flowchart shown can be added, removed, or changed in order. In the embodiment of the present application, Figure 1 As shown, the process of the data processing task result verification method based on smart contract includes at least the following steps.
[0042] S110. The trusted authority generates system key parameters and initializes system variables according to the initialization smart contract, wherein the system key parameters include a system public key and a system private key.
[0043] In this embodiment of the present invention, system key parameters include a system public key and a system private key, both of which are initially generated by a trusted authority. The system public key is a value known and accessible to all participants in the system. The system private key is kept secret by the trusted authority and is used to generate subsequent attribute private keys, etc.
[0044] The trusted authority selects the computational security parameters (CSP) λ, G and G T are two cyclic groups of prime order p, and e is a symmetric bilinear pairing G×G→G T , g is the generator of G. Random numbers α, β, a, b, c, u∈Z p , generate a polynomial h(x) = a + b·x, calculate h(u) = a + b·u, where Z p is a finite field containing integer elements (i.e., 0 to p-1). Select three hash functions H1:{0,1} * →G,H2:{0,1} * →Z p ,H3:G T →Z p The system public key and system private key are as follows:
[0045] PK={g,e(g,g) α ,g β ,g c ,g h(u) ,H1,H2,H3} Formula (1)
[0046] MSK={g α ,β,a,b,c,u} Formula (2)
[0047] Among them, PK is the system public key, MSK is the system private key, g is the generator of G, and e is a symmetric bilinear pairing G×G→G T , G and G T are two cyclic groups of prime order p, h(u) is the value obtained by substituting u into the polynomial h(x), and α, β, a, b, c, u are all Z p The random number in, H1 is the first hash function, H2 is the second hash function, H3 is the third hash function, Z p is a finite field.
[0048] When deploying the initialization smart contract, the system variables are initialized, where the system variables may include the public key of the publisher of the preset task, the public key of the executor of the preset task, etc. The initialization smart contract is shown in Table 1 below:
[0049] Table 1 Initialization of smart contract
[0050]
[0051] S120: The trusted authority obtains the attribute set and computing capability keyword input by the executor, and generates an attribute private key and a capability private key according to the attribute set and the computing capability keyword.
[0052] like Figure 2 As shown, in an embodiment of the present invention, Figure 2 The step S120 at least includes the following steps:
[0053] S121. The trusted authority determines a first value and generates the attribute private key according to the first value.
[0054] In the embodiment of the present invention, the trusted authority is from Z p A random value is selected as the first value t1, and an attribute private key SK is generated according to the first value t1. The attribute private key SK is as follows:
[0055]
[0056] K=g α ·g β·t1 Formula (4)
[0057] L = g t1 Formula (5)
[0058]
[0059] Among them, K is the first item of the attribute private key, L is the second item of the attribute private key, is the third item of the attribute private key, g is the generator of G, α, β, are both Z p In the random number, t1 is the first value, H1 is the first hash function, j is a bit string of 0101, and s is a bit string of 0101.
[0060] S122. The trusted authority determines a second value, calculates a target value based on the second value, and generates the capability private key based on the target value and the computing capability keyword.
[0061] In the embodiment of the present invention, the trusted authority is from Z pA random value is selected as the second value u', and u' is substituted into the polynomial h(x) = a + b x to obtain the target value h(u'). Based on the target value and the computing capability keyword, a capability private key AK is generated. The trusted authority transmits the capability private key AK to the executor through a preset channel. The capability private key AK is expressed as follows:
[0062] AK=(F1,F2,Q) Formula (7)
[0063]
[0064] Q=H1(ability) c Formula (10)
[0065] Among them, F1 is the first item of the capability private key, F2 is the second item of the capability private key, Q is the third item of the capability private key, g is the generator of G, L u',{u',u} (0) is the Lagrange interpolation polynomial about u', L u,{u',u} (0) is the Lagrange interpolation polynomial about u, c is Z p In the random number, u' is the second value, H1 is the first hash function, and ability is the computing ability keyword.
[0066] S130. The publishing device generates a first public-private key pair based on the first public-private key pair acquisition operation in response to the first public-private key pair acquisition operation performed by the publisher, and the executing device generates a second public-private key pair based on the second public-private key pair acquisition operation in response to the second public-private key pair acquisition operation performed by the executor.
[0067] like Figure 3 As shown, in an embodiment of the present invention, Figure 3 The step S130 at least includes the following steps:
[0068] S131. The publishing device determines a third value and a fourth value based on a first selection operation performed by the publisher in response to the first selection operation, and generates the first public-private key pair according to the third value and the fourth value.
[0069] In the embodiment of the present invention, the publishing device responds to the first selection operation performed by the publisher. Select a random value as the third value y, and select A random value n greater than the number of data items n in the value range V is selected as the fourth value t2, and a first public-private key pair is generated according to the third value y and the fourth value t2, wherein the third value y and the fourth value t2 are different values. It is a multiplicative cyclic group containing integer elements (i.e., 1 to p-1). The first public-private key pair is as follows:
[0070]
[0071] Among them, sk A is the first private key, pk A is the first public key, y is the third value, t2 is the fourth value, g is the generator of G, G is a cyclic group with prime order p, and i1 is a random integer belonging to the set [0,...,t2].
[0072] S132. The execution device determines a fifth value based on the second selection operation in response to the second selection operation performed by the executor, and generates the second public-private key pair according to the fifth value.
[0073] In the embodiment of the present invention, the execution device responds to the second selection operation performed by the executor, A random value is selected as the fifth value z, and a second public-private key pair is generated based on the fifth value z. The second public-private key pair is as follows:
[0074] sk B =z,[pk B =g z Formula (12)
[0075] Among them, sk B is the second private key, pk B is the second public key, z is the fifth value, g is the generator of G, and G is a cyclic group with prime order p.
[0076] S140. The publishing device generates a required ciphertext and a CPABE ciphertext based on the ciphertext acquisition operation in response to the ciphertext acquisition operation performed by the publisher, and publishes the data processing task according to the required ciphertext and the CPABE ciphertext.
[0077] like Figure 4 As shown, in an embodiment of the present invention, Figure 4 The step S140 at least includes the following steps:
[0078] S141. The publishing device generates the required ciphertext based on the ciphertext acquisition operation performed by the publisher in response to the ciphertext acquisition operation.
[0079] In the embodiment of the present invention, the publisher inputs the data processing task demand keyword demand, and the publishing device responds to the ciphertext acquisition operation performed by the publisher, p Select a random value as the sixth value r, and generate the required ciphertext CT according to the sixth value r and the data processing task requirement keyword demand demand Required ciphertext CTdemand As shown in the following formula:
[0080] CT demand =(E0, E1, E2, E3) Formula (13)
[0081] E0=e(g c·r ,H1(demand)) Formula (14)
[0082] E1=g r Formula (15)
[0083] E2=g h(u)·r Formula (16)
[0084] E3=g a·r Formula (17)
[0085] Among them, E0 is the first item of the required ciphertext, E1 is the second item of the required ciphertext, E2 is the third item of the required ciphertext, E3 is the fourth item of the required ciphertext, g is the generator of G, r is the sixth value, H1 is the first hash function, demand is the data processing task demand keyword, h(u) is a value obtained by substituting u into the polynomial h(x), and a is Z p Random numbers in .
[0086] S142. The publishing device generates the CPABE ciphertext based on the ciphertext acquisition operation performed by the publisher in response to the ciphertext acquisition operation.
[0087] In the embodiment of the present invention, the publisher inputs a data set D and sets an access policy (M, ρ), where M is a l×n shared generator matrix and the function ρ maps each row of the matrix M to an attribute value. The publishing device responds to the ciphertext acquisition operation performed by the publisher, and obtains the attribute value from the ciphertext. Select a random vector as the first vector v, where v=(s,m2,…,m n ), for 1≤i2≤l, calculate in is the i2th row of matrix M. From Z p Select l random values r1,…,r l , and from A random value is selected as the seventh value μ, and the Ciphertext-Policy Attribute-Based Encryption (CPABE) ciphertext CT is generated based on the l random values and the seventh value μ. CPABE CPABE ciphertext CT CPABE The executor calls the smart contract and uploads it to the blockchain. CPABE As shown in the following formula:
[0088]
[0089] C=(D||μ)·e(g,g) α·s Formula (19)
[0090] C'=g s Formula (20)
[0091]
[0092] Among them, (M,ρ) is the first item of CPABE ciphertext, C is the second item of CPABE ciphertext, and C' is the third item of CPABE ciphertext. is the fourth item of the CPABE ciphertext, M is a l×n shared generator matrix, the function ρ maps each row of the matrix M to an attribute value, D is the data set, μ is the seventh value, and e is a symmetric bilinear pairing G×G→G T , g is the generator of G, α and β are both Z p The random number in s is a bit string of 0101. for The product of and v, is the i2th row of matrix M, v is the first vector, H1 is the first hash function, From Z p The random value selected in .
[0093] S143. The publishing device responds to the data task function input operation performed by the publisher.
[0094] In an embodiment of the present invention, the publisher inputs a data task function f, and the publishing device responds to the data task function input operation performed by the publisher.
[0095] S144. The publishing device publishes the data processing task according to the first public key in the first public-private key pair, the required ciphertext, the CPABE ciphertext and the data task function.
[0096] In the embodiment of the present invention, the issuing device uses the first public key pk A , Required ciphertext CT demand 、CPABE ciphertext CT CPABE And the data task function f, and call the smart contract function issueTask, publish the data processing task on the blockchain, and update the relevant information of the data processing task. The smart contract function issueTask is shown in Table 2 below:
[0097] Table 2 Smart contract function issueTask
[0098]
[0099] S150: The execution device obtains the CPABE ciphertext based on the data processing task matching operation performed by the executor in response to the data processing task matching operation.
[0100] like Figure 5 As shown, in an embodiment of the present invention, Figure 5 The step S150 at least includes the following steps:
[0101] S151. The execution device receives the capability private key sent by the trusted authority, and in response to the data processing task matching operation performed by the executor, determines an eighth value based on the data processing task matching operation, and generates a matching trapdoor according to the capability private key and the eighth value.
[0102] In an embodiment of the present invention, the execution device responds to the data processing task matching operation performed by the executor, A random value is selected as the eighth value r', and a matching trapdoor T is generated based on the capability private key AK = (F1, F2, Q) and the eighth value r'. The matching trapdoor T is as follows:
[0103] T=(T1,T2,T3) Formula (22)
[0104] T1=F1 r' ·Q formula(23)
[0105] T2=F2 r' Formula (24)
[0106] T3=g r Formula (25)
[0107] Among them, T1 is the first item of the matching trapdoor, T2 is the second item of the matching trapdoor, T3 is the third item of the matching trapdoor, F1 is the first item of the capability private key, F2 is the second item of the capability private key, Q is the third item of the capability private key, r' is the eighth value, and g is the generator of G.
[0108] S152. The execution device obtains a first blockchain address based on the recording operation in response to the recording operation performed by the executor, and obtains the CPABE ciphertext according to the first blockchain address, the matching trapdoor, and the second public key.
[0109] In an embodiment of the present invention, the execution device responds to the recording operation performed by the executor and obtains the first blockchain address address based on the recording operation. A , the first blockchain address address A The publisher's address on the blockchain, based on the first blockchain addressA , matching trapdoor T and second public key pk B =g z , and the smart contract function tasksMatch initiates data processing task matching. When the data processing task is successfully matched, the CPABE ciphertext is obtained through the blockchain. The smart contract function tasksMatch is shown in Table 3 below:
[0110] Table 3 Smart contract function tasksMatch
[0111]
[0112] The find function is shown in Table 4 below:
[0113] Table 4 find function
[0114]
[0115] S160. The publishing device responds to the second public key acquisition operation performed by the publisher, obtains the second public key in the second public-private key pair based on the second public key acquisition operation, generates an accumulator value and auxiliary information according to the second public key, and uploads the accumulator value and the auxiliary information to the blockchain.
[0116] like Figure 6 As shown, in an embodiment of the present invention, Figure 6 The step S160 at least includes the following steps:
[0117] S161. The publishing device obtains the second public key based on the second public key acquisition operation in response to the second public key acquisition operation performed by the publisher, and generates the accumulator value and the auxiliary information according to the second public key.
[0118] In the embodiment of the present invention, the issuing device responds to the second public key acquisition operation performed by the publisher and calls the function get pk B Get the second public key pk B , and calculate the accumulator value acc and auxiliary information aux for the value range V. The accumulator value acc is as follows:
[0119]
[0120] Where e is a symmetric bilinear pairing G×G→G T , g is the generator of G, pk B is the second public key, H2 is the second hash function, y is the first private key, μ is the seventh value, z is the fifth value, is the i3th value in the range V, and n is a random integer.
[0121] The auxiliary information aux is as follows:
[0122]
[0123] Among them, v i is the i4th value in the range V, where i4 is a random integer.
[0124] Call the function get pk B As shown in Table 5 below:
[0125] Table 5 Calling function get pk B
[0126]
[0127] S162. The publishing device uploads the accumulator value and the auxiliary information to the blockchain in response to the upload operation performed by the publisher based on the upload operation.
[0128] In this embodiment of the present invention, in response to the upload operation performed by the publisher, the publishing device calls the smart contract function uploadAcc to upload the accumulator value and auxiliary information to the blockchain. The smart contract function uploadAcc is shown in Table 6 below:
[0129] Table 6 Smart contract function uploadAcc
[0130]
[0131] S170. The execution device receives the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculates a solution proof set based on the decryption set and the auxiliary information.
[0132] like Figure 7 As shown, in an embodiment of the present invention, Figure 7 The step S170 at least includes the following steps:
[0133] S171. The execution device receives the attribute private key sent by the trusted authority, and in response to the decryption operation performed by the executor, decrypts the CPABE ciphertext according to the attribute private key to obtain a decrypted data set.
[0134] In an embodiment of the present invention, the execution device receives the attribute private key sent by the trusted authority And in response to the decryption operation performed by the executor, the CPABE ciphertext CT is decrypted according to the attribute private key SK CPABEDecryption is performed to obtain the decrypted data set. When the attribute set S of the executor satisfies the access policy of the ciphertext, let I∈[1,...,l] and satisfy I=i5:ρ(i5)∈S, if is a set of constants corresponding to the attribute set S. If is the effective share in M, then Then the data set D and random number μ can be decrypted. The decryption data set D and random number μ are as follows:
[0135]
[0136] D||μ=C / e(g,g) α·s Formula (30)
[0137] Where D is the decrypted data set, μ is a random number, and e is a symmetric bilinear pairing G×G→G T , g is the generator of G, α is Z p The random number in , S is the attribute set, and i5 is a random integer.
[0138] S172. The execution device responds to the information acquisition operation performed by the executor and returns the auxiliary information and the first public key in the first public-private key pair according to the first blockchain address.
[0139] In this embodiment of the present invention, the execution device executes the first blockchain address input by the executor. A Call the smart contract function getParam to obtain auxiliary information aux and the first public key pk A The smart contract function getParam is shown in Table 7 below:
[0140] Table 7 Smart contract function getParam
[0141]
[0142] S173. The execution device receives the value range sent by the blockchain, and in response to the data processing operation performed by the executor, obtains a decrypted set according to the decrypted data set, the data task function, and the value range.
[0143] In the embodiment of the present invention, the execution device executes the data processing task T= on the decrypted data set D, the data task function f and the value range V in response to the data processing operation executed by the executor.<f,D,V> , and obtain the decryption set X={x1,...,x d}.
[0144] S174. The execution device calculates the solution proof set based on the decryption set and the auxiliary information in response to the data calculation operation performed by the executor.
[0145] In the embodiment of the present invention, the execution device responds to the data computing operation performed by the executor according to the decryption set X={x1,...,x d} and auxiliary information aux, calculate the solution proof set Π. The solution proof set Π is as follows:
[0146]
[0147] Where e is a symmetric bilinear pairing G×G→G T , g is the generator of G, H3 is the third hash function, H2 is the second hash function, z is the fifth value, y is the first private key, d is a random integer, and j is a random integer.
[0148] S180. The execution device receives the accumulator value sent by the blockchain, and in response to the verification operation performed by the executor, performs verification based on the accumulator value and the solution proof set to obtain a verification result.
[0149] In this embodiment of the present invention, the execution device calls the smart contract function verifyProof in response to the verification operation performed by the executor. It then verifies the solution based on the accumulator value and the solution proof set to obtain a verification result. If the verification result is passed, the reward is paid; if the verification result is failed, no reward is paid. The smart contract function verifyProof is shown in Table 8 below:
[0150] Table 8 Smart contract function verifyProof
[0151]
[0152]
[0153] In summary, in the data processing task result verification method based on smart contracts of the present application, the execution device receives the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculates the solution proof set based on the decryption set and the auxiliary information. The execution device receives the accumulator value sent by the blockchain, and in response to the verification operation performed by the executor, verifies the accumulator value and the solution proof set to obtain a verification result, thereby improving the reliability of the data processing task result. At the same time, the publishing device responds to the ciphertext acquisition operation performed by the publisher, generates the required ciphertext and CPABE ciphertext based on the ciphertext acquisition operation, and publishes the data processing task based on the required ciphertext and CPABE ciphertext, thereby ensuring the privacy security of the publisher's input data set D.
[0154] See also Figure 8 , which is a structural diagram of a data processing task result verification system based on smart contracts disclosed in an embodiment of this application. In one embodiment, Figure 8 As shown, the present application provides a data processing task result verification system 100 based on a smart contract. The data processing task result verification system 100 based on a smart contract may include at least: a trusted authority 110, a publishing device 130, an execution device 150, and a blockchain 170. Among them, there is information interaction between the trusted authority 110 and the execution device 150 and the blockchain 170, there is information interaction between the publishing device 130 and the blockchain 170, and there is information interaction between the execution device 150 and the blockchain 170.
[0155] Trusted authority 110 is used to generate system key parameters and initialize system variables according to the initialization smart contract. The system key parameters include a system public key and a system private key. Trusted authority 110 is also used to obtain the attribute set and computing capability keyword input by the executor and generate an attribute private key and a capability private key based on the attribute set and computing capability keyword.
[0156] The publishing device 130 is configured to, in response to a publisher's first public-private key pair acquisition operation, generate a first public-private key pair based on the first public-private key pair acquisition operation. Furthermore, in response to a ciphertext acquisition operation performed by the publisher, the publishing device 130 is configured to generate a required ciphertext and a CPABE ciphertext based on the ciphertext acquisition operation, and to publish the data processing task based on the required ciphertext and the CPABE ciphertext.
[0157] The execution device 150 is configured to generate a second public-private key pair based on the second public-private key pair acquisition operation in response to the executor's execution of the second public-private key pair acquisition operation. Furthermore, the execution device 150 is configured to obtain the CPABE ciphertext based on the data processing task matching operation in response to the executor's execution of the data processing task matching operation.
[0158] The publishing device 130 is also used to respond to a second public key acquisition operation performed by the publisher, obtain the second public key in the second public-private key pair based on the second public key acquisition operation, generate an accumulator value and auxiliary information according to the second public key, and upload the accumulator value and auxiliary information to the blockchain 170.
[0159] The execution device 150 is further configured to receive the auxiliary information sent by the blockchain, and in response to a decryption operation performed by the executor, process the CPABE ciphertext based on the decryption operation to obtain a decrypted set, and calculate a solution proof set based on the decrypted set and the auxiliary information. Furthermore, the execution device 150 is configured to receive the accumulator value sent by the blockchain, and in response to a verification operation performed by the executor, perform verification based on the accumulator value and the solution proof set to obtain a verification result.
[0160] In summary, in the data processing task result verification system based on smart contracts of the present application, the execution device 150 receives the auxiliary information sent by the blockchain 170, and in response to the decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculates the solution proof set based on the decryption set and the auxiliary information. The execution device 150 receives the accumulator value sent by the blockchain 170, and in response to the verification operation performed by the executor, verifies the accumulator value and the solution proof set to obtain a verification result, thereby improving the reliability of the data processing task result. At the same time, the publishing device 130 generates the required ciphertext and CPABE ciphertext based on the ciphertext acquisition operation performed by the publisher, and publishes the data processing task based on the required ciphertext and CPABE ciphertext, thereby ensuring the privacy security of the publisher's input data set D.
[0161] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "example," "specific example," "one implementation," "a preferred implementation," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0162] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
Claims
1. A method for verifying data processing task results based on smart contracts, characterized in that: The data processing task result verification method based on smart contracts includes: The trusted authority generates system key parameters and initializes system variables according to the initialization smart contract, wherein the system key parameters include a system public key and a system private key; The trusted authority obtains the attribute set and computing capability keyword input by the executor, and generates an attribute private key and a capability private key according to the attribute set and the computing capability keyword; The issuing device generates a first public-private key pair based on a first public-private key pair acquisition operation performed by the publisher, in response to the first public-private key pair acquisition operation performed by the publisher; the executing device generates a second public-private key pair based on the second public-private key pair acquisition operation performed by the executor; The publishing device generates a required ciphertext and a CPABE ciphertext based on the ciphertext acquisition operation in response to the ciphertext acquisition operation performed by the publisher, and publishes the data processing task according to the required ciphertext and the CPABE ciphertext; The execution device obtains the CPABE ciphertext based on the data processing task matching operation in response to the data processing task matching operation performed by the executor; The issuing device, in response to the second public key acquisition operation performed by the issuer, obtains the second public key of the second public-private key pair based on the second public key acquisition operation, generates an accumulator value and auxiliary information according to the second public key, and uploads the accumulator value and the auxiliary information to the blockchain; The execution device receives the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decrypted set, and calculates a solution proof set based on the decrypted set and the auxiliary information; The execution device receives the accumulator value sent by the blockchain, and in response to the verification operation performed by the executor, performs verification based on the accumulator value and the solution proof set to obtain a verification result.
2. The method for verifying data processing task results based on smart contracts according to claim 1, characterized in that: The trusted authority obtains the attribute set and computing capability keyword input by the executor, and generates an attribute private key and a capability private key according to the attribute set and the computing capability keyword, including: The trusted authority determines a first value and generates the attribute private key based on the first value; The trusted authority determines a second value, calculates a target value based on the second value, and generates the capability private key based on the target value and the computing capability keyword.
3. The method for verifying data processing task results based on smart contracts according to claim 2, characterized in that: The execution device obtains the CPABE ciphertext based on the data processing task matching operation performed by the executor in response to the data processing task matching operation, including: The execution device receives the capability private key sent by the trusted authority, and in response to the data processing task matching operation performed by the executor, determines an eighth value based on the data processing task matching operation, and generates a matching trapdoor based on the capability private key and the eighth value; The execution device obtains a first blockchain address based on the recording operation in response to the recording operation performed by the executor, and obtains the CPABE ciphertext according to the first blockchain address, the matching trapdoor, and the second public key.
4. The method for verifying data processing task results based on smart contracts according to claim 3, characterized in that: The issuing device, in response to a second public key acquisition operation performed by the issuer, obtains a second public key in the second public-private key pair based on the second public key acquisition operation, generates an accumulator value and auxiliary information according to the second public key, and uploads the accumulator value and auxiliary information to the blockchain, including: The issuing device obtains the second public key based on the second public key obtaining operation in response to the second public key obtaining operation performed by the issuer, and generates the accumulator value and the auxiliary information according to the second public key; The publishing device uploads the accumulator value and the auxiliary information to the blockchain based on the upload operation in response to the upload operation performed by the publisher.
5. The method for verifying data processing task results based on smart contracts according to claim 4, characterized in that: The execution device receives the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, processes the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculates a solution proof set based on the decryption set and the auxiliary information, including: The execution device receives the attribute private key sent by the trusted authority, and in response to the decryption operation performed by the executor, decrypts the CPABE ciphertext according to the attribute private key to obtain a decrypted data set; The execution device responds to the information acquisition operation performed by the executor and returns the auxiliary information and the first public key in the first public-private key pair according to the first blockchain address; The execution device receives the value range sent by the blockchain, and in response to the data processing operation performed by the executor, obtains a decrypted set based on the decrypted data set, the data task function, and the value range; The execution device calculates the solution proof set based on the decryption set and the auxiliary information in response to the data calculation operation performed by the executor.
6. The method for verifying data processing task results based on smart contracts according to claim 5, characterized in that: The capability private key is generated according to the target value and the computing capability keyword, and the capability private key is: AK=(F1,F2,Q) Among them, F1 is the first item of the capability private key, F2 is the second item of the capability private key, Q is the third item of the ability private key, Q = H1 (ability) c , g is the generator of G, G represents a cyclic group with prime order p, h(u')=a+b·u', L u',{u',u} (0) is the Lagrange interpolation polynomial about u', L u,{u',u} (0) is the Lagrange interpolation polynomial for the random number u, c is Z p The random number in, u' is the second value, H1 is the first hash function, ability is the computing ability keyword; random number a, b, u∈Z p Among them, Z p is a finite field containing integer elements, that is, from 0 to p-1.
7. The method for verifying data processing task results based on smart contracts according to claim 6, characterized in that: The matching trapdoor is generated according to the capability private key and the eighth value, and the matching trapdoor is: T=(T1,T2,T3) Among them, T1 is the first item of the matching trapdoor, T1=F1 r′ Q, T2 is the second item of the matching trapdoor, T2 = F2 r′ , T3 is the third item of the matching trapdoor, T3=g r′ , F1 is the first item of the capability private key, F2 is the second item of the capability private key, Q is the third item of the capability private key, r' is the eighth value, and g is the generator of G.
8. The method for verifying data processing task results based on smart contracts according to claim 7, characterized in that: The accumulator value is generated according to the second public key, and the accumulator value is: Where e is a symmetric bilinear pairing G×G→G T , g is the generator of G, pk B is the second public key, H2 is the second hash function, y is the first private key, μ is the seventh value, z is the fifth value, is the i3th value in the range V, and n is a random integer.
9. The method for verifying data processing task results based on smart contracts according to claim 8, characterized in that: The solution proof set is calculated based on the decryption set and the auxiliary information, and the solution proof set is: in, f represents the data task function, H3 is the third hash function, d is a random integer, and j is a random integer.
10. A data processing task result verification system based on smart contracts, characterized in that: The data processing task result verification system based on smart contracts includes: a trusted authority, a publishing device, an execution device and a blockchain, wherein: The trusted authority is used to generate system key parameters and initialize system variables according to the initialization smart contract, wherein the system key parameters include a system public key and a system private key; and the trusted authority is used to obtain the attribute set and computing capability keyword input by the executor, and generate an attribute private key and a capability private key based on the attribute set and the computing capability keyword; The publishing device is configured to, in response to a first public-private key pair acquisition operation performed by the publisher, generate a first public-private key pair based on the first public-private key pair acquisition operation; and the publishing device is configured to, in response to a ciphertext acquisition operation performed by the publisher, generate a required ciphertext and a CPABE ciphertext based on the ciphertext acquisition operation, and publish the data processing task based on the required ciphertext and the CPABE ciphertext; The execution device is configured to generate a second public-private key pair based on the second public-private key pair acquisition operation in response to the second public-private key pair acquisition operation performed by the executor; and the execution device is configured to obtain the CPABE ciphertext based on the data processing task matching operation performed by the executor in response to the data processing task matching operation performed by the executor; the issuing device is further configured to, in response to a second public key obtaining operation performed by the issuer, obtain a second public key in the second public-private key pair based on the second public key obtaining operation, generate an accumulator value and auxiliary information based on the second public key, and upload the accumulator value and the auxiliary information to the blockchain; The execution device is further used to receive the auxiliary information sent by the blockchain, and in response to the decryption operation performed by the executor, process the CPABE ciphertext based on the decryption operation to obtain a decryption set, and calculate a solution proof set based on the decryption set and the auxiliary information; and the execution device is used to receive the accumulator value sent by the blockchain, and in response to the verification operation performed by the executor, perform verification based on the accumulator value and the solution proof set to obtain a verification result.
Citation Information
Patent Citations
Verifiable privacy protection and personalized crowdsourcing task matching method and system under assistance of block chain
CN115694787A
Multi-party privacy calculation method, device and system based on block chain
CN115883086A