A privacy data comparison system, method, device, equipment and medium

By using zero-knowledge proof technology on terminal devices and blockchain platforms to generate and verify the promised value of privacy data, the risks of data leakage and tampering during the privacy data verification process in the prior art are solved, and a safe and efficient comparison of privacy data is achieved.

CN119739790APending Publication Date: 2025-04-01AISINO CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411918440.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art can easily lead to data leakage, malicious tampering and illegal use during the process of privacy data verification, and cannot effectively ensure the security of privacy data.

Method used

A privacy data comparison system is adopted, and the terminal equipment and blockchain platform are used to generate promised values ​​and random values ​​through the first zero-knowledge proof tool, encrypted and verified on the blockchain platform to ensure that the privacy data is not directly exposed during the comparison process.

Benefits of technology

On the premise of ensuring the security of private data, effective comparison of private data is achieved, the risk of data leakage and tampering is reduced, and data security and transparency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739790A_ABST
    Figure CN119739790A_ABST
Patent Text Reader

Abstract

The present application discloses a privacy data comparison system, method, device, equipment and medium. The terminal device encrypts the privacy data through a first zero-knowledge proof tool to obtain a first commitment value and a first random value corresponding to the privacy data, obtains the verification data and the corresponding second commitment value and second random value stored in the blockchain platform, generates a first proof according to the privacy data, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; sends the first commitment value and the first proof to the blockchain platform; the blockchain platform verifies the first proof, the first commitment value and the second commitment value based on a preset subtraction verification function to obtain a comparison result. The terminal device only sends the generated first proof and the first commitment value to the blockchain platform, and the size comparison of the privacy data is realized without sending the privacy data to any party, thereby reducing the risk of privacy data being leaked or tampered with, and ensuring the security of the privacy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a privacy data comparison system, method, device, equipment and medium. Background Art

[0002] With the vigorous development of the Internet and business software, the scenarios where the privacy data of user systems interact with external systems for verification have increased dramatically. For example, a game platform needs to verify whether the user's identity information is greater than the verification value of 18 years old, and a bank, insurance or trust company evaluates the assets or debts of individuals and enterprises and institutions to see whether they are greater than a specific verification value. The verification party has no right to know the user's privacy data, such as the user's real age, real assets, etc.

[0003] The existing method of verifying private data is that the verifier obtains the private data of the user and then compares the specific values ​​of the private data and the verification data, or the user sends the private data to a third party and the verifier sends the verification data to the third party, and the third party compares the specific values ​​of the private data and the verification data. However, this behavior of sending private data to the verifier or to a third party may cause data security issues such as leakage, malicious tampering, and illegal use of user private data. Therefore, there is an urgent need for a private data comparison method that ensures the security of private data. Summary of the invention

[0004] The present application provides a privacy data comparison system, method, apparatus, device and medium for performing privacy data comparison while ensuring the security of the privacy data.

[0005] In a first aspect, the present application provides a privacy data comparison system, the system comprising: a terminal device and a blockchain platform;

[0006] The terminal device is used to receive the private data to be verified uploaded by the user; obtain a first commitment value and a first random value corresponding to the private data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform;

[0007] The terminal device is further used to obtain the verification data and the corresponding second commitment value and second random value stored in the blockchain platform; generate a first proof based on the first zero-knowledge proof tool according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; and send the first proof to the blockchain platform;

[0008] The blockchain platform is used to obtain a comparison result between the privacy data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof, and a second commitment value corresponding to the verification data.

[0009] In a possible implementation, the terminal device is further configured to obtain, by using a first zero-knowledge proof tool, a second proof corresponding to the first commitment value of the privacy data to be verified, and send the second proof to the blockchain platform;

[0010] The blockchain platform is also used to obtain a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

[0011] In a possible implementation, the system further includes: a verification device;

[0012] The verification device is used to receive verification data uploaded by the verifier; obtain a second commitment value and a second random value corresponding to the verification data through a second zero-knowledge proof tool; and send the verification data and the corresponding second commitment value and second random value to the blockchain platform.

[0013] In a possible implementation, the blockchain platform is further used to send the comparison result to the verification device.

[0014] In a possible implementation, the terminal device is also used to obtain a second verification result of the verification data based on the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool; if the second verification result is true, the subsequent process of generating the first proof is performed; wherein the second verification result refers to whether the verification data is the verification result sent by the verifier.

[0015] In one possible implementation, the terminal device is specifically used to determine a first difference between the first commitment value and the second commitment value, a second difference between the verification data and the privacy data to be verified, and a third difference between the first random value and the second random value; and generate the first proof according to the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

[0016] In one possible implementation, the blockchain platform is specifically used to determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first proof and the first difference.

[0017] In a second aspect, the present application provides a privacy data comparison method, which is applied to a terminal device and includes:

[0018] Receive the private data to be verified uploaded by the user; obtain a first commitment value and a first random value of the private data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform;

[0019] Obtain the verification data and the corresponding second commitment value and second random value stored in the blockchain platform; generate a first proof based on the first zero-knowledge proof tool according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; and send the first proof to the blockchain platform;

[0020] The first proof and the first commitment value are sent to the blockchain platform, so that after the blockchain platform device receives the first commitment value and the first proof, it obtains a comparison result between the privacy data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof and the second commitment value corresponding to the verification data.

[0021] In a possible implementation, the method further includes:

[0022] A second proof corresponding to the first commitment value of the privacy data to be verified is obtained through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform, so that the blockchain platform obtains a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

[0023] In a possible implementation, after obtaining the verification data stored in the blockchain platform and the corresponding second commitment value and second random value, the method further includes:

[0024] According to the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool, a second verification result of the verification data is obtained; if the second verification result is true, the subsequent process of generating the first proof is performed; wherein the second verification result refers to whether the verification data is the verification result sent by the verifier.

[0025] In a possible implementation, according to the private data to be verified, the first commitment value, the first random value, the verification data, the second commitment value, and the second random value, based on a first zero-knowledge proof tool, a first proof is generated, and the method includes:

[0026] Determine a first difference between the first commitment value and the second commitment value, a second difference between the verification data and the privacy data to be verified, and a third difference between the first random value and the second random value; and generate the first proof according to the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

