CN112883109A - Block chain-based digital commodity transaction method and device - Google Patents

Block chain-based digital commodity transaction method and device Download PDF

Info

Publication number
CN112883109A
CN112883109A CN202110090850.5A CN202110090850A CN112883109A CN 112883109 A CN112883109 A CN 112883109A CN 202110090850 A CN202110090850 A CN 202110090850A CN 112883109 A CN112883109 A CN 112883109A
Authority
CN
China
Prior art keywords
digital
information
order
supplier
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110090850.5A
Other languages
Chinese (zh)
Other versions
CN112883109B (en
Inventor
王吉元
刘晓磊
郑艺林
陈刚
张如意
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110090850.5A priority Critical patent/CN112883109B/en
Publication of CN112883109A publication Critical patent/CN112883109A/en
Application granted granted Critical
Publication of CN112883109B publication Critical patent/CN112883109B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or 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/3821Electronic credentials
    • G06Q20/38215Use of certificates or encrypted proofs of transaction rights
    • 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
    • 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

Abstract

The present specification provides a block chain-based digital commodity transaction method and apparatus, in which a digital commodity asset issued by a supplier of a digital commodity is stored in the block chain, and an intelligent contract for managing the digital commodity asset is also deployed; the method comprises the following steps: acquiring an order transaction initiated by a purchasing party; the order transaction includes order information for a digital commodity; calling commodity ordering logic in the intelligent contract to generate an ordering event corresponding to the ordering information; when order confirmation information which is submitted by the supplier and corresponds to the order event is received, further calling order payment logic in the intelligent contract, and completing order payment based on the order information; and when receiving the delivery information which is submitted by the supplier and aims at the ordering information, further calling delivery logic in the intelligent contract, and transferring the identification of the digital commodity assets matched with the ordering information to the blockchain account of the purchasing party for holding.

Description

Block chain-based digital commodity transaction method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of electronic commerce, and in particular, to a method and an apparatus for digital commodity transaction based on a blockchain.
Background
Digital goods generally refer to exchanges in which information content is based on a digital format or products that are transported in a bit stream manner through a network. How to provide a credible transaction flow for two transaction parties without establishing a trust relationship between the two transaction parties is a technical problem encountered in a digital commodity transaction scene.
Blockchains provide data storage in a decentralized manner by storing data in a series of data blocks that have a precedence relationship to each other. The chain of blocks is maintained and updated by a network of block chain nodes, which are also responsible for validating data under a consensus scheme.
Blockchains may be maintained and updated by adding blocks for blockchain transactions. To store data to the blockchain, the data may be included in a blockchain transaction to add to a new block of the blockchain. Further, many blockchains (e.g., etherhouse blockchains) have blockchain contracts (also referred to as smart contracts) enabled, which may be executed through blockchain transactions. For example, a blockchain transaction may include a signed message issued by an externally owned account (e.g., blockchain account), sent by the blockchain network, and recorded in the blockchain. A block chain contract may be executed to implement the programmed functionality.
Disclosure of Invention
In view of the above, one or more embodiments of the present specification provide a method, an apparatus, a computer device and a computer-readable storage medium for block chain based digital commodity transaction.
In order to achieve the above purpose, one or more embodiments of the present specification provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, there is provided a digital merchandise transaction method based on a blockchain, a distributed ledger of the blockchain storing therein digital merchandise assets issued by suppliers of digital merchandise; the block chain is also provided with an intelligent contract for managing the digital commodity assets; the method is applied to node equipment and comprises the following steps:
the acquisition unit is used for acquiring the ordering transaction initiated by the purchasing party; the order transaction includes order information for a digital good corresponding to the digital good asset;
in response to the order transaction, invoking commodity order logic in the intelligent contract, generating an order event corresponding to the order information, and storing the order event in a distributed book of the block chain, so that after data synchronization is performed on a block chain book of the block chain by node equipment corresponding to the supplier, the supplier acquires the order event from the synchronized block chain book;
when order confirmation information which is submitted by the supplier and corresponds to the order event is received, further calling order payment logic in the intelligent contract, completing order payment based on the order information, and storing a payment certificate corresponding to the order payment in a distributed book of the block chain, so that after data synchronization is performed on the block chain book of the block chain by node equipment corresponding to the supplier, the supplier obtains the payment certificate from the synchronized block chain book;
and when receiving shipping information for the ordering information submitted by the supplier after obtaining the payment voucher, further calling shipping logic in the intelligent contract, and transferring the identification of the digital commodity asset matched with the ordering information to a blockchain account of the purchasing party for holding.
According to a second aspect of one or more embodiments of the present specification, there is provided a digital merchandise transaction apparatus based on a blockchain, a distributed ledger of the blockchain storing therein digital merchandise assets issued by suppliers of digital merchandise; the block chain is also provided with an intelligent contract for managing the digital commodity assets; the device is applied to node equipment and comprises:
the acquisition unit is used for acquiring the order transaction initiated by the purchasing party; the order transaction includes order information for a digital good corresponding to the digital good asset;
the intelligent contract calling unit is used for calling commodity ordering logic in the intelligent contract in response to the ordering transaction and generating an ordering event corresponding to the ordering information;
the storage unit is used for storing the ordering event in a distributed account book of the block chain, so that after data synchronization is performed on the block chain account book of the block chain by node equipment corresponding to the supplier, the supplier acquires the ordering event from the synchronized block chain account book;
the intelligent contract calling unit is used for further calling order payment logic in the intelligent contract when receiving order confirmation information which is submitted by the supplier and corresponds to the order event, and completing order payment based on the order information;
the storage unit is further configured to store a payment credential corresponding to the subscription payment in a distributed ledger of the blockchain, so that after data synchronization is performed on the blockchain ledger of the blockchain by a node device corresponding to the supplier, the supplier obtains the payment credential from the synchronized blockchain ledger;
and the intelligent contract calling unit is used for further calling a delivery logic in the intelligent contract when receiving delivery information which is submitted by the supplier after the supplier acquires the payment voucher and aims at the ordering information, and transferring the identification of the digital commodity asset matched with the ordering information to a block chain account of the buyer for holding.
According to a third aspect of one or more embodiments of the present specification, there is provided a computer apparatus comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; and when the processor runs the computer program, the digital commodity transaction method based on the block chain executed by the node equipment is executed.
According to a fourth aspect of one or more embodiments of the present specification, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, executes a blockchain-based digital commodity transaction method executed by the node apparatus.
The digital commodity transaction method, the device, the computer equipment and the computer readable storage medium based on the blockchain provided by the embodiments of the specification drive the transaction of the digital commodity by using the blockchain as a transaction medium, so that a tamper-proof mechanism based on the blockchain provides credible and rapid digital commodity transaction for both transaction parties.
Drawings
FIG. 1 is a schematic diagram of creating an intelligent contract provided by an exemplary embodiment.
FIG. 2 is a schematic diagram of a calling smart contract provided by an exemplary embodiment.
FIG. 3 is a schematic diagram of creating an intelligent contract and invoking an intelligent contract provided by an exemplary embodiment.
Fig. 4(a) and fig. 4(b) are schematic system architectures for implementing a blockchain-based digital goods transaction method according to an exemplary embodiment.
FIG. 5 is a block diagram illustrating a process for publishing digital good assets to a blockchain for a supplier of digital goods according to an exemplary embodiment.
Fig. 6 is a flowchart illustrating a method for block chain based digital goods transaction according to an exemplary embodiment.
Fig. 7 is a schematic diagram of a block chain-based digital goods transaction apparatus according to an exemplary embodiment.
Fig. 8 is a hardware block diagram for implementing an embodiment of the blockchain-based digital goods transaction apparatus provided in the present specification.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the methods may include more or less steps than those described herein. Moreover, a single step described in this specification may be divided into multiple steps for description in other embodiments; however, in other embodiments, multiple steps described in this specification may be combined into a single step for description.
Digital goods generally refer to exchanges in which information content is based on a digital format or products that are transported in a bit stream manner through a network. For example, the digital goods may include a recharge key used by the user when the user recharges the account on the e-commerce platform, a click password expanded by the user when playing the game in the game application, key characters for exchanging a game accessory such as skin equipment, and the like, and may also include an account key carried by a gift card for exchanging physical goods, and the like.
Because the digital commodity does not have the actual property, the transaction efficiency of the digital commodity can be rapidly improved by carrying out digital transaction based on the network; however, the most important problem to be solved in the digital trading scenario is mutual trust between two trading parties.
In view of this, in one or more embodiments of the present disclosure, a block chain-based digital commodity transaction method is provided, and a block chain-based tamper-resistant mechanism improves credibility and accuracy of digital commodity transaction.
The block chain or block chain described in one or more embodiments of the present specification may specifically refer to a P2P network system having a distributed data storage structure, where each node device achieves through a consensus mechanism, and the ledger data in the block chain is distributed within temporally consecutive "blocks", where the latter block may include a data digest of the former block, and achieves full backup of data of all or part of nodes according to a difference of the specific consensus mechanism (such as POW, POS, DPOS, or PBFT).
Blockchains are generally divided into three types: public chain (Public Blockchain), Private chain (Private Blockchain) and alliance chain (Consortium Blockchain). Furthermore, there may be a combination of the above types, such as private chain + federation chain, federation chain + public chain, and so on. It is contemplated that the embodiments provided herein can be implemented in a suitable type of blockchain.
The computing device may construct the data into a standard transaction (transaction) format supported by the blockchain, then issue the transaction to the blockchain, perform consensus processing on the received transaction by the node devices in the blockchain, and package the transaction into a block by the node devices serving as accounting nodes in the blockchain after the consensus is achieved, and perform persistent evidence storage in the blockchain.
Regardless of which consensus algorithm is adopted by the block chain, the accounting node can pack the received transaction to generate a latest block and send the latest block to other node devices for consensus verification. If the latest block is received by other node equipment and no problem is proved, the latest block can be added to the tail of the original block chain, so that the accounting process of the block chain is completed. The transactions contained in the block may also be performed during the process of the other nodes verifying the new block sent by the accounting node.
It should be noted that, each time a latest block is generated in the blockchain, the corresponding status of the executed transactions in the blockchain changes after the transaction in the latest block is executed. For example, in a block chain constructed by an account model, the account status of an external account or a smart contract account usually changes correspondingly with the execution of a transaction.
For example, when a "transfer transaction" is completed in a block, the balances of the transferring party account and the transferring party account associated with the "transfer transaction" (i.e., the field values of the Balance fields of these accounts) are usually changed.
For another example, the "intelligent contract invocation transaction" in the block is used to invoke an intelligent contract deployed on the blockchain, invoke the intelligent contract in the EVM corresponding to the node device to execute the "intelligent contract invocation transaction", and update the account status of the intelligent contract account in the account of the intelligent contract after the execution of the intelligent contract invocation transaction.
In practical applications, whether public, private, or alliance, it is possible to provide the functionality of a Smart contract (Smart contract). An intelligent contract on a blockchain is a contract on a blockchain that can be executed triggered by a transaction. An intelligent contract may be defined in the form of code.
Taking an Etherhouse as an example, a user is supported to create and call some complex logic in the Etherhouse network. The ethernet workshop is used as a programmable block chain, and the core of the ethernet workshop is an ethernet workshop virtual machine (EVM), and each ethernet workshop node can run the EVM. The EVM is a well-behaved virtual machine through which various complex logic can be implemented. The user issuing and invoking smart contracts in the etherhouse is running on the EVM. In fact, the EVM directly runs virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"), so the intelligent contract deployed on the blockchain may be bytecode.
After Bob sends a Transaction (Transaction) containing information to create a smart contract to the ethernet network, each node can execute the Transaction in the EVM, as shown in fig. 1. The From field of the transaction in the figure is used for recording the address of the account initiating the creation of the intelligent contract, the contract code stored in the field value of the Data field of the transaction can be byte code, and the field value of the To field of the transaction is a null account. After the nodes reach the agreement through the consensus mechanism, the intelligent contract is successfully created, and the follow-up user can call the intelligent contract.
After the intelligent contract is established, a contract account corresponding to the intelligent contract appears on the block chain, and the block chain has a specific address; for example, "0 x68e12cf284 …" in each node in fig. 1 represents the address of the contract account created; the contract Code (Code) and account store (Storage) will be maintained in the account store for that contract account. The behavior of the intelligent contract is controlled by the contract code, while the account storage of the intelligent contract preserves the state of the contract. In other words, the intelligent contract causes a virtual account to be generated on the blockchain that contains the contract code and account storage.
As mentioned above, the Data field containing the transaction that created the intelligent contract may hold the byte code of the intelligent contract. A bytecode consists of a series of bytes, each of which can identify an operation. Based on the multiple considerations of development efficiency, readability and the like, a developer can select a high-level language to write intelligent contract codes instead of directly writing byte codes. For example, the high-level language may employ a language such as Solidity, Serpent, LLL, and the like. For intelligent contract code written in a high-level language, the intelligent contract code can be compiled by a compiler to generate byte codes which can be deployed on a blockchain.
Taking the Solidity language as an example, the contract code written by it is very similar to a Class (Class) in the object-oriented programming language, and various members including state variables, functions, function modifiers, events, etc. can be declared in one contract. A state variable is a value permanently stored in an account Storage (Storage) field of an intelligent contract to save the state of the contract.
As shown in FIG. 2, still taking the Etherhouse as an example, after Bob sends a transaction containing the information of the calling intelligent contract to the Etherhouse network, each node can execute the transaction in the EVM. The From field of the transaction in the figure is used for recording the address of the account initiating the intelligent contract calling, the To field is used for recording the address of the intelligent contract called, and the Data field of the transaction is used for recording the method and the parameters for calling the intelligent contract. After invoking the smart contract, the account status of the contract account may change. Subsequently, a client may check the account status of the contract account through the accessed block link points, for example, the account status may be stored in the Storage tree of the intelligent contract in the form of a Key-Value pair. The results of the execution of the transaction that invokes the smart contract, which may be in the form of a transaction receipt (receipt), are stored in the MPT receipt tree.
The intelligent contract can be independently executed at each node in the blockchain in a specified mode, and all execution records and data are stored on the blockchain, so that after the transaction is executed, transaction certificates which cannot be tampered and cannot be lost are stored on the blockchain.
A schematic diagram of creating an intelligent contract and invoking the intelligent contract is shown in fig. 3. An intelligent contract is created in an Ethernet workshop and needs to be subjected to the processes of compiling the intelligent contract, changing the intelligent contract into byte codes, deploying the intelligent contract to a block chain and the like. The intelligent contract is called in the Ethernet workshop, a transaction pointing to the intelligent contract address is initiated, the EVM of each node can respectively execute the transaction, and the intelligent contract code is distributed and operated in the virtual machine of each node in the Ethernet workshop network.
For accounts in a blockchain, the account status of the account is usually maintained through a structure. When a transaction in a block is executed, the status of the account associated with the transaction in the block chain is also typically changed.
Taking etherhouses as an example, the structure of an account usually includes fields such as Balance, Nonce, Code and Storage. Wherein:
a Balance field for maintaining the current account Balance of the account;
a Nonce field for maintaining a number of transactions for the account; the counter is used for guaranteeing that each transaction can be processed only once, and replay attack is effectively avoided;
a Code field for maintaining a contract Code for the account; in practical applications, only the hash value of the contract Code is typically maintained in the Code field; thus, the Code field is also commonly referred to as the Codhash field.
A Storage field for maintaining the Storage contents of the account (default field value is null); for a contract account, a separate storage space is usually allocated to store the storage content of the contract account; this separate storage space is often referred to as the account storage of the contract account. The storage content of the contract account is usually constructed into a data structure of an MPT (Merkle Patricia Trie) tree and stored in the independent storage space; in which, the Storage content based on the contract account is constructed into an MPT tree, which is also commonly referred to as a Storage tree. Whereas the Storage field typically maintains only the root node of the Storage tree; thus, the Storage field is also commonly referred to as the Storage root field.
Wherein, for the external account, the field values of the Code field and the Storage field shown above are both null values.
For most blockchain models, Merkle trees are typically used; alternatively, the data is stored and maintained based on the data structure of the Merkle tree. Taking etherhouses as an example, the etherhouses use MPT tree (a Merkle tree variation) as a data organization form for organizing and managing important data such as account status, transaction information, and the like.
The Etherhouse designs three MPT trees, namely an MPT state tree, an MPT transaction tree and an MPT receipt tree, aiming at data needing to be stored and maintained in a block chain. In addition to the three MPT trees, there is actually a Storage tree constructed based on the Storage content of the contract account.
An MPT state tree, which is an MPT tree organized by account state data of all accounts in a blockchain; an MPT transaction tree, which is an MPT tree organized by transaction (transaction) data in a blockchain; the MPT receipt tree is organized into transaction (receipt) receipts corresponding to each transaction generated after the transactions in the block are executed. The hash values of the root nodes of the MPT state tree, the MPT transaction tree, and the MPT receipt tree shown above are eventually added to the block header of the corresponding block.
The MPT transaction tree and the MPT receipt tree correspond to the blocks, namely each block has the MPT transaction tree and the MPT receipt tree. For the MPT transaction tree, the MPT receipt tree and the MPT state tree which are organized, the MPT transaction tree, the MPT receipt tree and the MPT state tree are finally stored in a Key-Value type database (such as a levelDB) which adopts a multi-level data storage structure.
The event mechanism of the intelligent contract is a mode for the interaction between the intelligent contract and the out-of-chain entity. For intelligent contracts deployed on blockchains, direct interaction with out-of-chain entities is generally not possible; for example, the intelligent contract cannot generally send the call result of the intelligent contract to the call initiator of the intelligent contract point to point after the call is completed.
The call results (including intermediate results and final call results) generated during the call of the intelligent contract are usually recorded in the form of events (events) to the transaction log (transactions logs) of the transaction that called the intelligent contract, and stored in the memory space of the node device. The entity outside the chain which needs to interact with the intelligent contract can acquire the calling result of the intelligent contract by monitoring the transaction log stored in the storage space of the node equipment;
for example, in the case of an Etherhouse, the transaction log will eventually be stored in the MPT receipt tree described above as part of the receipt (receipt) of the transaction pen transaction that invoked the smart contract. And the entity outside the chain interacting with the intelligent contract can monitor the transaction receipts stored in the storage space of the node device on the MPT receipt tree and acquire the events generated by the intelligent contract from the monitored transaction receipts.
The intelligent contracts deployed on the blockchains can only reference data contents stored on the blockchains generally; in practical applications, for some complex business scenarios implemented based on the intelligent contract technology, the intelligent contract may need to refer to some external data on the data entities outside the chain.
In this scenario, the intelligent contract deployed on the blockchain may refer to data on the data entities outside the chain through the Oracle prediction machine, thereby implementing data interaction between the intelligent contract and the data entities in the real world. Data entities outside the chain may include, for example, centralized servers or data centers deployed outside the chain, and so on.
In practical application, when a predicting machine is deployed for an intelligent contract on a block chain, a predicting machine intelligent contract corresponding to the predicting machine can be deployed on the block chain; the intelligent contract of the prediction machine is used for maintaining external data sent to the intelligent contract on the block chain by the prediction machine; for example, external data sent by the predictive machine to the smart contract on the blockchain may be stored in the account storage space of the predictive machine smart contract.
When a target intelligent contract on the blockchain is called, external data required by the target intelligent contract can be read from the account storage space of the prediction machine intelligent contract to complete the calling process of the intelligent contract.
It should be noted that, when sending external data to the smart contract on the blockchain, the prediction engine may use an active sending method or a passive sending method.
In one implementation, the data entity outside the chain may send external data to be provided to the target intelligent contract to the intelligent contract of the language prediction machine after signing by using the private key of the language prediction machine; for example, in time, the signed external data may be sent to the intelligent contract of the prediction machine in a periodic sending manner;
the intelligent contract of the language predicting machine can maintain a CA (certificate authority) certificate of the language predicting machine, after external data sent by a data entity outside a chain is received, a signature of the external data can be verified by using a public key of the language predicting machine maintained in the CA certificate, and after the signature passes, the external data sent by the data entity outside the chain is stored in an account storage space of the intelligent contract of the language predicting machine.
In another implementation, when a target intelligent contract on a blockchain is called, if external data required by the target intelligent contract is not read from an account storage space of the intelligent contract of the language predictive controller, the intelligent contract of the language predictive controller may interact with the language predictive controller by using an event mechanism of the intelligent contract, and the language predictive controller sends the external data required by the target intelligent contract to the account storage space of the intelligent contract of the language predictive controller.
For example, when a target intelligent contract on a blockchain is called, if external data required by the target intelligent contract is not read from an account storage space of the intelligent contract of the language predictive machine, the intelligent contract of the language predictive machine can generate an external data acquisition event, record the external data acquisition event into a transaction log of the transaction calling the intelligent contract, and store the transaction log into a storage space of a node device; the predicting machine can monitor a transaction log generated by the predicting machine intelligent contract stored in the storage space of the node equipment, respond to the monitored external data acquisition event after monitoring the external data acquisition event in the transaction log, and send the external data required by the target intelligent contract to the predicting machine intelligent contract.
One or more embodiments shown below of the present specification provide a block chain-based digital commodity transaction method applied to a transaction system including a supplier 41, a buyer 42 and a block chain 40 of digital commodities shown in fig. 4(a) or 4 (b).
In fig. 4(a), the supplier 41 and the buyer 42 of the digital goods may respectively interface with the node devices 43 and 44 in the blockchain (or the supplier 41 and the buyer 42 may respectively be directly deployed on the node devices 43 and 44), or interface with the same node device (this is not illustrated in fig. 4 (a)), so as to realize interaction with data information on the blockchain. Intelligent contracts 405 for managing digital goods are deployed on the blockchain.
The transaction initiated by the supplier 41 or the buyer 42 to the blockchain 40 may be a transaction that is encapsulated by the supplier 41 or the buyer 42 based on a preset transaction format of the blockchain, and issues the encapsulated transaction to the node device 43 or 44 corresponding to the packaged transaction, so that the transaction is broadcasted and identified in the blockchain, and is recorded in the blockchain 40 after the identification verification is passed.
The transaction initiated by the supplier 41 or the buyer 42 to the blockchain 40 may be a transaction that is encapsulated into a transaction by the node device 43 corresponding to the supplier 41 or the node device 44 corresponding to the buyer 42 after receiving the data information to be issued to the blockchain 40 sent by the supplier 41 or the buyer 42, and issues the encapsulated transaction to the node device 43 or 44 corresponding to the encapsulated transaction based on the preset transaction format of the blockchain, so that the transaction is broadcasted and identified in the blockchain, and is recorded in the blockchain 40 after the identification verification is passed. This is not limited in this specification.
In fig. 4(b), the supplier 41 and the buyer 42 of the digital commodity are both users of the digital commodity transaction service system 47, and the supplier 41 and the buyer 42 are not directly interfaced with the node device of the block chain, but are interfaced with the node device 43 by the server of the digital commodity transaction service system. The digital commodity transaction business system performs data interaction with the intelligent contract 405 for digital commodity management through an external data source service contract 406 (e.g., a prediction machine contract).
At this time, through the inter-contract message call, the digital commodity transaction service system may acquire various digital commodity transaction events of the intelligent contract 405 for commodity management, package response data to the various digital commodity transaction events sent by the supplier 41 or the buyer 42 into a transaction format, and send the transaction format to the intelligent contract 405 through the external data source service contract 406, so as to further call the service logic of the intelligent contract 405 for digital commodity management.
It should be noted that, in the system architecture, the node device corresponding to the supplier or the node device corresponding to the buyer, which are described in the following embodiments of the present specification, may include the above node device 43.
Fig. 5 illustrates a process of publishing digital commodity assets into a blockchain by a supplier of digital commodities based on the intelligent contracts, which is executed by a node device in the blockchain, and includes:
step 502, acquiring a release transaction of digital commodity assets initiated by a supplier of digital commodities; the release transaction includes commodity information of a digital commodity to be released;
step 504, in response to the release transaction, invoking a digital commodity release logic in the intelligent contract, creating a digital commodity asset in a preset format for the digital commodity based on commodity information of the digital commodity, and releasing the created digital commodity asset to the blockchain for storage, so that after the node device corresponding to the purchasing party performs data synchronization on a blockchain ledger of the blockchain, the purchasing party acquires the digital commodity asset from the synchronized blockchain ledger.
Since digital commodities may exist only in digital form, the digital commodity assets described in this specification can be regarded as digital commodities themselves having value. The digital commodity asset may be represented as a data structure of a preset format. In an illustrated embodiment, the digital commodity asset is represented as a data structure maintained with the own attribute information of the digital commodity (asset):
Figure BDA0002912605910000121
Figure BDA0002912605910000131
the maintenance of the "number of digital commodities corresponding to a digital commodity asset" field in the digital commodity asset structure means the number of individual digital commodities corresponding to the digital commodity asset. Some digital goods are commonly used in the scenario of mass sales, for example, an enterprise user may purchase e-commerce platform consumption cards in bulk for the benefits of enterprise employees, at this time, a supplier may issue digital goods assets corresponding to different consumption card quantities and calibrate the prices of the digital goods assets corresponding to the different consumption card quantities when issuing the e-commerce platform consumption card assets: the price of the first digital good asset corresponding to 100 consumption cards of 100 dollar denomination is 9000 dollars, the price of the second digital good asset corresponding to 50 consumption cards of 100 dollar denomination is 4800 dollars, the price of the third digital good asset corresponding to 20 consumption cards of 100 dollar denomination is 1998 dollars, and so on. Therefore, the purchasing party can select and match different digital commodity assets based on the self requirements.
It is noted that, in order to describe the digital commodity asset in detail, the supplier may provide some description pictures, and store the storage address of the description pictures in the digital commodity asset, so as to facilitate the buyer to refer to the detailed description of the target digital commodity according to the description indicated by the storage address. Preferably, since the data space occupied by the picture is large, in order to save the storage space of the block chain, the storage address may be a third party storage database address outside the block chain, for example, another block chain having a cross-chain reference relationship with the block chain, which is not limited in this specification.
In addition, the digital commodity anchored offline resource type contained in the data structure refers to an actual resource type acceptable by a supplier for paying the target digital commodity, such as currency, stocks, bonds, real estate and the like; the resource types may also include a currency type, such as RMB, USD, Euro, etc., when the buyer is required to pay using the currency.
After the purchasing party acquires the digital commodity assets from the block chain, the purchasing party can acquire the commodity information of the target digital commodity, and accordingly orders the digital commodity assets displayed by the commodity information.
Steps 502 to 504 illustrate the process of completing the release of the digital commodity assets by invoking the intelligent contracts, and the supplier may also directly release and chain the digital commodity assets in a transaction form without invoking the intelligent contracts, or may invoke other intelligent contracts specifically used for releasing digital commodity objects and release and chain the digital commodity assets, which is not limited in this specification.
Fig. 6 illustrates a process for a supplier and a buyer of digital goods to complete a target digital goods transaction based on the above-mentioned intelligent contracts deployed on a blockchain according to an exemplary embodiment. As shown in fig. 6, the above process is performed by a node device of a blockchain, and includes:
step 602, obtaining an order transaction initiated by a buyer; the order transaction includes order information for a digital good corresponding to the digital good asset.
The purchasing party can initiate a block chain data synchronization request to the node equipment corresponding to the purchasing party and receive the block chain data sent by the node equipment. The blockchain data includes digital commodity assets published in a supplier blockchain. The purchasing party may initiate the above-described ordering transaction to the blockchain based on the acquired digital merchandise assets. The ordering information included in the ordering transaction can include the number of digital commodities ordered by the purchasing party, and the number is generally not more than the number of digital commodities corresponding to the digital commodity assets and maintained in the digital commodity asset structure; in some bidding-enabled trading modes, the procurement information may also include the price of the ordered target digital good by the procurement party.
Step 604, in response to the order transaction, invoking a commodity ordering logic in the intelligent contract, generating an ordering event corresponding to the ordering information, and storing the ordering event in a distributed ledger of the blockchain, so that after data synchronization is performed on the blockchain ledger of the blockchain by a node device corresponding to the supplier, the supplier acquires the ordering event from the synchronized blockchain ledger.
The content of the ordering event may specify the identity of the response object of the ordering event-the user identification of the supplier of the target digital good. After data synchronization is performed on the blockchain account book of the blockchain, the node device corresponding to the supplier may acquire the order event from the synchronized blockchain account book, and the supplier may initiate a blockchain data acquisition request to the node device corresponding to the supplier, and retrieve (e.g., retrieve based on the user identifier of the supplier) a blockchain event related to the supplier or (retrieve based on the identifier of the target digital commodity) related to the target digital commodity from the blockchain data acquired by the supplier.
In yet another illustrated embodiment, as shown in fig. 4(a), the provider 41 may subscribe to the corresponding node device 43 for the blockchain event related thereto, so that the node device 43 actively pushes the subscription event to the provider 41 when the node device 43 listens to the blockchain event, i.e., the subscription event, related to the provider 41 and generated by the intelligent contract 405 in a block.
Alternatively, as shown in fig. 4(b), the digital commodity transaction service system 47 may subscribe to the node device 43 for a digital commodity transaction event related to the user provider 41 and generated by the external data source service contract 406, and after the intelligent contract 405 calls commodity ordering logic in the intelligent contract in response to the order transaction to generate an ordering event corresponding to the ordering information and pushes the ordering event requiring response of the external service system to the external data source service contract 406, the external data source service contract 406 may further generate a service event requiring response of the provider 41; when the above node device 43 monitors the above order event, which is the blockchain event related to the supplier 41 generated by the external data source service contract 406, in the block, the above order event is actively pushed to the digital goods transaction service system 47.
After obtaining the subscription event, the supplier may perform authentication before subscription confirmation based on subscription information included in the subscription event, and the authentication content may include one or more of the following:
whether the identity of the purchasing party belongs to a purchasing party list with the authority of purchasing the digital commodity; the purchasing party list can be set in the digital commodity assets;
whether the order quantity prompted by the order information exceeds the digital commodity quantity corresponding to the digital commodity asset maintained in the digital commodity assets;
whether the order quantity prompted by the order information exceeds the upper limit quantity of the single-user purchasable quantity or not;
whether the sending time of the order transaction exceeds the valid period of the digital commodity;
when the transaction mode of the digital goods is a bidding transaction mode, whether the purchasing bid provided by the purchasing party in the ordering information meets the requirement of the supplier or not.
When the supplier verifies that the subscription information included in the subscription event does not meet the requirement of the supplier, subscription rejection information for the subscription event may be initiated to the blockchain, so that the node device of the blockchain continues to invoke the intelligent contract to execute a corresponding rejection flow, as shown in the following step 606.
Step 606, if the order confirmation information corresponding to the order event and submitted by the supplier is not received within a preset time period, or the order rejection information corresponding to the order event and submitted by the supplier is received, further invoking an order rejection logic in the intelligent contract to generate an order rejection event corresponding to the order information, and storing the order rejection event in a distributed account book of the block chain, so that after the node device corresponding to the purchasing party performs data synchronization on the block chain account book of the block chain, the purchasing party acquires the order rejection event from the synchronized block chain account book.
Wherein the reject reason indicated by the rejection subscription event comprises one or more of the following:
the identity of the purchasing party does not belong to a purchasing party identity list set in the digital commodity asset;
the ordering quantity prompted by the ordering information exceeds the quantity of the digital commodities corresponding to the digital commodity assets;
the ordering quantity prompted by the ordering information exceeds the single-user purchasable upper limit quantity set in the digital commodity assets;
the transmission time of the order transaction exceeds the valid period set in the digital commodity asset;
the purchase offer set by the purchasing party in the ordering information does not conform to the price range set in the digital commodity asset or the demand of the supplier.
When the supplier verifies that the subscription information included in the subscription event meets the requirement of the supplier, the supplier may initiate subscription confirmation information for the subscription event to the blockchain, so that the node device of the blockchain continues to invoke the intelligent contract to execute the corresponding payment process, as shown in step 608 below.
Step 608, when receiving order confirmation information corresponding to the order event and submitted by the supplier, further invoking an order payment logic in the intelligent contract, completing order payment based on the order information, and storing a payment credential corresponding to the order payment in a distributed ledger of the blockchain, so that after the node device corresponding to the supplier performs data synchronization on the blockchain ledger of the blockchain, the supplier obtains the payment credential from the synchronized blockchain ledger.
As previously mentioned, the digital good assets can have set therein the types of resources, such as currency, stocks, bonds, or real estate resources, etc., that are available to the supplier for payment of the target digital good. The buyer can obtain virtual resources anchored to the frozen real assets and capable of circulating on the chain by freezing real-world real assets (including assets in the form of currency, stocks, bond notes, real estate, etc.) on the chain.
When the method is realized, a purchasing party and node equipment of a block chain network can execute an asset freezing exchange process, and the purchasing party sends a certain amount of freezing vouchers of real assets to the node equipment corresponding to an organization with virtual resource exchange authority; when the real assets are exchanged, the purchasing party can host the real assets under the organization name with the virtual resource exchange authority; after receiving the frozen voucher, the node device corresponding to the organization can broadcast the frozen voucher to the blockchain network, so that the node device in the blockchain can add virtual resources corresponding to the frozen real asset amount value to the account balance of the blockchain of the user based on the frozen voucher.
The virtual resource corresponding to the frozen real asset amount value is added into the balance of the block chain account of the purchasing party based on the frozen certificate, and the method can be further realized by interaction between the purchasing party and a virtual resource exchange intelligent contract: the node device corresponding to the purchasing party or the institution with the virtual resource exchange authority sends a virtual resource exchange transaction to the blockchain network, wherein the virtual resource exchange transaction comprises the asset freezing voucher; responding to the virtual resource exchange transaction, the node equipment of the blockchain calls a virtual resource exchange contract deployed on the blockchain, executes the resource exchange logic declared by the intelligent contract, and adds virtual resources corresponding to the real asset amount value frozen by the asset freezing voucher into the account balance of the blockchain of the purchasing party.
Based on the mode, the purchasing party can obtain virtual resources which can be anchored with the value of the real assets in the block chain network based on the real assets held by the purchasing party, and the virtual resources can be expressed as balance of an account on the chain of the purchasing party.
At this time, the node device in step 608 calls an order payment logic for managing an intelligent contract for the digital commodity asset, and a specific process of completing the order payment based on the order information may include: acquiring the total number of virtual resources consumed for ordering the digital commodity assets based on the ordering information;
and transferring the virtual resources corresponding to the total amount to the blockchain account of the supplier from the virtual resources held in the blockchain account of the purchasing party, and generating corresponding payment credentials after the transfer is successful.
The payment credential may be an intelligent contract execution log corresponding to a virtual resource transfer process performed on a chain, or a hash digest of the execution log, or another payment credential form defined by development of an intelligent contract developer, which is not limited in this embodiment.
After receiving the virtual resources in the blockchain account of the supplier, the block chain account of the supplier can apply for an organization hosting the real assets according to the requirements of the supplier, appropriately convert the virtual resources into the real assets at proper time, and provide virtual resource cashing transactions by the node equipment corresponding to the organization, and logout is carried out on the virtual resources with corresponding quantity in the blockchain account of the supplier.
In another illustrated embodiment, the node device in step 608 calls order payment logic for managing an intelligent contract for a digital good asset, and completes a specific process of order payment based on the order information, and may further include:
generating a payment event corresponding to the ordering information, and storing the payment event in a distributed account book of the block chain, so that after data synchronization is performed on the block chain account book of the block chain by a node device corresponding to the purchasing party, the purchasing party acquires the payment event from the synchronized block chain account book to perform off-chain payment;
receiving an out-of-chain payment credential triggered by the buyer corresponding to the payment event to generate a payment completion event for the supplier.
The off-chain payment credentials may include bank transfer records, or other types of transfer records or credentials for off-chain assets acceptable to the supplier. It should be noted that, in order to ensure the authenticity and credibility of the transfer or transfer record of the assets under the chain, a corresponding predicting machine may be set for an intelligent contract that manages the digital commodity assets, and triggered by the payment behavior of the buyer, an authority connected to the predicting machine, such as a bank, a bond exchange, a house property transaction center, etc., performs a digital signature on the payment credentials of the transfer, transfer record, etc. of the assets under the chain through a private key held by the authority, and sends the payment credentials and the digital signature to the predicting machine, so that the predicting machine executes a response to a payment event generated by the intelligent contract, and sends the payment credentials to the intelligent contract.
And after the supplier obtains the payment completion event from the blockchain account book, the supplier can deliver the target digital commodity based on the order information.
Step 610, when receiving the shipping information for the ordering information submitted by the supplier after obtaining the payment certificate, further invoking the shipping logic in the intelligent contract, and transferring the identifier of the digital commodity asset matched with the ordering information to the blockchain account of the buyer for holding.
Since the digital goods are digital products, the supplier can complete the delivery of the digital goods based on the blockchain network. The present specification does not limit the specific manner of delivery by the supplier.
And when the ordering information indicates that the digital commodity assets are ordered according to the total quantity of the digital commodities included in the digital commodity assets, transferring the identifiers of the digital commodity assets and the identifiers of the digital commodity assets matched with the ordering information into the blockchain account of the purchasing party for holding.
When the ordering information indicates that the ordering information orders the number of partial digital commodities contained in the digital commodity asset, splitting the digital commodity asset into a first digital commodity asset and a second digital commodity asset which are matched with the ordering information, and transferring the identification of the first digital commodity asset into a block chain account of the purchasing party for holding; further updating the digital commodity asset stored in the blockchain to the second digital commodity asset.
For example, when the digital commodity asset represents 100 consumption cards with the face value of 100 yuan, if the ordering information provided by the purchasing party indicates that 100 consumption cards with the face value of 100 yuan are purchased, the purchasing party orders the number of all digital commodities contained in the digital commodity asset; if the ordering information provided by the purchasing party indicates that 60 consumption cards with the face value of 100 yuan are purchased, namely, the purchasing party orders part of the digital commodity quantity contained in the digital commodity asset, at the moment, the first digital commodity asset matched with the ordering information is the digital commodity asset of the consumption card with the face value of 100 yuan, which is separated from the digital commodity assets of the consumption cards with the face value of 100 yuan, and the second digital commodity asset is the digital commodity asset of the consumption cards with the face value of 40 yuan.
Whether the digital commodity assets can be split and sold based on the quantity or not can be specifically set in the structural body content of the digital commodity assets by the supplier based on the different types of the digital commodities or the different selling modes of the digital commodity assets by the supplier, or whether the supplier agrees or not is determined by the supplier before the ordering confirmation information is sent by the purchasing party after the splitting and purchasing requirement is lifted from the supplier by the ordering information.
The consumption exchange information of the purchased digital commodity asset can be sent to the purchasing party by the supplying party under the chain, or, in another illustrated embodiment, the node equipment further calls the shipping logic in the intelligent contract when receiving the shipping information for the ordering information submitted by the supplying party, and adds the consumption exchange information contained in the shipping information to the purchased digital commodity asset before transferring the identification of the purchased digital commodity asset to the block chain account of the purchasing party for holding, wherein the purchased digital commodity asset maintains the consumption exchange information of the purchased digital commodity. In order to include the privacy of the consumption redemption information, the consumption redemption information can be encrypted by the public key of the purchasing party.
Step 612, when receiving the shipping confirmation information corresponding to the shipping event and submitted by the buyer, further invoking a shipping confirmation logic in the intelligent contract, generating a shipping confirmation event for the supplier, and storing the shipping confirmation event in the distributed book of the block chain, so that after the node device corresponding to the supplier performs data synchronization on the block chain book of the block chain, the supplier acquires the shipping confirmation event from the synchronized block chain book.
It is noted that in one or more of the above embodiments, the node device invokes an order event, a payment completion event, a shipping confirmation event generated by the smart contract, and the supplier or buyer sends a response to the events: the order confirmation information (or order rejection information), the payment voucher information and the delivery confirmation information can all adopt a data structure body with a uniform format, so that the execution efficiency of the intelligent contract is improved, for example, the data structure body adopted by each event or the response information to the event can comprise the following contents:
Figure BDA0002912605910000201
Figure BDA0002912605910000211
when the digital merchandise transaction method described in the above steps 602 to 612 is applied to the system architecture shown in fig. 4(a), the order confirmation information corresponding to the order event submitted by the supplier, the shipping information for the order information submitted by the supplier, and the shipping confirmation information for the shipping event provided by the buyer are all used as the call transaction for the smart contract 405; as previously discussed, the data fields of each of the aforementioned invocations of the intelligent contract 405 (including the order transaction issued by the buyer at step 602) may include one or more fields included in the aforementioned data structure. In the embodiment, the establishment of a digital commodity transaction service system is omitted, and the digital commodity transaction can be quickly and reliably realized only by means of the synchronization of the intelligent contract 405 and the node corresponding to the purchasing party and the supplying party to the block chain data.
In yet another illustrated embodiment, when the digital merchandise transaction method described in steps 602 to 612 is applied to the system architecture shown in fig. 4(b), the order confirmation information corresponding to the order event submitted by the supplier, the shipping information for the order information submitted by the supplier, and the shipping confirmation information for the shipping event provided by the buyer are all response messages to the event sent to the smart contract 405 by the external data service contract 406 based on the order event, payment completion event, and shipping event generated by the smart contract 405, and at this time, the order confirmation information corresponding to the order event submitted by the supplier, the shipping information for the order information submitted by the supplier, and the shipping confirmation information for the shipping event provided by the buyer are not in the form of a call transaction to the smart contract 405, but in the form of an invocation message between intelligent contracts.
Based on the consensus mechanism and the distributed storage characteristics of the blockchain, data stored to the blockchain is difficult to tamper with or delete by a user. Therefore, the block chain-based digital commodity transaction method provided by one or more of the above embodiments sets the business logic related to the transaction flow for both transaction parties in the intelligent contract, and stores the data generated in the transaction flow in the block chain, thereby improving the credibility of the transaction and the execution efficiency of the transaction.
It should be noted that the present specification does not limit the specific business roles of the supplier and the buyer of the digital goods, for example, the supplier may be an issuer of the digital goods, and the buyer may be a distributor of the digital goods or a consumer; or, the supplier may be a distributor of the digital goods, in which case, the purchasing party may be a secondary distributor of the digital goods, or a consumer; as another example, the supplier and the buyer may both be individual users, a chain of transactions between two users may be conducted on the target digital goods, and so on.
In correspondence with the above flow implementation, the embodiments of the present specification further provide a digital commodity transaction apparatus 70 based on a blockchain. The apparatus 70 may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory for running through a Central Processing Unit (CPU) of the device. In terms of hardware, the device in which the apparatus is located generally includes other hardware such as a chip for transmitting and receiving wireless signals and/or other hardware such as a board for implementing a network communication function, in addition to the CPU, the memory, and the storage shown in fig. 8.
As shown in fig. 7, the present specification provides a digital goods transaction apparatus 70 based on a blockchain having digital goods assets published by a supplier of digital goods stored in a distributed ledger thereof; the block chain is also provided with an intelligent contract for managing the digital commodity assets; the apparatus 70 is applied to a node device, and includes:
an obtaining unit 702, which obtains an order transaction initiated by a purchasing party; the order transaction includes order information for a digital good corresponding to the digital good asset;
an intelligent contract invoking unit 704, which invokes commodity ordering logic in the intelligent contract in response to the order transaction, and generates an ordering event corresponding to the ordering information;
a storage unit 706, configured to store the ordering event in a distributed ledger of the block chain, so that after data synchronization is performed on a block chain ledger of the block chain by a node device corresponding to the supplier, the supplier obtains the ordering event from the synchronized block chain ledger;
the intelligent contract invoking unit 704, upon receiving the order confirmation information corresponding to the order event submitted by the supplier, further invokes order payment logic in the intelligent contract to complete order payment based on the order information;
the storage unit 706 is further configured to store a payment credential corresponding to the subscription payment in a distributed ledger of the blockchain, so that after data synchronization is performed on a blockchain ledger of the blockchain by a node device corresponding to the supplier, the supplier obtains the payment credential from the synchronized blockchain ledger;
the intelligent contract invoking unit 704 further invokes shipping logic in the intelligent contract when receiving shipping information for the ordering information submitted by the supplier after obtaining the payment credentials, and transfers the identifier of the digital commodity asset matched with the ordering information to the block chain account of the buyer for holding.
In yet another illustrated embodiment, a virtual resource anchored to an off-chain asset of a user is published on the blockchain;
the completing subscription payment based on the subscription information includes:
acquiring the total number of virtual resources for ordering the digital commodity asset value anchoring based on the ordering information;
and transferring the virtual resources corresponding to the total amount to the blockchain account of the supplier from the virtual resources held in the blockchain account of the purchasing party, and generating corresponding payment credentials after the transfer is successful.
In yet another illustrated embodiment, said completing the subscription payment based on said subscription information comprises:
generating a payment event corresponding to the ordering information, and storing the payment event in a distributed account book of the block chain, so that after data synchronization is performed on the block chain account book of the block chain by a node device corresponding to the purchasing party, the purchasing party acquires the payment event from the synchronized block chain account book to perform off-chain payment;
receiving an out-of-chain payment credential triggered by the buyer corresponding to the payment event to generate a payment completion event for the supplier.
In yet another illustrated embodiment, the further invoking of shipping logic in the smart contract to transfer the identification of the digital good asset matching the ordering information to the blockchain account of the buyer for holding includes:
and when the ordering information indicates that the digital commodity assets are ordered according to the total quantity of the digital commodities included in the digital commodity assets, transferring the identifiers of the digital commodity assets and the identifiers of the digital commodity assets matched with the ordering information into the blockchain account of the purchasing party for holding.
When the ordering information indicates that the ordering information orders the number of partial digital commodities contained in the digital commodity asset, splitting the digital commodity asset into a first digital commodity asset and a second digital commodity asset which are matched with the ordering information, and transferring the identification of the first digital commodity asset into a block chain account of the purchasing party for holding; further updating the digital commodity asset stored in the blockchain to the second digital commodity asset.
In yet another illustrated embodiment, consumption redemption information for digital goods that match the ordering information is maintained in the purchased digital goods asset and is encrypted by the public key of the purchasing party.
In yet another illustrated embodiment, the digital good asset is a structure containing several fields; the several fields include a combination of one or more of the following:
a commodity identification field for a digital commodity asset;
a digital commodity quantity field contained in the digital commodity asset;
a down-link resource type field for paying for the digital merchandise asset;
a list of purchasing parties having purchasing privileges for the digital good asset;
a chain-out address field of the description picture of the digital good asset.
In yet another illustrated embodiment, the order confirmation information corresponding to the order event submitted by the supplier and the shipping information for the order information submitted by the supplier are both call transactions for the smart contract;
wherein the data field of the call transaction to the smart contract comprises a combination of one or more of:
a goods identification field of the digital goods;
an order quantity field of the digital goods;
a number of virtual resources for payment field;
a consumption redemption information field for the digital good asset.
In yet another illustrated embodiment, the subscription confirmation information corresponding to the subscription event submitted by the supplier and the shipping information for the subscription information submitted by the supplier are both external data source service contracts deployed on the blockchain and respond to the subscription event and the payment credential, respectively, to invoke a message to an inter-contract provided by the smart contract.
In yet another illustrated embodiment, if the subscription confirmation information corresponding to the subscription event submitted by the supplier is not received within a preset time period or the subscription rejection information corresponding to the subscription event submitted by the supplier is received, the intelligent contract invoking unit 704 further invokes a subscription rejection logic in the intelligent contract to generate a subscription rejection event corresponding to the subscription information;
the storage unit 706 further stores the order rejection event in a distributed ledger of the blockchain, so that after the node device corresponding to the purchasing party performs data synchronization on the blockchain ledger of the blockchain, the purchasing party acquires the order rejection event from the synchronized blockchain ledger.
The implementation process of the functions and actions of each unit in the apparatus 70 is specifically described in the implementation process of the corresponding step in the digital commodity transaction method based on the blockchain executed by the node device of the blockchain, and related points may be referred to part of the description of the method embodiment, and are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the units or modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The apparatuses, units and modules described in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the above method embodiment, the embodiment of the present specification further provides a computer device, as shown in fig. 8, including a memory and a processor. Wherein the memory has stored thereon a computer program executable by the processor; the processor, when executing the stored computer program, performs the steps of the blockchain-based digital merchandise transaction method performed by the node devices of the blockchain in the embodiments of the present specification. For a detailed description of each step of the digital commodity transaction method based on the blockchain executed by the node device of the blockchain, please refer to the previous contents, and it is not repeated.
In correspondence with the above method embodiments, embodiments of the present specification also provide a computer-readable storage medium having stored thereon computer programs, which, when executed by a processor, perform the steps of the blockchain-based digital commodity transaction method performed by the node devices of the blockchain in the embodiments of the present specification. For a detailed description of each step of the digital commodity transaction method based on the blockchain executed by the node device of the blockchain, please refer to the previous contents, and it is not repeated.
The above description is only for the purpose of illustrating the preferred embodiments of the present disclosure and is not to be construed as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure are intended to be included within the scope of the present disclosure.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data.
Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.

Claims (20)

1. A digital commodity transaction method based on a blockchain, wherein digital commodity assets issued by a supplier of digital commodities are stored in a distributed account book of the blockchain; the block chain is also provided with an intelligent contract for managing the digital commodity assets; the method is applied to node equipment and comprises the following steps:
acquiring an order transaction initiated by a purchasing party; the order transaction includes order information for a digital good corresponding to the digital good asset;
in response to the order transaction, invoking commodity order logic in the intelligent contract, generating an order event corresponding to the order information, and storing the order event in a distributed book of the block chain, so that after data synchronization is performed on a block chain book of the block chain by node equipment corresponding to the supplier, the supplier acquires the order event from the synchronized block chain book;
when order confirmation information which is submitted by the supplier and corresponds to the order event is received, further calling order payment logic in the intelligent contract, completing order payment based on the order information, and storing a payment certificate corresponding to the order payment in a distributed book of the block chain, so that after data synchronization is performed on the block chain book of the block chain by node equipment corresponding to the supplier, the supplier obtains the payment certificate from the synchronized block chain book;
and when receiving shipping information for the ordering information submitted by the supplier after obtaining the payment voucher, further calling shipping logic in the intelligent contract, and transferring the identification of the digital commodity asset matched with the ordering information to a blockchain account of the purchasing party for holding.
2. The method of claim 1, the blockchain publishing virtual resources anchored to off-chain assets of the user;
the completing subscription payment based on the subscription information includes:
acquiring the total number of virtual resources for ordering the digital commodity asset value anchoring based on the ordering information;
and transferring the virtual resources corresponding to the total amount to the blockchain account of the supplier from the virtual resources held in the blockchain account of the purchasing party, and generating corresponding payment credentials after the transfer is successful.
3. The method of claim 1, the completing a subscription payment based on the subscription information, comprising:
generating a payment event corresponding to the ordering information, and storing the payment event in a distributed account book of the block chain, so that after data synchronization is performed on the block chain account book of the block chain by a node device corresponding to the purchasing party, the purchasing party acquires the payment event from the synchronized block chain account book to perform off-chain payment;
receiving an out-of-chain payment credential triggered by the buyer corresponding to the payment event to generate a payment completion event for the supplier.
4. The method of claim 1, 2 or 3, the further invoking shipping logic in the smart contract to transfer an identification of a digital good asset matching the ordering information to the buyer's blockchain account for holding, comprising:
when the ordering information indicates that the ordering is about the number of all digital commodities contained in the digital commodity asset, transferring the identification of the digital commodity asset and the identification of the digital commodity asset matched with the ordering information into a blockchain account of the purchasing party for holding;
when the ordering information indicates that the ordering information orders the number of partial digital commodities contained in the digital commodity asset, splitting the digital commodity asset into a first digital commodity asset and a second digital commodity asset which are matched with the ordering information, and transferring the identification of the first digital commodity asset into a block chain account of the purchasing party for holding; further updating the digital commodity asset stored in the blockchain to the second digital commodity asset.
5. The method of claim 4, wherein the purchased digital good assets are maintained with consumption redemption information for digital goods that match the ordering information, and the consumption redemption information is encrypted by the buyer's public key.
6. The method of claim 1, the digital commodity asset being a structure comprising a number of fields; the several fields include a combination of one or more of the following:
a commodity identification field for a digital commodity asset;
a digital commodity quantity field contained in the digital commodity asset;
a down-link resource type field for paying for the digital merchandise asset;
a list of purchasing parties having purchasing privileges for the digital good asset;
a chain-out address field of the description picture of the digital good asset.
7. The method of claim 1, wherein the order confirmation information corresponding to the order event submitted by the supplier and the shipping information for the order information submitted by the supplier are both call transactions for the smart contract;
wherein the data field of the call transaction to the smart contract comprises a combination of one or more of:
a goods identification field of the digital goods;
an order quantity field of the digital goods;
a number of virtual resources for payment field;
a consumption redemption information field for the digital good asset.
8. The method of claim 1, wherein the supplier-submitted subscription confirmation information corresponding to the subscription event and the supplier-submitted shipping information for the subscription information are both external data source service contracts deployed on the blockchain responsive to the subscription event, the payment credentials, respectively, to inter-contract invocation messages provided by the smart contract.
9. The method of claim 1, further comprising:
if the order confirmation information which is submitted by the supplier and corresponds to the order event is not received in a preset time period, or the order rejection information which is submitted by the supplier and corresponds to the order event is received, further calling order rejection logic in the intelligent contract to generate an order rejection event corresponding to the order information, and storing the order rejection event in a distributed account book of the block chain, so that after the node equipment corresponding to the purchasing party performs data synchronization on the block chain account book of the block chain, the purchasing party acquires the order rejection event from the synchronized block chain account book.
10. A digital commodity transaction apparatus based on a blockchain, wherein a distributed account book of the blockchain stores digital commodity assets issued by suppliers of digital commodities; the block chain is also provided with an intelligent contract for managing the digital commodity assets; the device is applied to node equipment and comprises:
the acquisition unit is used for acquiring the ordering transaction initiated by the purchasing party; the order transaction includes order information for a digital good corresponding to the digital good asset;
the intelligent contract calling unit is used for calling commodity ordering logic in the intelligent contract in response to the ordering transaction and generating an ordering event corresponding to the ordering information;
the storage unit is used for storing the ordering event in a distributed account book of the block chain, so that after data synchronization is performed on the block chain account book of the block chain by node equipment corresponding to the supplier, the supplier acquires the ordering event from the synchronized block chain account book;
the intelligent contract calling unit is used for further calling order payment logic in the intelligent contract when receiving order confirmation information which is submitted by the supplier and corresponds to the order event, and completing order payment based on the order information;
the storage unit is further configured to store a payment credential corresponding to the subscription payment in a distributed ledger of the blockchain, so that after data synchronization is performed on the blockchain ledger of the blockchain by a node device corresponding to the supplier, the supplier obtains the payment credential from the synchronized blockchain ledger;
and the intelligent contract calling unit is used for further calling a delivery logic in the intelligent contract when receiving delivery information which is submitted by the supplier after the supplier acquires the payment voucher and aims at the ordering information, and transferring the identification of the digital commodity asset matched with the ordering information to a block chain account of the buyer for holding.
11. The apparatus of claim 10, the blockchain publishing virtual resources anchored with off-chain assets of users;
the completing subscription payment based on the subscription information includes:
acquiring the total number of virtual resources for ordering the digital commodity asset value anchoring based on the ordering information;
and transferring the virtual resources corresponding to the total amount to the blockchain account of the supplier from the virtual resources held in the blockchain account of the purchasing party, and generating corresponding payment credentials after the transfer is successful.
12. The apparatus of claim 10, the completing a subscription payment based on the subscription information comprising:
generating a payment event corresponding to the ordering information, and storing the payment event in a distributed account book of the block chain, so that after data synchronization is performed on the block chain account book of the block chain by a node device corresponding to the purchasing party, the purchasing party acquires the payment event from the synchronized block chain account book to perform off-chain payment;
receiving an out-of-chain payment credential triggered by the buyer corresponding to the payment event to generate a payment completion event for the supplier.
13. The apparatus of claim 10 or 11 or 12, the further invoking of shipping logic in the smart contract to transfer an identification of a digital good asset matching the ordering information to the buyer's blockchain account for holding, comprising:
and when the ordering information indicates that the digital commodity assets are ordered according to the total quantity of the digital commodities included in the digital commodity assets, transferring the identifiers of the digital commodity assets and the identifiers of the digital commodity assets matched with the ordering information into the blockchain account of the purchasing party for holding.
When the ordering information indicates that the ordering information orders the number of partial digital commodities contained in the digital commodity asset, splitting the digital commodity asset into a first digital commodity asset and a second digital commodity asset which are matched with the ordering information, and transferring the identification of the first digital commodity asset into a block chain account of the purchasing party for holding; further updating the digital commodity asset stored in the blockchain to the second digital commodity asset.
14. The apparatus of claim 13, wherein the purchased digital good asset has maintained therein consumption redemption information for digital goods that match the ordering information, and the consumption redemption information is encrypted by the buyer's public key.
15. The apparatus of claim 10, the digital commodity asset being a structure comprising a number of fields; the several fields include a combination of one or more of the following:
a commodity identification field for a digital commodity asset;
a digital commodity quantity field contained in the digital commodity asset;
a down-link resource type field for paying for the digital merchandise asset;
a list of purchasing parties having purchasing privileges for the digital good asset;
a chain-out address field of the description picture of the digital good asset.
16. The apparatus of claim 10, wherein the order confirmation information corresponding to the order event submitted by the supplier and the shipping information for the order information submitted by the supplier are both call transactions for the smart contract;
wherein the data field of the call transaction to the smart contract comprises a combination of one or more of:
a goods identification field of the digital goods;
an order quantity field of the digital goods;
a number of virtual resources for payment field;
a consumption redemption information field for the digital good asset.
17. The apparatus of claim 10, wherein the subscription confirmation information corresponding to the subscription event submitted by the supplier and the shipping information for the subscription information submitted by the supplier are both inter-contract invocation messages provided by an external data source service contract deployed on the blockchain to the smart contract in response to the subscription event and the payment credentials, respectively.
18. The apparatus of claim 10, wherein the first and second electrodes are disposed on opposite sides of the substrate,
if the order confirmation information which is submitted by the supplier and corresponds to the order event is not received in a preset time period, or the order rejection information which is submitted by the supplier and corresponds to the order event is received, the intelligent contract calling unit further calls order rejection logic in the intelligent contract to generate the order rejection event corresponding to the order information, and stores the order rejection event in a distributed account book of the block chain, so that after the node equipment corresponding to the purchasing party performs data synchronization on the block chain account book of the block chain, the purchasing party acquires the order rejection event from the synchronized block chain account book.
19. A computer device, comprising: a memory and a processor; the memory having stored thereon a computer program executable by the processor; the processor, when executing the computer program, performs the method of any of claims 1 to 9.
20. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 9.
CN202110090850.5A 2021-01-22 2021-01-22 Block chain-based digital commodity transaction method and device Active CN112883109B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110090850.5A CN112883109B (en) 2021-01-22 2021-01-22 Block chain-based digital commodity transaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110090850.5A CN112883109B (en) 2021-01-22 2021-01-22 Block chain-based digital commodity transaction method and device

Publications (2)

Publication Number Publication Date
CN112883109A true CN112883109A (en) 2021-06-01
CN112883109B CN112883109B (en) 2022-04-05

Family

ID=76050484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110090850.5A Active CN112883109B (en) 2021-01-22 2021-01-22 Block chain-based digital commodity transaction method and device

Country Status (1)

Country Link
CN (1) CN112883109B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113421096A (en) * 2021-08-17 2021-09-21 支付宝(杭州)信息技术有限公司 Block chain-based goods transaction method and device
CN113610607A (en) * 2021-08-12 2021-11-05 深圳市方直科技股份有限公司 Block chain-based digital teaching material resource issuing method and device
CN115037484A (en) * 2022-08-10 2022-09-09 捷德(中国)科技有限公司 Digital collection receiving method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109017A (en) * 2018-01-11 2018-06-01 杭州秘猿科技有限公司 Commodity trading system based on block chain intelligence contract
CN109886677A (en) * 2018-12-29 2019-06-14 阿里巴巴集团控股有限公司 A kind of commodity based on block chain purchase method and apparatus
US20190303892A1 (en) * 2018-03-30 2019-10-03 Exposition Park Holdings SEZC Digital asset exchange
CN112200567A (en) * 2020-10-09 2021-01-08 支付宝(杭州)信息技术有限公司 Resource management method and device based on block chain and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109017A (en) * 2018-01-11 2018-06-01 杭州秘猿科技有限公司 Commodity trading system based on block chain intelligence contract
US20190303892A1 (en) * 2018-03-30 2019-10-03 Exposition Park Holdings SEZC Digital asset exchange
CN109886677A (en) * 2018-12-29 2019-06-14 阿里巴巴集团控股有限公司 A kind of commodity based on block chain purchase method and apparatus
CN112200567A (en) * 2020-10-09 2021-01-08 支付宝(杭州)信息技术有限公司 Resource management method and device based on block chain and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113610607A (en) * 2021-08-12 2021-11-05 深圳市方直科技股份有限公司 Block chain-based digital teaching material resource issuing method and device
CN113421096A (en) * 2021-08-17 2021-09-21 支付宝(杭州)信息技术有限公司 Block chain-based goods transaction method and device
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

Also Published As

Publication number Publication date
CN112883109B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
US10460283B2 (en) Smart contract optimization for multiparty service or product ordering system
CN110471984B (en) Service processing method and device based on block chain and electronic equipment
WO2021042817A1 (en) Block chain-based default asset processing method, apparatus, and electronic device
CN112883109B (en) Block chain-based digital commodity transaction method and device
CN111026789B (en) Block chain-based electronic bill query method and device and electronic equipment
CN112200571B (en) Resource distribution method and device based on block chain and electronic equipment
CN112767163B (en) Block chain-based digital commodity transaction method and device
CN112766854B (en) Block chain-based digital commodity transaction method and device
WO2021259140A1 (en) Blockchain-based original work transaction method and apparatus, and electronic device
CN109313685A (en) The encryption application of block catenary system
CN110458631B (en) Bill number distribution method and device based on block chain and electronic equipment
WO2021017437A1 (en) Blockchain-based note verification method and apparatus, electronic device, and storage medium
CN112200567B (en) Resource management method and device based on block chain and electronic equipment
US11615078B2 (en) Blockchain-based transaction methods
US11429983B2 (en) Blockchain-based bill write-off method, apparatus, electronic device, and storage medium
CN110738566A (en) asset screening method and device based on block chain and electronic equipment
CN112200568B (en) Block chain based account creation method and device and electronic equipment
CN112101938B (en) Digital seal using method and device based on block chain and electronic equipment
CN111475521A (en) Cargo management method and device based on block chain and electronic equipment
CN112561407B (en) Asset management method, system and device based on block chain
CN111383120A (en) Asset management method and device based on block chain and electronic equipment
CN111383119A (en) Asset management method and device based on block chain and electronic equipment
CN112200572A (en) Resource distribution method and device based on block chain and electronic equipment
CN113506111A (en) Entity article ownership registration method and device based on block chain
CN111383118A (en) Asset management method and device based on block chain and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant