CN113421096A - Block chain-based goods transaction method and device - Google Patents

Block chain-based goods transaction method and device Download PDF

Info

Publication number
CN113421096A
CN113421096A CN202110944034.6A CN202110944034A CN113421096A CN 113421096 A CN113421096 A CN 113421096A CN 202110944034 A CN202110944034 A CN 202110944034A CN 113421096 A CN113421096 A CN 113421096A
Authority
CN
China
Prior art keywords
ciphertext
party
price
purchasing
supplier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110944034.6A
Other languages
Chinese (zh)
Inventor
张如意
王吉元
陈刚
夏凝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110944034.6A priority Critical patent/CN113421096A/en
Publication of CN113421096A publication Critical patent/CN113421096A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

One or more embodiments of the present disclosure provide a block chain-based goods transaction method and apparatus, in which a supplier preferentially issues a buyer price ciphertext of a target good in a block chain system, and the buyer price ciphertext is obtained by homomorphic encryption via a buyer public key of the target buyer, so that only the target buyer can decrypt the target good price plaintext, and then whether the target good needs to be purchased is determined. Obviously, the price plaintext of the target goods can be known only by two trading parties through the method, and the privacy of the price plaintext is guaranteed. In addition, in the transaction settlement stage of purchasing, the account transfer operation is carried out in a homomorphic ciphertext mode, and the problem of transaction amount information leakage in the related technology is solved. Correspondingly, the specification can also carry out the delivery of the commission charge between the purchasing party and the service party in a homomorphic cryptograph mode, and the problem that the commission charge information is leaked in the related technology is avoided.

Description

