NUMERICAL VALUE RANKING METHOD AND APPARATUS BASED ON BLOCKCHAIN

20230291586 · 2023-09-14

    Inventors

    Cpc classification

    International classification

    Abstract

    A blockchain based numerical value ranking method includes: using, by a first participant, a public key of the first participant to encrypt a private value of the first participant to obtain an encrypted text of the first participant; obtaining encrypted texts of other participants, and generating a challenge value having a preset bit length; based on the challenge value and the private value of the first participant, and the encrypted texts and public keys of the other participants, determining mixed results of the first participant with respect to the other participants; and determining a numerical value ranking result between the first participant and a second participant based on the mixed result of the second participant with respect to the first participant.

    Claims

    1. A blockchain based numerical value ranking method, comprising: using, by a first participant, a public key of the first participant to encrypt a private value of the first participant to obtain an encrypted text of the first participant, and sending the encrypted text of the first participant to a blockchain for an on-chain operation; obtaining, by the first participant, encrypted texts of other participants, and generating a challenge value having a preset bit length; based on the challenge value and the private value of the first participant, and the encrypted texts and public keys of the other participants, determining, by the first participant, mixed results of the first participant with respect to the other participants, and sending the mixed results of the first participant with respect to the other participants to the blockchain for the on-chain operation, wherein the other participants are participants that are located in the same blockchain as the first participant and participate in a numerical value ranking process; and determining, by the first participant, a numerical value ranking result between the first participant and a second participant based on the mixed result of the second participant with respect to the first participant, wherein the second participant is one of the other participants that participate in the numerical value ranking process.

    2. The method according to claim 1, wherein determining, by the first participant, the mixed results of the first participant with respect to the other participants based on the challenge value and the private value of the first participant, and the encrypted texts and public keys of the other participants comprises: using, by the first participant, the public keys of the other participants to encrypt the challenge value and the private value of the first participant to obtain a first intermediate value; determining, by the first participant, a product of the encrypted texts of the other participants and the challenge value of the first participant as a second intermediate value; and determining, by the first participant, a difference between the first intermediate value and the second intermediate value as the mixed results of the first participant with respect to the other participants.

    3. The method according to claim 1, wherein determining, by the first participant, the numerical value ranking result between the first participant and the second participant based on the mixed result of the second participant with respect to the first participant comprises: obtaining, by the first participant, from the blockchain the mixed result of the second participant with respect to the first participant that is uploaded by the second participant; using, by the first participant, the private key of the first participant to decrypt the mixed result of the second participant with respect to the first participant to obtain a decrypted result; and determining, by the first participant, the numerical value ranking result between the first participant and the second participant based on a positive/negative attribute of the decrypted result.

    4. The method according to claim 3, wherein determining, by the first participant, the numerical value ranking result between the first participant and the second participant based on the positive/negative attribute of the decrypted result comprises: determining, by the first participant, that the private value of the first participant is smaller than a private value of the second participant if the positive/negative attribute of the decrypted result is positive; determining, by the first participant, that the private value of the first participant is greater than the private value of the second participant if the positive/negative attribute of the decrypted result is negative; and determining, by the first participant, that the private value of the first participant is equal to the private value of the second participant if the positive/negative attribute of the decrypted result is zero.

    5. The method according to claim 1, wherein after the numerical value ranking result between the first participant and the second participant is determined by the first participant, the method further comprises: after the first participant determines that the first participant is a winner based on the numerical value ranking result between the first participant and the second participant, sending the private key of the first participant to an intermediate party, such that the intermediate party uses the private key of the first participant to decrypt the encrypted text of the first participant to obtain the private value of the first participant.

    6. The method according to claim 1, wherein after the numerical value ranking result between the first participant and the second participant is determined by the first participant, the method further comprises: when the first participant determines that the private value of the winner is in dispute and is not disclosed, verifying a legitimacy by sending the private key of the first participant to the intermediate party or requesting the winner to send a challenge value of the winner to the intermediate party.

    7. A blockchain based numerical value ranking apparatus, comprising: a processing unit configured to use a public key of a first participant to encrypt a private value of the first participant to obtain an encrypted text of the first participant, and sending the encrypted text of the first participant to a blockchain for an on-chain operation; and an acquisition unit configured to obtain encrypted texts of other participants and generate a challenge value having a preset bit length; wherein the processing unit is further configured to: determine mixed results of the first participant with respect to the other participants based on the challenge value and the private value of the first participant and the encrypted texts and public keys of the other participants, and send the mixed results of the first participant with respect to the other participants to blockchain for the on-chain operation, wherein the other participants are participants that are located in a same blockchain as the first participant and participate in a numerical value ranking process; and determine a numerical value ranking result between the first participant and a second participant based on a mixed result of the second participant with respect to the first participant, wherein the second participant is one of the other participants that participate in the numerical value ranking process.

    8. The apparatus according to claim 7, wherein the processing unit is further configured to: use the public keys of the other participants to encrypt the challenge value and the private value of the first participant to obtain a first intermediate value; determine a product of the encrypted texts of the other participants and the challenge value of the first participant as a second intermediate value; and determine a difference between the first intermediate value and the second intermediate value as the mixed results of the first participant with respect to the other participants.

    9. The apparatus according to claim 7, wherein the processing unit is further configured to: obtain from the blockchain the mixed result of the second participant with respect to the first participant that is uploaded by the second participant; use the private key of the first participant to decrypt the mixed result of the second participant with respect to the first participant to obtain a decrypted result; and determine the numerical value ranking result between the first participant and the second participant based on a positive/negative attribute of the decrypted result.

    10. The apparatus according to claim 7, wherein the processing unit is further configured to: determine that the private value of the first participant is smaller than a private value of the second participant if the positive/negative attribute of the decrypted result is positive; determine that the private value of the first participant is greater than the private value of the second participant if the positive/negative attribute of the decrypted result is negative; and determine that the private value of the first participant is equal to the private value of the second participant if the positive/negative attribute of the decrypted result is zero.

    11. The apparatus according to claim 7, wherein the processing unit is further configured to: after the first participant determines that the first participant is a winner based on the numerical value ranking result between the first participant and the second participant, send the private key of the first participant to an intermediate party, such that the intermediate party uses the private key of the first participant to decrypt the encrypted text of the first participant to obtain the private value of the first participant.

    12. The apparatus according to claim 7, wherein the processing unit is further configured to: when the first participant determines that the private value of the winner is in dispute and is not disclosed, verify a legitimacy by sending the private key of the first participant to the intermediate party or requesting the winner to send a challenge value of the winner to the intermediate party.

    13. A computing device, comprising: a memory for storing program instructions; and a processor configured to call the program instructions stored in the memory, wherein when being executed by the processor, the program instructions cause the processor to perform: using, by a first participant, a public key of the first participant to encrypt a private value of the first participant to obtain an encrypted text of the first participant, and sending the encrypted text of the first participant to a blockchain for an on-chain operation; obtaining, by the first participant, encrypted texts of other participants, and generating a challenge value having a preset bit length; based on the challenge value and the private value of the first participant, and the encrypted texts and public keys of the other participants, determining, by the first participant, mixed results of the first participant with respect to the other participants, and sending the mixed results of the first participant with respect to the other participants to the blockchain for the on-chain operation, wherein the other participants are participants that are located in the same blockchain as the first participant and participate in a numerical value ranking process; and determining, by the first participant, a numerical value ranking result between the first participant and a second participant based on the mixed result of the second participant with respect to the first participant, wherein the second participant is one of the other participants that participate in the numerical value ranking process.

    14. A computer-readable storage medium, comprising: computer-readable instructions, wherein when being retrieved and executed by a computer, the computer-readable instructions cause the computer to perform the method according to claim 1.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0021] To more clearly illustrate the technical solution of the present disclosure, the accompanying drawings used in the description of the disclosed embodiments are briefly described below. The drawings described below are merely some embodiments of the present disclosure. Other drawings may be derived from such drawings by a person with ordinary skill in the art without creative efforts and may be encompassed in the present disclosure.

    [0022] FIG. 1 is a schematic diagram of an exemplary system architecture according to some embodiments of the present disclosure;

    [0023] FIG. 2 is a flowchart of an exemplary blockchain based numerical value ranking method according to some embodiments of the present disclosure;

    [0024] FIG. 3 is a flowchart of another exemplary blockchain based numerical value ranking method according to some embodiments of the present disclosure; and

    [0025] FIG. 4 is a schematic structural diagram of an exemplary blockchain based numerical value ranking apparatus according to some embodiments of the present disclosure.

    DETAILED DESCRIPTION OF THE EMBODIMENTS

    [0026] In order to make the objectives, technical solutions, and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.

    [0027] FIG. 1 is a schematic diagram of an exemplary system architecture according to some embodiments of the present disclosure. As shown in FIG. 1, the system architecture may include a blockchain 100, multiple participants 200 (1 to n), and a middle party (S) 300. The multiple participants 200 may be different institutions participating in a government bidding or an auction house bidding. The multiple participants 200 are located in a same blockchain.

    [0028] The blockchain 100 includes a plurality of blocks configured to store encrypted bids submitted by the multiple participants 200.

    [0029] The middle party 300 is a bid solicitor or an auction party located in the same blockchain as the multiple parties.

    [0030] It should be noted that the architecture shown in FIG. 1 above is merely intended to be exemplary, and does not limit the embodiments of the present disclosure.

    [0031] In view of this, FIG. 2 is a flowchart of an exemplary blockchain based numerical value ranking method according to some embodiments of the present disclosure. The method may be executed by a blockchain based numerical value ranking apparatus. The apparatus may be located within any one of the above-described parties. The embodiments of the present disclosure can be applied to a government project bidding process, and bids evaluation in the bidding process.

    [0032] As shown in FIG. 2, the method includes the following processes.

    [0033] At step 201, a first participant uses a public key of the first participant to encrypt its private value to obtain an encrypted text of the first participant, and sends the encrypted text of the first participant to the blockchain for an on-chain operation.

    [0034] In some embodiments, before the bid is encrypted, each participant also needs to generate a key pair including a public key and a private key, and sends the public key to other participants. For example, each participant I generates a homomorphically encrypted public-private key pair (pk.sub.i,sk.sub.i), and discloses the public key pk.sub.i. In the embodiments of the present disclosure, the encryption method may be a homomorphic encryption. The other participants are participants participating in a same numerical value ranking operation as the first participant.

    [0035] After each participant sends the public thereof to the other participants, each participant i uses its own public key pk.sub.i to homomorphically encrypt its own private value p.sub.i to obtain an encrypted text c.sub.i=E.sub.i(p.sub.i), and the on-chain operation is performed for the encrypted text. It should be noted that, in practical applications, the private value may be a bid of a participant, or a value that cannot be disclosed to the other participants.

    [0036] After all n participants completes the on-chain operation of the encrypted text thereof, the blockchain contains the encrypted texts {c.sub.1, . . . , c.sub.n} of the private values of all n participants.

    [0037] At step 202, the first participant obtains the encrypted texts from the other participants and generates a challenge value with a preset bit length, determines mixed results of the first participant with the other participants based on the challenge value and the private value of the first participant, and the encrypted texts and the public keys of the other participants, and sends the mixed results of the first participant with respect to the other participants to the blockchain for the on-chain operation.

    [0038] After each participant competes the on-chain operation for the encrypted text thereof, the first participant obtains the encrypted texts of the other participants from the blockchain, and generates the challenge value with the preset bit length. The challenge value may be a random number. A length of the challenge value is related to a length of the public key and a length of the private key. For example, the length of the challenge value may be a quarter of the length of the public key or the private key. If the length of the challenge value is not limited, a reversal of positive/negative attribute may occur when the mixed result is calculated.

    [0039] Next, the mixed results are calculated. For example, the first participant uses the public keys of the other participants to encrypt the challenge value and the private value to obtain a first intermediate value. The encrypted texts of the other participants are multiplied by the challenge value of the first participant to obtain a second intermediate value. A difference between the first intermediate value and the second intermediate value is determined to be the mixed results of the first participant with respect to the other participants.

    [0040] For example, each participant i obtains the public keys {pk.sub.1, . . . , pk.sub.i−1, pk.sub.i+1, . . . , pk.sub.n} of the other participants {1, . . . , i−1, i+1, . . . , n}, and generates its own challenge value r.sub.i. The mixed result of each participant i with respect to the other participant 1 is calculated as d.sub.i,1=E.sub.1(p.sub.ir.sub.i)−E.sub.1(p.sub.1)r.sub.i=E.sub.1((p.sub.i−p.sub.1)r.sub.i), where E.sub.1(p.sub.ir.sub.i) is the first intermediate value, and E.sub.1(p.sub.1)r.sub.i is the second intermediate value. Similarly, the mixed results of the participant i with respect to the remaining other participant {2, . . . , i−1, i+1, . . . , n} are calculated as d.sub.i,2=E.sub.2((p.sub.i−p.sub.2)r.sub.i), . . . , d.sub.i,i−1=E.sub.i−1((p.sub.i−p.sub.i−1)r.sub.i), d.sub.i,i+1=E.sub.i+1((p.sub.i−p.sub.i+1)r.sub.i), . . . , d.sub.i,n=E.sub.n((p.sub.i−p.sub.n)r.sub.i). The on-chain operations are performed on the mixed results.

    [0041] After the mixed results for the n participants are completed, the blockchain now includes the encrypted texts and the mixed results for all the participants. The complete list of the mixed results is shown in Table 1 below.

    TABLE-US-00001 TABLE 1 1 2 , , , n − 1 n 1 / d.sub.1, 2 . . . d.sub.1, n−1 d.sub.1, n 2 d.sub.2, 1 / . . . d.sub.2, n−1 d.sub.2, n . . . . . . . . . . . . . . . . . . n − 1 d.sub.n−1, 1 d.sub.n−1, 2 . . . / d.sub.n−1, n N d.sub.n, 1 d.sub.n, 2 . . . d.sub.n, n−1 /

    [0042] At S203, based on the mixed result of a second participant with respect to the first participant, the first participant determines a numerical value ranking result between the first participant and the second participant.

    [0043] In some embodiments, the first participant obtains a numerical value ranking result based on the mixed results of the participants that need to be included in the numerical ranking with respect to the first participant. For example, the first participant obtains from the blockchain the mixed result of the second participant with respect to the first participant, which is uploaded by the second participant. The first participant uses its private key to decrypt the mixed result of the second participant with respect to the first participant to obtain the decrypted result. Based on the positive/negative attribute of the decrypted result, the first participant determines the numerical value ranking result between the first participant and the second participant. The second participant is a participant having bids being compared among the other participants.

    [0044] The numerical value ranking result is determined in the following three scenarios.

    [0045] First Scenario

    [0046] If the positive/negative attribute of the decrypted result is positive, the first participant determines that a private value of the first participant is smaller than a private value of the second participant.

    [0047] In some embodiments, when the bids in the encrypted texts of one participant i and any other participant j are compared, the first participant i obtains d.sub.j,i=E.sub.i((p.sub.j−p.sub.i)r.sub.j) from the blockchain. Next, the first participant i uses its private key sk.sub.i to decrypt d.sub.j,i to obtain the decrypted result (p.sub.j−p.sub.i)r.sub.j. Next, the first participant i determines a numerical value ranking result between p.sub.j and p.sub.i based on the positive/negative attribute of the decrypted result (p.sub.j−p.sub.i)r.sub.j. When the positive/negative attribute of the decrypted result (p.sub.j−p.sub.i)r.sub.j is positive, it indicates that p.sub.j is greater than p.sub.i, that is, the private value of the participant j is greater than the private value of the participant i. At this time, the participant i knows its own private value is smaller than the private value of the participant j, and may adjust its own private value in a next bidding round.

    [0048] Second Scenario

    [0049] If the positive/negative attribute of the decrypted result is negative, the first participant determines that the private value of the first participant is greater than the private value of the second participant.

    [0050] Similarly, in some embodiments, when the positive/negative attribute of the decrypted result (p.sub.j−p.sub.i)r.sub.j is negative, it indicates that p.sub.j is smaller than p.sub.i, that is, the private value of the participant j is smaller than the private value of the participant i. At this time, the participant i knows its own private value is greater than the private value of the participant j.

    [0051] Third Scenario

    [0052] If the positive/negative attribute of the decrypted result is zero, the first participant determines that the private value of the first participant is equal to the private value of the second participant.

    [0053] Similarly, in some embodiments, when the positive/negative attribute of the decrypted result (p.sub.j−p.sub.i)r.sub.j is zero, it indicates that p.sub.j is equal to p.sub.i, that is, the private value of the participant j is equal to the private value of the participant i. At this time, the participant i knows its own private value is equal to the private value of the participant j.

    [0054] The participant i may use the above-described method to compare the numerical values (i.e., the bids in a current bidding round) with all the other participants {1, . . . , i−1, i+1, . . . , n}, that is, obtaining its own ranking in the current bidding round.

    [0055] In the embodiments of the present disclosure, each participant only needs a random number, and obtains the mixed result through simple calculation. Thus, an amount of data included in the up-link operation is limited, thereby reducing a system overhead and improving an efficiency of the numerical value ranking.

    [0056] FIG. 3 is a flowchart of another exemplary blockchain based numerical value ranking method according to some embodiments of the present disclosure. In some embodiments, as shown in FIG. 3, the entire process includes kye generation, bidding with encrypted texts, calculation of mixed results, and comparison of encrypted text bids, etc. The steps shown in FIG. 3 have described in detail previously in various embodiments.

    [0057] It should be noted that, after the numerical value ranking result between the first participant and the second participant is determined, when the numerical value ranking result between the first participant and the second participant determines the first participant is the winner, the private key of the first participant is sent to the intermediate party, such that the intermediate party cane use the private key of the first participant to decrypt the encrypted text of the first participant to obtain the private value of the first participant. When it is determined that the private value of the winner is in dispute and the private value of the winner is not disclosed, legality verification may be performed by sending the private key of the first participant to the intermediate party or requesting the winner to send the challenge value of the winner to the intermediate party.

    [0058] To better explain the embodiments of the present disclosure, the process of the blockchain based numerical value ranking will be described below in specific scenarios.

    [0059] The embodiment is a blockchain based numerical value ranking method for bidding/auction scenarios. Participants include three bidders A, B, and C (which may be extended to any number of bidders) and an intermediate party S (bid solicitor/auctioneer). The homomorphic encryption algorithm is Paillier addition homomorphic encryption algorithm.

    Embodiment One

    [0060] 0. Initialization

    [0061] The intermediate party S specifies a total number of rounds of bidding, that is, when the number of rounds of bidding is reached, the transaction is completed.

    [0062] 1. Key Generation [0063] (1) Bidder A generates a public-private key pair (pk.sub.a,sk.sub.a), and discloses the public key pk.sub.a. [0064] (2) Bidder B generates a public-private key pair (pk.sub.b,sk.sub.b), and discloses the public key pk.sub.b. [0065] (3) Bidder C generates a public-private key pair (pk.sub.c,sk.sub.c), and discloses the public key pk.sub.c.

    [0066] The bidders may use different public-private key pairs in each round of bidding.

    [0067] 2. Bidding with Encrypted Texts [0068] (1) Bidder A uses the public key pk.sub.a to homomorphically encrypt a bid p.sub.a to obtain E.sub.a(p.sub.a), and performs an on-chain operation for E.sub.a(p.sub.a). [0069] (2) Bidder B uses the public key pk.sub.b to homomorphically encrypt a bid p.sub.b to obtain E.sub.b(p.sub.b), and performs an on-chain operation for E.sub.b(p.sub.b). [0070] (3) Bidder C uses the public key pk.sub.c to homomorphically encrypt a bid p.sub.c to obtain E.sub.c(p.sub.c), and performs an on-chain operation for E.sub.c(p.sub.c).

    [0071] 3. Calculation of Mixed Results

    [0072] (1) Bidder A

    [0073] Bidder A obtains the public key pk.sub.b and the public key pk.sub.c and obtains from the blockchain the encrypted bids E.sub.b(p.sub.b) and E.sub.c(p.sub.c). Bidder A generates a challenge value r.sub.a (a bit length of the challenge value needs to be limited, for example, being set to a quarter of a length of the public-private key, otherwise causing a reversal of a positive/negative attribute of a mixed result). Bidder A calculates E.sub.b(p.sub.a.Math.r.sub.a)−E.sub.b(p.sub.b).Math.r.sub.a=E.sub.b((p.sub.a−p.sub.b).Math.r.sub.a) and E.sub.c(p.sub.a.Math.r.sub.a)−E.sub.c(p.sub.c).Math.r.sub.a=E.sub.c((p.sub.a−p.sub.c).Math.r.sub.a), and performs the on-chain operation for the results of the calculation.

    [0074] (2) Bidder B

    [0075] Bidder B obtains the public key pk.sub.a and the public key pk.sub.c and obtains from the blockchain the encrypted bids E.sub.a(p.sub.a) and E.sub.c(p.sub.c). Bidder B generates a challenge value r.sub.b. Bidder B calculates E.sub.a(p.sub.b.Math.r.sub.b)−E.sub.a(p.sub.a).Math.r.sub.b=E.sub.a((p.sub.b−p.sub.a).Math.r.sub.b) and E.sub.b(p.sub.b.Math.r.sub.b)−E.sub.c(p.sub.c).Math.r.sub.b=E.sub.c((p.sub.b−p.sub.c).Math.r.sub.b), and performs the on-chain operation for the results of the calculation.

    [0076] (3) Bidder C

    [0077] Bidder C obtains the public key pk.sub.a and the public key pk.sub.b and obtains from the blockchain the encrypted bids E.sub.a(p.sub.a) and E.sub.b(p.sub.b). Bidder C generates a challenge value r.sub.c. Bidder C calculates E.sub.a(p.sub.c.Math.r.sub.c)−E.sub.a(p.sub.a).Math.r.sub.c=E.sub.a((p.sub.c−p.sub.a).Math.r.sub.c) and E.sub.b(p.sub.c.Math.r.sub.c)−E.sub.b(p.sub.b).Math.r.sub.c=E.sub.b((p.sub.c−p.sub.b).Math.r.sub.c), and performs the on-chain operation for the results of the calculation.

    [0078] 4. Comparison of Encrypted Text Bids

    [0079] (1) Bidder A [0080] (a) Comparison of bidder A's bid and bidder B's bid: bidder A obtains from the blockchain E.sub.a((p.sub.b−p.sub.a).Math.r.sub.b), uses the private key sk.sub.a to decrypt E.sub.a((p.sub.b−p.sub.a).Math.r.sub.b) to obtain (p.sub.b−p.sub.a).Math.r.sub.b, and obtains a numerical value ranking result between p.sub.a and p.sub.b through determining the positive/negative attribute of (p.sub.b−p.sub.a).Math.r.sub.b. At the same time, bidder A is unable to obtain a specific bid difference due to existence of the challenge value r.sub.b. [0081] (b) Comparison of bidder A's bid and bidder C's bid: bidder A obtains from the blockchain E.sub.a((p.sub.c−p.sub.a).Math.r.sub.c), uses the private key sk.sub.a to decrypt E.sub.a((p.sub.c−p.sub.a).Math.r.sub.c) to obtain (p.sub.c−p.sub.a).Math.r.sub.c, and obtains a numerical value ranking result between p.sub.a and p.sub.c through determining the positive/negative attribute of (p.sub.c−p.sub.a).Math.r.sub.c. At the same time, bidder A is unable to obtain a specific bid difference due to existence of the challenge value r.sub.c.

    [0082] (2) Bidder B [0083] (a) Comparison of bidder B's bid and bidder A's bid: bidder B obtains from the blockchain E.sub.b((p.sub.a−p.sub.b).Math.r.sub.a), uses the private key sk.sub.b to decrypt E.sub.b((p.sub.a−p.sub.b).Math.r.sub.a) to obtain (p.sub.a−p.sub.b).Math.r.sub.a, and obtains a numerical value ranking result between p.sub.b and p.sub.a through determining the positive/negative attribute of (p.sub.a−p.sub.b).Math.r.sub.a. At the same time, bidder B is unable to obtain a specific bid difference due to existence of the challenge value r.sub.a. [0084] (b) Comparison of bidder B's bid and bidder C's bid: bidder B obtains from the blockchain E.sub.b((p.sub.c−p.sub.b).Math.r.sub.c), uses the private key sk.sub.b to decrypt E.sub.b((p.sub.c−p.sub.b).Math.r.sub.c) to obtain (p.sub.c−p.sub.b).Math.r.sub.c, and obtains a numerical value ranking result between p.sub.c and p.sub.b through determining the positive/negative attribute of (p.sub.c−p.sub.b).Math.r.sub.c. At the same time, bidder B is unable to obtain a specific bid difference due to existence of the challenge value r.sub.c.

    [0085] (3) Bidder C [0086] (a) Comparison of bidder C's bid and bidder A's bid: bidder C obtains from the blockchain E.sub.c((p.sub.a−p.sub.c).Math.r.sub.a), uses the private key sk.sub.c to decrypt E.sub.c((p.sub.a−p.sub.c).Math.r.sub.a) to obtain (p.sub.a−p.sub.c).Math.r.sub.a, and obtains a numerical value ranking result between p.sub.c and p.sub.a through determining the positive/negative attribute of (p.sub.a−p.sub.c).Math.r.sub.a. At the same time, bidder C is unable to obtain a specific bid difference due to existence of the challenge value r.sub.a. [0087] (b) Comparison of bidder C's bid and bidder B's bid: bidder C obtains from the blockchain E.sub.c((p.sub.b−p.sub.c).Math.r.sub.b), uses the private key sk.sub.c to decrypt E.sub.c((p.sub.b−p.sub.c).Math.r.sub.b) to obtain (p.sub.b−p.sub.c).Math.r.sub.b, and obtains a numerical value ranking result between p.sub.c and p.sub.b through determining the positive/negative attribute of (p.sub.b−p.sub.c).Math.r.sub.b. At the same time, bidder C is unable to obtain a specific bid difference due to existence of the challenge value r.sub.b.

    [0088] 5. Completion of Transaction

    [0089] After the total number of rounds of bidding is reached, the lowest bidder in case of bidding for a government project (or the highest bidder in case of bidding for an auction item) needs to provide the intermediate party S with the private key sk.sub.i used in the last round of bidding for the intermediate party S to decrypt the private value p.sub.i (i.e., the transaction value). After the intermediate party S obtains the final transaction value, the intermediate party S may or may not disclose the final transaction value. Disclosure of the final transaction value may avoid dispute.

    [0090] 6. Handling Dispute

    [0091] (1) The Final Transaction Value is not Disclosed.

    [0092] Fraud may occur when the final transaction value is not disclosed, and the fraudulent bidder uses different bids in a same round of bidding. For example, in the scenario that the lowest bid wins, bidder A uses different p.sub.a in the process of bidding, which makes the other bidders mistakenly believe that their bids are too high and they did not win. But bidder A actually bids higher and deceives the other bidders. For example, bidder A uses different p.sub.a when calculating E.sub.a(p.sub.a) and E.sub.b((p.sub.a−p.sub.b).Math.r.sub.a), which makes bidder B believe that p.sub.a is smaller than p.sub.b, while p.sub.a of E.sub.a(p.sub.a) is actually greater than p.sub.b.

    [0093] To resolve this issue, bidder B may provide the private key sk.sub.b to the intermediate party S, enabling the intermediate party S to compare bidder A's bid and bidder B's bid. Alternatively, bidder A may be requested to provide the challenge value r.sub.a to the intermediate party S to verify legitimacy of the calculation of the mixed results.

    [0094] (2) The Final Transaction Value is Disclosed.

    [0095] When the final transaction value is disclosed, the other bidders may directly verify the final transaction value is lower than their own bids. Thus, fraud risk does not exist.

    [0096] The present disclosure also provides another method of blockchain based numerical value ranking. The method includes the following processes.

    Embodiment Two

    [0097] 0. Initialization

    [0098] The intermediate party S specifies the total number of rounds of bidding, that is, when the number of rounds of bidding is reached, the transaction is completed.

    [0099] 1. Key Generation [0100] (1) Bidder A generates a public-private key pair (pk.sub.a,sk.sub.a), and discloses the public key pk.sub.a. [0101] (2) Bidder B generates a public-private key pair (pk.sub.b,sk.sub.b), and discloses the public key pk.sub.b. [0102] (3) Bidder C generates a public-private key pair (pk.sub.c,sk.sub.c), and discloses the public key pk.sub.c.

    [0103] The bidders may use different public-private key pairs in each round of bidding.

    [0104] 2. Bidding with Encrypted Texts [0105] (1) Bidder A uses the public key pk.sub.a to homomorphically encrypt a bid p.sub.a to obtain E.sub.a(p.sub.a), and performs an on-chain operation for E.sub.a(p.sub.a). [0106] (2) Bidder B uses the public key pk.sub.b to homomorphically encrypt a bid p.sub.b to obtain E.sub.b(p.sub.b), and performs an on-chain operation for E.sub.b(p.sub.b). [0107] (3) Bidder C uses the public key pk.sub.c to homomorphically encrypt a bid p.sub.c to obtain E.sub.c(p.sub.c), and performs an on-chain operation for E.sub.c(p.sub.c). [0108] 3. Calculation of mixed results

    [0109] (1) Bidder A [0110] (a) Bidder A obtains the public key pk.sub.b and the public key pk.sub.c, generates challenge values r.sub.a.sub.1 and r.sub.a.sub.2, calculates E.sub.b(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2) and E.sub.c(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2), and performs the on-chain operation for the results of the calculation. [0111] (b) Bidder A obtains from the blockchain E.sub.b(p.sub.b) and E.sub.c(p.sub.c), calculates E.sub.b(p.sub.b).Math.r.sub.a.sub.1+E.sub.b(r.sub.a.sub.2)=E.sub.b(p.sub.b.Math.r.sub.a.sub.1+r.sub.a.sub.2) and E.sub.c(p.sub.c).Math.r.sub.a.sub.1+E.sub.c(r.sub.a.sub.2)=E.sub.c(p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2), and performs the on-chain operation for the results of the calculation.

    [0112] (2) Bidder B [0113] (a) Bidder B obtains the public key pk.sub.a and the public key pk.sub.c, generates challenge values r.sub.b.sub.1 and r.sub.b.sub.2, calculates E.sub.a(p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2) and E.sub.b(p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2), and performs the on-chain operation for the results of the calculation. [0114] (b) Bidder B obtains from the blockchain E.sub.a(p.sub.a) and E.sub.a(p.sub.c), calculates E.sub.a(p.sub.a).Math.r.sub.b.sub.1+E.sub.a(r.sub.b.sub.2)=E.sub.a(p.sub.a.Math.r.sub.b.sub.1+r.sub.b.sub.2) and E.sub.c(p.sub.c).Math.r.sub.b.sub.1+E.sub.c(r.sub.b.sub.2)=E.sub.c(p.sub.c.Math.r.sub.b.sub.1+r.sub.b.sub.2), and performs the on-chain operation for the results of the calculation.

    [0115] (3) Bidder C [0116] (a) Bidder C obtains the public key pk.sub.a and the public key pk.sub.b, generates challenge values r.sub.c.sub.1 and r.sub.c.sub.2, calculates E.sub.a(p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2) and E.sub.b(p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2), and performs the on-chain operation for the results of the calculation. [0117] (b) Bidder C obtains from the blockchain E.sub.a(p.sub.a) and E.sub.b(p.sub.b), calculates E.sub.a(p.sub.a).Math.r.sub.c.sub.1+E.sub.a(r.sub.c.sub.2)=E.sub.a(p.sub.a.Math.r.sub.c.sub.1+r.sub.c.sub.2) and E.sub.b(p.sub.b).Math.r.sub.c.sub.1+E.sub.b(r.sub.c.sub.2)=E.sub.b(p.sub.b.Math.r.sub.c.sub.1+r.sub.c.sub.2), and performs the on-chain operation for the results of the calculation.

    [0118] 4. Comparison of Encrypted Text Bids

    [0119] (1) Bidder A [0120] (a) Bidder A obtains from the blockchain E.sub.a(p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2) and E.sub.a(p.sub.a.Math.r.sub.b.sub.1+r.sub.b.sub.2), uses the private key sk.sub.a to decrypt E.sub.a(p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2) and E.sub.a(p.sub.a.Math.r.sub.b.sub.1+r.sub.b.sub.2) to obtain p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2 and p.sub.a.Math.r.sub.b.sub.1+r.sub.b.sub.2, and obtains a numerical value ranking result between p.sub.a and p.sub.b. [0121] (b) Bidder A obtains from the blockchain E.sub.a(p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2) and E.sub.a(p.sub.a.Math.r.sub.c.sub.1+r.sub.c.sub.2), uses the private key sk.sub.a to decrypt E.sub.a(p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2) and E.sub.a(p.sub.a.Math.r.sub.c.sub.1+r.sub.c.sub.2) to obtain p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2 and p.sub.a.Math.r.sub.c.sub.1+r.sub.c.sub.2, and obtains a numerical value ranking result between p.sub.a and p.sub.c.

    [0122] (2) Bidder B [0123] (a) Bidder B obtains from the blockchain E.sub.b(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2) and E.sub.b(p.sub.b.Math.r.sub.a.sub.1+r.sub.a.sub.2), uses the private key sk.sub.b to decrypt E.sub.b(p.sub.a.Math.r.sub.a.sub.2) and E.sub.b(p.sub.b.Math.r.sub.a.sub.1+r.sub.a.sub.2) to obtain p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2 and p.sub.b.Math.r.sub.a.sub.1+r.sub.a.sub.2, and obtains a numerical value ranking result between p.sub.b and p.sub.a. [0124] (b) Bidder B obtains from the blockchain E.sub.b(p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2) and E.sub.b(p.sub.b.Math.r.sub.c.sub.1+r.sub.c.sub.2), uses the private key sk.sub.b to decrypt E.sub.b(p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2) and E.sub.b(p.sub.b.Math.r.sub.c.sub.1+r.sub.c.sub.2) to obtain p.sub.c.Math.r.sub.c.sub.1+r.sub.c.sub.2 and p.sub.b.Math.r.sub.c.sub.1+r.sub.c.sub.2, and obtains a numerical value ranking result between p.sub.b and p.sub.c.

    [0125] (3) Bidder C [0126] (a) Bidder C obtains from the blockchain E.sub.c(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2) and E.sub.c(p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2), uses the private key sk.sub.c to decrypt E.sub.c(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2) and E.sub.c(p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2) to obtain p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2 and p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2, and obtains a numerical value ranking result between p.sub.c and p.sub.a. [0127] (b) Bidder C obtains from the blockchain E.sub.c(p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2) and E.sub.c(p.sub.c.Math.r.sub.b.sub.1+r.sub.b.sub.2), uses the private key sk.sub.c to decrypt E.sub.c(p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2) and E.sub.c(p.sub.c.Math.r.sub.b.sub.1+r.sub.b.sub.2) to obtain p.sub.b.Math.r.sub.b.sub.1+r.sub.b.sub.2 and p.sub.c.Math.r.sub.b.sub.1+r.sub.b.sub.2, and obtains a numerical value ranking result between p.sub.c and p.sub.b.

    [0128] 5. Completion of Transaction

    [0129] After the total number of rounds of bidding is reached, the lowest bidder in case of bidding for a government project (or the highest bidder in case of bidding for an auction item) needs to provide the intermediate party S with the private key sk.sub.i used in the last round of bidding for the intermediate party S to decrypt the private value p.sub.i (i.e., the transaction value). After the intermediate party S obtains the final transaction value, the intermediate party S may or may not disclose the final transaction value. Disclosure of the final transaction value may avoid dispute.

    [0130] 6. Handling Dispute

    [0131] (1) The Final Transaction Value is not Disclosed.

    [0132] Fraud may occur when the final transaction value is not disclosed, and the fraudulent bidder uses different bids in a same round of bidding. For example, in the scenario that the lowest bid wins, bidder A uses different p.sub.a, r.sub.a.sub.1, and r.sub.a.sub.2 in the process of bidding, which makes the other bidders mistakenly believe that their bids are too high and they did not win. But bidder A actually bids higher and deceives the other bidders. Specifically, there are two scenarios as described in the following. [0133] (a) Bidder A uses different p.sub.c, when calculating E.sub.a(p.sub.a) and E.sub.c(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2), which makes bidder C believe that p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2 is smaller than p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2, while p.sub.a of E.sub.a(p.sub.a) is actually greater than p.sub.c. [0134] (b) Bidder A uses different r.sub.a.sub.1 and r.sub.a.sub.2 when calculating E.sub.c(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2) and E.sub.c(p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2), which makes bidder C believe that p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2 is smaller than p.sub.c.Math.r.sub.a.sub.1+r.sub.a.sub.2, while p.sub.a of E.sub.c(p.sub.a.Math.r.sub.a.sub.1+r.sub.a.sub.2) is actually greater than p.sub.c. In this case, bidder A is requested to provide the challenge values r.sub.a.sub.1 and r.sub.a.sub.2 to the intermediate party S, and bidder C provides the private key sk.sub.c to the intermediate party S to verify legitimacy of the calculation of the mixed results.

    [0135] In both scenarios described above, bidder C provides the private key sk.sub.c to the intermediate party S, enabling the intermediate party S to compare bidder C's bid and bidder A's bid. Alternatively, bidder A may be requested to provide the challenge values r.sub.a.sub.1 and r.sub.a.sub.2 to the intermediate party S to verify legitimacy of the entire process.

    [0136] (2) The Final Transaction Value is Disclosed.

    [0137] When the final transaction value is disclosed, the other bidders may directly verify the final transaction value is lower than their own bids. Thus, fraud risk does not exist.

    [0138] The embodiments of the present disclosure achieve the following technical effects. [0139] (1) The embodiments of the present disclosure achieve protection of bid privacy. The participants are unable to know the bids from the other participants. The intermediate party S (i.e., the bid solicitor or the auctioneer) can only know the bid of the final transaction. Thus, collusion between the participants and the intermediate party S in a traditional bidding scenario can be prevented. [0140] (2) the embodiments of the present disclosure does not need to introduce a trusted third party other than the bidding solicitor or the auctioneer, thereby reducing points of attack and avoiding collusion risk. [0141] (3) The embodiments of the present disclosure solves the problem of comparing numerical values in the encrypted texts that are encrypted using different encryption keys by multiple participants, such that each participant is able to compare the bids by itself without compromising confidence.

    [0142] In the embodiments of the present disclosure, after the first participant uses the public key to encrypt its private value and obtains the encrypted text of the first participant, the first participant obtains the encrypted texts of the other participants, generates the challenge value, determines the mixed results of the first participant with respect to the respective other participants based on the challenge value and the private value of the first participant and the encrypted texts and the public keys of the respective other participants, and determines the numerical value ranking result between the first participant and the second participant based on the mixed result of the second participant with respect to the first participant. Through comparing the positive/negative attribute of the mixed result obtained by the other participants using the public key of the first participant to encrypt the challenge values, the encrypted texts, and other information of the other participants, the numerical value ranking result can be determined. Without obtaining the private values of the other participants, each participant can obtain its own numerical value ranking result, thereby improving credibility of the numerical value ranking result and protecting privacy of each participant.

    [0143] Based on the technical concept, FIG. 4 is a schematic structural diagram of an exemplary blockchain based numerical value ranking apparatus according to some embodiments of the present disclosure. The apparatus may implement the blockchain based numerical value ranking method.

    [0144] As shown in FIG. 4, the apparatus includes a processing unit 401 and a acquisition unit 402. The processing unit 401 is configured to use the public key of the first participant to encrypt the private value of the first participant to obtain the encrypted text of the first participant, and to send the encrypted text of the first participant to the blockchain for the on-chain operation. The other participants are participants located in the same blockchain as the first participant and participated in the numerical value ranking process. The acquisition unit 402 is configured to obtain the encrypted texts of the other participants, and to generate the challenge value having the preset bit length.

    [0145] The processing unit 401 is further configured to determine the mixed results of the first participant with respect to the other participants based on challenge value and the private value of the first participant and the encrypted texts and the public keys of the other participants, and to send the mixed results of the first participant with respect to the other participants to the block chain for the on-chain operation. The processing unit 401 is further configured to determine the numerical value ranking result between the first participant and the second participant based on the mixed result of the second participant with respect to the first participant. The second participant is a participant among the other participants who participate in the bid ranking.

    [0146] In some embodiments, the processing unit 401 is further configured to use the public keys of the other participants to encrypt the challenge value and the private value of the first participant to obtain the first intermediate value, determine the product of the encrypted texts of the other participants and the challenge value of the first participant as the second intermediate value, and determine the difference between the first intermediate value and the second intermediate value as the mixed results of the first participant with respect to the other participants.

    [0147] In some embodiments, the processing unit 401 is further configured to obtain from the blockchain the mixed result of the second participant with respect to the first participant, which is uploaded by the second participant, use the private key of the first participant to decrypt the mixed result of the second participant with respect to the first participant to obtain the decrypted result, and determine the numerical value ranking result between the first participant and the second participant based on the positive/negative attribute of the decrypted result.

    [0148] In some embodiments, the processing unit 401 is further configured to determine that the private value of the first participant is smaller than the private value of the second participant if the positive/negative attribute of the decrypted result is positive, determine that the private value of the first participant is greater than the private value of the second participant if the positive/negative attribute of the decrypted result is negative, and determine that the private value of the first participant is equal to the private value of the second participant if the positive/negative attribute of the decrypted result is zero.

    [0149] In some embodiments, after the numerical value ranking result between the first participant and the second participant is determined and when it is determined that the first participant is the winner based on the numerical value ranking result between the first participant and the second participant, the processing unit 401 is further configured to send the private key of the first participant to the intermediate party, such that the intermediate party uses the private key of the first participant to decrypt the encrypted text of the first participant to obtain the private value of the first participant.

    [0150] In some embodiments, after the numerical value ranking result between the first participant and the second participant is determined and when it is determined that the private value of the winner is not disclosed and is in dispute, the processing unit 401 is further configured to verify the legitimacy by sending the private key of the first participant to the intermediate party, or requesting the winner to send the challenge value of the winner to the intermediate party.

    [0151] Based on the same technical concept, the present disclosure also provides a computing device. The computing device includes a memory for storing program instructions, and a processor configured to call the program instruction stored in the memory and execute the above-described blockchain based numerical value ranking method according to the obtained program instructions.

    [0152] Based on the same technical concept, the present disclosure also provides a computer-readable non-volatile storage medium including computer-readable instructions. When a computing device reads and executes the computer-readable instructions, the computer-readable instructions cause the computing device to implement the above-described blockchain based numerical value ranking method.

    [0153] The present disclosure is described with reference to flowcharts and/or block diagrams of the methods, the apparatus (systems), and the computer program products according to embodiments of the present disclosure. It should be understood that each flow and/or each block in the flowcharts and/or the block diagrams, and combinations of the flows and/or the blocks in the flowcharts and/or the block diagrams, can be implemented by the computer program instructions. The computer program instructions may be provided to the processor of a general purpose computer, a special purpose computer, an embedded processor, or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce the apparatus for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.

    [0154] The computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

    [0155] These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions provide steps for implementing the functions specified in the flow or flows of the flowcharts and/or the block or blocks of the block diagrams.

    [0156] Although the embodiments of the present disclosure have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the embodiments and all changes and modifications that fall within the scope of the present disclosure.

    [0157] It will be apparent to those skilled in the art that various modifications and variations can be made in the present disclosure without departing from the spirit and scope of the disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present application and their equivalents, the present disclosure is also intended to include these modifications and variations.