CN112037056B - Transaction processing method, device, equipment and storage medium - Google Patents

Transaction processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112037056B
CN112037056B CN202010842823.4A CN202010842823A CN112037056B CN 112037056 B CN112037056 B CN 112037056B CN 202010842823 A CN202010842823 A CN 202010842823A CN 112037056 B CN112037056 B CN 112037056B
Authority
CN
China
Prior art keywords
transaction
user
current owner
public key
target
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.)
Active
Application number
CN202010842823.4A
Other languages
Chinese (zh)
Other versions
CN112037056A (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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN202010842823.4A priority Critical patent/CN112037056B/en
Publication of CN112037056A publication Critical patent/CN112037056A/en
Application granted granted Critical
Publication of CN112037056B publication Critical patent/CN112037056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a transaction processing method, a transaction processing device, transaction processing equipment and a storage medium. Wherein the method comprises the following steps: responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item; generating a transaction contract of the target object according to the user public key, the current owner public key and a blockchain intelligent contract; determining whether the current owner and the user are target transaction parties of the transaction contract according to private keys input by the current owner and the user; if yes, replacing the current owner public key of the target object with the user public key to complete the transaction of the target object. The method and the system realize that both transaction parties conduct transactions on the blockchain, avoid random tampering of transaction information and ensure the safety of the transactions.

Description

Transaction processing method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to a blockchain technology, in particular to a transaction processing method, a transaction processing device, a transaction processing equipment and a transaction processing storage medium.
Background
With the changing consumption concepts and lifestyles, more and more people choose to conduct transactions of items through online platforms.
In the prior art, an online transaction platform is generally adopted for transaction, and a user views article information and pays through the transaction platform. However, the existing transaction platform has the problem that both transaction parties are not trusted. Because the information of both transaction sides is asymmetric, the user is difficult to distinguish the source and the true and false of the article, the source of the article cannot be traced, the transaction safety is low, and the transaction efficiency is greatly reduced.
Disclosure of Invention
The embodiment of the invention provides a transaction processing method, a transaction processing device and a transaction processing storage medium, so as to improve the security and the efficiency of transactions.
In a first aspect, an embodiment of the present invention provides a transaction processing method, performed by a block link point, the method including:
responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item;
generating a transaction contract of the target object according to the user public key, the current owner public key and a blockchain intelligent contract;
determining whether the current owner and the user are target transaction parties of the transaction contract according to private keys input by the current owner and the user;
if yes, replacing the current owner public key of the target object with the user public key to complete the transaction of the target object.
In a second aspect, an embodiment of the present invention further provides a transaction processing apparatus configured on a blockchain node, where the apparatus includes:
the information acquisition module is used for responding to a transaction initiation request of a user for a target object and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item;
the contract generation module is used for generating a transaction contract of the target object according to the user public key, the current owner public key and the blockchain intelligent contract;
the transaction party determining module is used for determining whether the current owner and the user are target transaction parties of the transaction contract according to private keys input by the current owner and the user;
and the transaction completion module is used for replacing the current owner public key of the target object with the user public key to complete the transaction of the target object if the current owner and the user are determined to be target transaction parties of the transaction contract.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements a method for processing a transaction according to any embodiment of the present invention when the program is executed by the processor.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions which, when executed by a computer processor, are used to perform a method of processing a transaction according to any of the embodiments of the present invention.
According to the embodiment of the invention, the transaction contracts of the two transaction parties are generated by responding to the transaction initiation request of the user and utilizing the intelligent contracts of the blockchain, and whether the two transaction parties are correct is determined by verifying whether the private key and the public key of the two transaction parties are matched, so that the transaction is completed. The problem that in the prior art, both transaction sides cannot transact articles through the blockchain is solved, the traceability of all transaction processes of target articles is realized, the identity of both transaction sides is ensured to be correct, and the safety and the efficiency of the transaction are improved.
Drawings
FIG. 1 is a flow chart of a transaction processing method according to a first embodiment of the invention;
FIG. 2 is a flow chart of a transaction processing method according to a second embodiment of the invention;
FIG. 3 is a block diagram showing a transaction processing apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flow chart of a transaction processing method according to an embodiment of the present invention, where the embodiment is applicable to an on-line transaction, and the method may be performed by a transaction processing device of a blockchain node. As shown in fig. 1, the method specifically includes the following steps:
s110, responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information comprises a user public key and the target item information comprises a current owner public key of the target item.
The user checks the articles to be transacted online, and if the target articles to be obtained are determined from the articles to be transacted, a transaction initiating request can be sent out aiming at the target articles. The block link point receives a transaction initiation request of a user, and obtains target article information and user information from the transaction initiation request. The user information may include an account name of the user, an age of the user, a gender of the user, a public key of the user, etc., the target item information may include attribute information of the target item, an account name of a current owner of the target item, a public key of the current owner, etc., and the attribute information of the target item may include information of an appearance, a number, a place of production, a lot number, etc. of the target item. The block chain link point determines a target object according to the transaction initiating request, searches the current owner of the target object according to the target object information, and sends a transaction prompt of the target object to the current owner of the target object so as to inform the current owner of the transaction state of the target object. The transaction state may include not initiating a transaction, waiting for a transaction, completing a transaction, etc., if the user issues a transaction initiation request for the target item, the transaction state of the target item is waiting for a transaction.
The public key is a unique identifier generated when a user or a current owner of a target object registers an account number on a blockchain node, and is public information. The user may obtain the current owner public key and query the blockchain for current owner information based on the current owner public key, e.g., may query the current owner's reputation score and historical transaction times, etc.
In this embodiment, optionally, before the user information and the target item information are acquired in response to the user request for initiating the transaction for the target item, the method further includes: responding to an information uploading request of a current owner of a target object to acquire information of the target object; and determining a serial number associated with the target object according to a preset hash algorithm and the target object information, and storing the serial number in a uplink manner.
Specifically, the target item information is stored in the uplink by the original current owner before the target item is first transacted. The initial current owner sends an information uploading request to the block link point, wherein the information uploading request contains target article information, and the target article information can comprise attribute information such as appearance, quantity and the like of target articles. The block link points respond to the information uploading request, acquire the attribute information of the target object from the information uploading request, and convert the attribute information of the target object into a serial number in the form of a hash value according to a preset hash algorithm, wherein the serial number is used as a unique identifier of an attribute file of the target object, and the attribute file is a file comprising the attribute information of the target object. Each item creates an initial source block upon entering the blockchain, representing the initial entry of the item into the transaction system. When the target item is transacted, a UTXO (Unspent Transaction Output, unexpired transaction output) model may be employed. Each transaction takes as input a last unexpired transaction, which refers to a transaction in which ownership transfer of the target item is not continued after the transaction of the target item. For example, the user obtains the target item from the initial current owner of the target item, the transaction is an unexpired transaction, if the user trades the target item again to another user after obtaining the target item, the user needs to take the transaction obtained by the target item as input of the transaction, and after the user trades with another user, the transaction obtained by the user for the target item becomes an unexpired transaction. The target item initially enters the blockchain system, and there is and only the original source block may not have reference input, and each remaining transaction will have reference to the last UTXO. By storing the information of the target object in a uplink manner and adopting the UTXO model, the information and circulation process of the target object can be traced by a user, the authenticity of the target object is ensured, and the transaction safety is guaranteed.
In this embodiment, optionally, after determining the serial number associated with the target article and storing the serial number in a chain, the method further includes: and responding to the target object viewing request of the user, searching and displaying the target object information associated with the serial number in the target object viewing request.
Specifically, the user may view the attribute information of the target object according to the serial number, so as to determine a modification process of the current owner of the target object to the information of the target object, for example, may view that the current owner modifies the appearance of the target object from red to blue. The serial number of the target item is bound to the current owner information, for example, an association relationship may exist with the public key of the current owner, and only the current owner of the target item may modify the target item information. The beneficial effects of setting up like this lie in, through carrying out the storage of the uplink to the target article, be favorable to tracing back to the target article information, improve the user to the trust degree of transaction.
The blockchain user may have accounts for multiple transaction platforms, and the blockchain user may be the current owner of the target item and the user initiating the transaction. If the blockchain user has a plurality of different transaction platform accounts, the blockchain user can uniformly manage the different accounts. The method can be implemented by using a DID (distributed digital identity identifier), and each blockchain user needs to register on the chain by using some necessary information, such as name, gender, certificate number, account number of each transaction platform, etc., when the blockchain user is in uplink, so as to obtain a DID number belonging to the personal identity claim. The method has the advantages that account information among different transaction platforms is unified, data intercommunication is achieved, the situation that a user switches accounts of different transaction platforms on a blockchain is avoided, and the user can finish registration by only writing identification information such as user names of different platforms when registering, so that a unified account is obtained. The user can check the transaction information of the user on different transaction platforms on the blockchain through the unified blockchain account number, so that the transaction and query efficiency of the user is improved.
S120, generating a transaction contract of the target object according to the user public key, the current owner public key and the blockchain intelligent contract.
The blockchain node determines a user initiating the transaction and a current owner of the target object, and obtains a user public key and a current owner public key. And generating a transaction contract specific to the target object of the user and the current owner according to the preset blockchain intelligent contract.
In this embodiment, optionally, the target article information further includes attribute information of the target article; accordingly, generating a transaction contract for the target item based on the user public key and the current owner public key, and the blockchain smart contract, comprising: generating an initial transaction contract associated with the target object according to the attribute information of the target object and the blockchain intelligent contract; the initial transaction contract is determined to be a complete transaction contract for the user and the current owner based on the user public key and the current owner public key.
Specifically, the target item information may include attribute information of the target item, current owner public key, and the like. Based on the attribute information of the target item, information such as the number and the name of the target item can be determined, and an initial transaction contract associated with the target item can be generated based on the blockchain smart contract. For example, information indicating the name of the target item may be included in the initial transaction contract. And acquiring the user public key and the current owner public key, determining both transaction parties, supplementing the user public key and the current owner public key into an initial transaction contract, and generating a complete transaction contract for the user and the current owner. The beneficial effect that sets up like this lies in, through the intelligent contract generation transaction contract on the chain, can avoid the information in the transaction contract to appear wrong, and transaction both sides can adopt dedicated on-chain currency to pay, release the transaction through intelligent contract, lock corresponding UTXO and amount, for the off-chain transaction, transfer the fund stream to on-line, only need carry out the operation of delivery off-line, improve the security and the efficiency of transaction.
S130, determining whether the current owner and the user are target transaction parties of the transaction contract according to the private key input by the current owner and the user.
The block chain node generates a transaction contract according to an instruction of the current owner to issue the transaction contract, the current owner signs the transaction contract, the transaction contract is sent to the user, and the user confirms again. If the user confirms that the signature is performed without errors, the current owner and the user are correct transaction parties, namely target transaction parties, and the transaction can be completed. The current owner and the user can confirm the signature according to the private key, the association relationship exists between the private key and the public key, if the private key is not matched with the public key, the condition that the identity of the current owner or the user is wrong is indicated, the effective multiple signature cannot be generated, and the transaction cannot be carried out.
In this embodiment, optionally, determining whether the current owner and the user are target transaction parties of the transaction contract according to the private key input by the current owner and the user includes: determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner; if yes, determining that the current owner is a target transaction party of the transaction contract, and acquiring a private key of the user; determining whether a private key input by a user is matched with a public key of the user; if yes, determining that the user is a target transaction party of the transaction contract.
Specifically, after receiving the transaction contract, the current owner of the target object inputs the private key of the current owner, and the blockchain node determines whether the private key input by the current owner is matched with the public key of the current owner in the transaction contract. If the public key of the current owner is not matched with the input private key, the current owner is not the current owner in the transaction contract, namely the current owner is not the target transaction party, the transaction is ended, and a prompt can be sent to the current owner and the user in the transaction contract; if the public key of the current owner is matched with the input private key, the current owner is the target transaction party, and the input private key of the current owner is the confirmation transaction contract. And sending the transaction contract confirmed by the current owner to a user initiating the transaction, and acquiring a private key input by the user. The block link point determines whether a private key input by a user is matched with a public key of the user in the transaction contract, if the private key is not matched with the public key of the user in the transaction contract, the user is not a target transaction party, the transaction is ended, and a prompt can be sent to a current owner and the user in the transaction contract; if so, the user is indicated as the target transaction party, and the transaction can be completed. The beneficial effects of the arrangement are that the identities of the current owner and the user can be confirmed through the public and private key matching of the current owner and the user, so that wrong transaction parties are prevented from carrying out transactions, and the transaction efficiency and the transaction accuracy are improved.
And S140, if so, replacing the current owner public key of the target object with the user public key to complete the transaction of the target object.
If the current owner and the user are determined to be target transaction parties, the transaction can be confirmed to be completed, the ownership of the target article is converted from the original current owner to the user, and the user becomes a new current owner of the target article. The user can sign the transaction contract with the private key after paying the agreed amount, after verification, the other party obtains the amount, the user obtains the ownership of the target object, and the transaction is completed as the new current owner of the target object. The public key of the current owner in the target article information is replaced by the public key of the user, the user is taken as the current owner of the target article, the attribute information of the target article is authorized to be modified, and the modification process is stored on the blockchain.
According to the technical scheme of the embodiment, the transaction contracts aiming at the transaction parties are generated by responding to the transaction initiation request of the user and utilizing the intelligent contracts of the blockchain, and whether the transaction parties are correct or not is determined by verifying whether the private keys and the public keys of the transaction parties are matched, so that the transaction is completed. The problem that in the prior art, both transaction sides cannot transact articles through the blockchain is solved, the traceability of all transaction processes of target articles is realized, the identity of both transaction sides is ensured to be correct, and the safety and the efficiency of the transaction are improved.
Example two
Fig. 2 is a flow chart of a transaction processing method according to a second embodiment of the present invention, which is further optimized based on the foregoing embodiment, and the method may be executed by a transaction processing device. As shown in fig. 2, the method specifically includes the following steps:
s210, responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information comprises a user public key and the target item information comprises a current owner public key of the target item.
S220, determining a third party public key according to the third parties agreed by the user and the current owner.
The third party is an authentication mechanism party predetermined by the user and the current owner of the target object, and is used for authenticating the target object, for example, the authenticity of the target object can be verified. The third party can register in the blockchain in advance, and if the user and the current owner agree to authenticate the target object by the third party, the blockchain node acquires the third party public key.
S230, generating a transaction contract of the target object according to the third party public key, the user public key, the current owner public key and the blockchain intelligent contract.
And generating an initial transaction contract of the target object according to the attribute information of the target object and the blockchain intelligent contract. And supplementing the initial transaction contract as a complete transaction contract according to the third party public key, the user public key and the current owner public key, wherein the complete transaction contract is a transaction contract for the third party, the user and the current owner.
S240, determining whether the current owner and the user are target transaction parties of the transaction contract according to the private key input by the current owner and the user.
The current owner, the third party and the user can sequentially input private keys for signature, and if the private keys of the current owner and the user are matched with the public keys of the current owner and the user in the transaction contract, the current owner and the user are determined to be target transaction parties. If the third party private key matches the third party public key in the transaction contract, determining that the third party is the third party designated by the current owner and user.
In this embodiment, optionally, determining whether the current owner and the user are target transaction parties of the transaction contract according to the private key input by the current owner and the user includes: determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner; if yes, determining that the current owner is a target transaction party of the transaction contract, and acquiring a private key of a third party; determining whether a private key input by a third party is matched with a public key of the third party; if yes, determining that the target object is successfully identified by the third party, and acquiring a private key of the user; determining whether a private key input by a user is matched with a public key of the user; if yes, determining that the user is a target transaction party of the transaction contract.
Specifically, the blockchain node firstly sends the transaction contract to the current owner, the current owner inputs a private key to sign, and if the private key input by the current owner is matched with the public key of the current owner in the transaction contract, the current owner is a target transaction party, and the transaction can be continued; if the private key input by the current owner is not matched with the public key of the current owner in the transaction contract, the current owner is not the target transaction party, the possibility of impoverishment of the identity of other people exists, the block link point stops the transaction in time, and a prompt is sent to the target transaction party in the transaction contract. After proving that the current owner is the target transaction party, the transaction contract is sent to a third party, and the third party authenticates the target article according to attribute information of the target article in the transaction contract, identity information of the current owner and the like. If the identification target object has no problem, a third party private key can be input for signature; if there is a problem in authenticating the target object, the signature may not be performed. If the private key input by the third party is not matched with the third party private key in the transaction contract, the blockchain node can send a notification to the current owner and the user to remind the current owner and the user that the third party identity has a problem. If the private key input by the third party is matched with the public key of the third party in the transaction contract, determining that the authentication of the target object by the third party is completed, sending the transaction contract to the user, and inputting the private key of the user by the user for signature. If the private key input by the user is matched with the public key of the user in the transaction contract, the user is the target transaction party, the transaction is completed, and the ownership of the target article is transferred to the user. If the third party considers that the target object has a problem and does not sign by the private key, the transaction contract is sent to the user for signing after the transaction contract is sent to the third party for a preset time. For example, the preset time is five minutes, after the transaction contract is sent to the third party, the third party is delayed and has no signature, and after five minutes, the transaction contract is directly transferred to the user.
The signature of the third party does not affect the signature of the user, i.e. the signing of the target object by the third party can give the user a certain reference, but does not decide whether the user signs or not. If the third party considers that the target object has a problem and does not sign by the private key, the user can still continue to conduct the transaction. If the user decides to abort the transaction, no private key signature is required. If the user does not sign the transaction within a specified time, the transaction is considered invalid and the transaction fails. The user can also check the number of times of transaction failure of the current owner through the public key of the current owner before the transaction, the number of times of transaction failure can be used as a suspicion of commodity quality and a judgment condition of the credit of the current owner, if the number of times of transaction failure is too large, the target object of the current owner is indicated to have a certain problem, and the transaction with the current owner can be avoided.
S250, if yes, replacing the public key of the current owner of the target object with the public key of the user, and completing the transaction of the target object.
According to the embodiment of the invention, the transaction contracts of the two transaction parties are generated by responding to the transaction initiation request of the user and utilizing the intelligent contracts of the blockchain, and whether the two transaction parties are correct is determined by verifying whether the private key and the public key of the two transaction parties are matched, so that the transaction is completed. The quality assurance of the target object can be improved through the authentication of the third party. The problem that in the prior art, both transaction sides cannot transact articles through the blockchain is solved, the traceability of all transaction processes of target articles is realized, the identity of both transaction sides is ensured to be correct, and the safety and the efficiency of the transaction are improved.
Example III
Fig. 3 is a block diagram of a transaction processing device according to a third embodiment of the present invention, which can execute a transaction processing method according to any embodiment of the present invention, and the transaction processing device is provided with functional modules and beneficial effects corresponding to the execution method and is configured on a blockchain node. As shown in fig. 3, the apparatus specifically includes:
an information obtaining module 301, configured to obtain user information and target item information in response to a transaction initiation request of a user for a target item; wherein the user information comprises a user public key and the target item information comprises a current owner public key of the target item;
a contract generation module 302, configured to generate a transaction contract of the target object according to the user public key, the current owner public key, and the blockchain intelligent contract;
a transaction party determining module 303, configured to determine whether the current owner and the user are target transaction parties of the transaction contract according to the private key input by the current owner and the user;
and the transaction completion module 304 is configured to replace the current owner public key of the target item with the user public key to complete the transaction of the target item if it is determined that the current owner and the user are the target transaction parties of the transaction contract.
Optionally, the apparatus further comprises:
the article information acquisition module is used for responding to the information uploading request of the current owner of the target article to acquire the target article information before responding to the transaction initiation request of the user for the target article to acquire the user information and the target article information;
and the article information storage module is used for determining a serial number associated with the target article according to a preset hash algorithm and the target article information and storing the serial number in a uplink manner.
Optionally, the apparatus further comprises:
and the target article viewing module is used for responding to the target article viewing request of the user, searching and displaying target article information associated with the serial number in the target article viewing request.
Optionally, the target item information further includes attribute information of the target item;
accordingly, the contract generation module 302 includes:
an initial contract generation unit, configured to generate an initial transaction contract associated with the target item according to attribute information of the target item and the blockchain intelligent contract;
and the complete contract generating unit is used for determining the initial transaction contract as a complete transaction contract for the user and the current owner according to the user public key and the current owner public key.
Optionally, the contract generating module 302 is specifically configured to:
determining a third party public key according to the third parties agreed by the user and the current owner;
and generating a transaction contract of the target object according to the third party public key, the user public key, the current owner public key and the blockchain intelligent contract.
Optionally, the transaction party determining module 303 is specifically configured to:
determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner;
if yes, determining that the current owner is a target transaction party of the transaction contract, and acquiring a private key of the user;
determining whether a private key input by a user is matched with a public key of the user;
if yes, determining that the user is a target transaction party of the transaction contract.
Optionally, the transaction party determining module 303 is further specifically configured to:
determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner;
if yes, determining that the current owner is a target transaction party of the transaction contract, and acquiring a private key of a third party;
determining whether a private key input by a third party is matched with a public key of the third party;
if yes, determining that the target object is successfully identified by the third party, and acquiring a private key of the user;
determining whether a private key input by a user is matched with a public key of the user;
if yes, determining that the user is a target transaction party of the transaction contract.
According to the embodiment of the invention, the transaction contracts of the two transaction parties are generated by responding to the transaction initiation request of the user and utilizing the intelligent contracts of the blockchain, and whether the two transaction parties are correct is determined by verifying whether the private key and the public key of the two transaction parties are matched, so that the transaction is completed. The problem that in the prior art, both transaction sides cannot transact articles through the blockchain is solved, the traceability of all transaction processes of target articles is realized, the identity of both transaction sides is ensured to be correct, and the safety and the efficiency of the transaction are improved.
Example IV
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary computer device 400 suitable for use in implementing embodiments of the invention. The computer device 400 shown in fig. 4 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 4, computer device 400 is in the form of a general purpose computing device. Components of computer device 400 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, a bus 403 that connects the various system components (including the system memory 402 and the processing units 401).
Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 400 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 400 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 404 and/or cache memory 405. Computer device 400 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 403 through one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored in, for example, memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The computer device 400 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), one or more devices that enable a user to interact with the computer device 400, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 400 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 411. Moreover, computer device 400 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 412. As shown, network adapter 412 communicates with other modules of computer device 400 over bus 403. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with computer device 400, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 401 executes various functional applications and data processing by running a program stored in the system memory 402, for example, implements a transaction processing method provided by an embodiment of the present invention, including:
responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item;
generating a transaction contract of the target object according to the user public key, the current owner public key and the blockchain intelligent contract;
determining whether the current owner and the user are target transaction parties of a transaction contract according to private keys input by the current owner and the user;
if yes, replacing the current owner public key of the target object with the user public key to complete the transaction of the target object.
Example five
A fifth embodiment of the present invention further provides a storage medium containing computer executable instructions, on which a computer program is stored, which when executed by a processor, implements a method for processing a transaction according to the embodiment of the present invention, including:
responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item;
generating a transaction contract of the target object according to the user public key, the current owner public key and the blockchain intelligent contract;
determining whether the current owner and the user are target transaction parties of a transaction contract according to private keys input by the current owner and the user;
if yes, replacing the current owner public key of the target object with the user public key to complete the transaction of the target object.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A method of processing a transaction performed by a block link point, the method comprising:
responding to a transaction initiation request of a user for a target object, and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item;
generating a transaction contract of the target object according to the user public key, the current owner public key and a blockchain intelligent contract;
determining whether the current owner and the user are target transaction parties of the transaction contract according to private keys input by the current owner and the user;
if yes, replacing the current owner public key of the target object with the user public key to complete the transaction of the target object;
determining whether the current owner and the user are target transaction parties of the transaction contract according to the private keys input by the current owner and the user comprises the following steps:
determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner;
if yes, determining the current owner as a target transaction party of the transaction contract, and acquiring a private key of the user;
determining whether the private key input by the user is matched with the public key of the user;
if yes, determining that the user is a target transaction party of the transaction contract;
and when the current owner and the user are confirmed to be target transaction parties of the transaction contract, continuing the transaction, and ending the transaction if any party of the current owner and the user is not confirmed.
2. The method of claim 1, further comprising, prior to acquiring the user information and the target item information in response to a user transaction initiation request for the target item:
responding to an information uploading request of a current owner of a target object, and acquiring the information of the target object;
and determining a serial number associated with the target object according to a preset hash algorithm and the target object information, and storing the serial number in a uplink manner.
3. The method of claim 2, further comprising, after determining a serial number associated with the target item and storing it in a chain:
and responding to the target object viewing request of the user, searching and displaying the target object information associated with the serial number in the target object viewing request.
4. The method of claim 1, wherein the target item information further comprises attribute information of a target item;
accordingly, generating a transaction contract for the target item from the user public key and the current owner public key, and a blockchain smart contract, comprising:
generating an initial transaction contract associated with the target object according to the attribute information of the target object and the blockchain intelligent contract;
and determining the initial transaction contract as a complete transaction contract for the user and the current owner according to the user public key and the current owner public key.
5. The method of claim 1, wherein generating a transaction contract for the target item based on the user public key and the current owner public key, and a blockchain smart contract, further comprises:
determining a third party public key according to the third parties agreed by the user and the current owner;
and generating a transaction contract of the target object according to the third party public key, the user public key, the current owner public key and the blockchain intelligent contract.
6. The method of claim 5, wherein determining whether the current owner and the user are target parties to the transaction contract based on private keys entered by the current owner and the user comprises:
determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner;
if yes, determining that the current owner is a target transaction party of the transaction contract, and acquiring a private key of the third party;
determining whether the private key input by the third party is matched with the public key of the third party;
if yes, determining that the target object is successfully identified by the third party, and acquiring a private key of the user;
determining whether the private key input by the user is matched with the public key of the user;
if yes, determining that the user is a target transaction party of the transaction contract.
7. A transaction processing device disposed on a blockchain node, the device comprising:
the information acquisition module is used for responding to a transaction initiation request of a user for a target object and acquiring user information and target object information; wherein the user information includes a user public key and the target item information includes a current owner public key of the target item;
the contract generation module is used for generating a transaction contract of the target object according to the user public key, the current owner public key and the blockchain intelligent contract;
the transaction party determining module is used for determining whether the current owner and the user are target transaction parties of the transaction contract according to private keys input by the current owner and the user;
the transaction completion module is used for replacing the current owner public key of the target object with the user public key to complete the transaction of the target object if the current owner and the user are determined to be target transaction parties of the transaction contract;
the transaction party determining module is specifically configured to:
determining whether the private key input by the current owner is matched with the public key of the current owner according to the private key input by the current owner;
if yes, determining that the current owner is a target transaction party of the transaction contract, and acquiring a private key of the user;
determining whether a private key input by a user is matched with a public key of the user;
if yes, determining that the user is a target transaction party of the transaction contract;
and when the current owner and the user are confirmed to be target transaction parties of the transaction contract, continuing the transaction, and ending the transaction if any party of the current owner and the user is not confirmed.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of processing a transaction according to any of claims 1-6 when executing the program.
9. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the method of processing a transaction as claimed in any one of claims 1 to 6.
CN202010842823.4A 2020-08-20 2020-08-20 Transaction processing method, device, equipment and storage medium Active CN112037056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010842823.4A CN112037056B (en) 2020-08-20 2020-08-20 Transaction processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010842823.4A CN112037056B (en) 2020-08-20 2020-08-20 Transaction processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112037056A CN112037056A (en) 2020-12-04
CN112037056B true CN112037056B (en) 2024-04-09