Block chain-based goods transaction method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of block chain technologies, and in particular, to a method and an apparatus for trading goods based on a block chain.
Background
The block chain technology (also called as distributed ledger technology) is a decentralized distributed database technology, has the characteristics of decentralization, openness and transparency, no tampering, trustiness and the like, and is suitable for application scenes with high requirements on data reliability.
The related art provides a technical scheme for completing goods transaction through a blockchain technology, so that the reliability of the transaction is improved by utilizing the non-falsification of the blockchain technology. In the technical scheme, a supplier of goods usually issues the price of the goods in a plaintext form in a block chain system, and a buyer confirms the price of the goods and then purchases the corresponding goods. Accordingly, when the goods purchase is settled, the fund transfer is also carried out in the block chain system in a clear text mode.
In practical applications, the supplier of the goods is likely to set different purchase prices for different buyers based on the same goods based on various considerations. If the goods transaction method in the related technology is adopted, the purchase price set by a certain purchasing party is easily leaked to other purchasing parties, and the normal operation of the transaction is further influenced. In addition, in the process of settlement of goods, the related technology is used for transferring transaction accounts in a plaintext form, so that the leakage of transaction information such as transaction amount, account balance of each party and the like is easily caused.
Disclosure of Invention
In view of the above, one or more embodiments of the present disclosure provide a block chain-based goods transaction method and apparatus.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments herein, there is provided a block chain-based item transaction method, comprising:
a goods supply direction block chain system submits goods release transaction so as to release a goods supply party price ciphertext and a purchasing party price ciphertext aiming at a target goods in the block chain system, wherein the goods supply party price ciphertext is generated by homomorphic encryption of a price plaintext set by a goods supply party for a target purchasing party through a goods supply party public key, and the purchasing party price ciphertext is generated by homomorphic encryption of the price plaintext through a purchasing party public key of the target purchasing party;
the target purchasing party decrypts the purchasing party price ciphertext issued in the block chain system based on the private key of the target purchasing party and generates purchasing information aiming at the target goods after confirming the decrypted price plaintext;
the blockchain system executes transfer operation according to the purchase information, and the transfer operation comprises the following steps: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
According to a second aspect of one or more embodiments of the present specification, there is provided a block chain-based item transaction method applied to a target buyer, the method including:
acquiring a buyer price ciphertext obtained by homomorphically encrypting a price plaintext of a target commodity through a buyer public key from a block chain system, decrypting the buyer price ciphertext through a buyer private key, and generating purchasing information aiming at the target commodity after the target buyer confirms the decrypted price plaintext;
and submitting the purchasing information to the block chain system or the supplier of the target goods.
According to a third aspect of one or more embodiments of the present specification, there is provided a block chain-based item transaction method applied to a block chain system, the method including:
in response to a goods release transaction submitted by a supplier, releasing a buyer price ciphertext and a supplier price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; the buyer price ciphertext distributed in the block chain system is provided to the target buyer so that the target buyer can decrypt the buyer price ciphertext through a buyer private key and generate the purchasing information aiming at the target goods after the decrypted price plaintext is confirmed;
and executing transfer operation according to the purchase information, wherein the transfer operation comprises the following steps: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
According to a fourth aspect of one or more embodiments of the present specification, there is provided a block chain-based item transaction method applied to a supplier, the method including:
submitting goods release transaction to a block chain system so as to release a supplier price ciphertext and a buyer price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext;
the buyer price ciphertext is acquired by the target buyer so that the target buyer can decrypt the buyer price ciphertext based on a buyer private key and generate purchasing information aiming at the target goods after confirming the decrypted price plaintext; after the purchasing information is acquired by the block chain system, the purchasing information is used for deducting a purchasing party transaction amount ciphertext calculated through the purchasing party price ciphertext and the purchasing information from a purchasing party balance ciphertext and adding a supplying party transaction amount ciphertext calculated through the supplying party price ciphertext and the purchasing information to a supplying party balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
According to a fifth aspect of one or more embodiments herein, there is provided a block chain-based item transaction apparatus for a buyer, the apparatus comprising:
the acquisition unit acquires a buyer price ciphertext obtained by homomorphically encrypting a price plaintext of a target commodity through a buyer public key from the block chain system, decrypts the buyer price ciphertext through a buyer private key, and generates purchasing information aiming at the target commodity after the target buyer confirms the decrypted price plaintext;
and the submitting unit is used for submitting the purchasing information to the block chain system or the supplier of the target goods.
According to a sixth aspect of one or more embodiments herein, there is provided a block chain-based item transaction apparatus applied to a block chain system, the apparatus including:
the release unit responds to the goods release transaction submitted by a supplier, and releases a buyer price ciphertext and a supplier price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; the buyer price ciphertext distributed in the block chain system is provided to the target buyer so that the target buyer can decrypt the buyer price ciphertext through a buyer private key and generate the purchasing information aiming at the target goods after the decrypted price plaintext is confirmed;
and the transaction unit executes transfer operation according to the purchase information, and comprises the following steps: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
According to a seventh aspect of one or more embodiments of the present specification, there is provided a block chain-based item transaction apparatus for use with a supplier, the apparatus including:
the system comprises a submitting unit and a purchasing unit, wherein the submitting unit submits goods release transactions to a block chain system so as to release a supplier price ciphertext and a purchasing price ciphertext of a target goods in the block chain system, the supplier price ciphertext is generated by homomorphic encryption of a price plaintext set by a supplier for a target purchasing party through a supplier public key, and the purchasing price ciphertext is generated by homomorphic encryption of the price plaintext through a purchasing public key;
the buyer price ciphertext is acquired by the target buyer so that the target buyer can decrypt the buyer price ciphertext based on a buyer private key and generate purchasing information aiming at the target goods after confirming the decrypted price plaintext; after the purchasing information is acquired by the block chain system, the purchasing information is used for deducting a purchasing party transaction amount ciphertext calculated through the purchasing party price ciphertext and the purchasing information from a purchasing party balance ciphertext and adding a supplying party transaction amount ciphertext calculated through the supplying party price ciphertext and the purchasing information to a supplying party balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
According to an eighth aspect of one or more embodiments herein, there is provided an electronic apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of the second, third and fourth aspects by executing the executable instructions.
According to a ninth aspect of one or more embodiments of the present specification, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to any one of the second, third and fourth aspects.
According to the technical scheme, when a supplier releases goods in the block chain system, the price of the released goods is as follows: the buyer price ciphertext obtained by homomorphic encryption of the buyer public key of the target buyer and the supplier price ciphertext obtained by homomorphic encryption of the supplier public key of the supplier. Therefore, only the target purchasing party maintaining the private key of the purchasing party and the goods supplying party maintaining the private key of the goods supplying party can decrypt to obtain the price plaintext of the target goods, and the problem that the goods supplying party in the related technology reveals the price of the goods when releasing the goods in the block chain system is solved.
In addition, a buyer balance ciphertext represented by a homomorphic ciphertext obtained based on a buyer public key and a supplier balance ciphertext represented by the homomorphic ciphertext obtained based on a supplier public key are maintained in the block chain system in the specification. On the basis, the account transfer operation of the purchase can be realized by deducting a purchase party transaction amount ciphertext calculated through a purchase party price ciphertext from a purchase party balance ciphertext and adding a supply party transaction amount ciphertext calculated through a supply party price ciphertext into a supply party balance ciphertext. It is understood that the specification equivalently utilizes the characteristic of homomorphic cryptograph, realizes the transfer operation in the goods transaction process in the form of cryptograph, and avoids the problem that the goods transaction amount and the account balance of both transaction parties are leaked in the related technology.
Drawings
FIG. 1 is a flow chart of a method of trading items based on a blockchain system provided by an exemplary embodiment.
Fig. 2 is a flow chart of an item transaction method based on a blockchain system applied to a target buyer according to an exemplary embodiment.
FIG. 3 is a flow chart of a method for a blockchain system based transaction of items for use in a blockchain system, according to an exemplary embodiment.
Fig. 4 is a flowchart of a method for trading goods based on a blockchain system applied to a supplier according to an exemplary embodiment.
FIG. 5 is an interaction diagram of a method of trading items based on a blockchain system, provided by an exemplary embodiment.
Fig. 6 is a schematic structural diagram of an apparatus according to an exemplary embodiment.
Fig. 7 is a block diagram of an item transaction arrangement based on a blockchain system for a targeted buyer according to an exemplary embodiment.
Figure 8 is a block diagram of a blockchain system-based item transaction device as applied to a blockchain system provided by an exemplary embodiment.
Fig. 9 is a block diagram of a goods transaction device based on a blockchain system applied to a supplier according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
The block chain technology (also called as distributed ledger technology) is a decentralized distributed database technology, has the characteristics of decentralization, openness and transparency, no tampering, trustiness and the like, and is suitable for application scenes with high requirements on data reliability.
In view of the high-quality characteristics of the blockchain technology, in order to improve the reliability of the goods transaction process, the related technology provides a technical scheme for realizing the goods transaction through the blockchain technology, and in the scheme, a supplier can obtain the goods information which can be purchased from the blockchain system through a mode of releasing the goods in the blockchain system, so as to determine whether the purchasing is needed. Correspondingly, the transfer operation is also completed in the blockchain system in the settlement process of the purchase so as to ensure the reliability of the transfer process.
However, in the related art, either price information of an item issued by a supplier in the blockchain system or transaction amount information involved in a settlement process is linked in the form of a clear text to the blockchain system. In the blockchain system, the uplink data is in a public and transparent state and can be viewed at will, so that the price information and the transaction amount information which are linked to the blockchain system in a plaintext form can be viewed at will by other users except two transaction parties. It should be understood that the price information and the transaction amount information of the goods in the goods purchasing process are sensitive information for both parties of the transaction and are not known by other users except the parties of the transaction.
In view of the problem that price information and transaction amount information of goods are leaked in the related art, the present specification provides a block chain-based goods transaction method, so that only two parties of a transaction can know the price information and the transaction amount information of the goods when the goods transaction is completed through a block chain system.
FIG. 1 is a flow chart of a block chain based item transaction method provided by an exemplary embodiment. As shown in fig. 1, the method may include the steps of:
and 102, submitting goods release transaction to a block chain system by a supplier, so as to release a supplier price ciphertext and a buyer price ciphertext aiming at a target goods in the block chain system, wherein the supplier price ciphertext is generated by homomorphic encryption of a price plaintext set by the supplier for a target buyer through a supplier public key, and the buyer price ciphertext is generated by homomorphic encryption of the price plaintext through a buyer public key of the target buyer.
In this specification, a supplier may publish items for sale in a blockchain system by submitting an item publication transaction to the blockchain system. The goods release transaction can include the description information of the corresponding goods and the price ciphertext of the goods.
Wherein, the price ciphertext may include: the price ciphertext of the purchasing party only can be checked by the corresponding purchasing party and the price ciphertext of the supplying party only can be checked by the supplying party, so that other users except the two transaction parties can be prevented from acquiring the plaintext price provided by the supplying party for the corresponding purchasing party. In actual operation, the price ciphertext of the purchasing party can be generated in a way that the public key of the purchasing party is used for homomorphically encrypting the price plaintext of the price set by the supplier for the corresponding purchasing party, so that only the purchasing party with the corresponding private key of the purchasing party can know the price of the plaintext; the supplier price ciphertext can be generated by the supplier public key to encrypt the plaintext price homomorphically.
In this specification, the goods release transaction submitted by the supplier may further include certification information generated by a zero-knowledge certification technique, where the certification information is used to indicate that the supplier price ciphertext and the buyer price ciphertext included in the goods release transaction correspond to equal price plaintext. On the basis, the block chain system can verify the certification information and only issues a supplier price ciphertext and a buyer price ciphertext contained in the goods release transaction under the condition that the verification is passed.
It should be understood that, in the goods transaction process, the price plaintext of the same goods known by both transaction parties should be consistent, but the blockchain system, as a third party other than both transaction parties, only obtains the price ciphertext of the goods, and cannot determine whether the price plaintext corresponding to the price ciphertext of the buyer party and the price ciphertext of the supplier party is consistent, so in actual operation, the blockchain system needs to verify the above-mentioned certification information to ensure the reliability of the transaction. It should be noted that the timing of the verification operation may be determined according to the actual situation, for example, the verification may be performed after the goods release transaction is received at a certain blockchain node, and if the verification fails, the goods release transaction is not submitted to the blockchain system, so as to prevent the goods release transaction from entering the consensus stage; as another example, the verification operation may be performed during a consensus operation on the goods distribution transaction, wherein in case of a failure of the verification, the consensus does not pass; for example, the buyer price ciphertext and the supplier price ciphertext may be distributed in a contract state, and the verification operation may be performed at the execution stage of the item distribution transaction, and if the verification fails, the item distribution transaction may not be executed, or the contract state may not be changed even though the transaction is executed, that is, the two price ciphertexts may not be distributed.
In practical applications, the blockchain system also needs to verify the validity of the transaction. In general, a certain price range is defined in the blockchain system, and if the price of an item to be distributed is outside the price range, the item is regarded as an illegal transaction and is not distributed. Specifically, when submitting the goods release transaction, the supplier may add a scope Proof (Range Proof) in the goods release transaction, where the scope Proof is used to prove that the price of the released goods is within the price interval specified by the blockchain system. In the present disclosure, any one of the range attestation methods may be employed to generate the above range attestation, and the present disclosure is not so limited.
It should be noted that the certification information and the scope certification may be generated by the supplier in the process of generating the goods release transaction, or may be generated by other subjects besides the supplier, and the disclosure is not limited thereto.
And 104, the target purchasing party decrypts the purchasing party price ciphertext issued in the block chain system based on a private key of the target purchasing party and generates purchasing information aiming at the target goods after confirming the decrypted price plaintext.
In this specification, a supplier may set different prices for different buyers, and a buyer price ciphertext that any buyer can decrypt is: and the buyer public key of any buyer is used for homomorphically encrypting the price plaintext set by the supplier for any buyer to obtain a buyer price ciphertext.
Therefore, for the target buyer, if the supplier issues the buyer price ciphertext of the target goods in the block chain system, the buyer price ciphertext is obtained by homomorphically encrypting the price plaintext set by the supplier for the target buyer through the buyer public key of the target buyer. Then, after the supplier issues the buyer price ciphertext to the block chain system, the target buyer can obtain the buyer price ciphertext from the block chain system by sending the goods information to the block chain system to obtain a transaction, and determine whether to buy the target goods after obtaining the price plaintext set by the supplier through the decryption of the private key of the buyer maintained by the supplier. Certainly, the target buyer can also obtain the buyer price ciphertext from the block chain system in other manners, for example, the block chain system can also actively provide the buyer price ciphertext to the target buyer after the supplier publishes the buyer price ciphertext in the block chain system by subscribing to the block chain system. How the buyer obtains the corresponding buyer price ciphertext can be determined by those skilled in the art according to practical situations, and the disclosure is not limited thereto.
In this specification, after confirming the price plaintext of the target item, the target purchasing party may generate corresponding purchasing information according to its own requirement, where the purchasing information may include information such as a purchasing quantity, a purchasing object (i.e., the target item), and a purchasing transaction amount.
It should be appreciated that the generated procurement information needs to be transmitted to the supplier to instruct the supplier to provide the targeted item to the buyer in accordance with the procurement information. The specification can send the purchase information to the supplier in different ways.
In one embodiment, the targeted purchasing party may send the purchasing information directly to the supplier via a down-link channel, e.g., the purchasing information may be sent to the supplier in the form of a purchase request.
In another embodiment, the target buyer can send the generated purchase information to the supplier through the blockchain system. Specifically, the target purchasing party can generate a goods purchasing transaction based on the purchasing information and submit the goods purchasing transaction to the block chain system, and then the block chain system can transmit the purchasing information to the supplier in a mode of executing the goods purchasing transaction. Correspondingly, after the supplier obtains the purchasing information generated by the target purchasing party, the target goods can be provided to the target purchasing party according to the purchasing information.
In one embodiment, the supplier can also provide the target goods to the target purchasing party according to the purchasing information through the down-link channel. In this embodiment, the target item may be either a physical item or a digital item.
In another embodiment, the supplier can provide the targeted item to the targeted buyer through the blockchain system. Specifically, the supplier can chain the target goods in advance to deposit the evidence in the block chain system, and after receiving the goods purchase transaction submitted by the target buyer, the supplier calls the goods issuing contract by executing the goods purchase transaction mode to issue the target goods to the target buyer according to the purchase information contained in the goods purchase transaction. In this embodiment, the target item issued by the supplier is a digital item.
Step 106, the blockchain system executes a transfer operation according to the purchase information, including: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
In this specification, the blockchain system may perform a transfer operation according to purchase information when receiving a goods settlement transaction, so as to complete a payment operation for the purchase in a mode of transferring assets on a chain.
In one embodiment, the block chain system may generate a purchase number corresponding to the purchase information, for example, the purchase number may be generated according to the purchase information included in the item purchase transaction when the item purchase transaction is received. On the basis, when the block chain system receives the goods settlement transaction, the corresponding purchase information can be determined through the purchase number contained in the goods settlement transaction, and the transfer operation is completed according to the determined purchase information.
In this specification, the above-mentioned goods settlement transaction may be initiated by different subjects at different times according to actual circumstances.
In one embodiment, the supplier can generate an item settlement transaction based on the received purchase information and send the item settlement transaction to the blockchain system when receiving the purchase information.
In another embodiment, the item settlement transaction may be generated and sent to the blockchain system by the targeted purchasing party directly based on the purchase information after generating the purchase information.
In another embodiment, the target purchasing party can generate an item settlement transaction and send the item settlement transaction to the blockchain system when receiving the target item returned by the supplier according to the purchasing information.
It should be understood that the first two embodiments described above generate an item settlement transaction before the target item is provided to the target buyer, which is equivalent to the settlement of the item through a pre-payment method, and is generally applied to the situation that the target buyer has sufficient trust with the supplier; the last embodiment of the three embodiments only generates the goods settlement transaction after the target buyer confirms the receiving, and compared with the first two embodiments, the last embodiment avoids the loss of the target buyer caused by the pre-payment mode.
Of course, the above examples are illustrative, and in practical applications, the goods settlement transaction may be generated by a supplier or a target buyer; the generation may be performed after the target buyer confirms the receipt or before the transaction of the goods is not completed (equivalent to prepayment). The specific manner in which the goods settlement transaction is generated can be determined by those skilled in the art based on the actual circumstances, and the description is not limited thereto.
In this specification, a buyer balance ciphertext of a target buyer and a supplier balance ciphertext of a supplier are maintained in a block chain system. The buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated by the target buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated by the supplier public key. On the basis, the trading volume ciphertext of the purchasing party calculated through the price ciphertext of the purchasing party can be deducted from the balance ciphertext of the purchasing party, and the trading volume ciphertext of the supplying party calculated through the price ciphertext of the supplying party is added to the balance ciphertext of the supplying party.
It should be understood that, because the procurement party balance ciphertext is the homomorphic ciphertext obtained by encrypting the procurement party public key, and the procurement party transaction balance ciphertext is obtained by calculating based on the procurement party price ciphertext obtained by encrypting the procurement party public key (obviously, the homomorphic ciphertext also based on the procurement party public key), in view of the characteristics of the homomorphic encryption algorithm, after the procurement party transaction balance ciphertext is deducted from the procurement party balance ciphertext, the procurement party balance plaintext corresponding to the procurement party balance ciphertext is obtained, and is consistent with the procurement party balance plaintext obtained after "the procurement party transaction balance plaintext corresponding to the procurement party transaction balance ciphertext is deducted directly from the original procurement party balance plaintext (the procurement party balance plaintext before transferring money). Similarly, after the supplier price ciphertext is added to the supplier balance ciphertext, the obtained supplier balance plaintext corresponding to the supplier balance ciphertext is consistent with the obtained supplier balance plaintext after the supplier transaction amount plaintext corresponding to the supplier transaction amount ciphertext is directly added to the original supplier balance plaintext (the supplier balance plaintext before account transfer). Therefore, through the transaction method in the specification, accurate encrypted account transfer can be realized on the premise of avoiding exposure of balance plaintext of both transaction parties and transaction amount plaintext.
In the above introduction it is pointed out that: the buyer trade amount cipher text is obtained through the buyer price cipher text calculation, and the supplier trade amount cipher text is obtained through the supplier price cipher text calculation. In this specification, the calculation may be implemented in various ways.
In one embodiment, the purchase information may include a purchase quantity of the target item. Then, the block chain system can directly represent the transaction amount ciphertext of the purchasing party based on the price ciphertext and the purchasing quantity of the purchasing party; correspondingly, the trade amount ciphertext of the supplier can be represented by the price ciphertext and the purchase amount of the supplier. For example, the buyer party transaction amount cryptogram may be characterized as: buyer price ciphertext; and the supplier transaction amount ciphertext can be characterized as: supplier price ciphertext;
in another embodiment, the buyer party transaction amount cryptogram may be provided by the target buyer party. Specifically, after the target purchasing party obtains the purchasing party price ciphertext and decrypts the purchasing party price ciphertext to obtain a price plaintext, the transaction amount plaintext can be obtained through calculation according to the purchasing amount of the target goods required to be purchased and the price plaintext; further, the transaction amount plaintext can be homomorphically encrypted through the purchasing party public key to obtain a purchasing party transaction amount ciphertext. And the transaction amount ciphertext of the purchasing party can be submitted to a blockchain system as purchasing information to be used for realizing transfer operation. Correspondingly, the ciphertext of the transaction amount of the supplier can also be submitted by the supplier, and the specific operation mode is consistent with that of the target purchasing party, which is not described herein again.
In this specification, goods transaction is performed through the blockchain system, which is equivalent to the blockchain system providing a transaction platform for both transaction parties. Therefore, the service party corresponding to the blockchain system can charge a certain commission. In practical operation, the service party can preset corresponding commission charge rates for different goods issued by the supplier so as to calculate the commission charge required to be spent for each purchase. It should be noted that the commission fee is also a private message for both the service party and the transaction party, so the commission fee is also deducted in the form of a cipher text when the commission fee is actually deducted in the present specification.
In an embodiment, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain the price plaintext, the transaction amount plaintext of the current purchasing can be calculated according to the number of the target goods required to be purchased and the price plaintext. On the basis, the method can further calculate to obtain the commission fee plaintext required by the purchase based on the transaction amount plaintext and the commission fee rate of the target goods, and homomorphically encrypt the commission fee plaintext through the public key of the purchasing party to obtain the commission fee plaintext of the purchasing party; correspondingly, the commission fee plaintext can be homomorphically encrypted through the service party public key of the service party to obtain a service party commission fee ciphertext. After receiving the procuring party procedure cipher text and the service party procedure cipher text, the block chain system deducts the procuring party procedure cipher text from the procuring party balance cipher text and adds the service party procedure cipher text to the service party balance cipher text. It should be understood that the present embodiment corresponds to a cryptogram transfer operation (i.e., independent settlement of the commission) performed for the transaction amount and the commission charge when the transfer operation is performed based on the purchase information. It should be stated that, similar to the buyer balance ciphertext and the supplier balance ciphertext, the server balance ciphertext in this embodiment is a homomorphic ciphertext of the server account balance generated based on the server public key.
In another embodiment, after the target buyer obtains the buyer price ciphertext from the blockchain system and decrypts the buyer price ciphertext to obtain the price plaintext, the target buyer can obtain the initial transaction amount plaintext of the current purchase according to the quantity of the target goods required to be purchased and the price plaintext, and further obtain the commission charge plaintext required to be consumed by the current purchase according to the initial transaction amount plaintext and the commission charge rate of the target goods. On the basis, the total amount of the initial transaction amount plaintext and the commission charge plaintext can be used as the total amount of the transaction amount plaintext required to be consumed by the purchase, and the total amount of the transaction amount plaintext is homomorphically encrypted through the public key of the purchasing party to obtain the transaction amount ciphertext of the purchasing party; similar to the previous embodiment, the present embodiment may also obtain the commission cryptograph of the service party by performing homomorphic encryption on the commission plaintext through the service party public key of the service party.
It is understood that the cryptograph of the transaction amount of the purchasing party in this embodiment already contains the commission fee to be deducted for the purchase; the block chain system needs to deduct the transaction amount cipher text of the purchasing party from the balance cipher text of the purchasing party, add the transaction amount cipher text of the supplying party to the balance cipher text of the supplying party, and also needs to add the commission cipher text of the service party to the balance cipher text of the service party.
It should be noted that the above procedure of deducting the commission fee is only described as providing the commission fee from the target purchasing party to the service party, and in practical applications, the commission fee may be provided from the supply party to the service party, or provided from both the purchasing party and the supply party to the service party.
Specifically, in the case where the supplier provides the service with the commission fee, the supplier may pay the commission fee by independently settling the commission fee or by settling the commission fee together with the transaction amount.
In an embodiment, after the supplier obtains the purchase information, the trade amount plaintext of the purchase can be obtained by calculation according to the purchase amount in the purchase information and the price plaintext of the target goods. On the basis, the supplier can further calculate to obtain a commission fee plaintext required by the purchase based on the transaction amount plaintext and the commission fee rate of the target goods, and the commission fee plaintext is homomorphically encrypted through a public key of the supplier to obtain the commission fee plaintext of the supplier; correspondingly, the commission fee plaintext can be homomorphically encrypted through the service party public key of the service party to obtain a service party commission fee ciphertext. After receiving the supplier fee ciphertext and the server fee ciphertext, the block chain system can deduct the supplier fee ciphertext from the supplier fee ciphertext and add the server fee ciphertext to the server fee ciphertext.
In another embodiment, the supplier may further calculate the commission amount plaintext to be consumed for the purchase based on the commission amount plaintext in the purchase information and the commission rate of the target item under the condition that the initial commission amount plaintext to be consumed for the purchase is calculated based on the purchase amount in the purchase information and the price plaintext of the target item. On the basis, the supplier can take the difference value between the initial transaction amount plaintext and the commission charge plaintext as the supplier transaction amount plaintext corresponding to the purchase information, and homomorphically encrypt the supplier transaction amount plaintext through a supplier public key to obtain the supplier transaction amount ciphertext; similar to the previous embodiment, the supplier in this embodiment may also perform homomorphic encryption on the commission plaintext through the service public key to obtain the commission ciphertext of the service.
It should be understood that the commission fee to be deducted for the purchase is deducted from the cryptogram of the transaction amount of the supplier in this embodiment. In other words, in this embodiment, the purchasing party trade amount plaintext = the supplier trade amount plaintext + the commission fee plaintext.
In this specification, the target purchasing party may obtain the balance ciphertext of the purchasing party by a down-chain fund exchange method. Specifically, the target purchasing party may send the on-chain balance exchange request including the off-chain fund to the fund management server corresponding to the block chain system, so that the fund management server homomorphically encrypts, according to the amount of the off-chain fund included in the on-chain balance exchange request, a balance plaintext of a corresponding amount into a purchasing party balance ciphertext through the purchasing party public key of the target purchasing party, and sends the purchasing party balance ciphertext to the block chain system, so that the block chain system maintains the purchasing party balance ciphertext in the purchasing party account of the target purchasing party. Similarly, the supplier can also obtain the balance ciphertext of the supplier in a mode of fund exchange under the chain, and the specific operation mode is similar to the mode of obtaining the balance ciphertext of the buyer by the target buyer and is not described herein again.
In this specification, the supplier can also present the supplier balance ciphertext recorded in the block chain system. In actual operation, the supplier can initiate a fund withdrawal transaction to the blockchain system to indicate the blockchain system to deduct a corresponding amount of supplier withdrawal ciphertext from a remainder ciphertext of the supplier (the supplier withdrawal ciphertext is a homomorphic ciphertext obtained by homomorphically encrypting the fund amount under the chain to be withdrawn by a public key of the supplier); the blockchain system can send a message of the request of the supplier for cash withdrawal to the fund management server, so that the fund management server returns corresponding amount of the linked fund to the supplier through the linked channel. In the process, the supplier can also provide a proof that the plaintext corresponding to the ciphertext submitted by the supplier is consistent with the amount of the fund under the chain required to be submitted (the amount of the fund under the chain can be sent to the fund management server through the channel under the chain so as to avoid the leakage of the amount of the fund under the chain), wherein the fund management server transfers the fund under the chain with the corresponding amount to the supplier only after verifying the proof.
According to the technical scheme, when a supplier releases goods in the block chain system, the price of the released goods is as follows: the buyer price ciphertext obtained by homomorphic encryption of the buyer public key of the target buyer and the supplier price ciphertext obtained by homomorphic encryption of the supplier public key of the supplier. Therefore, only the target purchasing party maintaining the private key of the purchasing party and the goods supplying party maintaining the private key of the goods supplying party can decrypt to obtain the price plaintext of the target goods, and the problem that the goods supplying party in the related technology reveals the price of the goods when releasing the goods in the block chain system is solved.
Further, a buyer balance ciphertext represented by a homomorphic ciphertext obtained based on a buyer public key and a supplier balance ciphertext represented by the homomorphic ciphertext obtained based on a supplier public key are maintained in the block chain system in the description. On the basis, the account transfer operation of the purchase can be realized by deducting a purchase party transaction amount ciphertext calculated through a purchase party price ciphertext from a purchase party balance ciphertext and adding a supply party transaction amount ciphertext calculated through a supply party price ciphertext into a supply party balance ciphertext. It is understood that the description equivalently uses the characteristic of homomorphic cryptographs (namely, operation is performed between homomorphic cryptographs based on the same identity public key, and equivalently, operation is performed between corresponding plaintexts), so that transfer operation in the goods transaction process is realized in a cryptograph mode, and the problem that the goods transaction amount and the account balance of both transaction parties are leaked in the related technology is solved.
Still further, the service party in this specification may set a commission rate for the target goods issued by the supplier so as to charge a commission for the purchase transaction related to the target goods. The handling fee is deducted from the balance of the purchasing party in the form of handling fee ciphertext of the purchasing party, and the corresponding handling fee ciphertext of the service party is added to the balance ciphertext of the service party corresponding to the service party. The problem of the charge of having avoided revealing.
The specification also provides a goods transaction method applied to the target purchasing party. In the method, specific operation manners, for example, how to release goods and how to receive interest, are similar to those in the previous embodiment, and only the target purchasing party is used as an execution subject to describe the technical solution of the present specification, and related contents can refer to the description in the previous embodiment, and are not described again in the next embodiment.
FIG. 2 is a flow chart of a block chain based item transaction method as applied to a targeted buyer in accordance with an exemplary embodiment. As shown in fig. 2, the method may include the steps of:
step 202, acquiring a buyer price ciphertext obtained by homomorphically encrypting a price plaintext of a target commodity through a buyer public key from a block chain system, decrypting the buyer price ciphertext through a buyer private key, and generating purchasing information aiming at the target commodity after the target buyer confirms the decrypted price plaintext.
As described above, a supplier can publish items for sale in a blockchain system by submitting an item publication transaction to the blockchain system. The goods release transaction can include the description information of the corresponding goods and the price ciphertext of the goods. On the basis, the target purchasing party can decrypt the purchasing party price ciphertext acquired from the block chain system through the purchasing party private key to obtain the price plaintext of the target goods, and after the price plaintext is confirmed, purchasing information aiming at the target goods is generated.
As described above, after the target purchasing party generates the purchasing information, the target purchasing party may send the purchasing information to the supplier through the down-link channel to instruct the supplier to provide the target goods according to the purchasing information; and the commodity purchasing transaction can be generated based on the purchasing information and sent to the block chain system, so that the purchasing information is disclosed to the supplier by the block chain system, and the supplier is instructed to provide the target commodity to the target purchasing party according to the purchasing information.
As described above, after the supplier obtains the purchase information, the supplier can provide the target goods to the target buyer through the down-link channel according to the purchase information; and the target goods can be provided to the target purchasing party through the block chain system, specifically, the goods supplier can chain the target goods in advance so as to store the goods in the block chain system, and after the goods purchasing transaction submitted by the target purchasing party is received, the goods distribution contract is called through the mode of executing the goods purchasing transaction so as to distribute the target goods to the target purchasing party according to the purchasing information contained in the goods purchasing transaction.
Step 204, submitting the purchasing information to the block chain system or the supplier of the target goods.
As described above, the blockchain system may perform a transfer operation according to the purchase information when receiving a goods settlement transaction, so as to complete a payment operation for the purchase in a mode of transferring assets on the chain. Wherein the goods settlement transaction can be initiated by different subjects at different times according to actual conditions. For example, when the supplier receives the purchase information, a goods purchase transaction is generated based on the received purchase information and sent to the blockchain system; for another example, after the target purchasing party generates the purchasing information, a goods settlement transaction is generated directly based on the purchasing information and is sent to the block chain system; for another example, when the target purchasing party receives the target goods returned by the supplier according to the purchasing information, a goods settlement transaction can be generated and sent to the blockchain system.
As described above, the block chain system maintains the buyer balance ciphertext of the target buyer and the supplier balance ciphertext of the supplier. The buyer balance ciphertext is a homomorphic ciphertext generated by the buyer public key of the target buyer, and the supplier balance ciphertext is a homomorphic ciphertext generated by the supplier public key. On the basis, the trading volume ciphertext of the purchasing party calculated through the price ciphertext of the purchasing party can be deducted from the balance ciphertext of the purchasing party, and the trading volume ciphertext of the supplying party calculated through the price ciphertext of the supplying party is added to the balance ciphertext of the supplying party.
As described above, the service side corresponding to the blockchain system can preset corresponding commission charge rates for different goods issued by the supplier, so as to calculate the commission charge required to be spent for each purchase.
In one case, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain the price plaintext, the transaction amount plaintext of the current purchasing can be calculated according to the number of the target goods required to be purchased and the price plaintext. On the basis, the method can further calculate to obtain the commission fee plaintext required by the purchase based on the transaction amount plaintext and the commission fee rate of the target goods, and homomorphically encrypt the commission fee plaintext through the public key of the purchasing party to obtain the commission fee plaintext of the purchasing party; correspondingly, the commission fee plaintext can be homomorphically encrypted through the service party public key of the service party to obtain a service party commission fee ciphertext. After receiving the procuring party procedure cipher text and the service party procedure cipher text, the block chain system deducts the procuring party procedure cipher text from the procuring party balance cipher text and adds the service party procedure cipher text to the service party balance cipher text.
In another case, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain a price plaintext, an initial transaction amount plaintext of the current purchase can be obtained through calculation according to the quantity of the target goods required to be purchased and the price plaintext, and a commission charge plaintext required to be consumed by the current purchase can be obtained through calculation according to the initial transaction amount plaintext and the commission charge rate of the target goods. On the basis, the total amount of the initial transaction amount plaintext and the commission charge plaintext can be used as the total amount of the transaction amount plaintext required to be consumed by the purchase, and the total amount of the transaction amount plaintext is homomorphically encrypted through the public key of the purchasing party to obtain the transaction amount ciphertext of the purchasing party; in this case, the plaintext of the service charge may be homomorphically encrypted by the public key of the service party to obtain the ciphertext of the service charge.
As mentioned above, the process of deducting the commission fee is only described as providing the commission fee from the target purchasing party to the service party, and in practical applications, the commission fee may be provided from the supply party to the service party, or may be provided from both the purchasing party and the supply party to the service party. The specific operation mode has been described above when the supplier provides the procedure, and therefore, the detailed description is omitted in this specification.
According to the technical scheme, the target purchasing party in the specification can obtain a purchasing party price ciphertext obtained by homomorphically encrypting the price plaintext of the target goods through the self identity public key from the block chain system, and decrypt the purchasing party price ciphertext through the purchasing party private key maintained by the target purchasing party to obtain the price plaintext of the target goods. In other words, only the target purchasing party can decrypt the purchasing party price ciphertext based on the own identity private key to obtain the price plaintext, so that the problem of leakage of the goods price plaintext in the related technology is solved.
Further, a buyer balance ciphertext represented by a homomorphic ciphertext obtained based on a buyer public key and a supplier balance ciphertext represented by the homomorphic ciphertext obtained based on a supplier public key are maintained in the block chain system in the description. On the basis, the account transfer operation of the purchase can be realized by deducting a purchase party transaction amount ciphertext calculated through a purchase party price ciphertext from a purchase party balance ciphertext and adding a supply party transaction amount ciphertext calculated through a supply party price ciphertext into a supply party balance ciphertext. It is understood that the description equivalently uses the characteristic of homomorphic cryptographs (i.e. operations performed between homomorphic cryptographs based on the same identity public key are equivalent to operations performed between corresponding plaintexts), and realizes transfer operation in the goods transaction process in a cryptograph transfer mode, thereby avoiding the problem that the goods transaction amount and the account balance of both parties in the transaction are leaked in the related technology.
Still further, the service party in this specification may set a commission rate for the target goods issued by the supplier so as to charge a commission for the purchase transaction related to the target goods. The handling fee is deducted from the balance of the purchasing party in the form of handling fee ciphertext of the purchasing party, and the corresponding handling fee ciphertext of the service party is added to the balance ciphertext of the service party corresponding to the service party. The problem of the charge of having avoided revealing.
The specification also provides a goods transaction method applied to the block chain system. In the method, specific operation manners, for example, how to release goods and how to receive interest, are similar to those in the two embodiments, and only the block chain system is used as an execution subject to describe the technical solution of this specification, and related contents can refer to the description of the embodiments, and are not described in detail in the following embodiments.
FIG. 3 is a flowchart of another blockchain-based item transaction method as applied to a blockchain system, according to an exemplary embodiment. As shown in fig. 3, the method may include the steps of:
step 302, in response to the goods release transaction submitted by a supplier, releasing a buyer price ciphertext and a supplier price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; and providing the buyer price ciphertext distributed in the block chain system to the target buyer so that the target buyer decrypts the buyer price ciphertext through a buyer private key and generates the purchasing information aiming at the target goods after the decrypted price plaintext is confirmed.
As described above, a supplier can publish items for sale in a blockchain system by submitting an item publication transaction to the blockchain system. The goods release transaction can include the description information of the corresponding goods and the price ciphertext of the goods. On the basis, the target purchasing party can decrypt the purchasing party price ciphertext acquired from the block chain system through the purchasing party private key to obtain the price plaintext of the target goods, and after the price plaintext is confirmed, purchasing information aiming at the target goods is generated.
As described above, after the target purchasing party generates the purchasing information, the target purchasing party may send the purchasing information to the supplier through the down-link channel to instruct the supplier to provide the target goods according to the purchasing information; and the commodity purchasing transaction can be generated based on the purchasing information and sent to the block chain system, so that the purchasing information is disclosed to the supplier by the block chain system, and the supplier is instructed to provide the target commodity to the target purchasing party according to the purchasing information.
As described above, after the supplier obtains the purchase information, the supplier can provide the target goods to the target buyer through the down-link channel according to the purchase information; and the target goods can be provided to the target purchasing party through the block chain system, specifically, the goods supplier can chain the target goods in advance so as to store the goods in the block chain system, and after the goods purchasing transaction submitted by the target purchasing party is received, the goods distribution contract is called through the mode of executing the goods purchasing transaction so as to distribute the target goods to the target purchasing party according to the purchasing information contained in the goods purchasing transaction.
Step 304, executing a transfer operation according to the purchase information, including: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
As described above, the blockchain system may perform a transfer operation according to the purchase information when receiving a goods settlement transaction, so as to complete a payment operation for the purchase in a mode of transferring assets on the chain. Wherein the goods settlement transaction can be initiated by different subjects at different times according to actual conditions. For example, when the supplier receives the purchase information, a goods purchase transaction is generated based on the received purchase information and sent to the blockchain system; for another example, after the target purchasing party generates the purchasing information, a goods settlement transaction is generated directly based on the purchasing information and is sent to the block chain system; for another example, when the target purchasing party receives the target goods returned by the supplier according to the purchasing information, a goods settlement transaction can be generated and sent to the blockchain system.
As described above, when the block chain system acquires purchase information, it is also possible to generate a purchase number corresponding to the purchase information. And the goods settlement transaction contains the purchase number, then, the block chain system can complete the transfer operation based on the purchase number contained in the goods settlement transaction under the condition of receiving the goods settlement transaction.
As described above, the block chain system maintains the buyer balance ciphertext of the target buyer and the supplier balance ciphertext of the supplier. The buyer balance ciphertext is a homomorphic ciphertext generated by the buyer public key of the target buyer, and the supplier balance ciphertext is a homomorphic ciphertext generated by the supplier public key. On the basis, the trading volume ciphertext of the purchasing party calculated through the price ciphertext of the purchasing party can be deducted from the balance ciphertext of the purchasing party, and the trading volume ciphertext of the supplying party calculated through the price ciphertext of the supplying party is added to the balance ciphertext of the supplying party.
As described above, the service side corresponding to the blockchain system can preset corresponding commission charge rates for different goods issued by the supplier, so as to calculate the commission charge required to be spent for each purchase.
In one case, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain the price plaintext, the transaction amount plaintext of the current purchasing can be calculated according to the number of the target goods required to be purchased and the price plaintext. On the basis, the method can further calculate to obtain the commission fee plaintext required by the purchase based on the transaction amount plaintext and the commission fee rate of the target goods, and homomorphically encrypt the commission fee plaintext through the public key of the purchasing party to obtain the commission fee plaintext of the purchasing party; correspondingly, the commission fee plaintext can be homomorphically encrypted through the service party public key of the service party to obtain a service party commission fee ciphertext. After receiving the procuring party procedure cipher text and the service party procedure cipher text, the block chain system deducts the procuring party procedure cipher text from the procuring party balance cipher text and adds the service party procedure cipher text to the service party balance cipher text.
In another case, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain a price plaintext, an initial transaction amount plaintext of the current purchase can be obtained through calculation according to the quantity of the target goods required to be purchased and the price plaintext, and a commission charge plaintext required to be consumed by the current purchase can be obtained through calculation according to the initial transaction amount plaintext and the commission charge rate of the target goods. On the basis, the total amount of the initial transaction amount plaintext and the commission charge plaintext can be used as the total amount of the transaction amount plaintext required to be consumed by the purchase, and the total amount of the transaction amount plaintext is homomorphically encrypted through the public key of the purchasing party to obtain the transaction amount ciphertext of the purchasing party; in this case, the plaintext of the service charge may be homomorphically encrypted by the public key of the service party to obtain the ciphertext of the service charge.
As mentioned above, the process of deducting the commission fee is only described as providing the commission fee from the target purchasing party to the service party, and in practical applications, the commission fee may be provided from the supply party to the service party, or may be provided from both the purchasing party and the supply party to the service party. The specific operation manner has been described above when the supplier provides the procedure, and therefore, the detailed description thereof is omitted in this embodiment.
According to the technical scheme, the target purchasing party in the specification can obtain a purchasing party price ciphertext obtained by homomorphically encrypting the price plaintext of the target goods through the self identity public key from the block chain system, and decrypt the purchasing party price ciphertext through the purchasing party private key maintained by the target purchasing party to obtain the price plaintext of the target goods. In other words, only the target purchasing party can decrypt the purchasing party price ciphertext based on the own identity private key to obtain the price plaintext, so that the problem of leakage of the goods price plaintext in the related technology is solved.
Further, a buyer balance ciphertext represented by a homomorphic ciphertext obtained based on a buyer public key and a supplier balance ciphertext represented by the homomorphic ciphertext obtained based on a supplier public key are maintained in the block chain system in the description. On the basis, the account transfer operation of the purchase can be realized by deducting a purchase party transaction amount ciphertext calculated through a purchase party price ciphertext from a purchase party balance ciphertext and adding a supply party transaction amount ciphertext calculated through a supply party price ciphertext into a supply party balance ciphertext. It is understood that the description equivalently uses the characteristic of homomorphic cryptographs (i.e. operations performed between homomorphic cryptographs based on the same identity public key are equivalent to operations performed between corresponding plaintexts), and realizes transfer operation in the goods transaction process in a cryptograph transfer mode, thereby avoiding the problem that the goods transaction amount and the account balance of both parties in the transaction are leaked in the related technology.
Still further, the service party in this specification may set a commission rate for the target goods issued by the supplier so as to charge a commission for the purchase transaction related to the target goods. The handling fee is deducted from the balance of the purchasing party in the form of handling fee ciphertext of the purchasing party, and the corresponding handling fee ciphertext of the service party is added to the balance ciphertext of the service party corresponding to the service party. The problem of the charge of having avoided revealing.
The specification also provides a goods transaction method applied to the supplier. In the method, specific operation manners, for example, how to release goods and how to receive interest, are similar to those in the two embodiments, and only the supplier is used as an execution subject to describe the technical solution of this specification, and related contents can refer to the description of the embodiments, and are not described in detail in the following embodiments.
Fig. 4 is a flowchart of yet another block-chain based item transaction method as applied to a supplier according to an exemplary embodiment. As shown in fig. 4, the method may include the steps of:
step 402, submitting a goods release transaction to a block chain system so as to release a supplier price ciphertext and a buyer price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; the buyer price ciphertext is acquired by the target buyer so that the target buyer can decrypt the buyer price ciphertext based on a buyer private key and generate purchasing information aiming at the target goods after confirming the decrypted price plaintext; after the purchasing information is acquired by the block chain system, the purchasing information is used for deducting a purchasing party transaction amount ciphertext calculated through the purchasing party price ciphertext and the purchasing information from a purchasing party balance ciphertext and adding a supplying party transaction amount ciphertext calculated through the supplying party price ciphertext and the purchasing information to a supplying party balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
As described above, a supplier can publish items for sale in a blockchain system by submitting an item publication transaction to the blockchain system. The goods release transaction can include the description information of the corresponding goods and the price ciphertext of the goods. On the basis, the target purchasing party can decrypt the purchasing party price ciphertext acquired from the block chain system through the purchasing party private key to obtain the price plaintext of the target goods, and after the price plaintext is confirmed, purchasing information aiming at the target goods is generated.
As described above, after the target purchasing party generates the purchasing information, the target purchasing party may send the purchasing information to the supplier through the down-link channel to instruct the supplier to provide the target goods according to the purchasing information; and the commodity purchasing transaction can be generated based on the purchasing information and sent to the block chain system, so that the purchasing information is disclosed to the supplier by the block chain system, and the supplier is instructed to provide the target commodity to the target purchasing party according to the purchasing information.
As described above, after the supplier obtains the purchase information, the supplier can provide the target goods to the target buyer through the down-link channel according to the purchase information; and the target goods can be provided to the target purchasing party through the block chain system, specifically, the goods supplier can chain the target goods in advance so as to store the goods in the block chain system, and after the goods purchasing transaction submitted by the target purchasing party is received, the goods distribution contract is called through the mode of executing the goods purchasing transaction so as to distribute the target goods to the target purchasing party according to the purchasing information contained in the goods purchasing transaction.
As described above, the blockchain system may perform a transfer operation according to the purchase information when receiving a goods settlement transaction, so as to complete a payment operation for the purchase in a mode of transferring assets on the chain. Wherein the goods settlement transaction can be initiated by different subjects at different times according to actual conditions. For example, when the supplier receives the purchase information, a goods purchase transaction is generated based on the received purchase information and sent to the blockchain system; for another example, after the target purchasing party generates the purchasing information, a goods settlement transaction is generated directly based on the purchasing information and is sent to the block chain system; for another example, when the target purchasing party receives the target goods returned by the supplier according to the purchasing information, a goods settlement transaction can be generated and sent to the blockchain system.
As described above, the block chain system maintains the buyer balance ciphertext of the target buyer and the supplier balance ciphertext of the supplier. The buyer balance ciphertext is a homomorphic ciphertext generated by the buyer public key of the target buyer, and the supplier balance ciphertext is a homomorphic ciphertext generated by the supplier public key. On the basis, the trading volume ciphertext of the purchasing party calculated through the price ciphertext of the purchasing party can be deducted from the balance ciphertext of the purchasing party, and the trading volume ciphertext of the supplying party calculated through the price ciphertext of the supplying party is added to the balance ciphertext of the supplying party.
As described above, the service side corresponding to the blockchain system can preset corresponding commission charge rates for different goods issued by the supplier, so as to calculate the commission charge required to be spent for each purchase.
In one case, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain the price plaintext, the transaction amount plaintext of the current purchasing can be calculated according to the number of the target goods required to be purchased and the price plaintext. On the basis, the method can further calculate to obtain the commission fee plaintext required by the purchase based on the transaction amount plaintext and the commission fee rate of the target goods, and homomorphically encrypt the commission fee plaintext through the public key of the purchasing party to obtain the commission fee plaintext of the purchasing party; correspondingly, the commission fee plaintext can be homomorphically encrypted through the service party public key of the service party to obtain a service party commission fee ciphertext. After receiving the procuring party procedure cipher text and the service party procedure cipher text, the block chain system deducts the procuring party procedure cipher text from the procuring party balance cipher text and adds the service party procedure cipher text to the service party balance cipher text.
In another case, after the target purchasing party acquires the purchasing party price ciphertext from the block chain system and decrypts the purchasing party price ciphertext to obtain a price plaintext, an initial transaction amount plaintext of the current purchase can be obtained through calculation according to the quantity of the target goods required to be purchased and the price plaintext, and a commission charge plaintext required to be consumed by the current purchase can be obtained through calculation according to the initial transaction amount plaintext and the commission charge rate of the target goods. On the basis, the total amount of the initial transaction amount plaintext and the commission charge plaintext can be used as the total amount of the transaction amount plaintext required to be consumed by the purchase, and the total amount of the transaction amount plaintext is homomorphically encrypted through the public key of the purchasing party to obtain the transaction amount ciphertext of the purchasing party; in this case, the plaintext of the service charge may be homomorphically encrypted by the public key of the service party to obtain the ciphertext of the service charge.
As mentioned above, the process of deducting the commission fee is only described as providing the commission fee from the target purchasing party to the service party, and in practical applications, the commission fee may be provided from the supply party to the service party, or may be provided from both the purchasing party and the supply party to the service party. Specifically, in the case where the supplier provides the service with the commission fee, the supplier may pay the commission fee by independently settling the commission fee or by settling the commission fee together with the transaction amount.
In an embodiment, after the supplier obtains the purchase information, the trade amount plaintext of the purchase can be obtained by calculation according to the purchase amount in the purchase information and the price plaintext of the target goods. On the basis, the supplier can further calculate to obtain a commission fee plaintext required by the purchase based on the transaction amount plaintext and the commission fee rate of the target goods, and the commission fee plaintext is homomorphically encrypted through a public key of the supplier to obtain the commission fee plaintext of the supplier; correspondingly, the commission fee plaintext can be homomorphically encrypted through the service party public key of the service party to obtain a service party commission fee ciphertext. After receiving the supplier fee ciphertext and the server fee ciphertext, the block chain system can deduct the supplier fee ciphertext from the supplier fee ciphertext and add the server fee ciphertext to the server fee ciphertext.
In another embodiment, the supplier may further calculate the commission amount plaintext to be consumed for the purchase based on the commission amount plaintext in the purchase information and the commission rate of the target item under the condition that the initial commission amount plaintext to be consumed for the purchase is calculated based on the purchase amount in the purchase information and the price plaintext of the target item. On the basis, the supplier can take the difference value between the initial transaction amount plaintext and the commission charge plaintext as the supplier transaction amount plaintext corresponding to the purchase information, and homomorphically encrypt the supplier transaction amount plaintext through a supplier public key to obtain the supplier transaction amount ciphertext; similar to the previous embodiment, the supplier in this embodiment may also perform homomorphic encryption on the commission plaintext through the service public key to obtain the commission ciphertext of the service.
It should be understood that the commission fee to be deducted for the purchase is deducted from the cryptogram of the transaction amount of the supplier in this embodiment. In other words, in this embodiment, the purchasing party trade amount plaintext = the supplier trade amount plaintext + the commission fee plaintext.
According to the technical scheme, the target purchasing party in the specification can obtain a purchasing party price ciphertext obtained by homomorphically encrypting the price plaintext of the target goods through the self identity public key from the block chain system, and decrypt the purchasing party price ciphertext through the purchasing party private key maintained by the target purchasing party to obtain the price plaintext of the target goods. In other words, only the target purchasing party can decrypt the purchasing party price ciphertext based on the own identity private key to obtain the price plaintext, so that the problem of leakage of the goods price plaintext in the related technology is solved.
Further, a buyer balance ciphertext represented by a homomorphic ciphertext obtained based on a buyer public key and a supplier balance ciphertext represented by the homomorphic ciphertext obtained based on a supplier public key are maintained in the block chain system in the description. On the basis, the account transfer operation of the purchase can be realized by deducting a purchase party transaction amount ciphertext calculated through a purchase party price ciphertext from a purchase party balance ciphertext and adding a supply party transaction amount ciphertext calculated through a supply party price ciphertext into a supply party balance ciphertext. It is understood that the description equivalently uses the characteristic of homomorphic cryptographs (i.e. operations performed between homomorphic cryptographs based on the same identity public key are equivalent to operations performed between corresponding plaintexts), and realizes transfer operation in the goods transaction process in a cryptograph transfer mode, thereby avoiding the problem that the goods transaction amount and the account balance of both parties in the transaction are leaked in the related technology.
Still further, the service party in this specification may set a commission rate for the target goods issued by the supplier so as to charge a commission for the purchase transaction related to the target goods. The handling fee is deducted from the balance of the purchasing party in the form of handling fee ciphertext of the purchasing party, and the corresponding handling fee ciphertext of the service party is added to the balance ciphertext of the service party corresponding to the service party. The problem of the charge of having avoided revealing.
In the following, the technical solution of the present specification will be described by taking the digital goods procurement through the blockchain system as an example.
FIG. 5 is an interaction diagram of a block chain based item transaction methodology provided by an exemplary embodiment. As shown in fig. 5, the method may include the steps of:
step 501, the supplier device generates a buyer price ciphertext and a supplier price ciphertext based on the price plaintext of the target digital goods.
In this embodiment, the supplier and the buyer can store their own public keys in the blockchain system in advance, so that any device can obtain their identity public keys from the blockchain system. Correspondingly, before the supplier issues the target digital goods, the supplier can acquire the public key of the buyer from the block chain system, so that the public key of the buyer is used as the public key of the buyer when the buyer conducts transaction, and then the public key of the buyer conducts homomorphic encryption on the price plaintext of the target digital goods to obtain the price ciphertext of the buyer. Further, the supplier needs to perform homomorphic encryption on the price plaintext of the target digital goods through the own identity public key (i.e., the supplier public key) to obtain the supplier price ciphertext. The specific operation process can be expressed as:
buyerGoodsPriceCipherText = HEEncrypt(buyerPublicKey, goodsPrice);
sellerGoodsPriceCipherText = HEEncrypt(sellerPublicKey, goodsPrice);
wherein, the buyerGoodsPriceCipherText represents a buyer price ciphertext; sellergoodscripticphertext represents supplier price ciphertext; HEEncrypt represents a homomorphic encryption algorithm; buyerPublicKey represents the buyer public key, sellerPublicKey represents the supplier public key, and goodPrice represents the price plaintext.
For example, assume that the supplier is user 1, the buyer is user 2, the target digital item is digital item X, and the price plaintext of the digital item X is 100. The public key of the purchasing party acquired by the user 1 from the block chain system is a public key M, and then a price ciphertext of the purchasing party obtained by homomorphically encrypting 100 through the public key M is a ciphertext M; the supplier price ciphertext resulting from homomorphic encryption of "100" by supplier public key N is ciphertext N1. Then, after each entry parameter is substituted into the above operation process, the two-price ciphertext can be respectively characterized as:
M= HEEncrypt(m,100);
N1= HEEncrypt(n,100)。
of course, there may be multiple purchasing parties for the same digital good. For example, the purchasing party for the above-mentioned digital item X may further include: a user 3. Then, user 1 may also set a clear text price for digital item X for user 3. Assuming that the plaintext price set by the user 1 for the user 3 is 120, and the public key of the identity of the user 3 acquired from the blockchain system is a public key H, the supplier device may further perform homomorphic encryption on "120" through the public key H to obtain a ciphertext H, and perform homomorphic encryption on "120" through a public key N to obtain a ciphertext N2. Then, after each entry parameter is substituted into the above operation process, the two-price ciphertext can be respectively characterized as:
H= HEEncrypt(h,120);
N2= HEEncrypt(n,120)。
it should be noted that the HEEncrypt is only one of many homomorphic encryption algorithms, and any homomorphic encryption algorithm may be used to calculate the price ciphertext in practical applications, which is not limited in this embodiment. It should be understood that the actually obtained public key M, public key N, public key h, ciphertext M, ciphertext N1, and ciphertext N2 are all presented in the form of character strings, and are only represented by the above symbols in the present embodiment.
It is further emphasized that the above example of the user 3 is merely illustrative of how a supplier may set different prices for different buyers for the same digital item. In practical application, the transaction flow is consistent no matter which purchasing party the user 1 transacts with, and only the set plaintext price and the adopted public and private key pair are changed. Therefore, in the subsequent steps, only the transaction process between the user 1 and the user 2 is described, and the transaction process between the user 1 and the user 3 is not described in additional detail. In addition, when the supplier issues the price ciphertexts corresponding to the plurality of purchasing parties at the same time, the supplier can issue the price ciphertexts corresponding to the plurality of purchasing parties through one goods issuing transaction only, and can also issue the price ciphertexts corresponding to each purchasing party through a plurality of goods issuing transactions respectively.
Step 502, the supplier device generates a goods release transaction based on the buyer price ciphertext and the supplier price ciphertext.
In this embodiment, the supplier device can generate the goods release transaction based on the two price ciphertexts after obtaining the buyer price ciphertexts and the supplier price ciphertexts. It should be appreciated that when the targeted digital item is released, the buyer is also provided with information regarding the targeted digital item.
In the above example, assuming that the digital item X is an "electronic ticket for a concert", besides the ciphertext M and the ciphertext N1 obtained by the operation need to be added to the item release transaction, the related information of the concert, such as the name of a singer, the name of a host, the holding place, etc., may be added to the item release transaction.
Further, before generating the goods release transaction, the supplier device may further generate certification information for certifying that the buyer price ciphertext is consistent with the supplier price ciphertext, and a range certificate that the price plaintext resides in a fixed interval. Specifically, the method can be calculated in the following manner:
Proof1=EqualProof(sellerGoodsPriceCipherText,buyerGoodsPriceCipherText, buyerPublicKey, sellerPublicKey);
Proof2 = RangeProof(sellerGoodsPriceCipherText, sellerPrivateKey, Z);
wherein EqualProof represents an algorithm for proving that the plaintexts corresponding to the two ciphertexts are equal, and RangeProof is a range proving algorithm; sellerPrivateKey is a private key of a supplier, and Z is an upper limit of a price range defined by a block chain system.
In connection with the above example, assuming that the supplier private key is characterized by m', after the corresponding input is substituted into the above formula, the two certificates can be respectively expressed as:
Proof1=EqualProof(M,N1,m,n);
Proof2 = RangeProof(M,m’, Z);
wherein, Proof1 can be used to prove to the blockchain system that the price plaintexts corresponding to the ciphertext M and the ciphertext N1 are equal; and Proof2 is used to prove to the blockchain system that the price plaintext corresponding to the ciphertext N1 is in the range [0, Z ] ([ 0, Z ] is a legal price interval preset by the blockchain system).
In step 503, the supplier device sends the item release transaction to the blockchain system.
In response to the above example, if the Proof1 and Proof2 are included after the receipt of the item distribution transaction, the two are verified. If both the verification result and the verification result pass, the ciphertext M and the ciphertext N1 contained in the goods release transaction are released; if either of the two verifications fails, the ciphertext M and the ciphertext N1 included in the goods transaction are not issued.
Step 504, the block chain system issues a buyer price ciphertext and a supplier price ciphertext of the target digital good.
In step 505, the buyer device obtains the buyer price ciphertext of the target digital item from the block chain system.
At step 506, the purchasing party device decrypts the purchasing party price ciphertext based on the purchasing party private key.
In connection with the above example, after the block chain system issues the related information of the digital goods X, the ciphertext M, and the ciphertext N1, the purchasing device may obtain the related information of the digital goods X and the ciphertext M from the block chain system. Then, the ciphertext M can be decrypted by the private key M' of the purchasing party maintained by the user, and the price plaintext 100 obtained by decryption and the related information are displayed to the user 2.
And step 507, the purchasing party equipment displays the decrypted price plaintext to the target purchasing party.
In step 508, the purchasing party device generates a goods purchasing transaction according to the purchasing information contained in the purchasing instruction, when receiving the purchasing instruction of the target purchasing party.
In connection with the above example, the user 2 may determine whether to purchase the digital item X according to the related information and the price plaintext displayed by the purchasing device. Specifically, the user 2 may determine whether the concert is interested or not according to the information such as the holding place of the concert and the name of the singer, and determine whether the price of the tickets of the concert is within the acceptable range of the user according to the displayed price plaintext. Wherein, after user 2 confirms the information that shows, can input corresponding purchase information through the controlling part on the purchasing side equipment, for example, purchase information can include: number of purchases, concert seat selection, etc. On the basis, the purchasing side equipment can generate goods purchasing transaction based on the purchasing information input by the user 2 and send the goods purchasing transaction to the block chain system.
At step 509, the purchaser device sends the item purchase transaction to the blockchain system.
Step 510, the block chain system verifies the purchase information contained in the goods purchase transaction and generates a corresponding purchase number.
In connection with the above example, after receiving the goods purchase transaction sent by the purchasing side device, the block chain system may generate a corresponding purchase order based on the purchase information included in the goods purchase transaction, and store the evidence for the purchase order. The purchase order includes a purchase number uniquely corresponding to the purchase order, for example, the purchase number of the purchase order may be "1565 fdga531gad1g6d5g 1". In this embodiment, the purchase number may be returned to the purchasing device, so that the purchasing device may obtain the purchase progress according to the purchase number.
In step 511, the supplier device obtains the purchase information of the target digital goods and the corresponding purchase number from the block chain system.
In connection with the above example, the supplier device may obtain the purchase order from the blockchain system, and upload a corresponding number of "electronic tickets for concert" to the blockchain system according to the purchase information included in the purchase order. Assuming that the number of purchases in the purchase information is 2 and the selected seat is "seat in venue", the user 1 can upload two "electronic tickets for concert" with seats in venue determined from the inventory to the blockchain system, for example, two electronic tickets for concert in "seat 1 in venue B" and "seat 2 in venue B" can be uploaded to the blockchain system.
It should be noted that, in order to mark the purchase orders corresponding to the two concert electronic tickets, the purchase number "1565 fdga531gad1g6d5g 1" may be uploaded to the blockchain system together with the two concert electronic tickets.
In step 512, the supplier device uploads the target digital item to the block chain system according to the purchase information.
Step 513, the blockchain system deposits a certificate for the received target digital goods.
At step 514, the purchasing device obtains the target digital item from the blockchain system.
In this embodiment, the purchasing device may query a purchasing progress according to the purchasing number, and obtain the target digital goods from the blockchain system when determining that the supplier has linked the target digital goods to the blockchain system.
In connection with the above example, after the purchasing device sends the purchase number "1565 fdga531gad1g6d5g 1" to the blockchain system, if the queried purchase progress indicates that the digital item X is already stored in the blockchain system, then the purchasing device can obtain the two "electronic tickets for concert" from the blockchain system.
In step 515, the purchasing device generates a goods settlement transaction based on the purchase number upon confirming that the obtained target digital goods matches the purchase information.
In this embodiment, the blockchain system performs a transfer operation (or settlement operation) for the purchase based on the item settlement transaction sent by the purchasing device. Wherein the item settlement transaction is initiated after the buyer confirms the received target digital item.
After receiving the example, the purchasing device may display the digital goods X to the user 2 after acquiring the digital goods X. Specifically, two concert electronic tickets "seat 1 in infield B-zone" and "seat 2 in infield B-zone" may be displayed to the user 2. When the user 2 confirms the electronic tickets of the two concerts without errors, the corresponding confirmation control can be triggered to indicate the purchasing side equipment to generate the goods settlement transaction based on the purchase number of '1565 fdga531gad1g6d5g 1', and the goods settlement transaction is sent to the block chain system to indicate the block chain system to settle accounts for the corresponding purchase orders.
In this embodiment, after the buyer confirms the received target digital goods, the buyer can further calculate the commission fee to be paid by the buyer.
In connection with the above example, the purchasing device may further obtain the commission rate set by the blockchain system for the digital item X from the blockchain system, assuming that the commission rate is 1%. Since the price plaintext of an electronic ticket at a concert is 100, the calculated plaintext of the commission fee corresponding to the purchase is: 100 × 2 × 1% = 2. On the basis, the purchasing side equipment can perform homomorphic encryption on the commission charge plaintext '2' through the purchasing side public key n to obtain a purchasing side commission charge ciphertext Y1; and (3) carrying out homomorphic encryption on the commission charge plaintext 2 through the service party public key l to obtain a service party commission charge ciphertext Y2. Accordingly, the two-party renewal cryptogram may be added to the goods settlement transaction as well.
At step 516, the buyer device sends the item settlement transaction to the blockchain system.
In this embodiment, after receiving the goods settlement transaction, the blockchain system may find the corresponding purchase order based on the corresponding purchase number, and perform settlement according to the purchase order. Specifically, a purchasing party account, a supplier account, and a server account of a server corresponding to the blockchain system may be maintained in the blockchain system, where each account has a homomorphic ciphertext obtained by encrypting a corresponding public key, so as to represent an account balance of a corresponding user. On the basis, transfer operation can be carried out among the accounts according to the purchase information so as to complete the settlement. The settlement process in each account can be specifically shown as the following formula:
buyer.balance=HESub(buyer.balance,buyerGoodsPriceCipherText*S, buyercommissionCipherText)
seller.balance = HEAdd(seller.balance, sellerGoodsPriceCipherText*S)
server.balance= HEAdd(server.balance, servercommissionCipherText)
wherein, the balance of the buyer is used for representing the balance ciphertext of the supplier, the balance of the seller is used for representing the balance ciphertext of the supplier, and the balance of the server is used for representing the balance ciphertext of the server; and the commensalisinoptertext is used for representing the commission fee ciphertext (correspondingly, the buyercomaxionsiphertext is the buyer commission fee ciphertext, and the servercompensationciphertext is the service party commission fee ciphertext). HESub characterizes an in-deduction algorithm, while HEAdd characterizes an in-increment algorithm, S being the purchase quantity of the target item.
In connection with the above example, the blockchain system may find the purchase order according to the purchase number "1565 fdga531gad1g6d5g 1" included in the item settlement transaction, and determine that the purchase number is 2 and the purchase object is an electronic ticket for a concert according to the purchase order. On the basis, the transfer operation can be carried out based on the buyer side price ciphertext and the supplier side price ciphertext of the concert electronic entrance ticket which are recorded in the block chain system, and the buyer side commission ciphertext and the server side commission ciphertext contained in the goods settlement transaction. Specifically, the ciphertext M, the ciphertext N1, the purchase amount "2", the buyer commission ciphertext Y1, and the supplier commission ciphertext Y2 may be substituted into the formula used in the settlement:
buyer.balance=HESub(buyer.balance,M*2, Y1)
seller.balance = HEAdd(seller.balance,N1*2)
server.balance= HEAdd(serber.balance,Y2)
it should be understood that, in this embodiment, the trade amount ciphertext is represented in the form of "purchase amount x price ciphertext" rather than in the settlement stage, and obviously, in this way, the ciphertext settlement can be realized in the settlement stage of purchase.
Step 517, the block chain system settles the purchase in the form of homomorphic cryptograph according to the goods settlement transaction.
According to the technical scheme, the price of the digital goods issued by the supplier in the block chain system is the homomorphic ciphertext encrypted by the public key of the buyer, so that the buyer only mastering the private key of the buyer can decrypt the price plaintext of the digital goods, and the problem of price information leakage caused by the fact that the supplier issues the price information of the digital goods in the plaintext form in the related art is solved.
Further, the account balances of the accounts maintained by the blockchain system in this embodiment are all as follows: the homomorphic cryptograph obtained by encrypting the corresponding public key enables the embodiment to utilize the characteristic that the transaction amount and the account balance (represented by the price cryptograph and the purchase quantity) are homomorphic cryptographs in the settlement process, so that the encrypted transfer between the purchasing party account and the supplying party account is realized, and the problem of leakage of the transaction amount and the account balance in the related technology is avoided.
FIG. 6 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 6, at the hardware level, the apparatus includes a processor 602, an internal bus 604, a network interface 606, a memory 608 and a non-volatile memory 610, but may also include hardware required for other services. One or more embodiments of the present description may be implemented in software, such as by processor 602 reading corresponding computer programs from non-volatile memory 610 into memory 608 and then executing. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 7, the block chain-based goods transaction apparatus may be applied to the device shown in fig. 6 to implement the technical solution of the present specification. Wherein, this goods transaction device based on block chain is applied to the target purchasing party, and the device can include:
an obtaining unit 701, configured to obtain, from a block chain system, a buyer price ciphertext obtained by homomorphically encrypting a price plaintext of a target item through a buyer public key, decrypt the buyer price ciphertext through a buyer private key, and generate purchase information for the target item after the target buyer confirms the decrypted price plaintext;
a submitting unit 702, for submitting the purchasing information to the blockchain system or the supplier of the target goods.
Optionally, the method further includes:
a sending unit 703, configured to send the purchase information to the supplier through a downlink channel, so as to instruct the supplier to provide the target item according to the purchase information; alternatively, the first and second electrodes may be,
and generating a goods purchasing transaction based on the purchasing information, and sending the goods purchasing transaction to the block chain system, so that the block chain system can transmit the purchasing information to the supplier to indicate the supplier to provide the target goods to the target purchasing party according to the purchasing information.
Optionally, a server side balance ciphertext of the server side is further recorded in the block chain system, and the server side balance ciphertext is a homomorphic ciphertext of the account balance of the server side generated based on the public key of the server side; the device also includes:
a calculating unit 704, configured to calculate a commission fee plaintext to be consumed for the purchase based on the purchase information, the price plaintext, and the commission fee rate of the target item, perform homomorphic encryption on the commission fee plaintext through the purchaser public key to obtain a purchaser commission fee ciphertext, and perform homomorphic encryption on the commission fee plaintext through the service party public key to obtain a service party commission fee ciphertext; and submitting the buyer party procedure fee ciphertext and the server party procedure fee ciphertext to the blockchain system so as to instruct the blockchain system to deduct the buyer party procedure fee ciphertext from the buyer party balance ciphertext and add the server party procedure fee ciphertext into the server party balance ciphertext.
Optionally, a server side balance ciphertext of the server side is further recorded in the block chain system, and the server side balance ciphertext is a homomorphic ciphertext of the account balance of the server side generated based on the public key of the server side; the calculation unit 704 is also used for:
under the condition that an initial transaction amount plaintext required to be consumed by the current purchasing is obtained through calculation based on the purchasing information and the price plaintext, calculating a commission amount plaintext required to be consumed by the current purchasing based on the initial transaction amount plaintext and a commission fee rate of the target goods, taking the total amount of the initial transaction amount plaintext and the commission fee plaintext as a purchasing party transaction amount plaintext corresponding to the purchasing information, and performing homomorphic encryption on the purchasing party transaction plaintext through the purchasing party public key to obtain a purchasing party transaction amount ciphertext; and homomorphically encrypting the commission fee plaintext through the service party public key to obtain a service party commission fee ciphertext;
submitting the server commission cryptogram to the blockchain system to instruct the blockchain system to add the server commission cryptogram in the server commission cryptogram.
Referring to fig. 8, the block chain-based goods transaction apparatus may be applied to the device shown in fig. 6 to implement the technical solution of the present specification. Wherein, this goods transaction device based on block chain is applied to block chain system, and the device can include:
the issuing unit 801 is configured to issue a buyer price ciphertext and a supplier price ciphertext of a target item in the block chain system in response to an item issuing transaction submitted by a supplier, where the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; the buyer price ciphertext distributed in the block chain system is provided to the target buyer so that the target buyer can decrypt the buyer price ciphertext through a buyer private key and generate the purchasing information aiming at the target goods after the decrypted price plaintext is confirmed;
the transaction unit 802, which performs a transfer operation according to the purchase information, includes: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
Optionally, the transaction unit 802 is further configured to:
and executing transfer operation according to the purchase information under the condition that the goods settlement transaction is received.
Optionally, the method further includes:
a generation unit 803 that generates a purchase number corresponding to the purchase information when the purchase information is acquired;
and the goods settlement transaction comprises the purchase number so as to indicate the block chain system to finish the transfer operation according to the purchase number.
Optionally, a server side balance ciphertext of the server side is further recorded in the block chain system, and the server side balance ciphertext is a homomorphic ciphertext of the account balance of the server side generated based on the public key of the server side;
the transaction unit 802 is further adapted to: deducting the proclaiming party procedure fee ciphertext from the proclaiming party residue ciphertext, and adding a service party procedure fee ciphertext into the service party residue ciphertext; the procuring party procuring charge ciphertext is generated by homomorphically encrypting the procuring party plaintext by the procuring party public key, the serving party procuring charge ciphertext is generated by homomorphically encrypting the procuring party plaintext by the serving party public key, and the procuring party plaintext is calculated by the target procuring party based on the procuring information, the price plaintext and the procuring rate of the target goods; alternatively, the first and second electrodes may be,
the trade amount plaintext corresponding to the trade amount ciphertext of the purchasing party comprises: calculating an initial transaction amount plaintext based on the purchase information and the price plaintext, and the commission fee plaintext; the transaction unit 802 is further adapted to: and adding the server party commission cipher text in the server party balance cipher text, wherein the server party commission cipher text is generated by carrying out homomorphic encryption on the commission plaintext by the server party public key.
Referring to fig. 9, the block chain-based goods transaction apparatus may be applied to the device shown in fig. 6 to implement the technical solution of the present specification. Wherein, this goods transaction device based on block chain is applied to the supplier, and the device can include:
a submitting unit 901, which submits a goods release transaction to a block chain system to release a supplier price ciphertext and a buyer price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key by homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key by homomorphic encryption of the price plaintext;
the buyer price ciphertext is acquired by the target buyer so that the target buyer can decrypt the buyer price ciphertext based on a buyer private key and generate purchasing information aiming at the target goods after confirming the decrypted price plaintext; after the purchasing information is acquired by the block chain system, the purchasing information is used for deducting a purchasing party transaction amount ciphertext calculated through the purchasing party price ciphertext and the purchasing information from a purchasing party balance ciphertext and adding a supplying party transaction amount ciphertext calculated through the supplying party price ciphertext and the purchasing information to a supplying party balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
Optionally, a server side balance ciphertext of the server side is further recorded in the block chain system, and the server side balance ciphertext is a homomorphic ciphertext of the account balance of the server side generated based on the public key of the server side; the device also includes:
a calculating unit 902, configured to calculate a commission fee plaintext to be consumed for the purchase based on the purchase information, the price plaintext, and the commission fee rate of the target item, perform homomorphic encryption on the commission fee plaintext through the supplier public key to obtain a supplier commission fee ciphertext, and perform homomorphic encryption on the commission fee plaintext through the server public key to obtain a server commission fee ciphertext; and submitting the supplier commission fee ciphertext and the server commission fee ciphertext to the blockchain system so as to instruct the blockchain system to deduct the supplier commission fee ciphertext from the supplier balance ciphertext and add the server commission fee ciphertext into the server balance ciphertext.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (24)