[0027] In a third aspect, the present application provides a privacy data comparison method, which is applied to a blockchain platform and includes:

[0028] Receiving a first commitment value sent by a terminal device; wherein the first commitment value is the private data to be verified uploaded by the user and received by the terminal device; obtaining the first commitment value corresponding to the private data to be verified through a first zero-knowledge proof tool;

[0029] Receive a first proof sent by the terminal device; wherein the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the first zero-knowledge proof tool, generate a first proof according to the private data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, wherein the first random value is the private data to be verified uploaded by the user received by the terminal device; obtain the first random value corresponding to the private data to be verified through the first zero-knowledge proof tool;

[0030] According to the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on a preset subtraction verification function, a comparison result between the privacy data to be verified and the verification data is obtained.

[0031] In a possible implementation, before obtaining a comparison result between the private data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof, and the second commitment value corresponding to the verification data, the method further includes:

[0032] Based on a preset proof verification function, a first verification result of the second proof is obtained; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein, the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true, wherein the second proof is a second proof corresponding to the first commitment value of the privacy data to be verified obtained by the terminal device through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform.

[0033] In a possible implementation manner, after obtaining the comparison result between the privacy data to be verified and the verification data, the method further includes:

[0034] The comparison result is sent to the verification device.

[0035] In a possible implementation, according to the first commitment value, the first proof, and the second commitment value corresponding to the verification data, based on a preset subtraction verification function, a comparison result of the private data to be verified and the verification data is obtained, and the method includes:

[0036] Determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first proof and the first difference.

[0037] In a fourth aspect, the present application provides a privacy data comparison method, which is applied to a verification device, and the method includes:

[0038] Receive the verification data uploaded by the verifier; obtain the second commitment value and the second random value corresponding to the verification data through the second zero-knowledge proof tool; send the verification data and the corresponding second commitment value and the second random value to the blockchain platform;

[0039] Receive the comparison result sent by the blockchain platform; wherein the comparison result is that the blockchain platform obtains the comparison result of the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on a preset subtraction verification function; wherein the first commitment value is the privacy data to be verified uploaded by the user received by the terminal device; the first commitment value corresponding to the privacy data to be verified is obtained through a first zero-knowledge proof tool; the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, a first proof is generated based on the first zero-knowledge proof tool; wherein the first random value is the privacy data to be verified uploaded by the user received by the terminal device; the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.

[0040] In a fifth aspect, a privacy data comparison device is provided, which is applied to a terminal device and includes:

[0041] The receiving module is used to receive the private data to be verified uploaded by the user.

[0042] The processing module is used to obtain a first commitment value and a first random value of the privacy data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform.

[0043] The acquisition module is used to acquire the verification data and the corresponding second commitment value and second random value stored in the blockchain platform. According to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, a first proof is generated based on the first zero-knowledge proof tool; and the first proof is sent to the blockchain platform.

[0044] The processing module is also used to send the first proof and the first commitment value to the blockchain platform, so that after the blockchain platform device receives the first commitment value and the first proof, it obtains the comparison result of the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first commitment value, the first proof and the second commitment value corresponding to the verification data.

[0045] In a possible implementation manner, the processing module is further used to:

[0046] A second proof corresponding to a first commitment value of the privacy data to be verified is obtained through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform, so that the blockchain platform obtains a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

[0047] In a possible implementation manner, the processing module is further used to:

[0048] According to the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool, a verification result of the verification data is obtained; if the verification result is true, the subsequent process of generating the first proof is performed; wherein the verification result refers to whether the verification data is the verification result sent by the verifier.

[0049] In a possible implementation manner, the processing module is specifically configured to:

[0050] Determine a first difference between the first commitment value and the second commitment value, a second difference between the verification data and the privacy data to be verified, and a third difference between the first random value and the second random value; and generate the first proof according to the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

[0051] In a sixth aspect, the present application provides a privacy data comparison device, which is applied to a blockchain platform, and includes:

[0052] The receiving module is used to receive a first commitment value sent by a terminal device; wherein the first commitment value is the privacy data to be verified uploaded by the user and received by the terminal device.

[0053] The processing module is used to obtain a first commitment value corresponding to the privacy data to be verified through a first zero-knowledge proof tool.

[0054] The receiving module is also used to receive a first proof sent by a terminal device; wherein the first proof is that the terminal device obtains verification data stored in the blockchain platform and the corresponding second commitment value and second random value; based on the first zero-knowledge proof tool, a first proof is generated according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, wherein the first random value is the privacy data to be verified uploaded by the user received by the terminal device; and the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.

[0055] The processing module is further used to obtain a comparison result between the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data and based on a preset subtraction verification function.

[0056] In a possible implementation manner, the processing module is further used to:

[0057] Based on a preset proof verification function, a first verification result of the second proof is obtained; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true, wherein the second proof is a second proof corresponding to the first commitment value of the privacy data to be verified obtained by the terminal device through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform.

[0058] In a possible implementation manner, the device further includes a sending module, specifically configured to:

[0059] The comparison result is sent to the verification device.

[0060] In a possible implementation manner, the processing module is specifically configured to:

[0061] Determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first proof and the first difference.

[0062] In a seventh aspect, the present application provides a privacy data comparison device, which is applied to a verification device, and includes:

[0063] The receiving module is used to receive the verification data uploaded by the verification party.

[0064] The processing module is used to obtain a second commitment value and a second random value corresponding to the verification data through a second zero-knowledge proof tool.

[0065] The sending module is used to send the verification data and the corresponding second commitment value and second random value to the blockchain platform.

[0066] The receiving module is also used to receive a comparison result sent by the blockchain platform; wherein the comparison result is that the blockchain platform obtains a comparison result of the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on a preset subtraction verification function; wherein the first commitment value is the privacy data to be verified uploaded by the user received by the terminal device; the first commitment value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool; the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, the first proof is generated based on the first zero-knowledge proof tool; wherein the first random value is the privacy data to be verified uploaded by the user received by the terminal device; the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.

[0067] In an eighth aspect, the present application further provides an electronic device, comprising at least a processor and a memory, wherein the processor is used to implement the steps of the privacy data comparison method as described in any one of the second aspect, the third aspect and the fourth aspect when executing a computer program stored in the memory.