Family

ID=73579922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010842823.4A Active CN112037056B (en) 2020-08-20 2020-08-20 Transaction processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112037056B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347522B (en) * 2021-01-05 2021-07-06 南京金宁汇科技有限公司 UTXO architecture-based third-party data uplink realization method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110289962A (en) * 2019-07-22 2019-09-27 国网电子商务有限公司 A kind of IBE key updating method and device based on UTXO model
CN111199399A (en) * 2018-10-31 2020-05-26 吴众玮 System and method for creating, transferring and invoking transferable commitments
CN111311341A (en) * 2020-01-22 2020-06-19 腾讯科技(深圳)有限公司 Bill processing method, apparatus and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199399A (en) * 2018-10-31 2020-05-26 吴众玮 System and method for creating, transferring and invoking transferable commitments
CN110289962A (en) * 2019-07-22 2019-09-27 国网电子商务有限公司 A kind of IBE key updating method and device based on UTXO model
CN111311341A (en) * 2020-01-22 2020-06-19 腾讯科技(深圳)有限公司 Bill processing method, apparatus and medium

Also Published As

Publication number Publication date
CN112037056A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
US11949670B2 (en) Method and system for trustworthiness using digital certificates
US10567175B2 (en) Method and system blockchain variant using digital signatures
CN108898389B (en) Content verification method and device based on block chain and electronic equipment
US10902425B2 (en) System and method for biometric credit based on blockchain
US20190188657A1 (en) Method and system for outside guarantees for a blockchain transaction
CN109155029B (en) Method and system for electronic distribution of controlled tokens
JP6462158B2 (en) Method and system for detecting unauthorized use in blockchain based transactions
US11715099B2 (en) Method and system for trust-based payments via blockchain
CN109716374B (en) Method and system for card-less ATM transactions via mobile device
US20150294313A1 (en) Systems, apparatus and methods for improved authentication
US20180337926A1 (en) Using third party information to improve predictive strength for authentications
US11310052B1 (en) Identity authentication blockchain
CN112037056B (en) Transaction processing method, device, equipment and storage medium
JP2019087236A (en) Systems and methods for enhancing online user authentication using personal cloud platform
US8910260B2 (en) System and method for real time secure image based key generation using partial polygons assembled into a master composite image
US20230274283A1 (en) Method and system for transfer of ownership of nft (non-fungible token) upon refund transaction in payment network
US20220131854A1 (en) Systems and methods for identity verification reuse
CN115099800A (en) Block chain based method and device for transferring poor asset data
CN114629663A (en) Block chain-based digital commodity transaction method and device
CN114528532A (en) Supply chain data evidence storing method and device, computer equipment and storage medium
WO2020070721A1 (en) System and method for easy and secure transactions in social networks for mobile devices
US11989703B2 (en) Method and system of blockchain disbursements
US20230385822A1 (en) Method and system for processing an asset swap across two blockchains
CN114172660B (en) Account management method, device and equipment of alliance chain and storage medium
CN117635324A (en) Data processing method, device, equipment and medium based on block chain network

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