1. A blockchain-based item transaction method, comprising:
a goods supply direction block chain system submits goods release transaction so as to release a goods supply party price ciphertext and a purchasing party price ciphertext aiming at a target goods in the block chain system, wherein the goods supply party price ciphertext is generated by homomorphic encryption of a price plaintext set by a goods supply party for a target purchasing party through a goods supply party public key, and the purchasing party price ciphertext is generated by homomorphic encryption of the price plaintext through a purchasing party public key of the target purchasing party;
the target purchasing party decrypts the purchasing party price ciphertext issued in the block chain system based on a private key of the target purchasing party and generates purchasing information aiming at the target goods after confirming the decrypted price plaintext;
the blockchain system executes transfer operation according to the purchase information, and the transfer operation comprises the following steps: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
2. The method of claim 1, wherein the goods issuance transaction further comprises certification information generated by a zero-knowledge certification technology, wherein the certification information is used for indicating that the supplier price ciphertext and the buyer price ciphertext correspond to an equal price plaintext; the method further comprises the following steps:
and the block chain system verifies the certification information contained in the goods release transaction, and releases the supplier price ciphertext and the buyer price ciphertext only under the condition that the verification is passed.
3. The method of claim 1, further comprising:
the target purchasing party sends the purchasing information to the goods supplying party through a down-link channel so as to instruct the goods supplying party to provide the target goods according to the purchasing information; alternatively, the first and second electrodes may be,
and the block chain system transmits the purchasing information contained in the goods purchasing transaction to the supplier by executing the goods purchasing transaction submitted by the target purchasing party so as to instruct the supplier to provide the target goods to the target purchasing party according to the purchasing information.
4. The method of claim 1, further comprising:
the block chain system acquires the goods purchasing transaction submitted by the target purchasing party, wherein the goods purchasing transaction comprises the purchasing information;
and the block chain system executes the goods issuing contract called by the goods purchasing transaction so as to provide the target goods for the target purchasing party according to the purchasing information.
5. The method of claim 1, the blockchain system performing transfer operations based on the procurement information, comprising:
the blockchain system receives and executes a goods settlement transaction to complete the transfer operation.
6. The method of claim 5, wherein the first and second light sources are selected from the group consisting of,
further comprising: the block chain system generates a purchase number corresponding to the purchase information;
and the goods settlement transaction comprises the purchase number so as to indicate the block chain system to finish the transfer operation according to the purchase number.
7. The method of claim 5, further comprising:
under the condition that the supplier obtains the purchasing information, the goods supplier generates the goods settlement transaction based on the purchasing information and sends the goods settlement transaction to the block chain system; alternatively, the first and second electrodes may be,
after the target purchasing party generates the purchasing information, the target purchasing party generates the goods settlement transaction based on the purchasing information and sends the goods settlement transaction to the block chain system; alternatively, the first and second electrodes may be,
and the target purchasing party generates the goods settlement transaction and sends the goods settlement transaction to the block chain system under the condition of receiving the target goods returned by the supplier according to the purchasing information.
8. The method of claim 1, wherein a server side balance ciphertext of a server side is further recorded in the blockchain system, and the server side balance ciphertext is a homomorphic ciphertext of a server side account balance generated based on a server side public key;
the block chain system executes transfer operation according to the purchase information, and further comprises: the block chain system deducts a proclaiming party procedure fee ciphertext from the proclaiming party residue ciphertext and adds a service party procedure fee ciphertext to the service party residue ciphertext; the procuring party procedure fee ciphertext is generated by homomorphically encrypting the procuring party fee plaintext by the procuring party public key, the serving party procedure fee ciphertext is generated by homomorphically encrypting the procuring party fee plaintext by the serving party public key, and the procuring fee plaintext is obtained by calculating a procuring fee rate of the target procuring party based on the procuring information, the price plaintext and the target goods; alternatively, the first and second electrodes may be,
the trade amount plaintext corresponding to the trade amount ciphertext of the purchasing party comprises: calculating an initial transaction amount plaintext based on the purchase information and the price plaintext, and the commission fee plaintext; the block chain system executes transfer operation according to the purchase information, and further comprises: and the block chain system adds the server party procedure fee ciphertext to the server party residue ciphertext, and the server party procedure fee ciphertext is generated by carrying out homomorphic encryption on the procedure fee plaintext by the server party public key.
9. A block chain-based goods transaction method is applied to a target purchasing party, and comprises the following steps:
acquiring a buyer price ciphertext obtained by homomorphically encrypting a price plaintext of a target commodity through a buyer public key from a block chain system, decrypting the buyer price ciphertext through a buyer private key, and generating purchasing information aiming at the target commodity after the target buyer confirms the decrypted price plaintext;
and submitting the purchasing information to the block chain system or the supplier of the target goods.
10. The method of claim 9, further comprising:
sending the purchasing information to the supplier through a down-link channel so as to instruct the supplier to provide the target goods according to the purchasing information; alternatively, the first and second electrodes may be,
and generating a goods purchasing transaction based on the purchasing information, and sending the goods purchasing transaction to the block chain system, so that the block chain system can transmit the purchasing information to the supplier to indicate the supplier to provide the target goods to the target purchasing party according to the purchasing information.
11. The method of claim 9, wherein a server side balance ciphertext of the server side is further recorded in the blockchain system, and the server side balance ciphertext is a homomorphic ciphertext of an account balance of the server side generated based on a public key of the server side; the method further comprises the following steps:
calculating the commission fee plaintext required to be consumed by the purchase based on the purchase information, the price plaintext and the commission fee rate of the target goods, carrying out homomorphic encryption on the commission fee plaintext through the purchasing party public key to obtain a purchasing party commission fee ciphertext, and carrying out homomorphic encryption on the commission fee plaintext through the service party public key to obtain a service party commission fee ciphertext;
and submitting the procuring party procedure fee ciphertext and the service party procedure fee ciphertext to the block chain system so as to instruct the block chain system to deduct the procuring party procedure fee ciphertext from the procuring party surplus ciphertext and add the service party procedure fee ciphertext to the service party surplus ciphertext.
12. The method of claim 9, wherein a server side balance ciphertext of the server side is further recorded in the blockchain system, and the server side balance ciphertext is a homomorphic ciphertext of an account balance of the server side generated based on a public key of the server side; the method further comprises the following steps:
under the condition that an initial transaction amount plaintext required to be consumed by the current purchasing is obtained through calculation based on the purchasing information and the price plaintext, calculating a commission amount plaintext required to be consumed by the current purchasing based on the initial transaction amount plaintext and a commission fee rate of the target goods, taking the total amount of the initial transaction amount plaintext and the commission fee plaintext as a purchasing party transaction amount plaintext corresponding to the purchasing information, and performing homomorphic encryption on the purchasing party transaction plaintext through the purchasing party public key to obtain a purchasing party transaction amount ciphertext; and homomorphically encrypting the commission fee plaintext through the service party public key to obtain a service party commission fee ciphertext;
submitting the server commission cryptogram to the blockchain system to instruct the blockchain system to add the server commission cryptogram in the server commission cryptogram.
13. A block chain-based goods transaction method is applied to a block chain system, and comprises the following steps:
in response to a goods release transaction submitted by a supplier, releasing a buyer price ciphertext and a supplier price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; the buyer price ciphertext distributed in the block chain system is provided to the target buyer so that the target buyer can decrypt the buyer price ciphertext through a buyer private key and generate the purchasing information aiming at the target goods after the decrypted price plaintext is confirmed;
and executing transfer operation according to the purchase information, wherein the transfer operation comprises the following steps: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
14. The method of claim 13, wherein performing a transfer operation based on the procurement information comprises:
and executing transfer operation according to the purchase information under the condition that the goods settlement transaction is received.
15. The method of claim 14, wherein the first and second light sources are selected from the group consisting of,
further comprising: under the condition of acquiring the purchasing information, generating a purchasing number corresponding to the purchasing information;
and the goods settlement transaction comprises the purchase number so as to indicate the block chain system to finish the transfer operation according to the purchase number.
16. The method of claim 13, wherein a server side balance ciphertext of the server side is further recorded in the blockchain system, and the server side balance ciphertext is a homomorphic ciphertext of an account balance of the server side generated based on a public key of the server side;
the executing of the transfer operation according to the purchase information further comprises: deducting the proclaiming party procedure fee ciphertext from the proclaiming party residue ciphertext, and adding a service party procedure fee ciphertext into the service party residue ciphertext; the procuring party procuring charge ciphertext is generated by homomorphically encrypting the procuring party plaintext by the procuring party public key, the serving party procuring charge ciphertext is generated by homomorphically encrypting the procuring party plaintext by the serving party public key, and the procuring party plaintext is calculated by the target procuring party based on the procuring information, the price plaintext and the procuring rate of the target goods; alternatively, the first and second electrodes may be,
the trade amount plaintext corresponding to the trade amount ciphertext of the purchasing party comprises: calculating an initial transaction amount plaintext based on the purchase information and the price plaintext, and the commission fee plaintext; the executing of the transfer operation according to the purchase information further comprises: and adding the server party commission cipher text in the server party balance cipher text, wherein the server party commission cipher text is generated by carrying out homomorphic encryption on the commission plaintext by the server party public key.
17. A block chain-based goods transaction method applied to a supplier comprises the following steps:
submitting goods release transaction to a block chain system so as to release a supplier price ciphertext and a buyer price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext;
the buyer price ciphertext is acquired by the target buyer so that the target buyer can decrypt the buyer price ciphertext based on a buyer private key and generate purchasing information aiming at the target goods after confirming the decrypted price plaintext; after the purchasing information is acquired by the block chain system, the purchasing information is used for deducting a purchasing party transaction amount ciphertext calculated through the purchasing party price ciphertext and the purchasing information from a purchasing party balance ciphertext and adding a supplying party transaction amount ciphertext calculated through the supplying party price ciphertext and the purchasing information to a supplying party balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
18. The method of claim 17, wherein a server side balance ciphertext of the server side is further recorded in the blockchain system, and the server side balance ciphertext is a homomorphic ciphertext of an account balance of the server side generated based on a public key of the server side; the method further comprises the following steps:
calculating the commission fee plaintext required to be consumed by the purchase based on the purchase information, the price plaintext and the commission fee rate of the target goods, carrying out homomorphic encryption on the commission fee plaintext through the supplier public key to obtain a supplier commission fee ciphertext, and carrying out homomorphic encryption on the commission fee plaintext through the server public key to obtain a server commission fee ciphertext;
and submitting the supplier commission fee ciphertext and the server commission fee ciphertext to the blockchain system so as to instruct the blockchain system to deduct the supplier commission fee ciphertext from the supplier balance ciphertext and add the server commission fee ciphertext into the server balance ciphertext.
19. The method of claim 17, wherein a server side balance ciphertext of the server side is further recorded in the blockchain system, and the server side balance ciphertext is a homomorphic ciphertext of an account balance of the server side generated based on a public key of the server side; the method further comprises the following steps:
under the condition that an initial transaction amount plaintext required to be consumed by the current purchasing is obtained through calculation based on the purchasing information and the price plaintext, a commission fee plaintext required to be consumed by the current purchasing is calculated based on the initial transaction amount plaintext and a commission fee rate of the target goods, a difference value between the initial transaction amount plaintext and the commission fee plaintext is used as a supplier transaction amount plaintext corresponding to the purchasing information, and the supplier transaction amount plaintext is subjected to homomorphic encryption through the supplier public key to obtain a supplier transaction amount ciphertext; and homomorphically encrypting the commission fee plaintext through the service party public key to obtain a service party commission fee ciphertext;
submitting the server commission cryptogram to the blockchain system to instruct the blockchain system to add the server commission cryptogram in the server commission cryptogram.
20. A block chain-based goods transaction apparatus applied to a target buyer, the apparatus comprising:
the acquisition unit acquires a buyer price ciphertext obtained by homomorphically encrypting a price plaintext of a target commodity through a buyer public key from the block chain system, decrypts the buyer price ciphertext through a buyer private key, and generates purchasing information aiming at the target commodity after the target buyer confirms the decrypted price plaintext;
and the submitting unit is used for submitting the purchasing information to the block chain system or the supplier of the target goods.
21. A blockchain-based goods transaction apparatus applied to a blockchain system, the apparatus comprising:
the release unit responds to the goods release transaction submitted by a supplier, and releases a buyer price ciphertext and a supplier price ciphertext of a target goods in the block chain system, wherein the supplier price ciphertext is generated by a supplier public key through homomorphic encryption of a price plaintext set by the supplier for a target buyer, and the buyer price ciphertext is generated by a buyer public key through homomorphic encryption of the price plaintext; the buyer price ciphertext distributed in the block chain system is provided to the target buyer so that the target buyer can decrypt the buyer price ciphertext through a buyer private key and generate the purchasing information aiming at the target goods after the decrypted price plaintext is confirmed;
and the transaction unit executes transfer operation according to the purchase information, and comprises the following steps: deducting a buyer transaction amount ciphertext calculated through the buyer price ciphertext and the purchasing information from the buyer balance ciphertext, and adding a supplier transaction amount ciphertext calculated through the supplier price ciphertext and the purchasing information into the supplier balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
22. A block chain-based goods transaction apparatus for use with a supplier, the apparatus comprising:
the system comprises a submitting unit and a purchasing unit, wherein the submitting unit submits goods release transactions to a block chain system so as to release a supplier price ciphertext and a purchasing price ciphertext of a target goods in the block chain system, the supplier price ciphertext is generated by homomorphic encryption of a price plaintext set by a supplier for a target purchasing party through a supplier public key, and the purchasing price ciphertext is generated by homomorphic encryption of the price plaintext through a purchasing public key;
the buyer price ciphertext is acquired by the target buyer so that the target buyer can decrypt the buyer price ciphertext based on a buyer private key and generate purchasing information aiming at the target goods after confirming the decrypted price plaintext; after the purchasing information is acquired by the block chain system, the purchasing information is used for deducting a purchasing party transaction amount ciphertext calculated through the purchasing party price ciphertext and the purchasing information from a purchasing party balance ciphertext and adding a supplying party transaction amount ciphertext calculated through the supplying party price ciphertext and the purchasing information to a supplying party balance ciphertext; the buyer balance ciphertext is a homomorphic ciphertext of the buyer account balance generated based on the buyer public key, and the supplier balance ciphertext is a homomorphic ciphertext of the supplier account balance generated based on the supplier public key.
23. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 9-19 by executing the executable instructions.
24. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 9-19.
CN202110944034.6A 2021-08-17 2021-08-17 Block chain-based goods transaction method and device Pending CN113421096A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110944034.6A CN113421096A (en) 2021-08-17 2021-08-17 Block chain-based goods transaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110944034.6A CN113421096A (en) 2021-08-17 2021-08-17 Block chain-based goods transaction method and device