[0068] In the ninth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer performs the steps of the privacy data comparison method as described in any one of the second aspect, the third aspect, and the fourth aspect.

[0069] In the tenth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program code, which, when executed on a computer, enables the computer to execute the steps of the privacy data comparison method described in any one of the second aspect, the third aspect, and the fourth aspect.

[0070] In the embodiment of the present application, the terminal device encrypts the private data through the first zero-knowledge proof tool, obtains the first commitment value and the first random value corresponding to the private data, obtains the verification data stored by the blockchain platform and the corresponding second commitment value and the second random value, and generates the first proof according to the private data, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; sends the first commitment value and the first proof to the blockchain platform; the blockchain platform verifies the first proof, the first commitment value and the second commitment value based on the preset subtraction verification function to obtain the comparison result. The terminal device only sends the generated first proof and the first commitment value to the blockchain platform, and the size comparison of the private data can be realized without sending the private data to any party, thereby reducing the risk of the private data being leaked or tampered with, and ensuring the security of the private data. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0072] Figure 1 A schematic diagram of the structure of a privacy data comparison system provided in an embodiment of the present application;

[0073] Figure 2 A complete structural diagram of a privacy data comparison system provided in an embodiment of the present application;

[0074] Figure 3 A schematic diagram of a privacy data comparison process provided in an embodiment of the present application;

[0075] Figure 4 One of the process diagrams of a privacy data comparison method provided in an embodiment of the present application;

[0076] Figure 5 A second process diagram of another privacy data comparison method provided in an embodiment of the present application;

[0077] Figure 6 A third process diagram of another privacy data comparison method provided in an embodiment of the present application;

[0078] Figure 7 One of the structural schematic diagrams of a privacy data comparison device provided in an embodiment of the present application;

[0079] Figure 8 A second structural diagram of a privacy data comparison device provided in an embodiment of the present application;

[0080] Fig. 9 A third structural diagram of a privacy data comparison device provided in an embodiment of the present application;

[0081] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0083] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their ordinary and common meanings.

[0084] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.

[0085] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0086] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0088] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

[0089] The current methods for comparing the size of private data have the following main defects:

[0090] (1) Private data is easily leaked: Currently, the method for comparing the size of private data is that the verifier directly compares the plaintext of the private data, or transmits the plaintext of the private data to a third party, who then compares the plaintext of the private data. Whether the verifier directly compares the plaintext of the private data or has a third party compare it, it may lead to the leakage of private data. Without the user's knowledge, the leaked private data may be stolen, abused, reused, etc., which makes it impossible to ensure the security of the private data and the fundamental interests of the users of the private data.

[0091] (2) The size comparison process is difficult to trace: The size comparison process of private data is generally carried out within a system centered on one party, such as the user, the third party, or the verification party. The size comparison process is not transparent, and other participants are not clear about the specific size comparison process. If the private data is tampered with or the verification results are forged during the verification process of the central system, it will be difficult for other participants to determine the correctness of the comparison results. Without a record of the size comparison process, it is impossible to trace the size comparison process.

[0092] Embodiment 1:

[0093] Figure 1 A structural diagram of a privacy data comparison system provided in an embodiment of the present application, the system comprising: a terminal device 11 and a blockchain platform 12;

[0094] The terminal device 11 is used to receive the private data to be verified uploaded by the user; obtain the first commitment value and the first random value corresponding to the private data to be verified through the first zero-knowledge proof tool; and send the first commitment value to the blockchain platform 12;

[0095] The terminal device 11 is further used to obtain the verification data and the corresponding second commitment value and second random value stored in the blockchain platform 12; generate a first proof based on the first zero-knowledge proof tool according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; and send the first proof to the blockchain platform 12;

[0096] The blockchain platform 12 is used to obtain a comparison result between the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data and based on a preset subtraction verification function.

[0097] like Figure 1 As shown, the privacy data comparison system includes a terminal device 11 and a blockchain platform 12. The terminal device 11 is connected to the blockchain platform 12. Among them, the terminal device 11 is a device that supports users to input privacy data to be verified, such as a server, a computer (Personal Computer, PC), etc. The terminal device 11 can pre-build a first zero-knowledge proof tool. Among them, a zero-knowledge proof tool refers to a cryptographic tool that allows mutually untrusted communicating parties to prove the validity of a proposition without leaking any additional information. The first zero-knowledge proof tool can generate Pedersen commitments and zero-knowledge proofs for private data, can perform addition and subtraction operations on Pedersen commitments, and can use the range proof Bulletproofs algorithm to verify zero-knowledge proofs.

[0098] The blockchain platform is a platform with general blockchain technology features such as decentralized distributed architecture, chain storage ledger, smart contract, peer-to-peer transmission, consensus mechanism, etc., which supports data on-chain, query and deployment of smart contracts. The blockchain platform 12 in this application stores data such as verification data, commitment value corresponding to verification data, and information on smart contracts corresponding to the zero-knowledge proof tool in this application. Among them, the smart contract corresponding to the zero-knowledge proof tool has contract functions such as Pedersen commitment, zero-knowledge proof, verification data and other data on-chain, query, etc., can perform addition and subtraction operations of Pedersen commitment, and can use Bulletproofs algorithm to verify zero-knowledge proof.

[0099] The blockchain platform 12 can be deployed on a cloud network or on a terminal device.

[0100] The user uploads the private data to be verified to the terminal device 11. The terminal device 11 encrypts the private data to be verified based on the first zero-knowledge proof tool, and obtains the first commitment value and the first random value corresponding to the private data to be verified, so as not to disclose the private data. Among them, the first commitment value is the ciphertext string obtained by encrypting the private data. In this application, the Pedersen commitment is selected for use, wherein the Pedersen commitment is a homomorphic commitment protocol that satisfies perfect hiding and computational binding, and can encrypt the private data into a ciphertext string, and the original data cannot be restored, and addition and subtraction operations can also be performed; the first random value refers to a random number generated for the private data to be verified when the first zero-knowledge proof tool generates the first commitment value, which is used to prove that the first commitment value is the commitment value corresponding to the private data to be verified.

