CN114092240A - Transaction method and device based on block chain, electronic equipment and storage medium - Google Patents

Transaction method and device based on block chain, electronic equipment and storage medium Download PDF

Info

Publication number
CN114092240A
CN114092240A CN202111256329.0A CN202111256329A CN114092240A CN 114092240 A CN114092240 A CN 114092240A CN 202111256329 A CN202111256329 A CN 202111256329A CN 114092240 A CN114092240 A CN 114092240A
Authority
CN
China
Prior art keywords
transaction
resource information
information
encrypted
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111256329.0A
Other languages
Chinese (zh)
Inventor
李纯懿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Original Assignee
Zhuo Erzhi Lian Wuhan Research Institute 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 Zhuo Erzhi Lian Wuhan Research Institute Co Ltd filed Critical Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Priority to CN202111256329.0A priority Critical patent/CN114092240A/en
Publication of CN114092240A publication Critical patent/CN114092240A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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/602Providing cryptographic facilities or services
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Bioethics (AREA)
  • Accounting & Taxation (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application provides a transaction method, a transaction device, electronic equipment and a computer-readable storage medium based on a block chain; the method comprises the following steps: acquiring transaction object information of a transaction object of the transaction party node; respectively sending the transaction object information to at least two nodes of parties to be transacted through a blockchain network, so that each node of parties to be transacted obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction party node; respectively receiving encrypted transaction resource information sent by the at least two to-be-transacted party nodes, and determining a target transacted party node corresponding to the transaction resource information meeting preset transaction conditions based on each encrypted transaction resource information; and exchanging the transaction object information and the transaction resource information with the target traded party node to complete the transaction of the transaction object. By the method and the device, high privacy and high safety of transaction can be realized, and malicious bidding is avoided.

Description

Transaction method and device based on block chain, electronic equipment and storage medium
Technical Field
The present disclosure relates to a Blockchain (Blockchain) technology, and in particular, to a method and an apparatus for transaction based on a Blockchain, an electronic device, and a storage medium.
Background
Bidding is a transaction mode which can effectively improve the progress speed of the project and save the cost of the project. Existing bidding links typically employ a fully open bidding mechanism in order to ensure fairness. For example, the tenderer discloses the project requirement index to all bidders, and each bidder discloses the index and the offer provided by the bidder to all participants.
Although the current bidding mechanism can meet the fairness of the bidding process, the completely open environment exposes the privacy information of each participant, which may result in some unfair competition situations. For example, bidder a and bidder B both disclose their bids and know privacy information of the product or proposal from each other. In this way, the bidder a and the bidder B can intentionally lower their bids than the other bidders to perform "price fight". Such inappropriate bidding activity will severely impact the subsequent development of bidding programs and adversely affect the bidder's ability to screen out the most appropriate solution.
Disclosure of Invention
The embodiment of the application provides a transaction method, a transaction device, an electronic device and a computer-readable storage medium based on a block chain, which can realize high privacy and high security of transaction and avoid malicious bidding.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a transaction method based on a block chain, which is applied to a transaction party node and comprises the following steps:
acquiring transaction object information of a transaction object of the transaction party node;
respectively sending the transaction object information to at least two nodes of parties to be transacted through a blockchain network, so that each node of parties to be transacted obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction party node;
respectively receiving encrypted transaction resource information sent by the at least two to-be-transacted party nodes, and determining a target transacted party node corresponding to the transaction resource information meeting preset transaction conditions based on each encrypted transaction resource information; the target traded party node is any one of the at least two nodes of parties to be traded;
and exchanging the transaction object information and the transaction resource information with the target traded party node to complete the transaction of the transaction object.
In the above scheme, the method further comprises:
obtaining encryption keys, and respectively sending the encryption keys to the at least two nodes of the parties to be traded through a blockchain network;
the encryption key is used for homomorphic encryption of the transaction resource information by the to-be-transacted party node to obtain corresponding encrypted transaction resource information.
In the above scheme, the method further comprises:
acquiring transaction resource threshold information aiming at the transaction object, and homomorphically encrypting the transaction resource threshold information to obtain a corresponding encryption threshold;
respectively sending the encryption threshold values to the at least two nodes of the parties to be traded;
and the encryption threshold is used for determining a node of a party to be traded and obtaining encrypted trading resource information aiming at the trading object.
In the foregoing solution, the determining, based on each encrypted transaction resource information, a target transacted party node corresponding to the transaction resource information that satisfies a preset transaction condition includes:
performing homomorphic comparison on each encrypted transaction resource information to determine the largest encrypted transaction resource information;
and taking the node of the party to be traded corresponding to the maximum encrypted trading resource information as the node of the target party to be traded corresponding to the trading resource information meeting the preset trading conditions.
The embodiment of the application provides a transaction method based on a block chain, which is applied to a to-be-transacted party node and comprises the following steps:
receiving transaction object information of a transaction object sent by a transaction party node through a blockchain network;
obtaining encrypted transaction resource information for the transaction object based on the transaction object information;
and sending the encrypted transaction resource information to the transaction party node through a blockchain network, so that the transaction party node determines a target traded party node corresponding to the transaction resource information meeting preset transaction conditions based on the encrypted transaction resource information of at least two to-be-traded party nodes, and exchanges transaction objects and transaction resources with the target traded party node to complete the transaction of the transaction objects.
In the foregoing solution, the obtaining encrypted transaction resource information for the transaction object based on the transaction object information includes:
presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface;
responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information;
and carrying out homomorphic encryption on the transaction resource information to obtain the encrypted transaction resource information.
In the above scheme, the method further comprises:
receiving an encryption threshold value sent by the trading party node;
the transaction object information obtaining encrypted transaction resource information for the transaction object includes:
presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface;
responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information;
carrying out homomorphic encryption on the transaction resource information to obtain first encrypted transaction resource information;
and comparing the first encrypted transaction resource information with the encryption threshold value in a homomorphic way, and when the first encrypted transaction resource information is greater than or equal to the encryption threshold value, taking the first encrypted transaction resource information as the encrypted transaction resource information.
The embodiment of the application provides a transaction device based on block chain, including:
the acquisition module is used for acquiring the transaction object information of the transaction object of the transaction party node;
the sending module is used for respectively sending the transaction object information to at least two nodes of parties to be transacted through a blockchain network, so that each node of parties to be transacted obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction party node;
the receiving module is used for respectively receiving encrypted transaction resource information sent by the at least two nodes of the party to be transacted and determining a target node of the party to be transacted corresponding to the transaction resource information meeting preset transaction conditions based on each encrypted transaction resource information; the target traded party node is any one of the at least two nodes of parties to be traded;
and the trading module is used for exchanging the trading object information and the trading resource information with the target traded party node to complete the trading of the trading object.
The embodiment of the application provides a transaction device based on block chain, including:
the receiving module is used for receiving transaction object information of a transaction object sent by a transaction party node through a blockchain network;
an obtaining module, configured to obtain encrypted transaction resource information for the transaction object based on the transaction object information;
and the sending module is used for sending the encrypted transaction resource information to the transaction party node through the blockchain network, so that the transaction party node determines a target traded party node corresponding to the transaction resource information meeting preset transaction conditions based on the encrypted transaction resource information of at least two to-be-traded party nodes, exchanges transaction objects and transaction resources with the target traded party node, and completes the transaction of the transaction objects.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the method provided by the embodiment of the application when executing the executable instructions stored in the memory.
Embodiments of the present application provide a computer-readable storage medium, which stores executable instructions for causing a processor to implement the method provided by the embodiments of the present application when the processor executes the executable instructions.
According to the method and the device, the transaction object information of the transaction object of the transaction part node is obtained, the transaction object information is respectively sent to at least two to-be-transacted part nodes through the blockchain network, so that each to-be-transacted part node obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction part node, the encrypted transaction resource information sent by the at least two to-be-transacted part nodes is respectively received, the target to-be-transacted part node corresponding to the transaction resource information meeting the preset transaction condition is determined based on each encrypted transaction resource information, then the transaction object information and the transaction resource information are exchanged with the target to-be-transacted part node, high privacy and high safety of transaction are achieved through combination of the blockchain and the encryption technology, and malicious bidding is avoided.
Drawings
Fig. 1A is an alternative structural diagram of a data sharing system according to an embodiment of the present application;
fig. 1B is an alternative structural diagram of a block provided in the present application;
FIG. 1C is an alternative schematic diagram of a block generation process provided by an embodiment of the present application;
fig. 2 is an alternative structural schematic diagram of an electronic device provided in an embodiment of the present application;
fig. 3 is an alternative flow chart of a blockchain-based transaction method provided by an embodiment of the present application;
fig. 4 is an alternative flow chart of a transaction method based on a blockchain according to an embodiment of the present application;
fig. 5 is an alternative structural diagram of a block chain-based transaction system according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, the block chain technique in the embodiments of the present application will be described.
Referring to the data sharing system shown in fig. 1A, the data sharing system 100 refers to a system for performing data sharing between nodes, the data sharing system may include a plurality of nodes 101, and the plurality of nodes 101 may refer to respective clients in the data sharing system. Each node 101 may receive input information while operating normally and maintain shared data within the data sharing system based on the received input information. In order to ensure information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the data sharing system receives input information, other nodes in the data sharing system acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all the nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding thereto, and each node in the data sharing system may store a node identifier of another node in the data sharing system, so that the generated block is broadcast to the other node in the data sharing system according to the node identifier of the other node in the following. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node, and table 1 only illustrates the IP address as an example.
Figure BDA0003324276080000061
Figure BDA0003324276080000071
Each node in the data sharing system stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1B, the block chain is composed of a plurality of blocks, the starting block includes a block header and a block main body, the block header stores an input information characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
When each block in the block chain is generated, referring to fig. 1C, when the node where the block chain is located receives the input information, the input information is verified, after the verification is completed, the input information is stored in the memory pool, and the hash tree for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identifications of the other nodes in the data sharing system, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.
Based on this, embodiments of the present application provide a transaction method and apparatus based on a block chain, an electronic device, and a computer-readable storage medium, which can implement high privacy and high security of a transaction, and avoid malicious bidding.
Next, an electronic device for implementing the above block chain based transaction method according to the embodiment of the present application is described, referring to fig. 2, where fig. 2 is an optional structural schematic diagram of an electronic device 200 according to the embodiment of the present application, and the electronic device for implementing the block chain based transaction method according to the embodiment of the present application is described. The electronic device 200 shown in fig. 2 includes: at least one processor 201, memory 205, at least one network interface 202, and a user interface 203. The various components in the electronic device 200 are coupled together by a bus system 204. It is understood that the bus system 204 is used to enable communications among the components. The bus system 204 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 204 in fig. 2.
The Processor 201 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 203 includes one or more output devices 2031, including one or more speakers and/or one or more visual display screens, that enable the presentation of media content. The user interface 203 also includes one or more input devices 2032 including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 205 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 205 may optionally include one or more storage devices physically located remote from processor 201.
The memory 205 includes either volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 205 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, the memory 205 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, in support of various operations, in embodiments of the present application, the memory 205 has stored therein an operating system 2051, a network communication module 2052, a presentation module 2053, an input processing module 2054, and a blockchain based transaction device 2055; in particular, the amount of the solvent to be used,
an operating system 2051, which includes system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and for handling hardware-based tasks;
a network communication module 2052 for communicating to other computing devices via one or more (wired or wireless) network interfaces 202, exemplary network interfaces 202 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 2053 for enabling presentation of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more output devices 2031 (e.g., display screens, speakers, etc.) associated with the user interface 203;
an input processing module 2054 for detecting one or more user inputs or interactions from one of the one or more input devices 2032 and for translating the detected inputs or interactions.
In some embodiments, the blockchain based transaction device provided by the embodiment of the present application can be implemented in software, and fig. 2 shows a blockchain based transaction device 2055 stored in the memory 205, which can be software in the form of programs and plug-ins, etc., and includes the following software modules: a get module 20551, a send module 20552, a receive module 20553, and a transaction module 20554, which are logical and thus may be arbitrarily combined or further separated depending on the functionality implemented. The functions of the respective modules will be explained below.
In other embodiments, the block chain based transaction apparatus provided in the embodiments of the present Application may be implemented in hardware, and for example, the block chain based transaction apparatus provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to execute the block chain based transaction method provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
The block chain based transaction method provided by the embodiment of the present application will be described in conjunction with exemplary applications and implementations of the terminal provided by the embodiment of the present application.
Referring to fig. 3, fig. 3 is an optional flowchart of a blockchain-based transaction method provided in an embodiment of the present application, where the method is applied to a transaction party node, and will be described with reference to steps shown in fig. 3, the blockchain-based transaction method provided in an embodiment of the present application includes:
step 301, obtaining transaction object information of a transaction object of the transaction party node;
step 302, the transaction object information is respectively sent to at least two nodes of parties to be transacted through a blockchain network, so that each node of parties to be transacted obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction party node;
step 303, respectively receiving encrypted transaction resource information sent by the at least two nodes of the party to be transacted, and determining a target node of the party to be transacted corresponding to the transaction resource information meeting preset transaction conditions based on each encrypted transaction resource information; the target traded party node is any one of the at least two nodes of parties to be traded;
and step 304, exchanging the transaction object information and the transaction resource information with the target traded party node to complete the transaction of the transaction object.
It should be noted that the blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. The block chain, which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises public and private key generation maintenance (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorization condition, the user management module supervises and audits the transaction condition of certain real identities and provides rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node equipment and used for verifying the validity of the service request, recording the service request to storage after consensus on the valid request is completed, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the service information to a shared account (network communication) completely and consistently after encryption, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of upgrading and canceling the contracts; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
The platform product service layer provides basic capability and an implementation framework of typical application, and developers can complete block chain implementation of business logic based on the basic capability and the characteristics of the superposed business. The application service layer provides the application service based on the block chain scheme for the business participants to use.
In the embodiment of the present application, the transaction object corresponds to a transaction party node, and the transaction object may be any item available for transaction, including a virtual item. In actual implementation, the trading party node obtains trading object information of the trading object, namely basic information of the trading object, such as the basic information of the trading object, including the name, appearance, function and the like of the trading object. The node of the trading party uploads the information of the trading object to the blockchain network, the node of the party to be traded can obtain the information of the trading object through the blockchain network, and then the trading resource information aiming at the trading object is obtained based on the information of the trading object. And the transaction resources corresponding to the transaction resource information are used for the transaction between the transaction objects.
In some embodiments, the method further comprises: obtaining encryption keys, and respectively sending the encryption keys to the at least two nodes of the parties to be traded through a blockchain network; the encryption key is used for homomorphic encryption of the transaction resource information by the to-be-transacted party node to obtain corresponding encrypted transaction resource information.
It should be noted that homomorphic encryption is a symmetric encryption algorithm, which can perform addition and multiplication operations on a ciphertext, so that a result obtained by performing a certain operation on the ciphertext after encryption is exactly equal to a ciphertext obtained by performing an expected operation on a plaintext before encryption and then encrypting the plaintext. The homomorphic encryption effectively ensures that a data processing party can directly carry out corresponding processing on the ciphertext of the data and cannot acquire the plaintext information of the data processed by the data processing party. The characteristic of homomorphic encryption ensures that the data and the privacy of the user can be correspondingly ensured.
In the embodiment of the application, the encryption key is a key for homomorphic encryption and is generated by the trading party node, and the trading party node sends the encryption key to at least two nodes of parties to be traded after obtaining the encryption key. In some embodiments, the encryption key generated by the transactor node comprises a public key and a private key, and the transactor node reserves the private key and sends the public key thereof to at least two nodes to be transacted.
It should be further noted that, in the embodiment of the present application, the transaction resource information represents the amount of the transaction resource corresponding to the node of the party to be transacted. And after the node of the party to be traded obtains the encryption key, carrying out homomorphic encryption on the trading resource information by using the encryption key to obtain the encrypted trading resource information. It should be understood that the encrypted transaction resource information is a ciphertext obtained by homomorphically encrypting the value of the transaction resource information.
In some embodiments, the method further comprises: acquiring transaction resource threshold information aiming at the transaction object, and homomorphically encrypting the transaction resource threshold information to obtain a corresponding encryption threshold; respectively sending the encryption threshold values to the at least two nodes of the parties to be traded; and the encryption threshold is used for determining a node of a party to be traded and obtaining encrypted trading resource information aiming at the trading object.
It should be noted that, in this embodiment of the application, the transaction resource threshold information is a numerical parameter, and in an actual scenario, the transaction resource threshold information may be, for example, a minimum value of a transaction resource set by a transaction party node, and is used by the to-be-transacted party node to obtain corresponding transaction resource information based on the minimum value, when the transaction resource information is less than the minimum value, prompt information indicating that the transaction resource is too small is generated, and when the transaction resource information is greater than or equal to the minimum value, the transaction resource information is obtained as the number of the transaction resource used by the to-be-transacted party node for performing a transaction with a transaction object.
In actual implementation, after obtaining the transaction resource threshold information, the transaction party node performs homomorphic encryption on the transaction resource threshold by using the encryption key to obtain an encryption threshold, it should be understood that the encryption threshold is a ciphertext obtained by homomorphic encryption on the transaction resource threshold information, and after obtaining the encryption threshold, the transaction party node to be transacted may perform homomorphic comparison on the encryption threshold and the encryption transaction resource information to determine the amount of the transaction resource finally used for performing transaction with the transaction object, that is, to determine the final transaction resource information.
In some embodiments, the determining, based on each encrypted transaction resource information, a target transacted party node corresponding to the transaction resource information meeting a preset transaction condition includes:
performing homomorphic comparison on each encrypted transaction resource information to determine the largest encrypted transaction resource information;
and taking the node of the party to be traded corresponding to the maximum encrypted trading resource information as the node of the target party to be traded corresponding to the trading resource information meeting the preset trading conditions.
According to the method and the device, the transaction object information of the transaction object of the transaction part node is obtained, the transaction object information is respectively sent to at least two to-be-transacted part nodes through the blockchain network, so that each to-be-transacted part node obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction part node, the encrypted transaction resource information sent by the at least two to-be-transacted part nodes is respectively received, the target to-be-transacted part node corresponding to the transaction resource information meeting the preset transaction condition is determined based on each encrypted transaction resource information, then the transaction object information and the transaction resource information are exchanged with the target to-be-transacted part node, high privacy and high safety of transaction are achieved through combination of the blockchain and the encryption technology, and malicious bidding is avoided.
Continuing to explain below, the present application provides a block chain based transaction method, which is applied to a node of a party to be transacted, and with reference to fig. 4, the method includes:
step 401, receiving transaction object information of a transaction object sent by a transaction party node through a blockchain network;
step 402, obtaining encrypted transaction resource information aiming at the transaction object based on the transaction object information;
step 403, sending the encrypted transaction resource information to the transaction part node through the blockchain network, so that the transaction part node determines a target traded part node corresponding to the transaction resource information meeting preset transaction conditions based on the encrypted transaction resource information of at least two to-be-traded part nodes, and performs exchange processing between a transaction object and a transaction resource with the target traded part node to complete transaction of the transaction object.
In some embodiments, the obtaining encrypted transaction resource information for the transaction object based on the transaction object information comprises:
presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface;
responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information;
and carrying out homomorphic encryption on the transaction resource information to obtain the encrypted transaction resource information.
In some embodiments, the method further comprises:
receiving an encryption threshold value sent by the trading party node;
the transaction object information obtaining encrypted transaction resource information for the transaction object includes:
presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface;
responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information;
carrying out homomorphic encryption on the transaction resource information to obtain first encrypted transaction resource information;
and comparing the first encrypted transaction resource information with the encryption threshold value in a homomorphic way, and when the first encrypted transaction resource information is greater than or equal to the encryption threshold value, taking the first encrypted transaction resource information as the encrypted transaction resource information.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
Step S1: the seller is used as an original owner of the transaction object, the seller personal information and the commodity price are encrypted, and the seller personal information ciphertext, the commodity information and the public key are linked.
The process of generating the key by the seller can be realized by the following steps:
selecting two large prime numbers p, q, and ensuring that gcd (pq, (p-1) (q-1) is 1;
(xi) calculating n-p q, λ -l cm (p-1, q-1);
(x) define l (x) 1)/n (division);
fourthly, randomly selecting one less than n2And μ ═ L (g) is presentλmod n2))-1mod n;
The public key is (n, g), namely PKt;
sixthly, the private key is (lambda, mu).
The process of encryption can be implemented as follows:
the plaintext m is a positive integer which is greater than or equal to 0 and less than n;
② randomly selecting r to satisfy 0<r<n and
Figure BDA0003324276080000141
(a sufficient condition is that r, n are coprime);
c g for calculating cipher text Encmrnmod n2
In practical implementation, the seller generates the binary vector Ib and adopts the encryption algorithmBit-by-bit encryption to obtain [ Ib]t=Enc(PKt,It)=([Ib]t(1),[Ib]t(2),……,[Ib]t(M)) And uploading the result to the blockchain network.
Then, after receiving the commodity information through the block chain network, the buyer encrypts the bid information through the public key, compares the bid information through subtraction homomorphic operation, and performs the bid without revealing the reserve price, and can bid when the bid is higher than the reserve price.
And finally, comparing the bids of a plurality of buyers through subtraction homomorphic operation, and only storing the related information of the current highest price according to the result. And in a period of time, the person with the highest price is the buyer of the transaction, the result is fed back to the buyer and the seller, the change of the owner of the transaction object is completed according to the decryption of the result, and the transaction information of the commodities is broadcasted in a full chain.
The transaction mode provided by the embodiment of the application ensures that double flowers cannot be generated in the blockchain system, namely two identical legal holders cannot appear in the system, and high security of transaction is realized. Meanwhile, the method can resist malicious attacks of new and old users, avoid global rollback, support parallelism and cross-chain naturally, and is beneficial to supervision. In addition, the homomorphic encryption does not need to decrypt the ciphertext in advance, and any algebraic operation which can be performed on the plaintext can be performed on ciphertext data.
Referring to fig. 5, fig. 5 is an alternative architecture schematic diagram of a block chain-based transaction system 500 provided in the embodiment of the present application, and a transaction party node 503 is connected to a to-be-transacted party node 501 through a network 502. In some embodiments, the trading party node 503 and the to-be-traded party node 501 may both be terminals or servers. The terminal may be a notebook computer, a tablet computer, a desktop computer, a smart phone, a dedicated messaging device, a portable game device, a smart speaker, a smart watch, and the like, but is not limited thereto. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN) service, big data and an artificial intelligence platform. Network 502 may be a wide area network or a local area network, or a combination of both. The trading party node 503 and the to-be-traded party node 501 may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited thereto.
An exemplary structure of the blockchain based transaction device 255 provided by the embodiment of the present application implemented as a software module is described below, and in some embodiments, as shown in fig. 2, the software module stored in the blockchain based transaction device 255 of the memory 250 may include:
an obtaining module 2551, configured to obtain transaction object information of a transaction object of the transaction party node;
a sending module 2552, configured to send the transaction object information to at least two nodes of parties to be traded through a blockchain network, respectively, so that each node of parties to be traded obtains encrypted transaction resource information for the transaction object based on the transaction object information, and sends the encrypted transaction resource information to the node of the transaction party;
a receiving module 2553, configured to receive encrypted transaction resource information sent by the at least two to-be-transacted party nodes, respectively, and determine, based on each encrypted transaction resource information, a target transacted party node corresponding to the transaction resource information that meets a preset transaction condition; the target traded party node is any one of the at least two nodes of parties to be traded;
and the trading module 2554 is configured to perform exchange processing of the trading object information and the trading resource information with the target traded party node to complete a trade for the trading object.
In some embodiments, the obtaining module is further configured to: obtaining encryption keys, and respectively sending the encryption keys to the at least two nodes of the parties to be traded through a blockchain network; the encryption key is used for homomorphic encryption of the transaction resource information by the to-be-transacted party node to obtain corresponding encrypted transaction resource information.
In some embodiments, the obtaining module is further configured to: acquiring transaction resource threshold information aiming at the transaction object, and homomorphically encrypting the transaction resource threshold information to obtain a corresponding encryption threshold; respectively sending the encryption threshold values to the at least two nodes of the parties to be traded; and the encryption threshold is used for determining a node of a party to be traded and obtaining encrypted trading resource information aiming at the trading object.
In some embodiments, the obtaining module is further configured to: performing homomorphic comparison on each encrypted transaction resource information to determine the largest encrypted transaction resource information; and taking the node of the party to be traded corresponding to the maximum encrypted trading resource information as the node of the target party to be traded corresponding to the trading resource information meeting the preset trading conditions.
The following continues to describe the block chain-based transaction apparatus provided in the embodiment of the present application, including:
the receiving module is used for receiving transaction object information of a transaction object sent by a transaction party node through a blockchain network;
an obtaining module, configured to obtain encrypted transaction resource information for the transaction object based on the transaction object information;
and the sending module is used for sending the encrypted transaction resource information to the transaction party node through the blockchain network, so that the transaction party node determines a target traded party node corresponding to the transaction resource information meeting preset transaction conditions based on the encrypted transaction resource information of at least two to-be-traded party nodes, exchanges transaction objects and transaction resources with the target traded party node, and completes the transaction of the transaction objects.
In some embodiments, the obtaining encrypted transaction resource information for the transaction object based on the transaction object information comprises: presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface; responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information; and carrying out homomorphic encryption on the transaction resource information to obtain the encrypted transaction resource information.
In some embodiments, the receiving module is further configured to: receiving an encryption threshold value sent by the trading party node; the transaction object information obtaining encrypted transaction resource information for the transaction object includes: presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface; responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information; carrying out homomorphic encryption on the transaction resource information to obtain first encrypted transaction resource information; and comparing the first encrypted transaction resource information with the encryption threshold value in a homomorphic way, and when the first encrypted transaction resource information is greater than or equal to the encryption threshold value, taking the first encrypted transaction resource information as the encrypted transaction resource information.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the computer instructions. . A method.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, cause the processor to perform the method provided by embodiments of the present application.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In conclusion, the embodiment of the application can realize high privacy and high security of the transaction, and avoids malicious bidding.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (10)