Publications (1)

Publication Number Publication Date
CN113421096A true CN113421096A (en) 2021-09-21

Family

ID=77719165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110944034.6A Pending CN113421096A (en) 2021-08-17 2021-08-17 Block chain-based goods transaction method and device

Country Status (1)

Country Link
CN (1) CN113421096A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114418769A (en) * 2022-01-27 2022-04-29 成都质数斯达克科技有限公司 Block chain transaction charging method and device and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190007197A1 (en) * 2017-06-29 2019-01-03 Microsoft Technology Licensing, Llc High-Precision Rational Number Arithmetic in Homomorphic Encryption
CN112651740A (en) * 2018-08-30 2021-04-13 创新先进技术有限公司 Block chain transaction method and device and electronic equipment
CN112883109A (en) * 2021-01-22 2021-06-01 支付宝(杭州)信息技术有限公司 Block chain-based digital commodity transaction method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190007197A1 (en) * 2017-06-29 2019-01-03 Microsoft Technology Licensing, Llc High-Precision Rational Number Arithmetic in Homomorphic Encryption
CN112651740A (en) * 2018-08-30 2021-04-13 创新先进技术有限公司 Block chain transaction method and device and electronic equipment
CN112883109A (en) * 2021-01-22 2021-06-01 支付宝(杭州)信息技术有限公司 Block chain-based digital commodity transaction method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114418769A (en) * 2022-01-27 2022-04-29 成都质数斯达克科技有限公司 Block chain transaction charging method and device and readable storage medium