[0101] When comparing the size of the private data to be verified and the verification data, the terminal device 11 needs to obtain the verification data and the corresponding second commitment value and second random value stored in the blockchain platform 12; based on the private data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, a first proof is generated based on the first zero-knowledge proof tool. Proof means allowing one party (the prover) to prove to another party (the verifier) ​​that a statement is true without revealing any additional information about the statement itself.

[0102] The verification data and the corresponding second commitment value and second random value stored in the blockchain platform 12, wherein the verification data refers to the data provided by the verifier, the second commitment value corresponding to the verification data is the ciphertext string obtained by encrypting the verification data, and the encryption of the verification data in this application also chooses to use Pedersen commitment; the second random value refers to a random number generated for the verification data when generating the second commitment value, which is used to prove that the second commitment value is the commitment value corresponding to the verification data.

[0103] After the terminal device 11 compares the size of the private data to be verified and the verification data, it sends the calculated first proof and the first commitment value to the blockchain platform 12, based on the subtraction verification function in the smart contract corresponding to the zero-knowledge proof tool pre-deployed on the blockchain platform 12, for example, the subtraction verification function is the subtraction verification function in the zero-knowledge proof tool Bulletproofs algorithm, and obtains the comparison result of the private data to be verified and the verification data according to the first commitment value of the private data to be verified, the first proof calculated by the terminal device 11, and the second commitment value corresponding to the verification data stored in the blockchain platform 12. Among them, the subtraction verification function in the Bulletproofs algorithm is a prior art and will not be repeated here.

[0104] In this application, the data privacy based on Pedersen commitment ensures the security and authenticity of user privacy data. Data privacy mainly refers to the fact that Pedersen commitment can encrypt the original data into a ciphertext string, and the original data cannot be restored. In addition, Pedersen commitment can perform addition and subtraction operations without affecting the encrypted original data, which enhances the security of user privacy data and greatly reduces the risk of malicious tampering and forgery.

[0105] In the embodiment of the present application, the terminal device encrypts the private data to be verified through the first zero-knowledge proof tool, obtains the first commitment value and the first random value corresponding to the private data to be verified, obtains the verification data stored by the blockchain platform and the corresponding second commitment value and the second random value, and generates the first proof of the comparison result according to the private data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; sends the first commitment value and the first proof to the blockchain platform; the blockchain platform verifies the first proof, the first commitment value and the second commitment value based on the preset subtraction verification function to obtain the comparison result. The terminal device only sends the generated first proof and the first commitment value to the blockchain platform, and the size comparison of the private data can be realized without sending the private data to any party, thereby reducing the risk of the private data being leaked or tampered with, and ensuring the security of the private data.

[0106] Embodiment 2:

[0107] In order to ensure the authenticity of the first commitment value used by the blockchain platform 12 when calculating the comparison results, the present application also verifies the second proof corresponding to the first commitment value to ensure the accuracy of the adopted first commitment value.

[0108] Specifically, the terminal device 11 is further used to obtain a second proof corresponding to the first commitment value of the privacy data to be verified through a first zero-knowledge proof tool, and send the second proof to the blockchain platform 12;

[0109] The blockchain platform 12 is also used to obtain a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

[0110] In the embodiment of the present application, when the terminal device 11 generates the first commitment value and the first random value according to the privacy data to be verified based on the first zero-knowledge proof tool, it also generates a second proof corresponding to the first commitment value of the privacy data to be verified. The second proof can indicate the authenticity of the first commitment value generated by the terminal device 11 according to the privacy data to be verified input by the user. The second proof and the first commitment value are sent to the blockchain platform 12 for storage.

[0111] A proof verification function is deployed in the blockchain platform to verify whether the proof is true. For example, the proof verification function is a proof verification function in the Bulletproofs algorithm, a zero-knowledge proof tool. According to the second proof, a first verification result of the second proof is obtained through the proof verification function. The first verification result may be true or false; when the first verification result is true, it means that the first commitment value corresponding to the second proof is true, that is, the first commitment value is the commitment value of the private data to be verified uploaded by the user; when the first verification result is false, it means that the first commitment value corresponding to the second proof is false, that is, the first commitment value is not the commitment value of the private data to be verified uploaded by the user. Among them, the proof verification function in the Bulletproofs algorithm is a prior art and will not be repeated here.

[0112] In the embodiment of the present application, the second proof and the first commitment value are stored on the blockchain. Before obtaining the comparison result of the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on the preset subtraction verification function, the first verification result of the second proof is obtained based on the preset proof verification function; if the first verification result is true, the subsequent process of obtaining the comparison result is carried out, thereby ensuring the authenticity of the first commitment value used by the blockchain platform when calculating the comparison result. In addition, based on the trustworthy, traceable and tamper-proof characteristics of the blockchain, the first commitment value and the second proof corresponding to the first commitment value are stored in the blockchain platform. If there is a problem of incorrect comparison results later, it is convenient to track and trace the source, thereby also realizing the trusted storage, trusted traceability, trusted access, etc. of the privacy data to be verified.

[0113] Embodiment 3:

[0114] In order to facilitate the verifier to set the verification data at any time according to the actual situation, and to ensure that the blockchain platform 12 can store the newly set verification data and the second commitment value and the second random value corresponding to the verification data, the privacy data comparison system of the embodiment of the present application also includes a verification device 13;

[0115] The verification device 13 is used to receive the verification data uploaded by the verifier; obtain the second commitment value and the second random value corresponding to the verification data through the second zero-knowledge proof tool; and send the verification data and the corresponding second commitment value and the second random value to the blockchain platform 13.

[0116] Figure 2 A complete structural diagram of a privacy data comparison system provided in an embodiment of the present application, the system includes: a terminal device 11, a blockchain platform 12 and a verification device 13; Figure 2As shown, the verification device 13 is connected to the blockchain platform 12. The verification device 13 is a device that supports the verification party to input verification data, such as a server, a computer (Personal Computer, PC), etc.

[0117] The verification device 13 has pre-built a second zero-knowledge proof tool. The verifier uploads the verification data to the verification device 13. The verification device 13 encrypts the verification data based on the second zero-knowledge proof tool to obtain the second commitment value and the second random value corresponding to the verification data, thereby ensuring the implementation of the subsequent size comparison process of the verification data and the private data. Among them, the second commitment value is the ciphertext string obtained by encrypting the verification data. In this application, the encryption of the verification data also chooses to use the Pedersen commitment; the second random value refers to a random number generated for the verification data when generating the second commitment value, which is used to prove that the second commitment value is the commitment value corresponding to the verification data.