1. A transaction method based on a block chain is characterized in that the method is applied to a transaction side node and comprises the following steps:
acquiring transaction object information of a transaction object of the transaction party node;
respectively sending the transaction object information to at least two nodes of parties to be transacted through a blockchain network, so that each node of parties to be transacted obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction party node;
respectively receiving encrypted transaction resource information sent by the at least two to-be-transacted party nodes, and determining a target transacted party node corresponding to the transaction resource information meeting preset transaction conditions based on each encrypted transaction resource information; the target traded party node is any one of the at least two nodes of parties to be traded;
and exchanging the transaction object information and the transaction resource information with the target traded party node to complete the transaction of the transaction object.
2. The method of claim 1, further comprising:
acquiring transaction resource threshold information aiming at the transaction object, and homomorphically encrypting the transaction resource threshold information to obtain a corresponding encryption threshold;
respectively sending the encryption threshold values to the at least two nodes of the parties to be traded;
and the encryption threshold is used for determining a node of a party to be traded and obtaining encrypted trading resource information aiming at the trading object.
3. The method according to claim 1, wherein the determining, based on each encrypted transaction resource information, a target transacted party node corresponding to the transaction resource information satisfying a preset transaction condition comprises:
performing homomorphic comparison on each encrypted transaction resource information to determine the largest encrypted transaction resource information;
and taking the node of the party to be traded corresponding to the maximum encrypted trading resource information as the node of the target party to be traded corresponding to the trading resource information meeting the preset trading conditions.
4. A transaction method based on a block chain is characterized in that the method is applied to a to-be-transacted party node and comprises the following steps:
receiving transaction object information of a transaction object sent by a transaction party node through a blockchain network;
obtaining encrypted transaction resource information for the transaction object based on the transaction object information;
and sending the encrypted transaction resource information to the transaction party node through a blockchain network, so that the transaction party node determines a target traded party node corresponding to the transaction resource information meeting preset transaction conditions based on the encrypted transaction resource information of at least two to-be-traded party nodes, and exchanges transaction objects and transaction resources with the target traded party node to complete the transaction of the transaction objects.
5. The method of claim 4, wherein obtaining encrypted transaction resource information for the transaction object based on the transaction object information comprises:
presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface;
responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information;
and carrying out homomorphic encryption on the transaction resource information to obtain the encrypted transaction resource information.
6. The method of claim 4, further comprising:
receiving an encryption threshold value sent by the trading party node;
the transaction object information obtaining encrypted transaction resource information for the transaction object includes:
presenting the transaction object information on a transaction interface, and presenting a transaction resource information input function item aiming at the transaction object information on the transaction interface;
responding to the input operation aiming at the transaction resource information input function item, and obtaining input transaction resource information;
carrying out homomorphic encryption on the transaction resource information to obtain first encrypted transaction resource information;
and comparing the first encrypted transaction resource information with the encryption threshold value in a homomorphic way, and when the first encrypted transaction resource information is greater than or equal to the encryption threshold value, taking the first encrypted transaction resource information as the encrypted transaction resource information.
7. A blockchain-based transaction apparatus, comprising:
the acquisition module is used for acquiring the transaction object information of the transaction object of the transaction party node;
the sending module is used for respectively sending the transaction object information to at least two nodes of parties to be transacted through a blockchain network, so that each node of parties to be transacted obtains encrypted transaction resource information aiming at the transaction object based on the transaction object information and sends the encrypted transaction resource information to the transaction party node;
the receiving module is used for respectively receiving encrypted transaction resource information sent by the at least two nodes of the party to be transacted and determining a target node of the party to be transacted corresponding to the transaction resource information meeting preset transaction conditions based on each encrypted transaction resource information; the target traded party node is any one of the at least two nodes of parties to be traded;
and the trading module is used for exchanging the trading object information and the trading resource information with the target traded party node to complete the trading of the trading object.
8. A blockchain-based transaction apparatus, comprising:
the receiving module is used for receiving transaction object information of a transaction object sent by a transaction party node through a blockchain network;
an obtaining module, configured to obtain encrypted transaction resource information for the transaction object based on the transaction object information;
and the sending module is used for sending the encrypted transaction resource information to the transaction party node through the blockchain network, so that the transaction party node determines a target traded party node corresponding to the transaction resource information meeting preset transaction conditions based on the encrypted transaction resource information of at least two to-be-traded party nodes, exchanges transaction objects and transaction resources with the target traded party node, and completes the transaction of the transaction objects.
9. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 6 when executing executable instructions stored in the memory.
10. A computer-readable storage medium having stored thereon executable instructions for, when executed by a processor, implementing the method of any one of claims 1 to 6.
CN202111256329.0A 2021-10-27 2021-10-27 Transaction method and device based on block chain, electronic equipment and storage medium Pending CN114092240A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111256329.0A CN114092240A (en) 2021-10-27 2021-10-27 Transaction method and device based on block chain, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111256329.0A CN114092240A (en) 2021-10-27 2021-10-27 Transaction method and device based on block chain, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114092240A true CN114092240A (en) 2022-02-25

