A privacy computing method based on blockchain smart contracts

Through the polynomial fitting method based on blockchain smart contracts, the problems of low privacy computing efficiency and low accuracy are solved, and efficient and reliable privacy computing results are achieved, which are suitable for a variety of scenarios.

CN114417403BActive Publication Date: 2025-08-12ZHEJIANG DIGITAL QIN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210008010.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-06
Publication Date
2025-08-12
Estimated Expiration
2042-01-06

AI Technical Summary

Technical Problem

The existing privacy computing technology has problems such as low operating efficiency or low accuracy, and the dedicated hardware is costly, so it is not suitable for promotion and use.

Method used

The privacy calculation method based on blockchain smart contracts is adopted, and the smart contract is published on the blockchain by establishing a polynomial fitting of the objective function, and the participants generate and broadcast polynomial expressions. The smart contract decryption and signature are used to determine the polynomial to achieve the reliability of the privacy calculation results.

Benefits of technology

It realizes efficient and reliable privacy calculations, controllable polynomial fitting accuracy, is suitable for a wide range of scenarios, has high computing efficiency and is reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417403B_ABST
    Figure CN114417403B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information technology, and more particularly to a privacy computing method based on blockchain smart contracts, comprising: establishing a polynomial fit for a target function; publishing a smart contract on a blockchain, the smart contract comprising N variable columns, a plurality of polynomial fill-in columns, and a result column, the variable column comprising a variable and a plurality of public key fill-in columns; participants selecting m variables for a privacy number; participants establishing a polynomial expression for the m variables such that the value of the polynomial expression equals the value of the privacy number; all participants broadcasting the polynomial expression for their respective privacy numbers, substituting the polynomial expression into the fitted polynomial of the target function to obtain a second polynomial; writing the result into the polynomial fill-in column of the smart contract; the smart contract determining the second polynomial to be adopted; and the smart contract substituting the variable values into the adopted second polynomial, i.e., the privacy computing result, into the result column. The substantial effect of the present invention is that privacy computing can be completed quickly and with reliable credibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a privacy computing method based on blockchain smart contracts. Background Art

[0002] With the development of information technology and machine learning, data has become a new factor of production, alongside traditional factors such as land, labor, capital, and technology. It plays a crucial role in driving productivity growth and technological progress. Compared to other factors of production, data possesses the following key characteristics: it can be infinitely replicated, and its value increases with exchange and sharing. This creates a natural contradiction in the utilization of data: while sharing and using data creates value, it can also lead to data leakage. Privacy computing has emerged as a key technology. Privacy computing refers to a set of technologies that implement data analysis and computation while protecting the data from external disclosure, achieving the goal of making data "available but invisible." It also aims to transform and unlock the value of data while fully protecting data security and privacy. Current methods for secure data utilization, such as data desensitization or anonymization, often sacrifice some data dimensions, resulting in ineffective utilization of data information. However, current privacy computing technologies suffer from low efficiency and accuracy.

[0003] For example, Chinese patent CN112883408A, published on June 1, 2021, discloses an encryption and decryption system and chip using privacy-preserving computing. The chip includes: an input interface for receiving multiple data to be processed; and a modular exponentiation calculation subsystem, comprising multiple computing units and their modular exponentiation calculation engines, which generates multiple modular exponentiation calculation results based on the multiple data to be processed. For each of the multiple data to be processed, the chip: when the operator operation corresponding to the data to be processed is for a privacy-preserving encryption algorithm, the pre-processing module and the encryption module are called to collaborate with the modular exponentiation calculation subsystem to complete the operator operation. When the operator operation corresponding to the data to be processed is for a privacy-preserving decryption algorithm, the decryption module is called to collaborate with the modular exponentiation calculation subsystem to complete the operator operation. When the operator operation corresponding to the data to be processed is for a secret-state operation algorithm, the modular exponentiation calculation subsystem is called to complete the operator operation. This reuse of computing resources is beneficial for improving computing performance and saving power. However, privacy-preserving computing requires the use of dedicated hardware, which is costly and not suitable for widespread use. Summary of the Invention