[0118] The second commitment value and the second random value corresponding to the verification data calculated by the verification device 13 and the verification data are sent to the blockchain platform 13 for storage, so as to prepare for the implementation of the subsequent size comparison process of the privacy data and the verification data.

[0119] In a possible implementation, the blockchain platform 12 can be deployed on a cloud network, on a terminal device, or on a verification device, and is not limited thereto.

[0120] Optionally, a transmission channel is set up to connect the terminal device 11, the blockchain platform 12 and the verification device 13 to ensure secure access and reliable transmission of privacy data.

[0121] In an embodiment of the present application, the verification data input by the verifier is received through the verification device, and based on the second zero-knowledge proof tool, the second commitment value and the second random value corresponding to the verification data are obtained; the verification data and the corresponding second commitment value and the second random value are sent to the blockchain platform, ensuring that the blockchain platform stores the verification data and the second commitment value and the second random value corresponding to the verification data, and at the same time, the function of the verifier being able to set the verification data at any time according to actual conditions can also be realized.

[0122] Embodiment 4:

[0123] After the size comparison between the private data to be verified and the verification data is completed, the blockchain platform 12 is also used to send the comparison result to the verification device 13, so that the verification party can know the size comparison result between the private data to be verified and the verification data.

[0124] Embodiment 5:

[0125] In order to ensure that the verification data used by the terminal device 11 when performing size comparison is the verification data issued by the verifier, after obtaining the verification data and the corresponding second commitment value and second random value stored in the blockchain platform 12, the terminal device 11 also verifies the verification data and the second commitment value and second random value corresponding to the verification data based on the first zero-knowledge proof tool to ensure the accuracy of the obtained verification data.

[0126] Specifically: the terminal device 11 is also used to obtain a second verification result of the verification data based on the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool; if the second verification result is true, the subsequent process of generating the first proof is performed; wherein the second verification result refers to whether the verification data is the verification result sent by the verification party.

[0127] A commitment verification function for verifying whether the commitment is true is deployed in the first zero-knowledge proof tool. For example, the commitment verification function is the commitment verification function in the zero-knowledge proof tool Bulletproofs algorithm. According to the verification data and the corresponding second commitment value and second random value, a second verification result of the verification data is obtained through the commitment verification function. The second verification result may be true or false; when the second verification result is true, it means that the verification data is the verification result sent by the verifier; when the second verification result is false, it means that the verification data is not the verification result sent by the verifier. Among them, the commitment verification function in the Bulletproofs algorithm is a prior art and will not be repeated here.

[0128] In an embodiment of the present application, according to the verifiability of the Pedersen commitment, based on the commitment verification function of the first zero-knowledge proof tool, a second verification result of the second commitment value is obtained to ensure the accuracy of the obtained verification data, making the privacy data comparison process more accurate and efficient.

[0129] Embodiment 6:

[0130] The embodiment of the present application explains the generation of the first certificate by the above-mentioned terminal device 11.

[0131] The terminal device 11 is specifically used to determine a first difference between a first commitment value and a second commitment value, a second difference between verification data and privacy data to be verified, and a third difference between a first random value and a second random value; and generate a first proof according to the first difference, the second difference and the third difference through a proof generation function of a first zero-knowledge proof tool.

[0132] Specifically: the first zero-knowledge proof tool deployed in the terminal device 11 subtracts the second commitment value from the first commitment value to obtain a first difference; subtracts the verification data from the privacy data to be verified to obtain a second difference; subtracts the second random value from the first random value to obtain a third difference; and generates a first proof based on the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

[0133] A proof generation function for generating proofs is deployed in the first zero-knowledge proof tool. For example, the proof generation function is a proof generation function in the zero-knowledge proof tool Bulletproofs algorithm. According to the first difference, the second difference and the third difference, a first proof is generated to indicate the authenticity of the first difference between the first commitment value and the second commitment value calculated by the terminal device 11, the second difference between the privacy data to be verified and the verification data, and the third difference between the first random value and the second random value. Among them, the proof generation function in the Bulletproofs algorithm is a prior art and will not be described in detail here.

[0134] In one possible implementation, after the verification data obtained is the verification data sent by the verifier, the terminal device 11 can first subtract the verification data from the privacy data to be verified to obtain the difference between the privacy data to be verified and the verification data; based on the difference, based on the first zero-knowledge proof tool, generate a first proof and send the first proof to the blockchain platform 12 for storage.

[0135] Embodiment 7:

[0136] The embodiment of the present application explains the generation of the comparison results performed by the above-mentioned blockchain platform 12.

[0137] The blockchain platform 12 is specifically used to determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on a preset subtraction verification function according to the first proof and the first difference.

[0138] The blockchain platform 12 verifies whether the first proof sent by the terminal device 11 is true, specifically: determining a first difference between the first commitment value and the second commitment value; according to the first proof and the first difference, based on a preset subtraction verification function, obtaining a comparison result between the privacy data to be verified and the verification data.

[0139] Among them, the comparison result is that the blockchain platform 12 outputs the character of "true" or "false". When the output is the character of "true", that is, the verification is passed, it proves that the zero-knowledge proof of the first difference is true, and the first difference is greater than 0 in the data interval specified by the Bulletproofs algorithm, that is, the private data to be verified is greater than the verification data; when the output is the character of "false", that is, the verification fails, it proves that the zero-knowledge proof of the first difference is false, and the first difference is not greater than 0 in the data interval specified by the Bulletproofs algorithm, that is, the private data to be verified is less than the verification data.

[0140] Based on the Bulletproofs algorithm in the zero-knowledge proof tool rangeproof, it is possible to prove that the data is within a specified range without revealing the specific value of the private data, thereby protecting the user's private data. No trust setting is required, and any participant can independently verify the validity of the proof, which enhances the decentralization of the system and the availability of private data. In addition, the Bulletproofs algorithm of rangeproof supports proving that multiple private data are within their respective ranges at one time, which can greatly reduce the number of proofs required and the total amount of data transmission in certain data size comparison scenarios.