Family

ID=80298149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111256329.0A Pending CN114092240A (en) 2021-10-27 2021-10-27 Transaction method and device based on block chain, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114092240A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117057807A (en) * 2023-10-11 2023-11-14 腾讯科技(深圳)有限公司 Resource processing method based on block chain architecture and related equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117057807A (en) * 2023-10-11 2023-11-14 腾讯科技(深圳)有限公司 Resource processing method based on block chain architecture and related equipment
CN117057807B (en) * 2023-10-11 2024-02-09 腾讯科技(深圳)有限公司 Resource processing method based on block chain architecture and related equipment

Similar Documents

Publication Publication Date Title
US11368391B2 (en) Verification of data processes in a network of computing resources
EP4120114A1 (en) Data processing method and apparatus, smart device and storage medium
CN111080295B (en) Electronic contract processing method and device based on blockchain
EP3070630B1 (en) Data system and method
CN113691597B (en) Block chain contract deployment method, device, equipment and storage medium
CN111314067B (en) Block storage method and device, computer equipment and storage medium
CN112446785A (en) Cross-chain transaction method, system, device, equipment and storage medium
WO2020051710A1 (en) System and process for managing digitized security tokens
EP3260979A1 (en) Verification of data processes in a network of computing resources
CN111047443B (en) User scoring method and device, electronic equipment and computer readable storage medium
CN110177124B (en) Identity authentication method based on block chain and related equipment
CN111066047A (en) Implementing a blockchain based workflow
CN103023657B (en) Security verification system based on distributed network transaction
CN110601815B (en) Block chain data processing method and equipment
CN111311211A (en) Data processing method and device based on block chain
CN111488372A (en) Data processing method, device and storage medium
CN112163240A (en) Block chain based distributed government affair architecture unifying method and system
CN114971625A (en) Microgrid green electricity transaction system based on block chain technology and data storage and settlement method
CN109660534A (en) Safety certifying method, device, electronic equipment and storage medium based on more trade companies
CN111292057A (en) Service processing method based on block chain
CN111274597A (en) Data processing method and equipment
Homoliak et al. An air-gapped 2-factor authentication for smart-contract wallets
CN114092240A (en) Transaction method and device based on block chain, electronic equipment and storage medium
CN112949866A (en) Poisson regression model training method and device, electronic equipment and storage medium
CN112488707A (en) Service flow supervision method and system

Legal Events

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