WO2022120886A1 - Commodity transaction method and apparatus, computer device, storage medium, and system - Google Patents

Commodity transaction method and apparatus, computer device, storage medium, and system Download PDF

Info

Publication number
WO2022120886A1
WO2022120886A1 PCT/CN2020/136244 CN2020136244W WO2022120886A1 WO 2022120886 A1 WO2022120886 A1 WO 2022120886A1 CN 2020136244 W CN2020136244 W CN 2020136244W WO 2022120886 A1 WO2022120886 A1 WO 2022120886A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
transaction
commodity
buyer
seller
Prior art date
Application number
PCT/CN2020/136244
Other languages
French (fr)
Chinese (zh)
Inventor
刘宏伟
韦家全
张鹏
Original Assignee
深圳技术大学
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 深圳技术大学 filed Critical 深圳技术大学
Publication of WO2022120886A1 publication Critical patent/WO2022120886A1/en

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
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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/3825Use of electronic signatures
    • 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/3827Use of message hashing
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]

Definitions

  • the embodiments of the present invention relate to the field of blockchain technology, and in particular, to a commodity transaction method and device, computer equipment, storage medium and system.
  • the third-party-based digital commodity trading model still has the following problems: First, since the transaction is based on the complete trust of the buyer and the seller on the third-party platform and the fairness of the transaction depends on the third-party This behavior will over-rely on third-party platforms and increase the risk of transactions; secondly, third parties will charge transaction fees for transactions, resulting in high transaction costs for digital commodities; thirdly, the plaintext data of digital commodities is directly exposed to third-party platforms, lacking data privacy and copyright protection.
  • Embodiments of the present invention provide a commodity transaction method, device, computer equipment, and storage medium.
  • a technical solution adopted by the embodiments of the present invention is to provide a commodity trading method, characterized in that, the method is applied to a blockchain platform and includes the following steps:
  • the method further includes:
  • the method further includes:
  • the transaction is terminated, the prepayment is returned to the buyer's terminal, and the security deposit pre-stored in the blockchain platform by the seller's terminal is deducted.
  • the method further includes:
  • an embodiment of the present invention also provides a commodity trading device, including:
  • an acquisition module configured to receive the first ciphertext obtained by performing the first encryption on the commodity information of the digital commodity through the proxy re-encryption algorithm and sent by the seller's terminal;
  • the acquiring module is further configured to receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: prepayment for purchasing the digital commodity;
  • the processing module is used for judging whether the transaction request exists in the preset transaction list, and when the transaction request is not in the transaction list, triggering a transaction instruction, so that the seller terminal monitors the transaction request and follows the transaction request.
  • the transaction request generates a re-encryption key
  • an execution module configured to receive the re-encryption key sent by the seller's terminal and verify it, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal, and encrypting and converting the first ciphertext of the digital commodity and saving it as a second ciphertext, so that after the buyer terminal checks the second ciphertext and decrypts to obtain the symmetric key of the digital commodity,
  • the first ciphertext pre-uploaded by the seller terminal is decrypted according to the symmetric key to obtain the plaintext information of the digital commodity.
  • the first processing submodule is further configured to terminate the transaction when the re-encryption key sent by the seller terminal and the arbitration request sent by the buyer terminal are not received within a preset time period, and the The advance payment is returned to the buyer's terminal.
  • the first acquisition submodule is further configured to receive an arbitration request sent by the buyer terminal;
  • the second processing sub-module is to determine the attribution of the defaulting party, and when the defaulting party is the buyer, terminate the transaction and return the prepayment to the buyer's terminal;
  • the third processing sub-module when the defaulting party is the seller, terminates the transaction, returns the prepayment to the buyer's terminal and deducts the deposit pre-stored in the blockchain platform by the seller's terminal.
  • the fourth processing sub-module when the transaction request is in the transaction list or when the verification fails, terminate the transaction and return the prepayment to the buyer's terminal.
  • an embodiment of the present invention further provides a commodity trading system, including: a blockchain platform, a buyer's terminal, a seller's terminal, and a file management platform; wherein,
  • the seller terminal is used for the first ciphertext obtained by symmetrically encrypting the commodity information of the digital commodity and sending the first ciphertext to the blockchain platform and the file management platform;
  • the buyer terminal configured to send a transaction request for requesting to trade the digital commodity to the blockchain platform, wherein the transaction request includes: prepayment for purchasing the digital commodity;
  • the blockchain platform is used to determine whether the transaction request exists in a preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction;
  • the seller terminal configured to monitor the transaction request and generate a re-encryption key according to the transaction request, and send the re-encryption key to the blockchain platform;
  • the blockchain platform is configured to receive the re-encryption key and perform verification, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal, and encrypting and converting the first ciphertext of the digital commodity and saving it as the second ciphertext;
  • the buyer's terminal configured to obtain the second ciphertext and decrypt it to obtain the symmetric key of the digital commodity and send it to the file management platform;
  • the file management platform is configured to decrypt the first ciphertext according to the symmetric key to obtain plaintext information of the digital commodity.
  • an embodiment of the present invention further provides a computer device, including a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, all The processor executes the steps of the commodity transaction method described above.
  • an embodiment of the present invention further provides a storage medium storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors execute the above-mentioned Describe the steps of the commodity trading method.
  • the commodity transaction method is applied to the blockchain, and the fair transaction of digital commodities can be realized with the help of blockchain, and the issuance of digital commodities and the collection of payments can be realized.
  • the openness of the blockchain it can avoid excessive dependence on third-party trust, reduce transaction risks, and use the blockchain platform to reduce costs.
  • the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
  • FIG. 1 is a schematic diagram of a basic flow of a commodity trading method provided by an embodiment of the present invention
  • FIG. 2 is a basic structural block diagram of a commodity trading device provided by an embodiment of the present invention.
  • FIG. 3 is a basic structural block diagram of a commodity trading system provided by an embodiment of the present invention.
  • FIG. 4 is a basic structural block diagram of a computer device provided by an embodiment of the present invention.
  • terminal and terminal device used here include both a wireless signal receiver device that only has a wireless signal receiver without transmission capability, and a device that includes receiving and transmitting hardware.
  • Such equipment may include: cellular or other communication equipment, which has a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service, personal communication system), which can combine voice, data Processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, pager, Internet/Intranet access, web browser, notepad, calendar and/or GPS (Global Positioning System (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other device having and/or including a conventional laptop and/or palmtop computer or other device with a radio frequency receiver.
  • PCS Personal Communications Service, personal communication system
  • PDA Personal Digital Assistant
  • GPS Global Positioning System (Global Positioning System) receiver
  • conventional laptop and/or palmtop computer or other device having and/or including a conventional laptop and/or palmtop computer or other device with a radio frequency receiver.
  • terminal may be portable, transportable, mounted in a vehicle (air, marine and/or land), or adapted and/or configured to operate locally, and/or In distributed form, run at any other location on Earth and/or in space.
  • the "terminal” and “terminal device” used here can also be a communication terminal, an Internet terminal, and a music/video playback terminal, such as a PDA, a MID (Mobile Internet Device) and/or a music/video playback terminal. It can also be a smart TV, a set-top box and other devices.
  • FIG. 1 is a schematic diagram of a basic flow of a commodity trading method provided by an embodiment of the present invention, wherein the commodity trading method is applied to a blockchain, and the method includes the following steps:
  • the seller is the party that has the right to sell digital commodities, which may be the producer of the digital commodity, or the party that only has the right to sell, wherein the seller has an Ethereum account in the Ethereum smart contract, which is used for The prepayment paid by the buyer is withdrawn after the transaction is successful.
  • the blockchain platform receives the first ciphertext sent by the seller's terminal and stores it in the blockchain platform.
  • the blockchain has the characteristics of decentralization, openness, and non-tampering.
  • using the blockchain platform to realize commodity transactions can ensure the fairness and justice of transactions to the greatest extent, and reduce transaction risks. Reduce transaction costs.
  • the blockchain platform used in this embodiment is the Ethereum smart contract, in which the smart contract is deployed by the seller, and the buyer and seller complete the digital commodity transaction by interacting with the smart contract. Arbitration in the event of a dispute.
  • the funds involved in the digital commodities in this embodiment are ether.
  • the commodity information represents information such as the name, attribute, and purpose of the digital commodity, which is used to display the sold digital commodity to the buyer.
  • the commodity information can be symmetrically encrypted, and the encryption algorithm used can be DES, AES, etc.
  • the first ciphertext is the ciphertext obtained by symmetrically encrypting the commodity information.
  • the seller terminal performs symmetric encryption on the digital commodity M to obtain the ciphertext M': M' ⁇ SE.Enc(M,K).
  • the symmetric key K is randomly selected.
  • the seller terminal uploads M' to the file management platform, that is, a distributed file system (IPFS, Inter Planetary File System) for storing commodity information of digital commodities.
  • IPFS returns the hash value IPFShash.
  • the seller terminal runs the UPPRE.Enc algorithm to encrypt the symmetric key K, obtains the first ciphertext CT i of K, and uses the private key to sign CT i
  • the seller when When the seller is not the producer of digital goods, it should obtain this signature from the producer of digital goods. Encode param, CT i , IPFShash, p i and Sig into the Ethereum smart contract, then the seller deploys the Ethereum smart contract into Ethereum and deposits the security deposit into the Ethereum smart contract.
  • x i1 and x i2 are random numbers.
  • S102 Receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: a prepayment for purchasing the digital commodity;
  • the buyer also has an Ethereum account in the Ethereum smart contract, which is mainly used for interacting with the smart contract, depositing the prepayment into the smart contract, and obtaining the plaintext of the digital commodity.
  • x j1 and x j2 are random numbers.
  • the buyer terminal uses the algorithm UPPRE.RequestGen to generate request information R, which includes the intermediate value ⁇ , g 2 , and the public key pk j1 . And send the prepayment and request information R to the smart contract to apply for the purchase of digital goods.
  • S103 Determine whether the transaction request exists in a preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction, so that the seller terminal monitors the transaction request and executes the transaction according to the transaction request. request to generate a re-encryption key;
  • the preset transaction list is used to store the accepted transaction request information R.
  • the Ethereum smart contract receives the transaction request (R) sent by the buyer's terminal, it will first check whether the pk j1 in R is It exists in the preset transaction list. If it already exists, the request information R will be rejected and the advance payment will be returned. Otherwise, the request message R is received.
  • R is added to the list pk j1 , and at the same time, the Ethereum smart contract triggers the transaction instruction, so that the event is monitored by the seller's terminal, which is used to inform the seller's terminal that the smart contract is waiting for the seller to submit the re-encryption key.
  • S104 Receive the re-encryption key sent by the seller's terminal and verify it, and when the verification is passed, encrypt and convert the first ciphertext of the digital commodity and save it as a second ciphertext, and store the transaction After requesting to be added to the transaction list and sending the prepayment to the seller terminal, so that the buyer terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity, and then file management
  • the platform decrypts the symmetric encrypted ciphertext pre-uploaded by the seller terminal according to the symmetric key to obtain the plaintext information of the digital commodity.
  • the seller terminal monitors the transaction request R sent by the buyer terminal, it uses the algorithm UPPRE.RekeyGen to generate a re-encryption key And submit it to the blockchain platform, namely the Ethereum smart contract, the Ethereum smart contract receives the submitted Then execute the algorithm UPPRE.VerifyRekey to verify correctness when re-encrypting the key If it is correct, the verification is passed, the transaction request R is added to the transaction list pk j1 and the prepayment is sent to the seller terminal, and the first ciphertext of the digital commodity is encrypted and converted and saved as the second ciphertext.
  • the Ethereum smart contract can output the second ciphertext CT j by executing the algorithm UPPRE.ReEnc.
  • the buyer's terminal can view the second ciphertext CT j in the account in the Ethereum smart contract and use sk j to decrypt CT j by executing the decryption algorithm UPPRE.Dec to obtain the symmetric key K: K ⁇ UPPRE.Dec
  • the buyer's terminal downloads M' in the file management platform (IPFS) according to IPFShash and decrypts to obtain the digital commodity plaintext M: M ⁇ SE.Dec(M', K).
  • IPFS file management platform
  • the commodity transaction method is applied to the blockchain, and the fair transaction of digital commodities is realized by means of the blockchain.
  • the openness of the blockchain it can avoid excessive dependence on third-party trust and reduce transaction risks.
  • using the blockchain platform can also reduce costs.
  • the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
  • the transaction in order to ensure the smooth progress of the commodity transaction and improve the transaction efficiency, can be terminated in time when the transaction is not completed within the preset time period, that is, the transaction is not received within the preset time period.
  • the re-encryption key is sent by the seller's terminal and the arbitration request sent by the buyer's terminal is not received, the transaction is terminated, and the prepayment is returned to the buyer's terminal.
  • an arbitration method comprising the following steps:
  • Step 1 receiving the arbitration request sent by the buyer terminal
  • the content Ethereum smart contract does not receive the re-encryption key sent by the seller's terminal in the preset time period, it can submit an arbitration request.
  • Step 2 Judging the ownership of the defaulting party, when the defaulting party is the buyer, terminate the transaction and return the prepayment to the buyer's terminal;
  • Step 3 When the defaulting party is the seller, terminate the transaction, return the prepayment to the buyer's terminal and deduct the deposit pre-stored in the blockchain platform by the seller's terminal.
  • the blockchain platform that is, the Ethereum smart contract, passes the verification equation with the equation established at the same time. If the above equations are not established at the same time, the smart contract determines that the buyer is in breach of contract, terminates the transaction, and refunds the advance payment. If the above equations are established at the same time, the smart contract determines that the seller is in breach of contract. The smart contract then deducts part of the seller's deposit as a penalty, returns the advance payment to the buyer, and terminates the transaction.
  • the method further includes:
  • Embodiments of the present invention also provide a commodity trading device. Please refer to FIG. 2 for details.
  • FIG. 2 is a block diagram of the basic structure of the commodity trading apparatus according to this embodiment.
  • a commodity trading device includes: an acquisition module 2100 , a processing module 2200 and an execution module 2300 .
  • the obtaining module 2100 is used to receive the first ciphertext obtained by performing the first encryption of the proxy re-encryption algorithm on the commodity information of the digital commodity sent by the seller's terminal; the obtaining module 2100 is also used to receive the request sent by the buyer's terminal A transaction request for trading the digital commodity, wherein the transaction request includes: a prepayment for purchasing the digital commodity;
  • the processing module 2200 is configured to determine whether the transaction request exists in the preset transaction list, when the When the transaction request is not in the transaction list, trigger a transaction instruction, so that the seller terminal monitors the transaction request and generates a re-encryption key according to the transaction request; the execution module 2300 is configured to receive the information sent by the seller terminal.
  • the re-encryption key is verified, and when the verification is passed, the first ciphertext of the digital commodity is encrypted and converted and saved as the second ciphertext, and the transaction request is added to the transaction list and Send the prepayment to the seller terminal, so that the buyer terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity, and then decrypt according to the symmetric key in the file management platform
  • the symmetric encrypted ciphertext pre-uploaded by the seller terminal obtains the plaintext information of the digital commodity.
  • the commodity trading method is applied to the blockchain, and the transaction of digital commodities is realized by means of the blockchain.
  • Fair trade realize the issuance of digital goods and the collection of payments, and at the same time, due to the openness of the blockchain, it can avoid excessive reliance on third-party trust, reduce transaction risks, and use the blockchain platform to reduce costs.
  • the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
  • it further includes: a first processing submodule, further configured to not receive the re-encryption key sent by the seller terminal and not receive the re-encryption key sent by the buyer terminal within a preset time period In the event of an arbitration request, the transaction is terminated and the advance payment is returned to the buyer's terminal.
  • it further includes: a first acquiring sub-module, which is further configured to receive an arbitration request sent by the buyer terminal; a second processing sub-module, which determines the attribution of the defaulting party, and when the defaulting party is the buyer, terminates the transaction and sends The prepayment is returned to the buyer's terminal; the third processing sub-module, when the defaulting party is the seller, terminates the transaction, returns the prepayment to the buyer's terminal and deducts the seller's terminal to pre-store in the area Margin in a blockchain platform.
  • it further includes: a fourth processing sub-module, which terminates the transaction and returns the prepayment to the buyer terminal when the transaction request is in the transaction list or when the verification fails.
  • the embodiment of the present invention also provides a commodity trading system.
  • the commodity trading system includes: a blockchain platform 301, a buyer terminal 302, a seller terminal 303 and a file management platform 304; wherein,
  • the seller terminal 303 is used for the first ciphertext obtained by symmetrically encrypting the commodity information of the digital commodity and sending the first ciphertext to the blockchain platform 301 and the file management platform 304;
  • the buyer terminal 302 is configured to send a transaction request for requesting to trade the digital commodity to the blockchain platform 301, wherein the transaction request includes: prepayment for purchasing the digital commodity;
  • the blockchain platform 301 is configured to determine whether the transaction request exists in a preset transaction list, and trigger a transaction instruction when the transaction request is not in the transaction list;
  • the seller terminal 303 configured to monitor the transaction request and generate a re-encryption key according to the transaction request, and send the re-encryption key to the blockchain platform 301;
  • the blockchain platform 301 is configured to receive the re-encryption key and perform verification, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal 303, and encrypting and converting the first ciphertext of the digital commodity and saving it as a second ciphertext;
  • the buyer terminal 302 is used to obtain the second ciphertext and decrypt it to obtain the symmetric key of the digital commodity and send it to the file management platform 304;
  • the file management platform 304 is configured to decrypt the first ciphertext according to the symmetric key to obtain plaintext information of the digital commodity.
  • the commodity trading method is applied to the blockchain, and the fair transaction of digital commodities is realized by means of the blockchain. , to realize the issuance of digital goods and the collection of payments.
  • the openness of the blockchain it can avoid excessive dependence on third-party trust and reduce transaction risks.
  • the use of the blockchain platform can also reduce costs.
  • the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
  • FIG. 4 is a block diagram of a basic structure of a computer device according to this embodiment.
  • the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus.
  • the non-volatile storage medium of the computer device stores an operating system, a database and computer-readable instructions
  • the database may store a sequence of control information.
  • the processor can realize a A commodity trading method.
  • the processor of the computer device is used to provide computing and control capabilities and support the operation of the entire computer device.
  • Computer readable instructions may be stored in the memory of the computer device, and when executed by the processor, the computer readable instructions may cause the processor to perform a method of trading commodities.
  • the network interface of the computer equipment is used for communication with the terminal connection.
  • FIG. 4 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • the processor is used to execute the specific content of the acquisition module 2100 , the processing module 2200 and the execution module 2300 in FIG. 2 , and the memory stores program codes and various types of data required to execute the above modules.
  • the network interface is used for data transmission between user terminals or servers.
  • the memory in this embodiment stores the program codes and data required to execute all the sub-modules in the commodity transaction method, and the server can call the server's program codes and data to execute the functions of all the sub-modules.
  • the commodity transaction method is applied to the blockchain, and the fair transaction of digital commodities can be realized by means of the blockchain. Realize the issuance of digital goods and the collection of payments. At the same time, due to the openness of the blockchain, it can avoid excessive dependence on third-party trust and reduce transaction risks. At the same time, the use of the blockchain platform can also reduce costs.
  • the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
  • the present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the commodity trading method described in any of the foregoing embodiments A step of.
  • the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods.
  • the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.

Landscapes

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

Abstract

A commodity transaction method, an apparatus, a computer device, a storage medium and a system. Said method is applied to a blockchain platform, and comprises: receiving first ciphertext sent by a seller terminal and obtained after performing first encryption on commodity information of a digital commodity using a proxy re-encryption algorithm (S101); receiving a transaction request sent by the buyer terminal for requesting to transact the digital commodity (S102); determining whether the transaction request is present in a preset transaction list, when the transaction request is not in the transaction list, triggering a transaction instruction, so that the seller terminal monitors the transaction request and generates a re-encryption key according to the transaction request (S103); and receiving the re-encryption key sent by the seller terminal and performing verification, when the verification is passed, encrypting and converting the first ciphertext of the digital commodity and saving same into second ciphertext, adding the transaction request to the transaction list, and sending the pre-payment to the seller terminal, so that the buyer terminal decrypts the symmetric key, and decrypts the plaintext information of the digital commodity in the file management platform (S104).

Description

商品交易方法和装置、计算机设备、存储介质及系统Commodity transaction method and device, computer equipment, storage medium and system 技术领域technical field
本发明实施例涉及区块链技术领域,尤其是一种商品交易方法和装置、计算机设备、存储介质及系统。The embodiments of the present invention relate to the field of blockchain technology, and in particular, to a commodity transaction method and device, computer equipment, storage medium and system.
背景技术Background technique
随着信息技术的发展,以往通过纸张、录音磁带、光盘等物质载体作为媒介交易的书籍、软件、音乐、电影等产品,如今都可以通过网络以电子方式进行交付。这种通过网络进行传输和交付,可以直接通过网络供给的无形商品,被称为数字商品。为了保障数字商品交易的公平性,避免卖方或者买方出现不诚实行为,常见策略是引入第三方权威参与数字商品交易,一方面确保买方在付款后就一定能得到数字商品,另一方面保障卖方在数字商品交易后得到款项,由此保证数字商品交易的公平性。With the development of information technology, books, software, music, movies and other products that used to be traded through material carriers such as paper, audio tapes, and CD-ROMs can now be delivered electronically through the Internet. Such intangible goods that are transmitted and delivered through the network and can be supplied directly through the network are called digital goods. In order to ensure the fairness of digital commodity transactions and avoid dishonest behavior by sellers or buyers, a common strategy is to introduce a third-party authority to participate in digital commodity transactions. After the digital commodity is traded, the payment is obtained, thereby ensuring the fairness of the digital commodity transaction.
虽然第三方承担了事前担保、解决纠纷等功能,但基于第三方的数字商品交易模式仍然存在以下问题:首先,由于交易基于买卖双方对第三方平台的完全信任且交易的公平性取决于第三方行为这样会过分依赖第三方平台,增加了交易的风险;其次,第三方会针对交易抽取交易费用,致使数字商品交易成本高;再次,数字商品的明文数据直接暴露给第三方平台,缺乏数据隐私与版权防护。Although the third party undertakes functions such as pre-guarantee and dispute resolution, the third-party-based digital commodity trading model still has the following problems: First, since the transaction is based on the complete trust of the buyer and the seller on the third-party platform and the fairness of the transaction depends on the third-party This behavior will over-rely on third-party platforms and increase the risk of transactions; secondly, third parties will charge transaction fees for transactions, resulting in high transaction costs for digital commodities; thirdly, the plaintext data of digital commodities is directly exposed to third-party platforms, lacking data privacy and copyright protection.
技术问题technical problem
本发明实施例提供一种商品交易方法、装置、计算机设备及存储介质。Embodiments of the present invention provide a commodity transaction method, device, computer equipment, and storage medium.
技术解决方案technical solutions
为解决上述技术问题,本发明创造的实施例采用的一个技术方案是:提供一种商品交易方法,其特征在于,所述方法应用于区块链平台,包括下述步骤:In order to solve the above technical problems, a technical solution adopted by the embodiments of the present invention is to provide a commodity trading method, characterized in that, the method is applied to a blockchain platform and includes the following steps:
接收卖方终端发送的对数字商品的商品信息进行代理重加密算法进行第一次加密后得到的第一密文;Receive the first ciphertext sent by the seller's terminal after performing the first encryption on the commodity information of the digital commodity by the proxy re-encryption algorithm;
接收买方终端发送的请求交易所述数字商品的交易请求,其中,所述交易请求包括:购买所述数字商品的预付款;Receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: a prepayment for purchasing the digital commodity;
判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令,以使所述卖方终端监控所述交易请求并按照所述交易请求生成重加密密钥;Determine whether the transaction request exists in the preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction, so that the seller terminal monitors the transaction request and generates according to the transaction request re-encryption key;
接收所述卖方终端发送的所述重加密密钥并进行验证,当验证通过时,对所述数字商品的第一密文进行加密转换并保存为第二密文,以及将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以使所述买方终端查看所述第二密文并解密得到所述数字商品的对称密钥后,在文件管理平台中按照所述对称密钥解密所述卖方终端预先上传的对称加密的密文,得到所述数字商品的明文信息。Receive the re-encryption key sent by the seller terminal and verify it, when the verification is passed, encrypt and convert the first ciphertext of the digital commodity and save it as the second ciphertext, and add the transaction request to the transaction list and send the prepayment to the seller's terminal, so that the buyer's terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity. Decrypt the symmetric encrypted ciphertext pre-uploaded by the seller terminal according to the symmetric key to obtain the plaintext information of the digital commodity.
可选地,所述方法还包括:Optionally, the method further includes:
在预设的时间段内没有接收到所述卖方终端发送的所述重加密密钥且没有接收到所述买方终端发送的仲裁请求时,终止交易,将所述预付款退回至所述买方终端。When the re-encryption key sent by the seller terminal and the arbitration request sent by the buyer terminal are not received within a preset time period, the transaction is terminated, and the prepayment is returned to the buyer terminal .
可选地,所述方法还包括:Optionally, the method further includes:
接收所述买方终端发送的仲裁请求;receiving an arbitration request sent by the buyer's terminal;
判断违约方归属,当违约方为买方时,终止交易并将所述预付款 退回至所述买方终端;Determine the attribution of the defaulting party, when the defaulting party is the buyer, terminate the transaction and return the advance payment to the buyer's terminal;
当违约方为卖方时,终止交易,将所述预付款退回至所述买方终端以及扣除所述卖方终端预先存储到所述区块链平台中的保证金。When the defaulting party is the seller, the transaction is terminated, the prepayment is returned to the buyer's terminal, and the security deposit pre-stored in the blockchain platform by the seller's terminal is deducted.
可选地,所述方法还包括:Optionally, the method further includes:
当所述交易请求在所述交易列表中或者当验证没有通过时,终止交易并将所述预付款退回至所述买方终端。When the transaction request is in the transaction list or when the verification fails, the transaction is terminated and the prepayment is returned to the buyer's terminal.
为解决上述技术问题,本发明实施例还提供一种商品交易装置,包括:In order to solve the above technical problems, an embodiment of the present invention also provides a commodity trading device, including:
获取模块,用于接收卖方终端发送的对数字商品的商品信息进行代理重加密算法进行第一次加密后得到的第一密文;an acquisition module, configured to receive the first ciphertext obtained by performing the first encryption on the commodity information of the digital commodity through the proxy re-encryption algorithm and sent by the seller's terminal;
所述获取模块,还用于接收买方终端发送的请求交易所述数字商品的交易请求,其中,所述交易请求包括:购买所述数字商品的预付款;The acquiring module is further configured to receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: prepayment for purchasing the digital commodity;
处理模块,用于判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令,以使所述卖方终端监控所述交易请求并按照所述交易请求生成重加密密钥;The processing module is used for judging whether the transaction request exists in the preset transaction list, and when the transaction request is not in the transaction list, triggering a transaction instruction, so that the seller terminal monitors the transaction request and follows the transaction request. the transaction request generates a re-encryption key;
执行模块,用于接收所述卖方终端发送的所述重加密密钥并进行验证,当验证通过时,将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以及对所述数字商品的第一密文进行加密转换并保存为第二密文,以使所述买方终端查看所述第二密文并解密得到所述数字商品的对称密钥后,在文件管理平台中按照所述对称密钥解密所述卖方终端预先上传的第一密文,得到所述数字商品的明文信息。an execution module, configured to receive the re-encryption key sent by the seller's terminal and verify it, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal, and encrypting and converting the first ciphertext of the digital commodity and saving it as a second ciphertext, so that after the buyer terminal checks the second ciphertext and decrypts to obtain the symmetric key of the digital commodity, In the file management platform, the first ciphertext pre-uploaded by the seller terminal is decrypted according to the symmetric key to obtain the plaintext information of the digital commodity.
可选地,还包括:Optionally, also include:
第一处理子模块,还用于在预设的时间段内没有接收到所述卖方 终端发送的所述重加密密钥且没有接收到所述买方终端发送的仲裁请求时,终止交易,将所述预付款退回至所述买方终端。The first processing submodule is further configured to terminate the transaction when the re-encryption key sent by the seller terminal and the arbitration request sent by the buyer terminal are not received within a preset time period, and the The advance payment is returned to the buyer's terminal.
可选地,还包括:Optionally, also include:
第一获取子模块,还用于接收所述买方终端发送的仲裁请求;The first acquisition submodule is further configured to receive an arbitration request sent by the buyer terminal;
第二处理子模块,判断违约方归属,当违约方为买方时,终止交易并将所述预付款退回至所述买方终端;The second processing sub-module is to determine the attribution of the defaulting party, and when the defaulting party is the buyer, terminate the transaction and return the prepayment to the buyer's terminal;
第三处理子模块,当违约方为卖方时,终止交易,将所述预付款退回至所述买方终端以及扣除所述卖方终端预先存储到所述区块链平台中的保证金。The third processing sub-module, when the defaulting party is the seller, terminates the transaction, returns the prepayment to the buyer's terminal and deducts the deposit pre-stored in the blockchain platform by the seller's terminal.
可选地,还包括:Optionally, also include:
第四处理子模块,当所述交易请求在所述交易列表中或者当验证没有通过时,终止交易并将所述预付款退回至所述买方终端。The fourth processing sub-module, when the transaction request is in the transaction list or when the verification fails, terminate the transaction and return the prepayment to the buyer's terminal.
为解决上述技术问题,本发明实施例还提供一种商品交易系统,包括:区块链平台、买方终端、卖方终端和文件管理平台;其中,In order to solve the above technical problems, an embodiment of the present invention further provides a commodity trading system, including: a blockchain platform, a buyer's terminal, a seller's terminal, and a file management platform; wherein,
所述卖方终端,用于对数字商品的商品信息进行对称加密后得到的第一密文并将所述第一密文发送给所述区块链平台和所述文件管理平台;The seller terminal is used for the first ciphertext obtained by symmetrically encrypting the commodity information of the digital commodity and sending the first ciphertext to the blockchain platform and the file management platform;
所述买方终端,用于发送请求交易所述数字商品的交易请求给所述区块链平台,其中,所述交易请求包括:购买所述数字商品的预付款;the buyer terminal, configured to send a transaction request for requesting to trade the digital commodity to the blockchain platform, wherein the transaction request includes: prepayment for purchasing the digital commodity;
所述区块链平台,用于判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令;The blockchain platform is used to determine whether the transaction request exists in a preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction;
所述卖方终端,用于监控所述交易请求并按照所述交易请求生成重加密密钥,以及将所述重加密密钥发送给所述区块链平台;the seller terminal, configured to monitor the transaction request and generate a re-encryption key according to the transaction request, and send the re-encryption key to the blockchain platform;
所述区块链平台,用于接收所述重加密密钥并进行验证,当验证 通过时,将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以及对所述数字商品的第一密文进行加密转换并保存为第二密文;the blockchain platform is configured to receive the re-encryption key and perform verification, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal, and encrypting and converting the first ciphertext of the digital commodity and saving it as the second ciphertext;
所述买方终端,用于获取所述第二密文并进行解密得到所述数字商品的对称密钥并发送至所述文件管理平台;the buyer's terminal, configured to obtain the second ciphertext and decrypt it to obtain the symmetric key of the digital commodity and send it to the file management platform;
所述文件管理平台,用于按照所述对称密钥对所述第一密文进行解密得到所述数字商品的明文信息。The file management platform is configured to decrypt the first ciphertext according to the symmetric key to obtain plaintext information of the digital commodity.
为解决上述技术问题,本发明实施例还提供一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行上述所述商品交易方法的步骤。To solve the above technical problem, an embodiment of the present invention further provides a computer device, including a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, all The processor executes the steps of the commodity transaction method described above.
为解决上述技术问题,本发明实施例还提供一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述所述商品交易方法的步骤。In order to solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the above-mentioned Describe the steps of the commodity trading method.
有益效果beneficial effect
由于区块链具有去中心化、公开可查、不可篡改等特点,将该商品交易方法应用于区块链,借助于区块链实现数字商品的公平交易,实现数字商品的发放与款项的收取,同时由于区块链的公开性可以避免对第三方信任度上的过度依赖,减小交易风险,同时利用区块链平台还可以降低成本。此外,在数字商品隐私保护方面,通过对商品信息进行重加密处理,能够在数字商品被加密的前提下实施解密权限的委托,当且仅当买方付款后获得数字商品的委托解密权限,增强了私密性。Since the blockchain has the characteristics of decentralization, openness, and non-tampering, the commodity transaction method is applied to the blockchain, and the fair transaction of digital commodities can be realized with the help of blockchain, and the issuance of digital commodities and the collection of payments can be realized. At the same time, due to the openness of the blockchain, it can avoid excessive dependence on third-party trust, reduce transaction risks, and use the blockchain platform to reduce costs. In addition, in terms of privacy protection of digital commodities, by re-encrypting commodity information, the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例 描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1为本发明实施例提供的商品交易方法的基本流程示意图;FIG. 1 is a schematic diagram of a basic flow of a commodity trading method provided by an embodiment of the present invention;
图2为本发明实施例提供的商品交易装置基本结构框图;FIG. 2 is a basic structural block diagram of a commodity trading device provided by an embodiment of the present invention;
图3为本发明实施例提供的商品交易系统基本结构框图;FIG. 3 is a basic structural block diagram of a commodity trading system provided by an embodiment of the present invention;
图4为本发明实施例提供的计算机设备基本结构框图。FIG. 4 is a basic structural block diagram of a computer device provided by an embodiment of the present invention.
本发明的具体实施方式DETAILED DESCRIPTION OF THE INVENTION
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。In order for those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
在本发明的说明书和权利要求书及上述附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如101、102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。In some of the processes described in the description and claims of the present invention and the above-mentioned drawings, various operations are included in a specific order, but it should be clearly understood that these operations may not be in accordance with the order in which they appear herein. For execution or parallel execution, the sequence numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. Additionally, these flows may include more or fewer operations, and these operations may be performed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit "first" and "second" are different types.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
实施例Example
本技术领域技术人员可以理解,这里所使用的“终端”、“终端设备”既包括无线信号接收器的设备,其仅具备无发射能力的无线信号接收器的设备,又包括接收和发射硬件的设备,其具有能够在双向通信链路上,执行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备;PCS(Personal Communications Service,个人通信系统),其可以组合语音、数据处理、传真和/或数据通信能力;PDA(Personal Digital Assistant,个人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、日历和/或GPS(Global Positioning System,全球定位系统)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“终端”、“终端设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“终端”、“终端设备”还可以是通信终端、上网终端、音乐/视频播放终端,例如可以是PDA、MID(Mobile Internet Device,移动互联网设备)和/或具有音乐/视频播放功能的移动电话,也可以是智能电视、机顶盒等设备。Those skilled in the art can understand that the "terminal" and "terminal device" used here include both a wireless signal receiver device that only has a wireless signal receiver without transmission capability, and a device that includes receiving and transmitting hardware. A device having receive and transmit hardware capable of performing two-way communications over a two-way communication link. Such equipment may include: cellular or other communication equipment, which has a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service, personal communication system), which can combine voice, data Processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, pager, Internet/Intranet access, web browser, notepad, calendar and/or GPS (Global Positioning System (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other device having and/or including a conventional laptop and/or palmtop computer or other device with a radio frequency receiver. As used herein, "terminal", "terminal equipment" may be portable, transportable, mounted in a vehicle (air, marine and/or land), or adapted and/or configured to operate locally, and/or In distributed form, run at any other location on Earth and/or in space. The "terminal" and "terminal device" used here can also be a communication terminal, an Internet terminal, and a music/video playback terminal, such as a PDA, a MID (Mobile Internet Device) and/or a music/video playback terminal. It can also be a smart TV, a set-top box and other devices.
如图1所示,图1为本发明实施例提供的一种商品交易方法的基本流程示意图,其中,该商品交易方法应用于区块链,该方法包括下述步骤:As shown in FIG. 1, FIG. 1 is a schematic diagram of a basic flow of a commodity trading method provided by an embodiment of the present invention, wherein the commodity trading method is applied to a blockchain, and the method includes the following steps:
S101、接收卖方终端发送的对数字商品的商品信息进行代理重加密算法进行第一次加密后得到的第一密文;S101. Receive a first ciphertext obtained by performing the first encryption of the commodity information of the digital commodity through the proxy re-encryption algorithm and sent by the seller's terminal;
本实施例中,卖方为拥有数字商品售卖权的一方,其可以为数字商品的生产者,也可以为仅拥有售卖权的一方,其中,卖方在以太坊智能合约中拥有以太坊账户,用于在交易成功后提取买方支付的预付款。In this embodiment, the seller is the party that has the right to sell digital commodities, which may be the producer of the digital commodity, or the party that only has the right to sell, wherein the seller has an Ethereum account in the Ethereum smart contract, which is used for The prepayment paid by the buyer is withdrawn after the transaction is successful.
本实施例中,为了便于交易,区块链平台接收卖方终端发送的第一密文,并存储于区块链平台中。需要说明的是,区块链具有去中心化、公开可查、不可篡改的特点,本实施例中,利用区块链平台实现商品交易可以最大程度的确保交易的公平公正,减小交易风险,降低交易成本。本实施例中采用的区块链平台为以太坊智能合约,其中,智能合约由卖方部署,买卖双方通过与智能合约交互完成数字商品交易,一方面管控买方预付款和卖方保证金,另一方面在出现争议时执行仲裁。本实施例中的数字商品所涉及的资金为以太币。本实施例中,商品信息表示数字商品的名称、属性、用途等方面的信息,其用于向买方展示售卖的数字商品。为了确保商品信息的私密性,卖方终端在发送商品信息时,可以对商品信息进行对称加密,采用的加密算法可以为DES,AES等,本实施例中定义对称加密算法为:SE={Enc,Dec}。其中,第一密文为对商品信息进行对称加密后的密文。In this embodiment, in order to facilitate transactions, the blockchain platform receives the first ciphertext sent by the seller's terminal and stores it in the blockchain platform. It should be noted that the blockchain has the characteristics of decentralization, openness, and non-tampering. In this embodiment, using the blockchain platform to realize commodity transactions can ensure the fairness and justice of transactions to the greatest extent, and reduce transaction risks. Reduce transaction costs. The blockchain platform used in this embodiment is the Ethereum smart contract, in which the smart contract is deployed by the seller, and the buyer and seller complete the digital commodity transaction by interacting with the smart contract. Arbitration in the event of a dispute. The funds involved in the digital commodities in this embodiment are ether. In this embodiment, the commodity information represents information such as the name, attribute, and purpose of the digital commodity, which is used to display the sold digital commodity to the buyer. In order to ensure the privacy of the commodity information, when the seller terminal sends the commodity information, the commodity information can be symmetrically encrypted, and the encryption algorithm used can be DES, AES, etc. The symmetric encryption algorithm defined in this embodiment is: SE={Enc, Dec}. The first ciphertext is the ciphertext obtained by symmetrically encrypting the commodity information.
本发明的一个实施例,卖方终端对数字商品M进行对称加密,得到密文M′:M′←SE.Enc(M,K)。其中对称密钥K随机选取。卖方终端将M′上传至文件管理平台,即分布式文件系统(IPFS,Inter Planetary File System)用于存放数字商品的商品信息。同时IPFS返回哈希值IPFShash。卖方终端运行UPPRE.Enc算法对对称密钥K加密,得到K的第一密文CT i,并使用私钥对CT i||IPFShash进行签名,签名结果记为Sig,在其他实施例中,当卖方不是数字商品生产者时,应向数字商品生产者获取这个签名。将param,CT i,IPFShash,pk i以及Sig编码到以太 坊智能合约中,然后卖方将此以太坊智能合约部署到以太坊中,并向以太坊智能合约里存入保证金。 In an embodiment of the present invention, the seller terminal performs symmetric encryption on the digital commodity M to obtain the ciphertext M': M'←SE.Enc(M,K). The symmetric key K is randomly selected. The seller terminal uploads M' to the file management platform, that is, a distributed file system (IPFS, Inter Planetary File System) for storing commodity information of digital commodities. At the same time, IPFS returns the hash value IPFShash. The seller terminal runs the UPPRE.Enc algorithm to encrypt the symmetric key K, obtains the first ciphertext CT i of K, and uses the private key to sign CT i ||IPFShash, and the signature result is recorded as Sig. In other embodiments, when When the seller is not the producer of digital goods, it should obtain this signature from the producer of digital goods. Encode param, CT i , IPFShash, p i and Sig into the Ethereum smart contract, then the seller deploys the Ethereum smart contract into Ethereum and deposits the security deposit into the Ethereum smart contract.
本发明的一个实施例,在步骤S101之前,对区块链平台进行系统初始化,与此同时,卖方运行UPPRE.Setup算法产生公共参数param,包括生成元g;运行UPPRE.KeyGen算法产生卖方的公私钥,记公钥pk i=(pk i1,pk i2),私钥sk i=(sk i1,sk i2)=(x i1,x i2)。其中x i1,x i2均为随机数。 In an embodiment of the present invention, before step S101, the blockchain platform is initialized, and at the same time, the seller runs the UPPRE.Setup algorithm to generate public parameters param, including the generator g; runs the UPPRE.KeyGen algorithm to generate the seller's public and private parameters key, denote the public key pk i =(pk i1 , pk i2 ), and the private key sk i =(sk i1 ,sk i2 )=(x i1 ,x i2 ). Among them, x i1 and x i2 are random numbers.
S102、接收买方终端发送的请求交易所述数字商品的交易请求,其中,所述交易请求包括:购买所述数字商品的预付款;S102. Receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: a prepayment for purchasing the digital commodity;
本发明实施例中,买方在以太坊智能合约中也拥有一个以太坊账户,主要用于与智能合约交互以及将预付款存入到智能合约中,并获得数字商品明文。In the embodiment of the present invention, the buyer also has an Ethereum account in the Ethereum smart contract, which is mainly used for interacting with the smart contract, depositing the prepayment into the smart contract, and obtaining the plaintext of the digital commodity.
本发明的一个实施例,买方终端使用算法UPPRE.keyGen生成公钥pk j=(pk j1,pk j2),私钥sk j=(sk j1,sk j2)=(x j1,x j2)。其中x j1,x j2均为随机数。另外,买方终端使用算法UPPRE.RequestGen生成请求信息R,其中包含中间值δ,g 2,以及公钥pk j1。并将预付款以及请求信息R发送给智能合约,申请购买数字商品。 In an embodiment of the present invention, the buyer terminal uses the algorithm UPPRE.keyGen to generate the public key pk j =(pk j1 ,pk j2 ), and the private key sk j =(sk j1 ,sk j2 )=(x j1 ,x j2 ). Among them, x j1 and x j2 are random numbers. In addition, the buyer terminal uses the algorithm UPPRE.RequestGen to generate request information R, which includes the intermediate value δ, g 2 , and the public key pk j1 . And send the prepayment and request information R to the smart contract to apply for the purchase of digital goods.
S103、判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令,以使所述卖方终端监控所述交易请求并按照所述交易请求生成重加密密钥;S103. Determine whether the transaction request exists in a preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction, so that the seller terminal monitors the transaction request and executes the transaction according to the transaction request. request to generate a re-encryption key;
本发明的一个实施例,预设的交易列表用于存储已经接受的交易请求信息R,当以太坊智能合约收到买方终端发送的交易请求(R)时,会先检查R中的pk j1是否存在于预设的交易列表中,若已存在则拒绝请求信息R,并将预付款退回。否则接收此请求信息R。当接收了交易请求R,则添加R至列表pk j1,同时,以太坊智能合约触发交易 指令,以使该事件被卖方终端监听,用于告知卖方终端智能合约正在等待卖方提交重加密密钥。 In an embodiment of the present invention, the preset transaction list is used to store the accepted transaction request information R. When the Ethereum smart contract receives the transaction request (R) sent by the buyer's terminal, it will first check whether the pk j1 in R is It exists in the preset transaction list. If it already exists, the request information R will be rejected and the advance payment will be returned. Otherwise, the request message R is received. When the transaction request R is received, R is added to the list pk j1 , and at the same time, the Ethereum smart contract triggers the transaction instruction, so that the event is monitored by the seller's terminal, which is used to inform the seller's terminal that the smart contract is waiting for the seller to submit the re-encryption key.
S104、接收所述卖方终端发送的所述重加密密钥并进行验证,当验证通过时,对所述数字商品的第一密文进行加密转换并保存为第二密文,以及将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以使所述买方终端查看所述第二密文并解密得到所述数字商品的对称密钥后,在文件管理平台中按照所述对称密钥解密所述卖方终端预先上传的对称加密的密文,得到所述数字商品的明文信息。S104. Receive the re-encryption key sent by the seller's terminal and verify it, and when the verification is passed, encrypt and convert the first ciphertext of the digital commodity and save it as a second ciphertext, and store the transaction After requesting to be added to the transaction list and sending the prepayment to the seller terminal, so that the buyer terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity, and then file management The platform decrypts the symmetric encrypted ciphertext pre-uploaded by the seller terminal according to the symmetric key to obtain the plaintext information of the digital commodity.
本发明的一个实施例,卖方终端监听到买方终端发送的交易请求R后,使用算法UPPRE.RekeyGen生成重加密密钥
Figure PCTCN2020136244-appb-000001
并提交至区块链平台,即以太坊智能合约,以太坊智能合约接收到方提交的
Figure PCTCN2020136244-appb-000002
则执行算法UPPRE.VerifyRekey验证
Figure PCTCN2020136244-appb-000003
的正确性,当重加密密钥
Figure PCTCN2020136244-appb-000004
正确时,验证通过,将交易请求R添加至交易列表pk j1中并将预付款发送给卖方终端,以及对数字商品的第一密文进行加密转换并保存为第二密文。
In an embodiment of the present invention, after the seller terminal monitors the transaction request R sent by the buyer terminal, it uses the algorithm UPPRE.RekeyGen to generate a re-encryption key
Figure PCTCN2020136244-appb-000001
And submit it to the blockchain platform, namely the Ethereum smart contract, the Ethereum smart contract receives the submitted
Figure PCTCN2020136244-appb-000002
Then execute the algorithm UPPRE.VerifyRekey to verify
Figure PCTCN2020136244-appb-000003
correctness when re-encrypting the key
Figure PCTCN2020136244-appb-000004
If it is correct, the verification is passed, the transaction request R is added to the transaction list pk j1 and the prepayment is sent to the seller terminal, and the first ciphertext of the digital commodity is encrypted and converted and saved as the second ciphertext.
需要说明的是,在验证重加密密钥
Figure PCTCN2020136244-appb-000005
时,验证等式
Figure PCTCN2020136244-appb-000006
与等式
Figure PCTCN2020136244-appb-000007
是否同时成立,当同时成立时,重加密密钥
Figure PCTCN2020136244-appb-000008
正确,验证通过。并且以太坊智能合约可以通过执行算法UPPRE.ReEnc来输出第二密文CT j
It should be noted that when verifying the re-encryption key
Figure PCTCN2020136244-appb-000005
, verify the equation
Figure PCTCN2020136244-appb-000006
with the equation
Figure PCTCN2020136244-appb-000007
Whether it is established at the same time, when it is established at the same time, the re-encryption key
Figure PCTCN2020136244-appb-000008
Correct, verified. And the Ethereum smart contract can output the second ciphertext CT j by executing the algorithm UPPRE.ReEnc.
需要说明的是,买方终端可以在以太坊智能合约中的账户中查看第二密文CT j并通过执行解密算法UPPRE.Dec,使用sk j解密CT j得到对称密钥K:K←UPPRE.Dec,同时,买方终端根据IPFShash在文件管理平台(IPFS)里下载M′并解密得到数字商品明文M:M←SE.Dec(M′,K)。 It should be noted that the buyer's terminal can view the second ciphertext CT j in the account in the Ethereum smart contract and use sk j to decrypt CT j by executing the decryption algorithm UPPRE.Dec to obtain the symmetric key K: K←UPPRE.Dec At the same time, the buyer's terminal downloads M' in the file management platform (IPFS) according to IPFShash and decrypts to obtain the digital commodity plaintext M: M←SE.Dec(M', K).
本发明实施例中,由于区块链具有去中心化、公开可查、不可篡改等特点,将该商品交易方法应用于区块链,借助于区块链实现数字商品的公平交易,实现数字商品的发放与款项的收取,同时由于区块链的公开性可以避免对第三方信任度上的过度依赖,减小交易风险,同时利用区块链平台还可以降低成本。此外,在数字商品隐私保护方面,通过对商品信息进行重加密处理,能够在数字商品被加密的前提下实施解密权限的委托,当且仅当买方付款后获得数字商品的委托解密权限,增强了私密性。In the embodiment of the present invention, since the blockchain has the characteristics of decentralization, openness and inspection, and non-tampering, the commodity transaction method is applied to the blockchain, and the fair transaction of digital commodities is realized by means of the blockchain. At the same time, due to the openness of the blockchain, it can avoid excessive dependence on third-party trust and reduce transaction risks. At the same time, using the blockchain platform can also reduce costs. In addition, in terms of privacy protection of digital commodities, by re-encrypting commodity information, the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
可选地,在一些实施方式中,为了确保商品交易的顺利进行,提高交易效率,当在预设时间段内没有完成交易可以及时终止交易的进行,即,在预设的时间段内没有接收到所述卖方终端发送的所述重加密密钥且没有接收到所述买方终端发送的仲裁请求时,终止交易,将所述预付款退回至所述买方终端。Optionally, in some embodiments, in order to ensure the smooth progress of the commodity transaction and improve the transaction efficiency, the transaction can be terminated in time when the transaction is not completed within the preset time period, that is, the transaction is not received within the preset time period. When the re-encryption key is sent by the seller's terminal and the arbitration request sent by the buyer's terminal is not received, the transaction is terminated, and the prepayment is returned to the buyer's terminal.
可选地,在一些实施方式中,为了公平交易,保障买方或者卖方的合法权益,当交易不能正常进行时,区块链平台需要对不能正常进行的交易进行公平的仲裁,本发明实施例提供一种仲裁方法,该方法包括如下步骤:Optionally, in some embodiments, in order to conduct fair transactions and protect the legitimate rights and interests of buyers or sellers, when transactions cannot be performed normally, the blockchain platform needs to conduct fair arbitration for transactions that cannot be performed normally. An arbitration method comprising the following steps:
步骤一、接收所述买方终端发送的仲裁请求;Step 1, receiving the arbitration request sent by the buyer terminal;
需要说明的是,在预设的时间段内容以太坊智能合约没有接收到卖方终端发送的重加密密钥时,可以提请仲裁请求。It should be noted that when the content Ethereum smart contract does not receive the re-encryption key sent by the seller's terminal in the preset time period, it can submit an arbitration request.
步骤二、判断违约方归属,当违约方为买方时,终止交易并将所述预付款退回至所述买方终端;Step 2: Judging the ownership of the defaulting party, when the defaulting party is the buyer, terminate the transaction and return the prepayment to the buyer's terminal;
步骤三、当违约方为卖方时,终止交易,将所述预付款退回至所述买方终端以及扣除所述卖方终端预先存储到所述区块链平台中的保证金。Step 3: When the defaulting party is the seller, terminate the transaction, return the prepayment to the buyer's terminal and deduct the deposit pre-stored in the blockchain platform by the seller's terminal.
本发明实施例中,区块链平台,即以太坊智能合约通过验证等式
Figure PCTCN2020136244-appb-000009
与等式
Figure PCTCN2020136244-appb-000010
是否同时成立。如果上述等式没有同时成立,则智能合约判定为买方违约,终止交易,退还预付金。如果上述等式同时成立,则智能合约判定为卖方违约。然后智能合约会扣除卖方的部分保证金作为惩罚,然后将预付款退回给买方,最后终止交易。
In the embodiment of the present invention, the blockchain platform, that is, the Ethereum smart contract, passes the verification equation
Figure PCTCN2020136244-appb-000009
with the equation
Figure PCTCN2020136244-appb-000010
established at the same time. If the above equations are not established at the same time, the smart contract determines that the buyer is in breach of contract, terminates the transaction, and refunds the advance payment. If the above equations are established at the same time, the smart contract determines that the seller is in breach of contract. The smart contract then deducts part of the seller's deposit as a penalty, returns the advance payment to the buyer, and terminates the transaction.
可选地,在一些实施方式中,该方法还包括:Optionally, in some embodiments, the method further includes:
当所述交易请求在所述交易列表中或者当验证没有通过时,终止交易并将所述预付款退回至所述买方终端。When the transaction request is in the transaction list or when the verification fails, the transaction is terminated and the prepayment is returned to the buyer's terminal.
本发明实施例还提供一种商品交易装置。具体请参阅图2,图2为本实施例商品交易装置基本结构框图。Embodiments of the present invention also provide a commodity trading device. Please refer to FIG. 2 for details. FIG. 2 is a block diagram of the basic structure of the commodity trading apparatus according to this embodiment.
如图2所示,一种商品交易装置,包括:获取模块2100、处理模块2200和执行模块2300。其中,获取模块2100,用于接收卖方终端发送的对数字商品的商品信息进行代理重加密算法进行第一次加密后得到的第一密文;获取模块2100,还用于接收买方终端发送的请求交易所述数字商品的交易请求,其中,所述交易请求包括:购买所述数字商品的预付款;处理模块2200,用于判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令,以使所述卖方终端监控所述交易请求并按照所述交易请求生成重加密密钥;执行模块2300,用于接收所述卖方终端发送的所述重加密密钥并进行验证,当验证通过时,对所述数字商品的第一密文进行加密转换并保存为第二密文,以及将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以使所述买方终端查看所述第二密文并解密得到所述数字商品的对称密钥后,在文件管理平台中按照所述对称密钥解密所述卖方终端预先上传的对称 加密的密文,得到所述数字商品的明文信息。As shown in FIG. 2 , a commodity trading device includes: an acquisition module 2100 , a processing module 2200 and an execution module 2300 . Wherein, the obtaining module 2100 is used to receive the first ciphertext obtained by performing the first encryption of the proxy re-encryption algorithm on the commodity information of the digital commodity sent by the seller's terminal; the obtaining module 2100 is also used to receive the request sent by the buyer's terminal A transaction request for trading the digital commodity, wherein the transaction request includes: a prepayment for purchasing the digital commodity; the processing module 2200 is configured to determine whether the transaction request exists in the preset transaction list, when the When the transaction request is not in the transaction list, trigger a transaction instruction, so that the seller terminal monitors the transaction request and generates a re-encryption key according to the transaction request; the execution module 2300 is configured to receive the information sent by the seller terminal. The re-encryption key is verified, and when the verification is passed, the first ciphertext of the digital commodity is encrypted and converted and saved as the second ciphertext, and the transaction request is added to the transaction list and Send the prepayment to the seller terminal, so that the buyer terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity, and then decrypt according to the symmetric key in the file management platform The symmetric encrypted ciphertext pre-uploaded by the seller terminal obtains the plaintext information of the digital commodity.
本发明实施例提供的一种商品交易装置,由于区块链具有去中心化、公开可查、不可篡改等特点,将该商品交易方法应用于区块链,借助于区块链实现数字商品的公平交易,实现数字商品的发放与款项的收取,同时由于区块链的公开性可以避免对第三方信任度上的过度依赖,减小交易风险,同时利用区块链平台还可以降低成本。此外,在数字商品隐私保护方面,通过对商品信息进行重加密处理,能够在数字商品被加密的前提下实施解密权限的委托,当且仅当买方付款后获得数字商品的委托解密权限,增强了私密性。In the commodity trading device provided by the embodiments of the present invention, since the blockchain has the characteristics of decentralization, openness and inspection, and non-tampering, the commodity trading method is applied to the blockchain, and the transaction of digital commodities is realized by means of the blockchain. Fair trade, realize the issuance of digital goods and the collection of payments, and at the same time, due to the openness of the blockchain, it can avoid excessive reliance on third-party trust, reduce transaction risks, and use the blockchain platform to reduce costs. In addition, in terms of privacy protection of digital commodities, by re-encrypting commodity information, the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
在一些实施方式中,还包括:第一处理子模块,还用于在预设的时间段内没有接收到所述卖方终端发送的所述重加密密钥且没有接收到所述买方终端发送的仲裁请求时,终止交易,将所述预付款退回至所述买方终端。In some embodiments, it further includes: a first processing submodule, further configured to not receive the re-encryption key sent by the seller terminal and not receive the re-encryption key sent by the buyer terminal within a preset time period In the event of an arbitration request, the transaction is terminated and the advance payment is returned to the buyer's terminal.
在一些实施方式中,还包括:第一获取子模块,还用于接收所述买方终端发送的仲裁请求;第二处理子模块,判断违约方归属,当违约方为买方时,终止交易并将所述预付款退回至所述买方终端;第三处理子模块,当违约方为卖方时,终止交易,将所述预付款退回至所述买方终端以及扣除所述卖方终端预先存储到所述区块链平台中的保证金。In some embodiments, it further includes: a first acquiring sub-module, which is further configured to receive an arbitration request sent by the buyer terminal; a second processing sub-module, which determines the attribution of the defaulting party, and when the defaulting party is the buyer, terminates the transaction and sends The prepayment is returned to the buyer's terminal; the third processing sub-module, when the defaulting party is the seller, terminates the transaction, returns the prepayment to the buyer's terminal and deducts the seller's terminal to pre-store in the area Margin in a blockchain platform.
在一些实施方式中,还包括:第四处理子模块,当所述交易请求在所述交易列表中或者当验证没有通过时,终止交易并将所述预付款退回至所述买方终端。In some embodiments, it further includes: a fourth processing sub-module, which terminates the transaction and returns the prepayment to the buyer terminal when the transaction request is in the transaction list or when the verification fails.
为解决上述技术问题,本发明实施例还提供商品交易系统,如图3所示,商品交易系统包括:区块链平台301、买方终端302、卖方终端303和文件管理平台304;其中,In order to solve the above technical problems, the embodiment of the present invention also provides a commodity trading system. As shown in FIG. 3 , the commodity trading system includes: a blockchain platform 301, a buyer terminal 302, a seller terminal 303 and a file management platform 304; wherein,
所述卖方终端303,用于对数字商品的商品信息进行对称加密后得到的第一密文并将所述第一密文发送给所述区块链平台301和所述文件管理平台304;The seller terminal 303 is used for the first ciphertext obtained by symmetrically encrypting the commodity information of the digital commodity and sending the first ciphertext to the blockchain platform 301 and the file management platform 304;
所述买方终端302,用于发送请求交易所述数字商品的交易请求给所述区块链平台301,其中,所述交易请求包括:购买所述数字商品的预付款;The buyer terminal 302 is configured to send a transaction request for requesting to trade the digital commodity to the blockchain platform 301, wherein the transaction request includes: prepayment for purchasing the digital commodity;
所述区块链平台301,用于判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令;The blockchain platform 301 is configured to determine whether the transaction request exists in a preset transaction list, and trigger a transaction instruction when the transaction request is not in the transaction list;
所述卖方终端303,用于监控所述交易请求并按照所述交易请求生成重加密密钥,以及将所述重加密密钥发送给所述区块链平台301;the seller terminal 303, configured to monitor the transaction request and generate a re-encryption key according to the transaction request, and send the re-encryption key to the blockchain platform 301;
所述区块链平台301,用于接收所述重加密密钥并进行验证,当验证通过时,将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端303,以及对所述数字商品的第一密文进行加密转换并保存为第二密文;The blockchain platform 301 is configured to receive the re-encryption key and perform verification, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal 303, and encrypting and converting the first ciphertext of the digital commodity and saving it as a second ciphertext;
所述买方终端302,用于获取所述第二密文并进行解密得到所述数字商品的对称密钥并发送至所述文件管理平台304;The buyer terminal 302 is used to obtain the second ciphertext and decrypt it to obtain the symmetric key of the digital commodity and send it to the file management platform 304;
所述文件管理平台304,用于按照所述对称密钥对所述第一密文进行解密得到所述数字商品的明文信息。The file management platform 304 is configured to decrypt the first ciphertext according to the symmetric key to obtain plaintext information of the digital commodity.
本发明实施例提供的商品交易系统,由于区块链具有去中心化、公开可查、不可篡改等特点,将该商品交易方法应用于区块链,借助于区块链实现数字商品的公平交易,实现数字商品的发放与款项的收取,同时由于区块链的公开性可以避免对第三方信任度上的过度依赖,减小交易风险,同时利用区块链平台还可以降低成本。此外,在数字商品隐私保护方面,通过对商品信息进行重加密处理,能够在数字商品被加密的前提下实施解密权限的委托,当且仅当买方付款后获得数 字商品的委托解密权限,增强了私密性。In the commodity trading system provided by the embodiment of the present invention, since the blockchain has the characteristics of decentralization, openness, and non-tampering, the commodity trading method is applied to the blockchain, and the fair transaction of digital commodities is realized by means of the blockchain. , to realize the issuance of digital goods and the collection of payments. At the same time, due to the openness of the blockchain, it can avoid excessive dependence on third-party trust and reduce transaction risks. At the same time, the use of the blockchain platform can also reduce costs. In addition, in terms of privacy protection of digital commodities, by re-encrypting commodity information, the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy.
为解决上述技术问题,本发明实施例还提供计算机设备。具体请参阅图4,图4为本实施例计算机设备基本结构框图。To solve the above technical problems, the embodiments of the present invention further provide computer equipment. For details, please refer to FIG. 4 , which is a block diagram of a basic structure of a computer device according to this embodiment.
如图4所示,计算机设备的内部结构示意图。如图4所示,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、数据库和计算机可读指令,数据库中可存储有控件信息序列,该计算机可读指令被处理器执行时,可使得处理器实现一种商品交易方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种商品交易方法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图4中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。As shown in Figure 4, a schematic diagram of the internal structure of the computer equipment. As shown in FIG. 4, the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus. Wherein, the non-volatile storage medium of the computer device stores an operating system, a database and computer-readable instructions, and the database may store a sequence of control information. When the computer-readable instructions are executed by the processor, the processor can realize a A commodity trading method. The processor of the computer device is used to provide computing and control capabilities and support the operation of the entire computer device. Computer readable instructions may be stored in the memory of the computer device, and when executed by the processor, the computer readable instructions may cause the processor to perform a method of trading commodities. The network interface of the computer equipment is used for communication with the terminal connection. Those skilled in the art can understand that the structure shown in FIG. 4 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
本实施方式中处理器用于执行图2中获取模块2100、处理模块2200和执行模块2300的具体内容,存储器存储有执行上述模块所需的程序代码和各类数据。网络接口用于向用户终端或服务器之间的数据传输。本实施方式中的存储器存储有商品交易方法中执行所有子模块所需的程序代码及数据,服务器能够调用服务器的程序代码及数据执行所有子模块的功能。In this embodiment, the processor is used to execute the specific content of the acquisition module 2100 , the processing module 2200 and the execution module 2300 in FIG. 2 , and the memory stores program codes and various types of data required to execute the above modules. The network interface is used for data transmission between user terminals or servers. The memory in this embodiment stores the program codes and data required to execute all the sub-modules in the commodity transaction method, and the server can call the server's program codes and data to execute the functions of all the sub-modules.
本发明实施例提供的计算机设备,由于区块链具有去中心化、公开可查、不可篡改等特点,将该商品交易方法应用于区块链,借助于区块链实现数字商品的公平交易,实现数字商品的发放与款项的收取, 同时由于区块链的公开性可以避免对第三方信任度上的过度依赖,减小交易风险,同时利用区块链平台还可以降低成本。此外,在数字商品隐私保护方面,通过对商品信息进行重加密处理,能够在数字商品被加密的前提下实施解密权限的委托,当且仅当买方付款后获得数字商品的委托解密权限,增强了私密性。本发明还提供一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任一实施例所述商品交易方法的步骤。In the computer equipment provided by the embodiments of the present invention, since the blockchain has the characteristics of decentralization, openness, and non-tampering, the commodity transaction method is applied to the blockchain, and the fair transaction of digital commodities can be realized by means of the blockchain. Realize the issuance of digital goods and the collection of payments. At the same time, due to the openness of the blockchain, it can avoid excessive dependence on third-party trust and reduce transaction risks. At the same time, the use of the blockchain platform can also reduce costs. In addition, in terms of privacy protection of digital commodities, by re-encrypting commodity information, the delegation of decryption authority can be implemented on the premise that the digital commodity is encrypted, and the entrusted decryption authority of the digital commodity can be obtained if and only after the buyer pays, which enhances the privacy. The present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to execute the commodity trading method described in any of the foregoing embodiments A step of.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart of the accompanying drawings are sequentially shown in the order indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order and may be performed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution sequence is also It does not have to be performed sequentially, but may be performed alternately or alternately with other steps or at least a portion of sub-steps or stages of other steps.
以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only some embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can be made. It should be regarded as the protection scope of the present invention.

Claims (10)

  1. 一种商品交易方法,其特征在于,所述方法应用于区块链平台,包括下述步骤:A commodity trading method, characterized in that the method is applied to a blockchain platform, comprising the following steps:
    接收卖方终端发送的对数字商品的商品信息进行代理重加密算法进行第一次加密后得到的第一密文;Receive the first ciphertext sent by the seller's terminal after performing the first encryption on the commodity information of the digital commodity by the proxy re-encryption algorithm;
    接收买方终端发送的请求交易所述数字商品的交易请求,其中,所述交易请求包括:购买所述数字商品的预付款;Receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: a prepayment for purchasing the digital commodity;
    判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令,以使所述卖方终端监控所述交易请求并按照所述交易请求生成重加密密钥;Determine whether the transaction request exists in the preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction, so that the seller terminal monitors the transaction request and generates according to the transaction request re-encryption key;
    接收所述卖方终端发送的所述重加密密钥并进行验证,当验证通过时,对所述数字商品的第一密文进行加密转换并保存为第二密文以及将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以使所述买方终端查看所述第二密文并解密得到所述数字商品的对称密钥后,在文件管理平台中按照所述对称密钥解密所述卖方终端预先上传的对称加密的密文,得到所述数字商品的明文信息。Receive the re-encryption key sent by the seller's terminal and verify it, and when the verification is passed, encrypt and convert the first ciphertext of the digital commodity and save it as the second ciphertext, and add the transaction request to In the transaction list, the prepayment is sent to the seller terminal, so that the buyer terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity. The symmetric key decrypts the symmetric encrypted ciphertext pre-uploaded by the seller terminal to obtain plaintext information of the digital commodity.
  2. 根据权利要求1所述的商品交易方法,其特征在于,所述方法还包括:The commodity trading method according to claim 1, wherein the method further comprises:
    在预设的时间段内没有接收到所述卖方终端发送的所述重加密密钥且没有接收到所述买方终端发送的仲裁请求时,终止交易,将所述预付款退回至所述买方终端。When the re-encryption key sent by the seller terminal and the arbitration request sent by the buyer terminal are not received within a preset time period, the transaction is terminated, and the prepayment is returned to the buyer terminal .
  3. 根据权利要求1所述的商品交易方法,其特征在于,所述方法还包括:The commodity trading method according to claim 1, wherein the method further comprises:
    接收所述买方终端发送的仲裁请求;receiving an arbitration request sent by the buyer's terminal;
    判断违约方归属,当违约方为买方时,终止交易并将所述预付款退回至所述买方终端;Determine the ownership of the defaulting party, and when the defaulting party is the buyer, terminate the transaction and return the advance payment to the buyer's terminal;
    当违约方为卖方时,终止交易,将所述预付款退回至所述买方终端以及扣除所述卖方终端预先存储到所述区块链平台中的保证金。When the defaulting party is the seller, the transaction is terminated, the prepayment is returned to the buyer's terminal, and the security deposit pre-stored in the blockchain platform by the seller's terminal is deducted.
  4. 根据权利要求1所述的商品交易方法,其特征在于,所述方法还包括:The commodity trading method according to claim 1, wherein the method further comprises:
    当所述交易请求在所述交易列表中或者当验证没有通过时,终止交易并将所述预付款退回至所述买方终端。When the transaction request is in the transaction list or when the verification fails, the transaction is terminated and the prepayment is returned to the buyer's terminal.
  5. 一种商品交易装置,其特征在于,包括:A commodity trading device, characterized in that it includes:
    获取模块,用于接收卖方终端发送的对数字商品的商品信息进行代理重加密算法进行第一次加密后得到的第一密文;an acquisition module, configured to receive the first ciphertext obtained by performing the first encryption on the commodity information of the digital commodity through the proxy re-encryption algorithm and sent by the seller's terminal;
    所述获取模块,还用于接收买方终端发送的请求交易所述数字商品的交易请求,其中,所述交易请求包括:购买所述数字商品的预付款;The acquiring module is further configured to receive a transaction request sent by the buyer's terminal for requesting to trade the digital commodity, wherein the transaction request includes: prepayment for purchasing the digital commodity;
    处理模块,用于判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令,以使所述卖方终端监控所述交易请求并按照所述交易请求生成重加密密钥;The processing module is used for judging whether the transaction request exists in the preset transaction list, and when the transaction request is not in the transaction list, triggering a transaction instruction, so that the seller terminal monitors the transaction request and follows the transaction request. the transaction request generates a re-encryption key;
    执行模块,用于接收所述卖方终端发送的所述重加密密钥并进行验证,当验证通过时,对所述数字商品的第一密文进行加密转换并保存为第二密文,以及将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以使所述买方终端查看所述第二密文并解密得到所述数字商品的对称密钥后,在文件管理平台中按照所述对称密钥解密所述卖方终端预先上传的对称加密的密文,得到所述数字商品的 明文信息。The execution module is configured to receive the re-encryption key sent by the seller terminal and verify it, and when the verification is passed, encrypt and convert the first ciphertext of the digital commodity and save it as the second ciphertext, and After adding the transaction request to the transaction list and sending the prepayment to the seller terminal, so that the buyer terminal can view the second ciphertext and decrypt to obtain the symmetric key of the digital commodity, In the file management platform, the symmetric encrypted ciphertext uploaded in advance by the seller terminal is decrypted according to the symmetric key to obtain the plaintext information of the digital commodity.
  6. 根据权利要求5所述的商品交易装置,其特征在于,还包括:第一处理子模块,还用于在预设的时间段内没有接收到所述卖方终端发送的所述重加密密钥且没有接收到所述买方终端发送的仲裁请求时,终止交易,将所述预付款退回至所述买方终端。The commodity trading device according to claim 5, further comprising: a first processing submodule, further configured to not receive the re-encryption key sent by the seller terminal within a preset time period and When the arbitration request sent by the buyer terminal is not received, the transaction is terminated, and the prepayment is returned to the buyer terminal.
  7. 根据权利要求5所述的商品交易装置,其特征在于,还包括:The commodity trading device according to claim 5, further comprising:
    第一获取子模块,还用于接收所述买方终端发送的仲裁请求;The first acquisition sub-module is further configured to receive an arbitration request sent by the buyer terminal;
    第二处理子模块,判断违约方归属,当违约方为买方时,终止交易并将所述预付款退回至所述买方终端;The second processing sub-module is to determine the attribution of the defaulting party, and when the defaulting party is the buyer, terminate the transaction and return the prepayment to the buyer's terminal;
    第三处理子模块,当违约方为卖方时,终止交易,将所述预付款退回至所述买方终端以及扣除所述卖方终端预先存储到所述区块链平台中的保证金。The third processing sub-module, when the defaulting party is the seller, terminates the transaction, returns the prepayment to the buyer's terminal and deducts the deposit pre-stored in the blockchain platform by the seller's terminal.
  8. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如权利要求1至4中任一项权利要求所述商品交易方法的步骤。A computer device comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor causes the processor to perform any one of claims 1 to 4. The steps of a method of trading commodities as claimed in one of the claims.
  9. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如权利要求1至4中任一项权利要求所述商品交易方法的步骤。A storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the execution of any one of claims 1 to 4 The steps of the commodity trading method.
  10. 一种商品交易系统,其特征在于,包括:区块链平台、买方终端、卖方终端和文件管理平台;其中,A commodity trading system, comprising: a blockchain platform, a buyer's terminal, a seller's terminal and a file management platform; wherein,
    所述卖方终端,用于对数字商品的商品信息进行对称加密后得到的第一密文并将所述第一密文发送给所述区块链平台和所述文件管 理平台;The seller terminal is used for the first ciphertext obtained by symmetrically encrypting the commodity information of the digital commodity and sending the first ciphertext to the blockchain platform and the file management platform;
    所述买方终端,用于发送请求交易所述数字商品的交易请求给所述区块链平台,其中,所述交易请求包括:购买所述数字商品的预付款;the buyer terminal, configured to send a transaction request for requesting to trade the digital commodity to the blockchain platform, wherein the transaction request includes: prepayment for purchasing the digital commodity;
    所述区块链平台,用于判断所述交易请求是否存在于预设的交易列表中,当所述交易请求不在所述交易列表中时,触发交易指令;The blockchain platform is used to determine whether the transaction request exists in a preset transaction list, and when the transaction request is not in the transaction list, trigger a transaction instruction;
    所述卖方终端,用于监控所述交易请求并按照所述交易请求生成重加密密钥,以及将所述重加密密钥发送给所述区块链平台;the seller terminal, configured to monitor the transaction request and generate a re-encryption key according to the transaction request, and send the re-encryption key to the blockchain platform;
    所述区块链平台,用于接收所述重加密密钥并进行验证,当验证通过时,将所述交易请求添加至所述交易列表中并将所述预付款发送给所述卖方终端,以及对所述数字商品的第一密文进行加密转换并保存为第二密文;the blockchain platform is configured to receive the re-encryption key and perform verification, and when the verification is passed, add the transaction request to the transaction list and send the prepayment to the seller terminal, and encrypting and converting the first ciphertext of the digital commodity and saving it as the second ciphertext;
    所述买方终端,用于获取所述第二密文并进行解密得到所述数字商品的对称密钥并发送至所述文件管理平台;the buyer's terminal, configured to obtain the second ciphertext and decrypt it to obtain the symmetric key of the digital commodity and send it to the file management platform;
    所述文件管理平台,用于按照所述对称密钥对所述第一密文进行解密得到所述数字商品的明文信息。The file management platform is configured to decrypt the first ciphertext according to the symmetric key to obtain plaintext information of the digital commodity.
PCT/CN2020/136244 2020-12-10 2020-12-14 Commodity transaction method and apparatus, computer device, storage medium, and system WO2022120886A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011455309.1A CN112581127A (en) 2020-12-10 2020-12-10 Commodity transaction method and device, computer equipment, storage medium and system
CN202011455309.1 2020-12-10

Publications (1)

Publication Number Publication Date
WO2022120886A1 true WO2022120886A1 (en) 2022-06-16

Family

ID=75131425

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/136244 WO2022120886A1 (en) 2020-12-10 2020-12-14 Commodity transaction method and apparatus, computer device, storage medium, and system

Country Status (2)

Country Link
CN (1) CN112581127A (en)
WO (1) WO2022120886A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037484A (en) * 2022-08-10 2022-09-09 捷德(中国)科技有限公司 Digital collection receiving method and device and electronic equipment
CN116112284A (en) * 2023-02-27 2023-05-12 敏于行(北京)科技有限公司 Method and system for verifying validity of threshold proxy re-encryption cooperative network
CN116308655A (en) * 2023-03-17 2023-06-23 北京未来链技术有限公司 Intelligent community commodity big data intelligent bill spelling and settlement system based on blockchain

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113269641B (en) * 2021-05-20 2023-06-27 中国联合网络通信集团有限公司 Transaction management method, device and system
CN113254884B (en) * 2021-06-29 2021-11-05 浩鲸云计算科技股份有限公司 Method for realizing digital copyright authorization based on proxy re-encryption and block chain technology
CN113537966B (en) * 2021-07-19 2024-06-04 大唐网络有限公司 Transaction method, device and system based on 5G

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060089919A1 (en) * 2003-06-04 2006-04-27 Kidd Samuel R Transaction processing
CN109509099A (en) * 2018-12-27 2019-03-22 石更箭数据科技(上海)有限公司 Data trade method and device calculates equipment, storage medium
CN109741057A (en) * 2018-12-27 2019-05-10 石更箭数据科技(上海)有限公司 Collecting method and system, platform, storage medium
CN109754249A (en) * 2018-12-27 2019-05-14 石更箭数据科技(上海)有限公司 Data trade method and system, platform, storage medium
CN110430186A (en) * 2019-07-31 2019-11-08 国网电子商务有限公司 Block chain data transacting system and method based on proxy re-encryption and intelligent contract

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060089919A1 (en) * 2003-06-04 2006-04-27 Kidd Samuel R Transaction processing
CN109509099A (en) * 2018-12-27 2019-03-22 石更箭数据科技(上海)有限公司 Data trade method and device calculates equipment, storage medium
CN109741057A (en) * 2018-12-27 2019-05-10 石更箭数据科技(上海)有限公司 Collecting method and system, platform, storage medium
CN109754249A (en) * 2018-12-27 2019-05-14 石更箭数据科技(上海)有限公司 Data trade method and system, platform, storage medium
CN110430186A (en) * 2019-07-31 2019-11-08 国网电子商务有限公司 Block chain data transacting system and method based on proxy re-encryption and intelligent contract

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037484A (en) * 2022-08-10 2022-09-09 捷德(中国)科技有限公司 Digital collection receiving method and device and electronic equipment
CN115037484B (en) * 2022-08-10 2022-11-01 捷德(中国)科技有限公司 Digital collection receiving method and device and electronic equipment
CN116112284A (en) * 2023-02-27 2023-05-12 敏于行(北京)科技有限公司 Method and system for verifying validity of threshold proxy re-encryption cooperative network
CN116112284B (en) * 2023-02-27 2023-07-18 敏于行(北京)科技有限公司 Method and system for verifying validity of threshold proxy re-encryption cooperative network
CN116308655A (en) * 2023-03-17 2023-06-23 北京未来链技术有限公司 Intelligent community commodity big data intelligent bill spelling and settlement system based on blockchain
CN116308655B (en) * 2023-03-17 2023-09-15 北京未来链技术有限公司 Intelligent community commodity big data intelligent bill spelling and settlement system based on blockchain

Also Published As

Publication number Publication date
CN112581127A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
WO2022120886A1 (en) Commodity transaction method and apparatus, computer device, storage medium, and system
WO2019214312A1 (en) Blockchain-based logistics information transmission method, system and device
CN111369236B (en) Data management method and device applied to blockchain
WO2023030450A1 (en) Data sharing method and electronic device
WO2023005838A1 (en) Data sharing method and electronic device
Tzianos et al. Hermes: An open and transparent marketplace for IoT sensor data over distributed ledgers
CN111049806B (en) Joint authority control method and device, electronic equipment and storage medium
CN116743768B (en) Method, apparatus, device and computer readable storage medium for trading computing power resources
CN114358766A (en) Method, equipment and blockchain system for trading green electric certificates
CN116257589A (en) Transaction data processing method, system, device, electronic equipment and storage medium
CN106203980A (en) A kind of method of network payment, device, capital management server and system
CN106204006A (en) Based on across the payment system of fund server and method, device and server
CN111401891B (en) Data management method and device applied to blockchain
CN111861462B (en) Financial product transaction method and device based on blockchain
JP2024003002A (en) Using virtual blockchain protocols to implement fair electronic exchange
CN106204015A (en) Based on across the payment system of fund server and method, device and server
CN106203971A (en) Payment system based on same fund server and method of payment, device and server
CN106204005A (en) Based on across the payment system of fund server and method of payment, device and server
CN106203973A (en) Based on across the payment system of fund server and method of payment, device and server
CN106204007A (en) Payment system based on same fund server and method of payment, device and server
CN106203976A (en) Payment system based on same fund server and method of payment, device and server
CN106203979A (en) Payment system based on same fund server and method of payment, device and server
CN115082050A (en) Transaction method, system, device, equipment and medium for third party payment
CN111131227B (en) Data processing method and device
KR102263220B1 (en) E-commerce Payment Method using Block Chain

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20964819

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20964819

Country of ref document: EP

Kind code of ref document: A1