A trading method and a trading blockchain system based on blockchain
By using encryption technology in blockchain transaction methods to protect the auction price, the problem of price exposure of bidders is solved, and the privacy of price and fairness of transactions is guaranteed.
Patent Information
- Application Number
- CN202210302405.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In the existing technology, the bidder's prices are easily exposed, resulting in unfair transactions such as malicious bidding, and it is difficult to meet the needs of power asset trading in new energy power systems.
The blockchain-based transaction method is adopted to encrypt the auction price through the random numbers and public keys of each purchaser, generate a price ciphertext, and compare prices through price comparison to ensure price privacy.
It effectively guarantees the privacy of bidding prices, avoids the occurrence of malicious bidding and unfair transactions, and meets the needs of power asset trading in new energy power systems.
Smart Images

Figure CN114626852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and particularly to a transaction method and a transaction blockchain system based on blockchain. Background Art
[0002] At present, building a new power system with new energy as the main body has become the mainstream of the development of the energy industry, and it is necessary to focus on the development of clean energy. Most of the traditional energy trading architectures are centralized trading models, where a trusted organization or person participates in account management, transaction payment, and provides security services. This is more suitable for the trading of traditional fossil energy. However, due to the characteristics of electric energy assets such as being disposable, divisible, and easily consumable, for the trading of electric energy assets, there are often multiple trading models combined with different market clearings, and the traditional trading market is difficult to meet this demand. And under various trading models of electric energy trading, the competitive bidding trading of electric energy not only needs to consider protecting the anonymity of both parties' address information and other information during the trading process, but also the bidding price of the bidders is extremely important. Once leaked, it will lead to unfair trading phenomena such as malicious bidding. Summary of the Invention
[0003] Therefore, the technical problem to be solved by the present invention is to overcome the defect that the price of the bidder is easily exposed in the prior art, so as to provide a transaction method and a transaction blockchain system based on blockchain.
[0004] The present invention provides a transaction method based on blockchain. Each purchaser, seller, and administrator is a different node of the same consortium chain. The method includes: multiple purchasers respectively give the bidding prices for the same auction order, and encrypt the bidding prices through their respective random numbers and public keys to obtain price ciphertexts; the purchaser generates a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding purchaser; the currently highest-bidding purchaser decrypts the price comparison pair, determines the high-price purchaser according to the price comparison pair, and determines the high-price purchaser as the currently highest-bidding purchaser; if all the purchasers who give bidding prices for the auction order have completed the step of the purchaser generating a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding purchaser, determine the currently highest-bidding purchaser as the successful bidder; the administrator forms a transaction block in combination with the transaction information, and adds the transaction block to the blockchain. The transaction information includes the auction order, the seller who issues the auction order, the successful bidder, and the bidding price corresponding to the successful bidder.
[0005] Optionally, in the blockchain-based transaction method provided by the present invention, among the purchasers who give bidding prices for the auction order, if there is a purchaser who has not completed the step of generating a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the current highest-bidding purchaser, determine the purchaser who has not completed the step of generating a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the current highest-bidding purchaser, and return the step of the purchaser generating a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the current highest-bidding purchaser; until all purchasers who give bidding prices for the auction order have completed the step of generating a price comparison pair according to their random numbers, bidding prices, and the public key and price ciphertext of the current highest-bidding purchaser.
[0006] Optionally, in the blockchain-based transaction method provided by the present invention, the Paillier homomorphic encryption algorithm is used to encrypt the bidding price to obtain a price ciphertext.
[0007] Optionally, in the blockchain-based transaction method provided by the present invention, the random number of the purchaser includes a first random number and a second random number, the price comparison pair includes a first encrypted comparison item and a second encrypted comparison item, and the step of the purchaser generating a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the current highest-bidding purchaser includes: generating a first comparison item according to the random number and bidding price of the purchaser, where the first comparison item is obtained by multiplying the bidding price by the first random number and then summing the product with the second random number; encrypting the first comparison item using the Paillier homomorphic encryption algorithm to obtain a first encrypted comparison item; encrypting the second random number using the Paillier homomorphic encryption algorithm to obtain an encrypted random number; and determining the product of the polynomial term of the price ciphertext of the current highest-bidding purchaser and the encrypted random number as the second encrypted comparison item, where in the polynomial term of the price ciphertext of the current highest-bidding purchaser, the number of times of the price ciphertext of the current highest-bidding purchaser is the first random number.
[0008] Optionally, in the blockchain-based transaction method provided by the present invention, the current highest-bidding purchaser decrypts the price comparison pair and determines the high-price purchaser according to the price comparison pair, including: decrypting the first encrypted comparison item using the Paillier homomorphic encryption algorithm to obtain a first comparison item; decrypting the second encrypted comparison item using the Paillier homomorphic encryption algorithm to obtain a second comparison item, where the second comparison item is the sum of the product of the bidding price of the current highest-bidding purchaser and the first random number and the second random number; if the first comparison item is greater than the second comparison item, determining the purchaser as the high-price purchaser; if the first comparison item is less than or equal to the second comparison item, determining the current highest-bidding purchaser as the high-price purchaser.
[0009] Optionally, in the blockchain-based transaction method provided by the present invention, if the type of the auction order is a non-public auction, the purchaser inputs the password corresponding to the auction order and gives the auction price for the auction order.
[0010] Optionally, in the blockchain-based transaction method provided by the present invention, forming a transaction block by combining transaction information and adding the transaction block to the blockchain includes: the smart contract submitting the transaction information to the administrator; the administrator packing the transaction information and conducting consensus within the administrator; and adding the transaction block with successful consensus to the end of the blockchain.
[0011] The second aspect of the present invention provides a transaction blockchain system, including: multiple purchasers, sellers, and administrators located on the same consortium chain, where the seller is used to release auction orders; multiple purchasers respectively give the auction prices for the same auction order, and encrypt the auction prices through their respective random numbers and public keys to obtain price ciphertexts; the purchaser generates a price comparison pair based on its random number, auction price, and the public key and price ciphertext of the currently highest-bidding purchaser; the currently highest-bidding purchaser decrypts the price comparison pair and determines the high-price purchaser based on the price comparison pair, and determines the high-price purchaser as the currently highest-bidding purchaser; if all the purchasers who give the auction price for the auction order have completed the step of the purchaser generating a price comparison pair based on its random number, auction price, and the public key and price ciphertext of the currently highest-bidding purchaser, the currently highest-bidding purchaser is determined as the successful auction party; the administrator combines the transaction information to form a transaction block and adds the transaction block to the blockchain, and the transaction information includes the auction order, the seller who releases the auction order, the successful auction party, and the auction price corresponding to the successful auction party.
[0012] The third aspect of the present invention provides a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to execute the blockchain-based transaction method provided by the first aspect of the present invention.
[0013] The fourth aspect of the present invention provides a computer-readable storage medium, and the computer-readable storage medium stores computer instructions for causing a computer to execute the blockchain-based transaction method provided by the first aspect of the present invention.
[0014] The technical solution of the present invention has the following advantages:
[0015] In the blockchain-based transaction method and transaction blockchain system provided by the present invention, after each purchaser gives a bidding price for the same bidding order, the bidding price is encrypted. When price comparison is required, the purchaser generates a price comparison pair based on a random number, the bidding price, and the public key and price ciphertext of the current highest-bidding purchaser. The current highest-bidding purchaser decrypts the price comparison pair and conducts price comparison. Since the price comparison pair is generated in combination with the purchaser's random number, even after the current highest-bidding purchaser decrypts the price comparison pair, it is still impossible to determine the bidding prices of the purchasers participating in the bidding, which guarantees the privacy of the bidding prices and avoids unfair trading phenomena such as malicious bidding caused by the exposure of the bidding prices. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a schematic diagram of the transaction blockchain system in an embodiment of the present invention;
[0018] Figure 2 It is a flowchart of a specific example of the blockchain-based transaction method in an embodiment of the present invention;
[0019] Figure 3 It is a principle block diagram of a specific example of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0021] In the description of the present invention, it should be noted that the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0022] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0023] An embodiment of the present invention provides a blockchain-based transaction method, which is applied to, for example Figure 1In the blockchain system shown, each buyer, seller, and administrator are different nodes of the same consortium blockchain. The transaction method based on the blockchain provided by the embodiments of the present invention includes:
[0024] Step S11: Multiple buyers respectively give the bidding prices for the same bidding order, and encrypt the bidding prices through their respective random numbers and public keys to obtain price ciphertexts.
[0025] In an optional embodiment, the bidding order is issued by the seller, and the bidding order includes information such as electricity quantity, reserve price, deadline, etc. The buyers with purchase needs search for the order they want to bid on through keywords or the bidding order number and place a bid before the deadline.
[0026] In an optional embodiment, after the buyer gives the bidding price for the bidding order, the buyer executes the bidding protocol, encrypts the bidding price using the private key to generate the price ciphertext, and submits it. In the blockchain, the smart contract is called to collect the price ciphertexts of all bidders.
[0027] In an optional embodiment, the types of bidding orders include public bidding and non-public bidding. If the type of the bidding order is a non-public order, a bidding password needs to be set for it, and only when the buyer successfully enters the bidding password can the buyer participate in the bidding.
[0028] Step S12: The buyer generates a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest bidding buyer.
[0029] In an optional embodiment, at the first comparison, the first buyer participating in the bidding is initialized as the highest bidding buyer.
[0030] Step S13: The currently highest bidding buyer decrypts the price comparison pair, determines the high-price buyer based on the price comparison pair, and determines the high-price buyer as the currently highest bidding buyer.
[0031] In the embodiments of the present invention, after each buyer gives the bidding price, the bidding price will not be announced. Even in the price comparison stage, the buyer will generate a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest bidding buyer, and the currently highest bidding buyer will conduct the price comparison. After decrypting the price comparison pair, the currently highest bidding buyer obtains the data after being operated with the random number, and will not know the bidding prices of the buyers participating in the bidding, which protects the privacy of the buyers' bids and avoids malicious competition.
[0032] If all the buyers who give the bidding price for the bidding order have completed the above Step S13, the following steps are executed:
[0033] Step S14: Determine the current highest-bidding purchaser as the successful bidder.
[0034] In the embodiment of the present invention, it is necessary to compare the bidding prices of all purchasers and determine the purchaser with the highest bidding price as the successful bidder. Therefore, after all purchasers who have given bidding prices have successively executed the above Step S13, it can be ensured that the bidding prices of all purchasers have been compared. If there are purchasers who have not executed the above Step S13, then the above Step S13 is executed again for the purchasers who have not executed the above Step S13 until the bidding prices of all purchasers have been compared.
[0035] Step S15: The administrator forms a transaction block based on the transaction information and adds the transaction block to the blockchain. The transaction information includes the bidding order, the seller who issued the bidding order, the successful bidder, and the bidding price corresponding to the successful bidder.
[0036] After determining the successful bidder from multiple purchasers who have given bidding prices, a transaction is successfully reached between the successful bidder and the seller. The transaction record includes electricity quantity, transaction electricity price, the seller and the successful bidder, etc. This transaction is automatically submitted by the smart contract to the administrator for packaging and consensus within the administrator. The transaction block with successful consensus is added to the end of the blockchain, and the records on the chain are convenient for future traceability.
[0037] In the transaction method based on blockchain provided in the embodiment of the present invention, after each purchaser gives a bidding price for the same bidding order, the bidding price is encrypted. When price comparison is required, the purchaser generates a price comparison pair according to the random number, the bidding price, the public key of the current highest-bidding purchaser, and the price ciphertext. The current highest-bidding purchaser decrypts the price comparison pair and conducts price comparison. Since the price comparison pair is generated in combination with the purchaser's random number, even after the current highest-bidding purchaser decrypts the price comparison pair, it is still impossible to determine the bidding prices of the purchasers participating in the bidding, which protects the privacy of the bidding prices and avoids the occurrence of unfair trading phenomena such as malicious bidding caused by the exposure of bidding prices.
[0038] In an optional embodiment, the identities of the purchaser and the seller are not always unchanged. When a node issues a bidding order, the node is defined as the seller, and when there is a purchase demand and a bidding price is given for the bidding order, the node is defined as the purchaser.
[0039] In an optional embodiment, after obtaining the authorization of the enterprise, the user registers in the chain. The user can be either a seller or a purchaser. The super node in the system is the administrator user, and the administrator user has the "write" permission of the blockchain and also has the responsibility of consensus after the transaction is uploaded to the chain.
[0040] In an alternative embodiment, when the purchaser encrypts the bidding price, the Paillier homomorphic encryption algorithm is used to encrypt the bidding price to obtain the price ciphertext.
[0041] The Paillier cryptosystem based on the composite power residue class problem is a typical additive homomorphic operation, where,
[0042] 1) KeyGen() → (n, g), (p, q): Let p and q be two large prime numbers, let n = p × q, select g ∈ B, and generate the public key (n, g) and the private key (p, q) respectively.
[0043] 2) Encrypt(m) → c = g m ·r n mod n 2 : Input the plaintext m < n, select a random number r < n, and generate the required ciphertext through the encryption function;
[0044] 3) Input the ciphertext c < n 2 , and the corresponding plaintext can be solved;
[0045] The homomorphic property of this algorithm can be proved as follows:
[0046]
[0047] In an alternative embodiment, in the blockchain-based transaction method provided in the embodiments of the present invention, the random number of the purchaser includes a first random number and a second random number, and the price comparison pair includes a first encrypted comparison item and a second encrypted comparison item.
[0048] The steps for the purchaser to generate a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the current highest-bidding purchaser specifically include:
[0049] First, generate a first comparison item according to the random number of the purchaser and the bidding price. The first comparison item is the sum of the product of the bidding price a i and the first random number x i and the second random number y i : The first comparison item = a i ·x i +y i .
[0050] Then, use the Paillier homomorphic encryption algorithm to encrypt the first comparison item to obtain the first encrypted comparison item
[0051] Secondly, use the Paillier homomorphic encryption algorithm to encrypt the second random number y i to obtain the encrypted random number
[0052] Finally, determine the product of the polynomial terms of the ciphertext of the price of the current highest-bidding buyer and the encrypted random number as the second encrypted comparison term Among the polynomial terms of the ciphertext of the price of the current highest-bidding buyer, the ciphertext of the price of the current highest-bidding buyer has a degree of the first random number x i .
[0053] In an optional embodiment, step S13 above specifically includes:
[0054] First, decrypt the first encrypted comparison term using the Paillier homomorphic encryption algorithm to obtain the first comparison term:
[0055] Then, decrypt the second encrypted comparison term using the Paillier homomorphic encryption algorithm to obtain the second comparison term, where the second comparison term is the sum of the product of the bidding price of the current highest-bidding buyer and the first random number and the second random number:
[0056] If the first comparison term is greater than the second comparison term, determine the buyer as a high-price buyer; if the first comparison term is less than or equal to the second comparison term, determine the current highest-bidding buyer as the high-price buyer.
[0057] If (a i ·x i +y i ) > (a max ·x i +y i ), then determine the i-th buyer as the current highest-bidding buyer, and continue to compare the bidding price of the i-th buyer with the bidding prices of other buyers; if (a i ·x i +y i ) ≤ (a max ·x i +y i ), then continue to compare the current highest-bidding buyer with the bidding prices of other buyers until the highest bidder in this auction is obtained.
[0058] Because (a i ·x i +y i ) and (a max ·x i +y i)Both contain random numbers, so each party can only know its own bid and the price ciphertext of other parties, which can protect the bid privacy of the entire bidding process. At the same time, according to the additive homomorphism property of the encryption algorithm, the magnitudes of a i and a max can be compared.
[0059] An embodiment of the present invention provides a transaction blockchain system, as Figure 1 shown, including: multiple buyers, a seller, and an administrator located in the same consortium chain,
[0060] The seller is used to publish auction orders. For detailed content, please refer to the description in the above method embodiment and will not be elaborated here.
[0061] Multiple buyers respectively give their bidding prices for the same auction order, and encrypt the bidding prices through their respective random numbers and public keys to obtain price ciphertexts; the buyer generates a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer; the currently highest-bidding buyer decrypts the price comparison pair and determines the high-price buyer according to the price comparison pair, and determines the high-price buyer as the currently highest-bidding buyer; if all the buyers who give bidding prices for the auction order have completed the step of the buyer generating a price comparison pair according to its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer, the currently highest-bidding buyer is determined as the successful bidder. For detailed content, please refer to the description in the above method embodiment and will not be elaborated here.
[0062] The administrator combines the transaction information to form a transaction block and adds the transaction block to the blockchain. The transaction information includes the auction order, the seller who publishes the auction order, the successful bidder, and the bidding price corresponding to the successful bidder. For detailed content, please refer to the description in the above method embodiment and will not be elaborated here.
[0063] An embodiment of the present invention provides a computer device, as Figure 3 shown, which mainly includes one or more processors 31 and a memory 32, Figure 3 Taking one processor 31 as an example.
[0064] This computer device may further include: an input device 33 and an output device 34.
[0065] The processor 31, the memory 32, the input device 33, and the output device 34 can be connected through a bus or other means, Figure 3 Taking connection through a bus as an example.
[0066] The processor 31 may be a Central Processing Unit (CPU). The processor 31 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., in the form of chips, or combinations of the above types of chips. The general-purpose processor may be a microprocessor or any conventional processor, etc. The memory 32 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the transaction blockchain system, etc. In addition, the memory 32 may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 32 optionally includes a memory remotely provided with respect to the processor 31, and these remote memories may be connected to the transaction blockchain system through a network. The input device 33 may receive a calculation request (or other digital or character information) input by the user and generate a key signal input related to the transaction blockchain system. The output device 34 may include a display device such as a display screen for outputting calculation results.
[0067] An embodiment of the present invention provides a computer-readable storage medium that stores computer instructions. The computer storage medium stores computer-executable instructions that can execute the transaction blockchain method in any of the above method embodiments. Among them, the storage medium may be a magnetic disk, optical disk, Read-Only Memory (ROM), Random Access Memory (RAM), Flash Memory, Hard Disk Drive (abbreviation: HDD), or Solid-State Drive (SSD), etc.; the storage medium may also include a combination of the above types of memories.
[0068] Obviously, the above embodiments are merely examples given for clear illustration and not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all implementation manners here. And the obvious changes or modifications derived therefrom still fall within the protection scope of the present invention.
Claims
1. A blockchain-based transaction method, characterized in that, Each buyer, seller, and administrator is a different node of the same consortium blockchain. The method includes: Multiple buyers respectively give bidding prices for the same auction order, and encrypt the bidding prices with their respective random numbers and public keys to obtain price ciphertexts; The buyer generates a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer; The currently highest-bidding buyer decrypts the price comparison pair, determines the high-bidding buyer based on the price comparison pair, and determines the high-bidding buyer as the currently highest-bidding buyer; If all the buyers who have given bidding prices for the auction order have completed the step of the buyer generating a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer, determine the currently highest-bidding buyer as the successful bidder; The administrator forms a transaction block in combination with the transaction information and adds the transaction block to the blockchain. The transaction information includes the auction order, the seller who issued the auction order, the successful bidder, and the bidding price corresponding to the successful bidder; If among the buyers who have given bidding prices for the auction order, there are buyers who have not completed the step of the buyer generating a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer, Determine the buyers who have not completed the step of the buyer generating a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer, and return to the step of the buyer generating a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer; until all the buyers who have given bidding prices for the auction order have completed the step of the buyer generating a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer; Use the Paillier homomorphic encryption algorithm to encrypt the bidding price to obtain the price ciphertext; The random number of the buyer includes a first random number and a second random number. The price comparison pair includes a first encrypted comparison item and a second encrypted comparison item. The step of the buyer generating a price comparison pair based on its random number, bidding price, and the public key and price ciphertext of the currently highest-bidding buyer includes: Generate a first comparison item based on the random number and bidding price of the buyer. The first comparison item is obtained by multiplying the bidding price by the first random number and then summing the product with the second random number; Use the Paillier homomorphic encryption algorithm to encrypt the first comparison item to obtain the first encrypted comparison item; Use the Paillier homomorphic encryption algorithm to encrypt the second random number to obtain an encrypted random number; Determine the product of the polynomial term of the price ciphertext of the currently highest-bidding buyer and the encrypted random number as the second encrypted comparison item. In the polynomial term of the price ciphertext of the currently highest-bidding buyer, the degree of the price ciphertext of the currently highest-bidding buyer is the first random number; The current highest bidder decrypts the price comparison pair and determines the high-price buyer based on the price comparison pair, including: Using the Paillier homomorphic encryption algorithm to decrypt the first encrypted comparison item to obtain the first comparison item; Using the Paillier homomorphic encryption algorithm to decrypt the second encrypted comparison item to obtain a second comparison item, where the second comparison item is the sum of the product of the bidding price of the current highest bidder and the first random number and the second random number; If the first comparison item is greater than the second comparison item, the buyer is determined as the high-price buyer; If the first comparison item is less than or equal to the second comparison item, the current highest bidder is determined as the high-price buyer.
2. The blockchain-based transaction method according to claim 1, characterized in that, If the type of the auction order is a non-public auction, The buyer inputs the password corresponding to the auction order and gives the bidding price for the auction order.
3. The blockchain-based transaction method according to claim 1, characterized in that, Forming a transaction block by combining transaction information and adding the transaction block to the blockchain, including: The smart contract submits the transaction information to the administrator; The administrator packages the transaction information and conducts consensus within the administrator; Adding the transaction block with successful consensus to the end of the blockchain.
4. A transaction blockchain system, characterized in that, Including: Multiple buyers, sellers, and administrators located on the same consortium chain, The seller is used to publish auction orders; Multiple purchasers respectively give the bidding prices for the same bidding order, and encrypt the bidding prices through their respective random numbers and public keys to obtain price ciphertexts; the purchasers generate price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser; the currently highest-bidding purchaser decrypts the price comparison pairs, determines the high-price purchaser according to the price comparison pairs, and determines the high-price purchaser as the currently highest-bidding purchaser; if all the purchasers who give bidding prices for the bidding order have completed the step of the purchaser generating price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser, determine the currently highest-bidding purchaser as the successful bidder; if among the purchasers who give bidding prices for the bidding order, there are purchasers who have not completed the step of the purchaser generating price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser, determine the purchasers who have not completed the step of the purchaser generating price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser, and return to the step of the purchaser generating price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser; until all the purchasers who give bidding prices for the bidding order have completed the step of the purchaser generating price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser; use the Paillier homomorphic encryption algorithm to encrypt the bidding price to obtain the price ciphertext; the random number of the purchaser includes a first random number and a second random number, the price comparison pair includes a first encrypted comparison item and a second encrypted comparison item, and the step of the purchaser generating price comparison pairs according to their random numbers, bidding prices, and the public key and price ciphertext of the currently highest-bidding purchaser includes: generating a first comparison item according to the random number and bidding price of the purchaser, where the first comparison item is obtained by multiplying the bidding price by the first random number and then summing the product with the second random number; using the Paillier homomorphic encryption algorithm to encrypt the first comparison item to obtain the first encrypted comparison item; using the Paillier homomorphic encryption algorithm to encrypt the second random number to obtain an encrypted random number; determining the product of the multiple terms of the price ciphertext of the currently highest-bidding purchaser and the encrypted random number as the second encrypted comparison item, and in the multiple terms of the price ciphertext of the currently highest-bidding purchaser, the number of times of the price ciphertext of the currently highest-bidding purchaser is the first random number; the currently highest-bidding purchaser decrypts the price comparison pairs and determines the high-price purchaser according to the price comparison pairs, including: using the Paillier homomorphic encryption algorithm to decrypt the first encrypted comparison item to obtain the first comparison item;Decrypt the second encrypted comparison item using the Paillier homomorphic encryption algorithm to obtain the second comparison item, where the second comparison item is the sum of the product of the auction price of the current highest bidding buyer and the first random number and the second random number; if the first comparison item is greater than the second comparison item, determine the buyer as a high-price buyer; if the first comparison item is less than or equal to the second comparison item, determine the current highest bidding buyer as the high-price buyer; The administrator forms a transaction block by combining transaction information and adds the transaction block to the blockchain. The transaction information includes the auction order, the seller who publishes the auction order, the successful bidder, and the bidding price corresponding to the successful bidder.
5. A computer device, characterized in that, Including: At least one processor; And a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to execute the blockchain-based transaction method according to any one of claims 1-3.
6. A computer-readable storage medium, characterized in that,The computer-readable storage medium stores computer instructions for causing the computer to execute the blockchain-based transaction method according to any one of claims 1-3.
Citation Information
Patent Citations
Concealed bidding method and bidding system based on homomorphic encryption algorithm
CN110830232A
Anonymous auction method and device based on blockchain, and medium
CN112288555A