[0004] This invention aims to solve the current lack of efficient privacy-preserving computing technology. This paper proposes a privacy-preserving computing method based on blockchain smart contracts that can efficiently perform privacy-preserving computing.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a privacy calculation method based on blockchain smart contract, comprising: establishing a polynomial fitting of the target function; publishing a smart contract on the blockchain, wherein the smart contract comprises N variable columns, a plurality of polynomial filling columns and a result column, wherein the variable column comprises variables and a plurality of public key filling columns, and the smart contract generates a random value for each variable value; the participant selects m variables for the privacy number, writes the public key into the public key filling column of the m variable columns, the smart contract checks for the duplication of variables without privacy numbers, and encrypts the variable value with the public key and broadcasts it; the participant decrypts and obtains the selected value. The smart contract determines the values of m variables and establishes a polynomial expression of m variables so that the value of the polynomial expression is equal to the value of the privacy number. All participants broadcast the polynomial expression of their own privacy number. The participants substitute the polynomial expression into the fitting polynomial of the objective function and expand the fitting polynomial to obtain a second polynomial. The second polynomial is signed with the private key and written into the polynomial filling column of the smart contract. The smart contract decrypts the polynomial filling column to obtain multiple second polynomials and determines the second polynomial that is adopted by majority. The smart contract substitutes the variable values into the adopted second polynomial, which is the privacy calculation result, and writes the result into the result column.

[0006] Preferably, the method for establishing a polynomial fit of the objective function includes: the participants generate a preset number of sample data according to the objective function; establish a polynomial fit of the sample data; multiple participants generate multiple polynomial fits, among which the polynomial fit with the smallest error is the polynomial fit of the objective function.

[0007] Preferably, the method for generating sample data includes: broadcasting the value range of the privacy number between the participants; the participants uniformly generate multiple examples of the privacy number; randomly combining the examples of the privacy number into value groups, substituting the value groups into the objective function to obtain the result of the objective function; and using the result as a label value to mark the value group as sample data.

[0008] Preferably, the method for generating sample data includes: several participants divide the value range of their respective privacy numbers into several intervals, and respectively count the probability of their respective privacy numbers falling into each interval as the interval probability; the value range and interval probability of the privacy number are broadcasted among the several participants; the participants randomly generate the number of examples within the value range of the privacy number, so that the distribution probability of the example number in the interval is equal to the interval probability; the example numbers of the privacy number are randomly combined into value groups, and the value groups are substituted into the objective function to obtain the result of the objective function; the result is used as a label value to mark the value group as sample data.

[0009] Preferably, the method for establishing a polynomial fit for sample data includes: establishing a polynomial fit expression and assigning initial values to the coefficients of the polynomial fit; substituting the sample data into the polynomial fit expression to obtain a fitting value, calculating the square of the difference between the fitting value and the sample data label value and recording it as a loss value; constructing a loss function, wherein the loss function is equal to the sum of the loss values of all sample data; and using an optimization algorithm to obtain the optimal value of the coefficients of the polynomial fit so that the value of the loss function is minimized.

[0010] The substantial effects of this invention are: polynomials can fit any continuous function, and the fitting accuracy is controllable, which enables privacy computing to have a wide range of applications, and the accuracy can meet the needs of use; polynomials have high computational efficiency and can quickly complete privacy computing; with the help of smart contracts, privacy computing can have reliable credibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 Schematic diagram of the privacy computing method in Example 1.

[0012] Figure 2 This is a schematic diagram of a method for generating sample data according to the first embodiment.

[0013] Figure 3 This is a schematic diagram of a method for establishing a polynomial fitting of sample data in Example 1.

[0014] Figure 4 This is a schematic diagram of a method for generating sample data according to the second embodiment. DETAILED DESCRIPTION

[0015] The specific implementation of the present invention will be further described below with reference to specific embodiments and in conjunction with the accompanying drawings.

[0016] Example 1:

[0017] A privacy calculation method based on blockchain smart contract, please refer to the attached Figure 1, including: step A01) establishing a polynomial fit for the objective function; step A02) publishing a smart contract on the blockchain, the smart contract including N variable columns, several polynomial filling columns and a result column, the variable column including variables and multiple public key filling columns, the smart contract generates a random value for each variable value; step A03) the participant selects m variables for the privacy number, writes the public key into the public key filling column of the m variable columns, the smart contract checks for the duplication of variables without privacy numbers, and then encrypts the variable value with the public key and broadcasts it; step A04) the participant decrypts to obtain the values of the selected m variables, and establishes a polynomial expression for the m variables, The value of the polynomial expression is equal to the value of the privacy number. Step A05) All participants broadcast the polynomial expression of their respective privacy numbers. The participants substitute the polynomial expression into the fitting polynomial of the objective function and expand the fitting polynomial to obtain a second polynomial. Step A06) The second polynomial is signed with the private key and written into the polynomial field of the smart contract. Step A07) The smart contract decrypts the polynomial field to obtain multiple second polynomials, and determines the second polynomial to be adopted by majority. Step A08) The smart contract substitutes the variable value into the adopted second polynomial, which is the privacy calculation result, and writes the result into the result field.