[0141] Embodiment 8:

[0142] For ease of understanding, the privacy data comparison process provided by this application is explained below through a specific embodiment. For example, a game platform verifies whether the age of user A is greater than the verification data 18 years old. Assuming that user A is 20 years old, refer to Figure 3 , Figure 3 A schematic diagram of a privacy data comparison process provided in an embodiment of the present application, the process includes the following steps:

[0143] S301A: When the terminal device receives the private data 20 to be verified uploaded by user A, it obtains the first commitment value, the first random value and the second proof of the private data 20 to be verified based on the first zero-knowledge proof tool.

[0144] S302A: Send the first commitment value and the second proof to the blockchain platform.

[0145] S301B: When receiving the verification data 18 uploaded by the verifier, the verification device obtains a second commitment value and a second random value of the verification data 18 based on a second zero-knowledge proof tool.

[0146] S302B: Send the verification data 18, the second commitment value and the second random value to the blockchain platform.

[0147] S301A and S302A are the processes in which the terminal device initializes the privacy data to be verified, and S301B and S302B are the processes in which the verification device initializes the verification data.

[0148] S303: The terminal device obtains the verification data 18 stored in the blockchain platform and the second commitment value and the second random value corresponding to the verification data 18.

[0149] S304: The terminal device generates a first proof based on the first zero-knowledge proof tool according to the privacy data 20 to be verified, the first commitment value, the first random value, the verification data 18, the second commitment value and the second random value.

[0150] S305: Send the first proof of user A’s age difference to the blockchain platform.

[0151] S306: The blockchain platform obtains a comparison result between the privacy data 20 to be verified and the verification data 18 based on the first commitment value, the first proof of the age difference of user A and the second commitment value corresponding to the verification data 18, based on a preset subtraction verification function, where the comparison result is "true" or "false".

[0152] S307: Send the comparison result to the verification device.

[0153] Among them, S303, S304, S305, S306 and S307 are verification processes.

[0154] In a possible implementation, the first proof generated in step 304 can be sent to the verification device at the same time as it is sent to the blockchain platform. When performing verification, the verification device uses the first proof as a parameter to call the subtraction verification function in the smart contract deployed by the blockchain platform to perform a subtraction of the first commitment value of the private data 20 to be verified stored on the chain and the second commitment value of the verification data 18 to obtain a first difference, and uses the first difference to automatically verify the first proof on the chain and output a comparison result.

[0155] In the embodiment of the present application, the privacy data to be verified is encrypted, and the first commitment value and the second proof of the corresponding privacy data to be verified are generated in the user terminal device through the zero-knowledge proof tool. "The privacy data in plain text does not leave the local area" makes the privacy data in a controllable use range, which can effectively guarantee the authenticity and security of the privacy data, and ensure that the privacy data will not be leaked or forged during the size comparison of the privacy data. In addition, by combining the blockchain platform and smart contract technology, the size comparison process of the privacy data is more credible, and the commitment value of the privacy data and the commitment value of the verification data are stored on the chain in real time, avoiding forgery and tampering during the size comparison process between the two parties, making the verification result more credible; the smart contract automatically executes the verification of the first commitment value and the first proof of the privacy data without additional interference, the size comparison result is highly credible, and the size comparison process of the privacy data is traceable throughout, which effectively solves the drawbacks of the centralized privacy data comparison system that is opaque and difficult to trace.

[0156] Embodiment 9:

[0157] Based on the same technical concept, on the basis of the above embodiments, the present application provides a privacy data comparison method, which is applied to a terminal device. Figure 4 This is one of the process diagrams of a privacy data comparison method provided in an embodiment of the present application, such as Figure 4 As shown, the process includes:

[0158] S401: receiving the private data to be verified uploaded by the user.

[0159] S402: Obtain a first commitment value and a first random value of the privacy data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform.

[0160] S403: Obtain the verification data stored in the blockchain platform and the corresponding second commitment value and second random value.

[0161] S404: Generate a first proof based on the first zero-knowledge proof tool according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; and send the first proof to the blockchain platform.

[0162] S405: Send the first proof and the first commitment value to the blockchain platform, so that after the blockchain platform device receives the first commitment value and the first proof, it obtains a comparison result between the privacy data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof and the second commitment value corresponding to the verification data.

[0163] In a possible implementation, the method further includes:

[0164] A second proof corresponding to a first commitment value of the privacy data to be verified is obtained through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform, so that the blockchain platform obtains a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

[0165] In a possible implementation, after obtaining the verification data stored in the blockchain platform and the corresponding second commitment value and second random value, the method further includes:

[0166] According to the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool, a verification result of the verification data is obtained; if the verification result is true, the subsequent process of generating the first proof is performed; wherein the verification result refers to whether the verification data is the verification result sent by the verifier.

[0167] In a possible implementation, according to the private data to be verified, the first commitment value, the first random value, the verification data, the second commitment value, and the second random value, based on a first zero-knowledge proof tool, a first proof is generated, and the method includes:

[0168] Determine a first difference between the first commitment value and the second commitment value, a second difference between the verification data and the privacy data to be verified, and a third difference between the first random value and the second random value; and generate the first proof according to the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

[0169] Embodiment 10:

[0170] Based on the same technical concept, on the basis of the above embodiments, this application provides another privacy data comparison method, which is applied to the blockchain platform. Figure 5 The second process diagram of another privacy data comparison method provided in the embodiment of the present application is as follows: Figure 5 As shown, the process includes:

[0171] S501: Receive a first commitment value sent by a terminal device; wherein the first commitment value is the privacy data to be verified uploaded by the user and received by the terminal device.

[0172] S502: Obtaining a first commitment value corresponding to the privacy data to be verified through a first zero-knowledge proof tool.

[0173] S503: Receive a first proof sent by a terminal device; wherein the first proof is that the terminal device obtains verification data stored in the blockchain platform and the corresponding second commitment value and second random value; based on the first zero-knowledge proof tool, generate a first proof according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, wherein the first random value is the privacy data to be verified uploaded by the user and received by the terminal device; obtain the first random value corresponding to the privacy data to be verified through the first zero-knowledge proof tool.