Similar Documents

Publication Publication Date Title
US20220156738A1 (en) Methods and systems of using a cryptocurrency system to manage payments and payment alternatives
US11847621B2 (en) Systems and methods for math-based currency escrow transactions
KR102309819B1 (en) The trading system and the method based on a blockchain
US11694207B2 (en) Securing an exchange item associated with fraud
US20200013048A1 (en) Blockchain-based secure payment system
KR20200106130A (en) Method and device for protecting sensitive data of transaction activity based on smart contract in blockchain
US20120330846A1 (en) Dynamic electronic money
KR20170114905A (en) Elecronic device and electronic payement method using id-based public key cryptography
CN107852333A (en) System and method for the mandate of sharable content object
JPH10171887A (en) On-line shopping system
JP2008099138A (en) Anonymous order system, apparatus and program
US20200051068A1 (en) Dynamic provisioning of wallets in a secure payment system
CN106203980A (en) A kind of method of network payment, device, capital management server and system
JP2000357196A (en) Device and method for information processing, device and method for management, provided medium, system and method for providing information, and device for information transmission
CN113421096A (en) Block chain-based goods transaction method and device
US20200242573A1 (en) Cryptographic transactions supporting real world requirements
JP2023500260A (en) Proxy mutual ledger authentication
CN106203976A (en) Payment system based on same fund server and method of payment, device and server
CN106203986A (en) A kind of method of network payment, device, capital management server and system
JP6844828B1 (en) Information processing method, information processing device, information processing program and recording medium
WO2000057328A2 (en) Anonymous purchases while allowing verifiable identities for refunds returned along the paths taken to make the purchase
AU2015203621B2 (en) Dynamic electronic money
CN114140251B (en) Electronic ticket pledge method and system based on proxy re-encryption
CN117252702B (en) Block chain-based data asset transaction method and system
WO2018125234A1 (en) Anonymous electronic payment system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210921