[0018] In this example, the objective function is f(x1, x2, x3) = 12*x1 + 16*x2 + 8*x3. This means that there are three companies in the same industry: Company A, Company B, and Company C. Company A's sales volume is represented by x1, Company B's sales volume is represented by x2, and Company C's sales volume is represented by x3. The objective function calculates the industry's overall sales volume, allowing the three companies to assess market demand trends. However, each company is reluctant to disclose specific product sales figures.

[0019] Table 1 Schematic diagram of smart contract filling column

[0020] Variable S1 (0x65A53…2DF21B,0xE32DA…CA53E6) Variable S2 (0x65A53…2DF21B,NULL) … … variable SN (NULL,NULL) Polynomial 1 NULL Polynomial 2 NULL … … Polynomial N NULL result NULL

[0021] Table 1 illustrates the smart contract entry fields for this example. The smart contract generates N variables and assigns them values. The party requesting a variable value writes its public key to the corresponding location. The smart contract verifies the value and then encrypts the variable value using the public key and broadcasts it to the blockchain network. For example, the party corresponding to public key 0x65A53…2DF21B, Enterprise A, requests variables S1 and S2 for the private number x1. In this example, the smart contract assigns the value 20 to variable S1 and the value 8 to variable S2. If the private number value is 160, the polynomial expression is: x1 = 160 = 14 * S1 - 15 * S2. The smart contract also assigns 12 to variable S3 and 6 to variable S4. Assuming x2=270=6*S1+12.5*S3, x3=80=S1+5*S4, each participant, namely Company A, Company B, and Company C, calculates the second polynomial separately and obtains the second polynomial: f(x1,x2,x3)=12*x1+16*x2+8*x3=12*(14*S1-15*S2)+16*(6*S1+12.5*S3)+8*(S1+5*S4)=272*S1-180*S2+200*S3+40*S4. The three participants write f(x1,x2,x3)=272*S1-180*S2+200*S3+40*S4 into the polynomial filling column respectively. If all three parties calculate correctly, the resulting second polynomial should be the same. To prevent errors in the calculation of the second polynomial by one enterprise, which could lead to errors in the privacy calculation, the smart contract uses the majority opinion and takes the second polynomial calculated by the majority of enterprises as the trusted second polynomial. The smart contract substitutes the variable values into the second polynomial and calculates the value of the second polynomial, which is the result of the privacy calculation.

[0022] During this process, each participant only knows the values of two of the variables and therefore cannot know the values of the other private numbers. Smart contracts exist and execute on the blockchain as binary machine code, which is not readable. Therefore, the values of variables and private numbers will not be leaked. Smart contracts enable trusted privacy computing.

[0023] The method for establishing a polynomial fit of an objective function includes: a participant generates a preset number of sample data according to the objective function; establishing a polynomial fit of the sample data; multiple participants generate multiple polynomial fits, among which the polynomial fit with the smallest error is the polynomial fit of the objective function.

[0024] Please see the attached Figure 2The method for generating sample data includes: step B01) broadcasting the value range of a private number among the participants; the participants uniformly generating multiple examples of the private number; step B02) randomly combining the examples of the private number into value groups, substituting the value groups into the objective function to obtain the objective function result; and step B3) using the result as a label value to mark the value groups as sample data. For example, if the value range of the private number x1 is [1, 30] and the value range of the private number x2 is [2, 40], and three numbers are uniformly selected from the private numbers x1 and x2 within their value ranges, then the values of x1 are {1, 12, 23} and the values of x2 are {12, 23, 24}. The value groups can be either {{1, 12}, {12, 23}, {23, 24}} or {{1, 23}, {12, 12}, {23, 24}}. Substituting the value groups into the objective function yields the output of the objective function, which serves as the label for the value group. Use labels to mark value groups to obtain sample data.

[0025] Please see the attached Figure 3 The method for establishing a polynomial fit for sample data includes: step C01) establishing a polynomial fit expression and assigning initial values to the coefficients of the polynomial fit; step C02) substituting the sample data into the polynomial fit expression to obtain a fit value, calculating the square of the difference between the fit value and the sample data label value and recording it as a loss value; step C03) constructing a loss function, where the loss function is equal to the sum of the loss values of all sample data; and step C04) using an optimization algorithm to obtain the optimal value of the coefficients of the polynomial fit so that the value of the loss function is minimized.