[0174] S504: Obtain a comparison result between the private data to be verified and the verification data according to the first commitment value, the first proof, and the second commitment value corresponding to the verification data and based on a preset subtraction verification function.

[0175] In a possible implementation, before obtaining a comparison result between the private data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof, and the second commitment value corresponding to the verification data, the method further includes:

[0176] Based on a preset proof verification function, a first verification result of the second proof is obtained; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true, wherein the second proof is a second proof corresponding to the first commitment value of the privacy data to be verified obtained by the terminal device through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform.

[0177] In a possible implementation manner, after obtaining the comparison result between the privacy data to be verified and the verification data, the method further includes:

[0178] The comparison result is sent to the verification device.

[0179] In a possible implementation, according to the first commitment value, the first proof, and the second commitment value corresponding to the verification data, based on a preset subtraction verification function, a comparison result of the private data to be verified and the verification data is obtained, and the method includes:

[0180] Determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first proof and the first difference.

[0181] Embodiment 11:

[0182] Based on the same technical concept, on the basis of the above embodiments, the present application provides another privacy data comparison method, which is applied to the verification device. Figure 6The third process diagram of another privacy data comparison method provided in the embodiment of the present application is as follows: Figure 6 As shown, the process includes:

[0183] S601: receiving verification data uploaded by the verification party.

[0184] S602: Obtain a second commitment value and a second random value corresponding to the verification data through a second zero-knowledge proof tool.

[0185] S603: Send the verification data and the corresponding second commitment value and second random value to the blockchain platform.

[0186] S604: Receive the comparison result sent by the blockchain platform; wherein the comparison result is that the blockchain platform obtains the comparison result of the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on a preset subtraction verification function; wherein the first commitment value is the privacy data to be verified uploaded by the user and received by the terminal device; the first commitment value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool; the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, the first proof is generated based on the first zero-knowledge proof tool; wherein the first random value is the privacy data to be verified uploaded by the user and received by the terminal device; the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.

[0187] Embodiment 12:

[0188] Based on the same technical concept, on the basis of the above embodiments, the present application provides a privacy data comparison device, which is applied to a terminal device. Figure 7 This is one of the structural diagrams of a privacy data comparison device provided in an embodiment of the present application, such as Figure 7 As shown, the device comprises:

[0189] The receiving module 701 is used to receive the private data to be verified uploaded by the user.

[0190] The processing module 702 is used to obtain a first commitment value and a first random value of the privacy data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform.

[0191] The acquisition module 703 is used to acquire the verification data and the corresponding second commitment value and second random value stored in the blockchain platform. According to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, a first proof is generated based on the first zero-knowledge proof tool; and the first proof is sent to the blockchain platform.

[0192] The processing module 702 is also used to send the first proof and the first commitment value to the blockchain platform, so that after the blockchain platform device receives the first commitment value and the first proof, it obtains the comparison result of the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first commitment value, the first proof and the second commitment value corresponding to the verification data.

[0193] In a possible implementation manner, the processing module 702 is further configured to:

[0194] A second proof corresponding to a first commitment value of the privacy data to be verified is obtained through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform, so that the blockchain platform obtains a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

[0195] In a possible implementation manner, the processing module 702 is further configured to:

[0196] According to the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool, a verification result of the verification data is obtained; if the verification result is true, the subsequent process of generating the first proof is performed; wherein the verification result refers to whether the verification data is the verification result sent by the verifier.

[0197] In a possible implementation manner, the processing module 702 is specifically configured to:

[0198] Determine a first difference between the first commitment value and the second commitment value, a second difference between the verification data and the privacy data to be verified, and a third difference between the first random value and the second random value; and generate the first proof according to the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

[0199] Embodiment 13:

[0200] Based on the same technical concept, on the basis of the above embodiments, this application provides a privacy data comparison device, which is applied to the blockchain platform. Figure 8 The second structural diagram of a privacy data comparison device provided in an embodiment of the present application is as follows: Figure 8 As shown, the device comprises:

[0201] The receiving module 801 is used to receive a first commitment value sent by a terminal device; wherein the first commitment value is the privacy data to be verified uploaded by the user and received by the terminal device.

[0202] The processing module 802 is used to obtain a first commitment value corresponding to the privacy data to be verified through a first zero-knowledge proof tool.

[0203] The receiving module 801 is also used to receive a first proof sent by a terminal device; wherein the first proof is that the terminal device obtains verification data stored in the blockchain platform and the corresponding second commitment value and second random value; based on the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, a first proof is generated based on a first zero-knowledge proof tool, wherein the first random value is the privacy data to be verified uploaded by the user and received by the terminal device; and the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.

[0204] The processing module 802 is further configured to obtain a comparison result between the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data and based on a preset subtraction verification function.

[0205] In a possible implementation manner, the processing module 802 is further configured to:

[0206] Based on a preset proof verification function, a first verification result of the second proof is obtained; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true, wherein the second proof is a second proof corresponding to the first commitment value of the privacy data to be verified obtained by the terminal device through a first zero-knowledge proof tool, and the second proof is sent to the blockchain platform.

[0207] In a possible implementation manner, the device further includes a sending module 803, which is specifically configured to:

[0208] The comparison result is sent to the verification device.

[0209] In a possible implementation manner, the processing module 802 is specifically configured to:

[0210] Determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first proof and the first difference.

[0211] Embodiment 14:

[0212] Based on the same technical concept, on the basis of the above embodiments, the present application provides a privacy data comparison device, which is applied to a verification device. Fig. 9 The third structural diagram of a privacy data comparison device provided in an embodiment of the present application is as follows: Fig. 9 As shown, the device comprises:

[0213] The receiving module 901 is used to receive the verification data uploaded by the verification party.

[0214] The processing module 902 is used to obtain a second commitment value and a second random value corresponding to the verification data through a second zero-knowledge proof tool.

[0215] The sending module 903 is used to send the verification data and the corresponding second commitment value and second random value to the blockchain platform.