[0026] The beneficial technical effects of this embodiment are: polynomials can fit any continuous function, and the fitting accuracy is controllable, so that privacy computing has a wide range of applications, and the accuracy can meet the needs of use; polynomials have high computational efficiency and can complete privacy computing quickly; with the help of smart contracts, privacy computing can have reliable credibility.

[0027] Example 2:

[0028] A privacy calculation method based on blockchain smart contract, please refer to the attached Figure 4The method for generating sample data includes: Step D01) Several participants divide their respective privacy number value ranges into several intervals and calculate the probability of their privacy numbers falling within each interval as the interval probability; Step D02) Several participants broadcast the privacy number value range and interval probability among themselves; Step D03) The participants randomly generate example numbers within the privacy number value range, such that the distribution probability of the example numbers within the interval is equal to the interval probability; Step D04) The example numbers of the privacy number are randomly combined into value groups, and the value groups are substituted into the objective function to obtain the objective function result; Step D05) The result is used as a label value to label the value group as sample data. The accuracy of the polynomial fitting objective function is directly related to the sample data. If the sample data is close to the privacy value ultimately calculated for privacy, the accuracy of the final privacy calculation result will be higher.

[0029] The embodiment described above is only a preferred solution of the present invention and does not limit the present invention in any form. Other variations and modifications are possible without exceeding the technical solution described in the claims.

Claims

1. A privacy computing method based on blockchain smart contracts, characterized in that: include: Establish a polynomial fit of the objective function; Publishing a smart contract on a blockchain, wherein the smart contract includes N variable columns, a plurality of polynomial filling columns, and a result column. The variable column includes variables and multiple public key filling columns, and the smart contract generates a random value for each variable; The participants select m variables for the privacy number and write the public key into the public key filling column of the m variable columns. The smart contract checks for duplication of variables without privacy numbers and encrypts the variable values with the public key before broadcasting; The participants decrypt and obtain the values of the selected m variables, and then establish a polynomial expression of the m variables so that the value of the polynomial expression is equal to the value of the privacy number. All participants broadcast the polynomial expression of their private number. The participants substitute the polynomial expression into the fitting polynomial of the objective function and expand the fitting polynomial to obtain the second polynomial. Sign the second polynomial with the private key and write it into the polynomial field of the smart contract; The smart contract decrypts the polynomial field and obtains multiple second polynomials. The second polynomial is determined by majority. The smart contract substitutes the variable value into the adopted second polynomial, which is the privacy calculation result, and writes the result into the result column.

2. A privacy computing method based on blockchain smart contracts according to claim 1, characterized in that: Methods for establishing a polynomial fit for the objective function include: The participants generate a preset number of sample data according to the objective function; Build a polynomial fit to the sample data; Multiple participants generate multiple polynomial fits, among which the polynomial fit with the smallest error is the polynomial fit of the objective function.

3. A privacy computing method based on blockchain smart contracts according to claim 2, characterized in that: Methods for generating sample data include: The value range of the private number broadcast between participants; The number of instances where the participants evenly generate private numbers; Randomly combine the examples of privacy numbers into value groups, substitute the value groups into the objective function, and obtain the result of the objective function; The result is used as a label value to mark the value group as sample data.

4. A privacy computing method based on blockchain smart contracts according to claim 2, characterized in that: Methods for generating sample data include: Several participants divide the range of their privacy numbers into several intervals, and calculate the probability of their privacy numbers falling into each interval as the interval probability; The value range and interval probability of broadcasting private numbers between several participants; The participants randomly generate the number of examples within the range of the privacy number, so that the distribution probability of the number of examples in the interval is equal to the interval probability; Randomly combine the examples of privacy numbers into value groups, substitute the value groups into the objective function, and obtain the result of the objective function; The result is used as a label value to mark the value group as sample data.

5. A privacy computing method based on blockchain smart contracts according to any one of claims 2 to 4, characterized in that: Methods for building a polynomial fit to sample data include: Establish a polynomial fitting expression and assign initial values to the polynomial fitting coefficients; Substitute the sample data into the polynomial fitting expression to obtain the fitting value, and calculate the square of the difference between the fitting value and the sample data label value as the loss value; Constructing a loss function, where the loss function is equal to the sum of the loss values of all sample data; An optimization algorithm is used to obtain the optimal value of the polynomial fitting coefficients so that the value of the loss function is minimized.

Citation Information

Patent Citations

  • Encryption and decryption system and chip for privacy computing

    CN112883408A

  • Multi-party private data calculation method based on block chain technology

    CN112734426A

  • Triangular privacy calculation method

    CN113780530A