[0216] The receiving module 901 is also used to receive the comparison result sent by the blockchain platform; wherein the comparison result is that the blockchain platform obtains the comparison result of the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on the preset subtraction verification function; wherein the first commitment value is the privacy data to be verified uploaded by the user received by the terminal device; the first commitment value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool; the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, the first proof is generated based on the first zero-knowledge proof tool; wherein the first random value is the privacy data to be verified uploaded by the user received by the terminal device; the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.

[0217] Embodiment 15:

[0218] Based on the same technical concept, the present application also provides an electronic device, Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, it includes: a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004;

[0219] The memory 1003 stores a computer program, and when the program is executed by the processor 1001, the processor 1001 implements any of the above embodiments. Since the principle of solving the problem by the electronic device is similar to the privacy data comparison method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0220] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0221] The communication interface 1002 is used for communication between the above electronic device and other devices.

[0222] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0223] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0224] Embodiment 16:

[0225] Based on the same technical concept, the embodiment of the present application provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device implements any of the above embodiments when executing. Since the principle of solving the problem by the computer-readable storage medium is similar to that of the privacy data comparison method, the implementation of the computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0226] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.

[0227] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the above embodiments. Since the principle of solving the problem by the above computer program product is similar to that of the privacy data comparison method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0228] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0229] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0230] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0231] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0232] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A privacy data comparison system, characterized in that: The system includes: a terminal device and a blockchain platform; The terminal device is used to receive the private data to be verified uploaded by the user; obtain a first commitment value and a first random value corresponding to the private data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform; The terminal device is further used to obtain the verification data and the corresponding second commitment value and second random value stored in the blockchain platform; generate a first proof based on the first zero-knowledge proof tool according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; and send the first proof to the blockchain platform; The blockchain platform is used to obtain a comparison result between the privacy data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof, and a second commitment value corresponding to the verification data.

2. The system according to claim 1, characterized in that The terminal device is further configured to obtain, by using a first zero-knowledge proof tool, a second proof corresponding to the first commitment value of the private data to be verified, and send the second proof to the blockchain platform; The blockchain platform is also used to obtain a first verification result of the second proof based on a preset proof verification function; if the first verification result is true, a subsequent process of obtaining a comparison result is performed; wherein the first verification result refers to a verification result of whether the first commitment value corresponding to the second proof is true.

3. The system according to claim 1, characterized in that The system further comprises: a verification device; The verification device is used to receive verification data uploaded by the verifier; obtain a second commitment value and a second random value corresponding to the verification data through a second zero-knowledge proof tool; and send the verification data and the corresponding second commitment value and second random value to the blockchain platform.

4. The system according to claim 3, characterized in that The blockchain platform is also used to send the comparison result to the verification device.

5. The system according to claim 1, characterized in that The terminal device is also used to obtain a second verification result of the verification data based on the verification data and the corresponding second commitment value and second random value, based on the commitment verification function of the first zero-knowledge proof tool; if the second verification result is true, the subsequent process of generating the first proof is performed; wherein the second verification result refers to whether the verification data is the verification result sent by the verifier.

6. The system according to claim 1, characterized in that The terminal device is specifically used to determine a first difference between the first commitment value and the second commitment value, a second difference between the verification data and the privacy data to be verified, and a third difference between the first random value and the second random value; and generate the first proof according to the first difference, the second difference and the third difference through the proof generation function of the first zero-knowledge proof tool.

7. The system according to claim 1, characterized in that The blockchain platform is specifically used to determine a first difference between the first commitment value and the second commitment value; and obtain a comparison result between the privacy data to be verified and the verification data based on the preset subtraction verification function according to the first proof and the first difference.

8. A privacy data comparison method based on the privacy data comparison system according to any one of claims 1 to 7, applied to a terminal device, characterized in that: The method comprises: Receive the private data to be verified uploaded by the user; obtain a first commitment value and a first random value of the private data to be verified through a first zero-knowledge proof tool; and send the first commitment value to the blockchain platform; Obtain the verification data and the corresponding second commitment value and second random value stored in the blockchain platform; generate a first proof based on the first zero-knowledge proof tool according to the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value; and send the first proof to the blockchain platform; The first proof and the first commitment value are sent to the blockchain platform, so that after the blockchain platform device receives the first commitment value and the first proof, it obtains a comparison result between the privacy data to be verified and the verification data based on a preset subtraction verification function according to the first commitment value, the first proof and the second commitment value corresponding to the verification data.

9. A privacy data comparison method based on the privacy data comparison system according to any one of claims 1 to 7, applied to a blockchain platform, characterized in that: The method comprises: Receiving a first commitment value sent by a terminal device; wherein the first commitment value is the private data to be verified uploaded by the user and received by the terminal device; obtaining the first commitment value corresponding to the private data to be verified through a first zero-knowledge proof tool; Receive a first proof sent by the terminal device; wherein the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the first zero-knowledge proof tool, generate a first proof according to the private data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, wherein the first random value is the private data to be verified uploaded by the user received by the terminal device; obtain the first random value corresponding to the private data to be verified through the first zero-knowledge proof tool; According to the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on a preset subtraction verification function, a comparison result between the privacy data to be verified and the verification data is obtained.

10. A privacy data comparison method based on the privacy data comparison system of claim 4, applied to a verification device, characterized in that: The method comprises: Receive the verification data uploaded by the verifier; obtain the second commitment value and the second random value corresponding to the verification data through the second zero-knowledge proof tool; send the verification data and the corresponding second commitment value and the second random value to the blockchain platform; Receive the comparison result sent by the blockchain platform; wherein the comparison result is that the blockchain platform obtains the comparison result of the privacy data to be verified and the verification data based on the first commitment value, the first proof and the second commitment value corresponding to the verification data, based on a preset subtraction verification function; wherein the first commitment value is the privacy data to be verified uploaded by the user received by the terminal device; the first commitment value corresponding to the privacy data to be verified is obtained through a first zero-knowledge proof tool; the first proof is that the terminal device obtains the verification data stored by the blockchain platform and the corresponding second commitment value and second random value; based on the privacy data to be verified, the first commitment value, the first random value, the verification data, the second commitment value and the second random value, a first proof is generated based on the first zero-knowledge proof tool; wherein the first random value is the privacy data to be verified uploaded by the user received by the terminal device; the first random value corresponding to the privacy data to be verified is obtained through the first zero-knowledge proof tool.