CN115203749B - Data transaction method and system based on block chain - Google Patents

Data transaction method and system based on block chain Download PDF

Info

Publication number
CN115203749B
CN115203749B CN202211129514.8A CN202211129514A CN115203749B CN 115203749 B CN115203749 B CN 115203749B CN 202211129514 A CN202211129514 A CN 202211129514A CN 115203749 B CN115203749 B CN 115203749B
Authority
CN
China
Prior art keywords
data
transaction
utxo
output
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211129514.8A
Other languages
Chinese (zh)
Other versions
CN115203749A (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.)
Tianju Dihe Suzhou Technology Co ltd
Original Assignee
Tianju Dihe Suzhou Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianju Dihe Suzhou Technology Co ltd filed Critical Tianju Dihe Suzhou Technology Co ltd
Priority to CN202211129514.8A priority Critical patent/CN115203749B/en
Publication of CN115203749A publication Critical patent/CN115203749A/en
Application granted granted Critical
Publication of CN115203749B publication Critical patent/CN115203749B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • 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
    • 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

Abstract

The invention discloses a data transaction method and system based on a block chain, and relates to the technical field of block chains. One embodiment of the method comprises: the data purchasing end sends purchasing transaction to the data transaction device; the data transaction device calls a verification intelligent contract on the block chain according to the purchase transaction to verify the zero knowledge proof, and if the verification is passed, the transaction encryption information is uploaded to the block chain; the data purchasing end sends transaction plaintext information to the data providing end; the data providing end verifies the transaction plaintext information according to the transaction encryption information, and if the verification is passed, the data providing end sends target data to the data purchasing end; the data purchasing end receives the target data and sends a confirmation transaction to the data transaction device according to the confirmation operation of the data purchasing end; and the data transaction device calls a pre-deployed transfer intelligent contract on the block chain according to the confirmed transaction, and transfers the resources of the data buyer to the data provider. The implementation can protect the privacy of the transaction parties.

Description

Data transaction method and system based on block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a data transaction method and a data transaction system based on a block chain.
Background
The block chain has the characteristics of being not tampered and the like, and can be applied to data transaction to enable the transaction process to be carried out fairly and publicly. However, storing transaction data in blockchains presents privacy concerns. Transaction data in the blockchain is completely disclosed, all nodes of the transaction on the chain have redundant backups, purchase records are used as transaction contents and are opened on the chain publicly, and any blockchain participant can inquire relevant information of the data transaction on the chain, including transaction parties, purchase price, data contents, transaction date and the like. However, if the transaction content is encrypted, the blockchain node also cannot verify the correctness of the transaction. Therefore, the existing data transaction method based on the block chain cannot protect the privacy of transaction parties.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data transaction method and system based on a block chain, which can protect privacy of transaction parties.
In a first aspect, an embodiment of the present invention provides a data transaction method based on a blockchain, including:
the data purchasing end sends purchasing transaction to the data transaction device; wherein, the data transaction device is applied to the node equipment of the block chain, and the purchase transaction comprises the following steps: zero knowledge proof and transaction encryption information; the transaction encryption information is obtained by encrypting transaction plaintext information;
the data transaction device calls a pre-deployed verification intelligent contract on the block chain according to the purchase transaction so as to verify the zero knowledge proof, and if the verification is passed, the transaction encryption information is uploaded to the block chain;
the data purchasing end sends the transaction plaintext information to a data providing end;
the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, and if the verification is passed, target data corresponding to the transaction plaintext information is sent to the data purchasing end;
the data purchasing end receives the target data and sends a confirmation transaction to the data transaction device according to the confirmation operation of the data purchasing end;
and the data transaction device calls a pre-deployed transfer intelligent contract on the block chain according to the confirmed transaction, and transfers the resources of the data buyer to a data provider.
In a second aspect, an embodiment of the present invention provides a data transaction system based on a blockchain, including: the data purchasing terminal, the data transaction device and the data providing terminal; the data transaction device is applied to node equipment of a block chain;
the data purchasing end is used for sending purchasing transaction to the data transaction device; wherein the purchase transaction comprises: zero knowledge proof and transaction encryption information; the transaction encryption information is obtained by encrypting transaction plaintext information; sending the transaction plaintext information to a data providing end; receiving target data corresponding to the transaction plaintext information sent by the data providing end, and sending a confirmation transaction to the data transaction device according to a confirmation operation of a data purchaser;
the data transaction device is used for calling a pre-deployed verification intelligent contract on the block chain according to the purchase transaction so as to verify the zero knowledge proof, and if the verification is passed, the transaction encryption information is uploaded to the block chain; according to the confirmed transaction, calling a pre-deployed transfer intelligent contract on the block chain, and transferring the resources of the data buyer to a data provider;
and the data providing end is used for verifying the transaction plaintext information according to the transaction encryption information stored in the block chain, and if the verification is passed, the target data is sent to the data purchasing end.
One embodiment of the above invention has the following advantages or benefits: only transaction encryption information is stored in the block chain, but transaction plaintext information is not stored, so that privacy and safety of all parties of data transaction are improved. The data transaction arrangement may verify the authenticity of the purchase transaction by a zero knowledge proof submitted by the data purchaser, ensuring that the transaction encryption information stored in the blockchain is generated by the purchase transaction provided by the data purchaser. The data provider can verify the legality of the transaction plaintext information provided by the data purchasing end based on the transaction encryption information stored in the block chain, and the safety of data transaction is ensured by combining the chain with the chain.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a flowchart of a data transaction method based on a blockchain according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a blockchain-based data transaction system according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, an embodiment of the present invention provides a data transaction method based on a blockchain, including:
step 101: the data purchasing end sends purchasing transaction to the data transaction device; the data transaction device is applied to node equipment of the block chain, and the purchase transaction comprises the following steps: zero knowledge proof and transaction encryption information; the transaction encryption information is obtained by encrypting transaction plaintext information.
In order to avoid storing the transaction plaintext information in the blockchain, the embodiment of the invention encrypts the transaction plaintext information through a cryptographic algorithm to obtain the transaction encrypted information.
Step 102: and the data transaction device calls a verification intelligent contract which is pre-deployed on the block chain according to the purchase transaction so as to verify the zero knowledge proof, and if the verification is passed, the transaction encryption information is uploaded to the block chain.
When the intelligent contract is called, the following verification method is executed: and verifying the zero knowledge proof, and uploading transaction encryption information to the blockchain if the verification is passed.
If the verification is not passed, an authenticity verification non-passing notice is sent to the data purchasing end, and the data purchasing end can inquire a verification result from the data transaction device.
Step 103: and the data purchasing end sends transaction plaintext information to the data providing end.
In order to improve the security of the transaction plaintext information in the transmission process and prevent the transaction plaintext information from being tampered, the data purchasing end can send the transaction plaintext information through a trusted communication channel under the chain, the transaction plaintext information can be encrypted and signed, and the data providing end verifies whether the transaction plaintext information is sent by the data purchasing end or not based on the signature.
Step 104: and the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, and if the verification is passed, the data providing end sends target data corresponding to the transaction plaintext information to the data purchasing end.
If the verification is not passed, a transaction plaintext information verification failure notice is sent to the data purchasing end, or the data purchasing end actively acquires a verification result from the data providing end.
Step 105: the data purchasing end receives the target data and sends a confirmation transaction to the data transaction device according to the confirmation operation of the data purchasing end.
The target data is data purchased by the data purchaser from the data provider. The data purchasing end and the data providing end can be two APPs or two modes of the same APP.
Step 106: and the data transaction device calls a pre-deployed transfer intelligent contract on the block chain according to the confirmed transaction, and transfers the resources of the data buyer to the data provider.
When the intelligent transfer contract is called, the following transfer method is executed: resources of the data purchaser are transferred to the data provider.
The resources may be in the form of tokens, credits, or the like.
The verification intelligent contract and the transfer intelligent contract can be two intelligent contracts, and a verification method and a transfer method can be respectively realized through two methods in one intelligent contract. The subsequent intelligent contract management is similar, and the query method, the verification method and the transfer method can be realized through the same intelligent contract.
Only transaction encryption information is stored in the block chain, but transaction plaintext information is not stored, so that privacy and safety of all parties of data transaction are improved. The data transaction arrangement may verify the authenticity of the purchase transaction by a zero knowledge proof submitted by the data purchaser, ensuring that the transaction encryption information stored in the blockchain is generated by the purchase transaction provided by the data purchaser. The data provider can verify the legality of the transaction plaintext information provided by the data purchasing end based on the transaction encryption information stored in the block chain, and the safety of data transaction is ensured in a mode of combining the block chain with the block chain.
In one embodiment of the invention, the method further comprises:
the data providing end determines the description information of the target data and sends the description information to the data transaction device;
the data transaction device calls a management intelligent contract which is pre-deployed on the block chain, and description information is uploaded into the block chain;
the data purchasing end sends a query request to the data transaction device according to the query operation of the data purchasing end;
the data transaction device calls the management intelligent contract to inquire the description information meeting the conditions according to the inquiry request, and feeds the inquiry result back to the data purchasing end.
In order to enable the data purchaser to know the information of the data to be transacted, but improve the privacy and the safety of the data related to transaction at the same time, the embodiment of the invention stores the description information of the data in the block chain and provides query service for the data purchaser, and the data purchaser can query the data to be transacted in the block chain through the data purchaser and determine the content of the purchase transaction according to the data to be transacted in the block chain.
The description information can be uploaded to the block chain in a set format, for example, the format of the description information is < Data ID, metaData: { JSON }, rand (R) >. The Data ID is used for representing the Data identification, is composed of a string of randomly generated characters, and is a Data global unique ID. The MetaData is MetaData, can adopt JSON format, has kept several fields about description information, can be customized by the data provider, can deal with different data content under different scenes. And Rand (R) is a third random number.
In one embodiment of the invention, the transaction plaintext information comprises: identification of target data, an input UTXO (Unspent Transaction Output) list, a signature of each input UTXO, and an Output UTXO list;
the input UTXO list comprises a plurality of input UTXOs;
the output UTXO list comprises a plurality of output UTXOs;
inputting the UTXO as a triple comprising a public key of the data purchaser, a face value of the UTXO and a first random number;
the output UTXO is a triple comprising a public key of a data purchaser or a public key of a data provider, a face value of the output UTXO and a second random number;
embodiments of the present invention use UTXO to characterize resources and the following embodiments will be described with reference to tokens as an example. A UTXO is a triplet that contains three fields, namely < PK, value, R ρ >, where PK is used to characterize the owner's public key, value is used to characterize the face Value of the current UTXO, and R ρ is used to characterize the random number.
The transaction plaintext information provided by the data purchasing end can be in the following form:<Data_ID, Input: [{UTXO 1 :{PKi, value 1 , Rρ 1 }}], Output: [{UTXO 2 :{PKo, value 2 , Rρ 2 }}]>。
data _ ID is the identification of the target Data. The data buyer can be offline with the data provider for the data to be purchased, and can also determine the identification of the data that the data provider can sell through the intelligent contract. For example, the identification, description information and selling price of the data which can be sold are stored in the intelligent contract, and if the price information contained in the purchase transaction meets the selling price requirement in the intelligent contract, the identification of the target data which can be sold is determined by the intelligent contract. In this case, the data trafficking device may invoke an intelligent contract pre-deployed in the blockchain to determine the identity of the target data according to the price information in the purchase traffic.
Input: [{UTXO 1 :{PKi, value 1 , Rρ 1 }}]For characterizing a list of input UTXOs, including one or more input UTXOs attributed to a data purchaser 1 For characterizing the input UTXO, PKi being the public key, rp, of the data purchaser 1 Is a first random number, value 1 Is input intoThe denomination of the UTXO.
Output: [{UTXO 2 :{PKo, value 2 , Rρ 2 }}]For characterizing the output UTXO list, containing one or more outputs UTXO, UTXO 2 For characterizing the output UTXO. Wherein, part of the output UTXO belongs to the data provider, and the other output UTXO belongs to the data purchaser for changing. Thus, PKo may be the public key of the data purchaser or the public key of the data provider. value 2 For outputting the face value of UTXO, rp 2 Is a second random number.
The embodiment of the invention uses the UTXO to represent the resources, is convenient to record the circulation of the resources in the transaction process and provides convenience for hiding the clear text information of the transaction by a cryptographic method.
In one embodiment of the invention, the transaction encryption information includes: a cryptographic commitment of the identity of the target data, a hash of each output UTXO, and a hash of each first random number;
the method further comprises the following steps:
the data purchasing end carries out hash operation on the identifier of the target data and the third random number to obtain a cryptology promise of the identifier of the target data; performing hash operation on each output UTXO to obtain the hash of each output UTXO; and carrying out hash operation on each first random number to obtain the hash of each first random number.
The transaction encryption information is as follows: < commit (Data _ ID), [ Hash (Outputs) ], [ Hash (Inputs R ρ) ] >, where commit (Data _ ID) is used to characterize the cryptographic Commitment of the identity of the target Data, i.e. adding Data _ ID to Rand (R), followed by a Hash operation.
The Hash (Outputs) is used for representing a Hash list of the output UTXO, and the Hash is finally stored on the block chain instead of the UTXO itself, so that other users cannot know the owner and face value of the UTXO.
[Hash(Inputs Rρ)]For characterizing a first random number Rp in an input UTXO 1 The hash list uses the hash of the first random number, so that other users can be prevented from deducing the output UTXO in the block chain corresponding to the input UTXO, and the privacy of transaction data is improved.
In an actual application scenario, the cryptographic commitment may be replaced by a hash of the identifier of the target data, which is not limited to the above-mentioned embodiment, as long as the transaction plaintext information can be hidden.
The embodiment of the invention hides the transaction plaintext information by a cryptography method, and stores the cryptography commitment or hash in the block chain instead of directly storing the transaction plaintext information, thereby protecting the privacy of each party of the transaction.
In one embodiment of the invention, the method further comprises:
the data purchasing end generates a zero-knowledge proof according to preset constraint conditions;
the constraint conditions include: the hash of each input UTXO can be inquired in the hash of the output UTXO recorded in the blockchain, the signature of each input UTXO is generated by the private key of the corresponding data purchaser, the hashes of the first random numbers do not belong to the hashes of the first random numbers recorded in the blockchain, the sum of the face values of the input UTXOs of the input UTXO list is equal to the sum of the face values of the output UTXOs of the output UTXO list, and the sum of the face values of the output UTXOs corresponding to the output UTXO containing the public key of the data provider is not lower than any one or more of preset resource limits;
verifying the zero knowledge proof, including:
the zero knowledge proof is verified based on the constraint conditions.
The resource limit is preset by the data provider and is the minimum resource amount which the data buyer needs to pay for the target data.
The hash of each input UTXO can be queried in the hash of the output UTXO recorded in the blockchain, which indicates that the source of the hash of each input UTXO is recorded on the blockchain and is a legal source. The hash of each first random number does not belong to the hash of the first random number recorded in the block chain, which indicates that each input UTXO is an unconsumed token, and thus the token is prevented from being repeatedly consumed. The sum of the face values of the input UTXO list is equal to the sum of the face values of the output UTXO list, which shows that the input and the output are conservative, and the safety of data transaction can be submitted through various constraint conditions.
For example, if the constraints include the five items, then zero knowledge proves that it is necessary to prove that the transaction plaintext information satisfies the five items, and if so, that the purchase transaction is indeed initiated by the data purchaser. The authenticity of the purchase transaction can be verified through zero knowledge proof, and the transaction safety is improved.
In one embodiment of the present invention, the data providing end verifies the transaction plaintext information according to the transaction encrypted information stored in the blockchain, including:
and the data providing end verifies whether the hash of each output UTXO in the transaction encryption information stored in the block chain corresponds to the hash of each output UTXO in the transaction plaintext information one by one, if so, the verification is passed, otherwise, the verification is not passed.
The data providing end can determine transaction encryption information corresponding to the transaction plaintext information, determine whether the transaction encryption information is obtained by calculating the transaction plaintext information through a cryptographic algorithm, determine whether the transaction plaintext information is tampered through the transaction plaintext information and the transaction encryption information, and improve transaction safety. And if the hash of each output UTXO in the transaction encryption information is the same as the hash of each corresponding output UTXO in the transaction plaintext information, the transaction plaintext information is proved not to be tampered. In an actual application scenario, the hash of each output UTXO in the transaction plaintext information is calculated first, and then the transaction encrypted information is compared.
In an actual application scenario, the transaction plaintext information may also be verified through one or more of the above constraints. Taking one of the items as an example, the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, and the method comprises the following steps: the data providing end verifies whether the hash of each input UTXO can be inquired in the hash of the output UTXO recorded by the block chain. If the inquiry can be made, the verification is passed, otherwise, the verification is not passed. Of course, the above verification methods may also be combined to verify the transaction plaintext information, for example, the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, including: and the data providing terminal verifies whether the hash of each output UTXO in the transaction encryption information stored in the block chain is in one-to-one correspondence with the hash of each output UTXO in the transaction plaintext information, if so, verifies whether the signature of each input UTXO is generated by the private key of the corresponding data purchaser, if so, the signature passes the verification, otherwise, the signature does not pass the verification. And verifying whether the purchase transaction is initiated by the data purchaser by verifying the signature, thereby further improving the security of the data transaction.
In an actual application scenario, the transaction plaintext information may also be verified through the identifier of the target data and the random number in the corresponding description information, for example, the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, including: and the data providing end verifies whether the identifier of the target data and the hash of the third random number are equal to the cryptographic commitment in the transaction encryption information in the block chain, if so, the verification is passed, and otherwise, the verification is not passed. This verification process may be used in conjunction with the verification process of the transaction plaintext information described previously.
In one embodiment of the invention, the method further comprises:
the data transaction device marks the state of the transaction encryption information as to be confirmed based on the verification intelligent contract;
after the data transaction device receives the confirmed transaction, marking the state of the transaction encryption information as confirmed;
the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, and the method comprises the following steps:
and the data providing end verifies the transaction plaintext information according to the confirmed transaction encryption information stored in the block chain.
The data transaction device can change the state of the transaction encryption information stored in the blockchain to ensure the accuracy of the verification result and the accuracy of the resource transfer.
Each node of the block chain stores: a cryptographic commitment of an identification of the target data, a hash of each output UTXO, and a hash of each first random number.
For example, three lists, such as table 1-table 3, are stored in the blockchain for storing the above three data, and when the transaction encryption information is uploaded to the blockchain, the information in the three lists is updated synchronously. All tables are only increased and not decreased.
TABLE 1 Cryptographic promise of identification of target data
Figure DEST_PATH_IMAGE001
Table 2 hashing of output UTXO
Figure DEST_PATH_IMAGE002
Table 3 hashing of a first random number
Figure DEST_PATH_IMAGE003
As shown in fig. 2, an embodiment of the present invention provides a data transaction system based on a blockchain, including: the data purchasing terminal, the data transaction device and the data providing terminal; the data transaction device is applied to the node equipment of the block chain;
the data purchasing end is used for sending purchasing transaction to the data transaction device; wherein the purchase transaction includes: zero knowledge proof and transaction encryption information; the transaction encryption information is obtained by encrypting transaction plaintext information; transmitting transaction plaintext information to a data providing end; receiving target data corresponding to transaction plaintext information sent by a data providing end, and sending a confirmation transaction to a data transaction device according to a confirmation operation of a data purchaser;
the data transaction device is used for calling a verification intelligent contract which is pre-deployed on the block chain according to the purchase transaction so as to verify the zero knowledge certificate, uploading transaction encryption information to the block chain if the verification is passed, and marking the state of the transaction encryption information as to-be-confirmed; according to the confirmed transaction, calling a pre-deployed transfer intelligent contract on the block chain, transferring the resources of the data purchaser to a data provider, and marking the transaction encryption information in the state of waiting for confirmation as confirmed;
and the data providing end is used for verifying the transaction plaintext information according to the confirmed transaction encryption information stored in the block chain, and if the verification is passed, sending the target data to the data purchasing end.
The embodiment of the invention realizes data transaction based on the blockchain, can ensure the legality of the data transaction process, ensures that transaction data is not tampered, and ensures the benefits of all parties of the transaction. Based on zero knowledge proof and a cryptographic algorithm, the privacy safety of each party of transaction is ensured, and the transaction safety is improved.
In an embodiment of the present invention, the data transaction apparatus is configured to invoke a management intelligent contract pre-deployed on the blockchain, and upload description information to the blockchain; calling and managing an intelligent contract according to the query request to query the description information meeting the conditions, and feeding back the query result to the data purchasing end;
and the data purchasing end is used for sending a query request to the data transaction device according to the query operation of the data purchasing end.
In one embodiment of the invention, the transaction plaintext information comprises: identification of target data, an input UTXO list, a signature of each input UTXO and an output UTXO list;
the input UTXO list comprises a plurality of input UTXOs;
the output UTXO list comprises a plurality of output UTXOs;
inputting the UTXO as a triple comprising a public key of the data purchaser, a face value of the UTXO and a first random number;
the output UTXO is a triple comprising a public key of a data purchaser or a public key of a data provider, a face value of the output UTXO and a second random number;
in one embodiment of the invention, the transaction encryption information comprises: a cryptographic commitment of the identity of the target data, a hash of each output UTXO, and a hash of each first random number;
the data purchasing end is used for carrying out hash operation on the identifier of the target data and the third random number to obtain a cryptology promise of the identifier of the target data; performing hash operation on each output UTXO to obtain the hash of each output UTXO; and carrying out hash operation on each first random number to obtain the hash of each first random number.
In an embodiment of the invention, the data purchasing end is used for generating a zero-knowledge proof according to a preset constraint condition;
the constraint conditions include: the hash of each input UTXO can be inquired in the hash of the output UTXO recorded in the block chain, the signature of each input UTXO is generated by a private key of the corresponding data purchaser, the hashes of the first random numbers do not belong to the hashes of the first random numbers recorded in the block chain, the sum of the face values of the input UTXOs of the input UTXO list is equal to the sum of the face values of the output UTXOs of the output UTXO list, and the sum of the face values of the output UTXOs corresponding to the output UTXOs containing the public keys of the data providers is not lower than any one or more of preset resource limit;
and the data transaction device is used for verifying the zero knowledge proof based on the constraint condition.
In an embodiment of the present invention, the data providing end is configured to verify whether the hash of each output UTXO in the transaction encryption information stored in the block chain corresponds to the hash of each output UTXO in the transaction plaintext information one-to-one, and if so, the verification is passed, otherwise, the verification is not passed.
In one embodiment of the invention, the data transaction device is used for marking the state of the transaction encryption information as to be confirmed based on the verification intelligent contract; after the data transaction device receives the confirmed transaction, marking the state of the transaction encryption information as confirmed;
and the data providing end is used for verifying the transaction plaintext information according to the confirmed transaction encryption information stored in the block chain.
Referring now to FIG. 3, a block diagram of a computer system 300 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, the computer system 300 includes a Central Processing Unit (CPU) 301 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the system 300 are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. A drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 as necessary, so that a computer program read out therefrom is mounted into the storage section 308 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 301.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: 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 the present invention, 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. In contrast, in the present invention, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, 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 thereof. 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not form a limitation on the modules themselves in some cases, and for example, the sending module may also be described as a "module sending a picture acquisition request to a connected server".
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A data transaction method based on a block chain is characterized by comprising the following steps:
the data purchasing end sends purchasing transaction to the data transaction device; wherein, the data transaction device is applied to the node equipment of the block chain, and the purchase transaction comprises the following steps: zero knowledge proof and transaction encryption information; the transaction encryption information is obtained by encrypting transaction plaintext information;
the data transaction device calls a pre-deployed verification intelligent contract on the block chain according to the purchase transaction to verify the zero knowledge proof, if the verification is passed, the transaction encryption information is uploaded to the block chain, and the state of the transaction encryption information is marked to be confirmed;
the data purchasing end sends the transaction plaintext information to a data providing end;
the data providing end verifies the transaction plaintext information according to the confirmed transaction encryption information stored in the block chain, and if the verification is passed, target data corresponding to the transaction plaintext information is sent to the data purchasing end;
the data purchasing end receives the target data and sends a confirmation transaction to the data transaction device according to the confirmation operation of the data purchasing end;
and the data transaction device calls a pre-deployed transfer intelligent contract on the block chain according to the confirmed transaction, transfers the resources of the data purchaser to a data provider, and marks the transaction encryption information in the state of waiting for confirmation as confirmed.
2. The method of claim 1, further comprising:
the data providing end determines the description information of the target data and sends the description information to the data transaction device;
the data transaction device calls a pre-deployed management intelligent contract on the block chain and uploads the description information to the block chain;
the data purchasing end sends a query request to the data transaction device according to the query operation of the data purchasing end;
the data transaction device calls the management intelligent contract to inquire the description information meeting the conditions according to the inquiry request, and feeds the inquiry result back to the data purchasing end.
3. The method of claim 1,
the transaction plaintext information comprises: the identification of the target data, the input UTXO list, the signature of each input UTXO and the output UTXO list;
the input UTXO list comprises a plurality of input UTXOs;
the output UTXO list comprises a plurality of output UTXOs;
the input UTXO is a triple group comprising a public key of a data purchaser, a face value of the input UTXO and a first random number;
the output UTXO is a triplet including a public key of a data purchaser or a public key of a data provider, a face value of the output UTXO, and a second random number.
4. The method of claim 3,
the transaction encryption information includes: a cryptographic commitment of an identity of the target data, a hash of each of the output UTXOs, and a hash of each of the first random numbers;
the method further comprises the following steps:
the data purchasing end carries out hash operation on the identifier of the target data and a third random number to obtain a cryptology commitment of the identifier of the target data; performing hash operation on each output UTXO to obtain the hash of each output UTXO; and carrying out hash operation on each first random number to obtain the hash of each first random number.
5. The method of claim 4, further comprising:
the data purchasing end generates the zero knowledge proof according to preset constraint conditions;
the constraint conditions include: the hash of each input UTXO can be inquired in the hash of the output UTXO recorded by the blockchain, the signature of each input UTXO is generated by a private key of a corresponding data purchaser, the hashes of the first random numbers do not belong to the hashes of the first random numbers recorded by the blockchain, the sum of the face values of the input UTXOs of the input UTXO list is equal to the sum of the face values of the output UTXOs of the output UTXO list, and the sum of the face values of the output UTXOs corresponding to the output UTXOs containing the public key of the data provider is not lower than any one or more of preset resource limit;
verifying the zero knowledge proof, comprising:
verifying the zero knowledge proof based on the constraint.
6. The method of claim 4 or 5,
the data providing end verifies the transaction plaintext information according to the transaction encryption information stored in the block chain, and the verification comprises the following steps:
and the data providing end verifies whether the hash of each output UTXO in the transaction encryption information stored in the block chain corresponds to the hash of each output UTXO in the transaction plaintext information one by one, if so, the verification is passed, otherwise, the verification is not passed.
7. A blockchain-based data transaction system, comprising: the data purchasing terminal, the data transaction device and the data providing terminal; the data transaction device is applied to node equipment of a block chain;
the data purchasing end is used for sending purchasing transaction to the data transaction device; wherein the purchase transaction comprises: zero knowledge proof and transaction encryption information; the transaction encryption information is obtained by encrypting transaction plaintext information; sending the transaction plaintext information to a data providing end; receiving target data corresponding to the transaction plaintext information sent by the data providing end, and sending a confirmation transaction to the data transaction device according to a confirmation operation of a data purchaser;
the data transaction device is used for calling a verification intelligent contract which is pre-deployed on the block chain according to the purchase transaction so as to verify the zero knowledge proof, uploading the transaction encryption information to the block chain if the verification is passed, and marking the state of the transaction encryption information as to-be-confirmed; according to the confirmed transaction, calling a pre-deployed transfer intelligent contract on the block chain, transferring the resource of the data purchaser to a data provider, and marking the transaction encryption information in the state of waiting for confirmation as confirmed;
and the data providing end is used for verifying the transaction plaintext information according to the confirmed transaction encryption information stored in the block chain, and if the verification is passed, the data providing end sends the target data to the data purchasing end.
8. The system of claim 7,
the transaction plaintext information comprises: the identification of the target data, the input UTXO list, the signature of each input UTXO and the output UTXO list;
the input UTXO list comprises a plurality of input UTXOs;
the output UTXO list comprises a plurality of output UTXOs;
the input UTXO is a triple group comprising a public key of a data purchaser, a face value of the input UTXO and a first random number;
the output UTXO is a triplet including a public key of a data purchaser or a public key of a data provider, a face value of the output UTXO, and a second random number.
9. The system of claim 8,
the transaction encryption information includes: a cryptographic commitment of an identity of the target data, a hash of each of the output UTXOs, and a hash of each of the first random numbers;
the data purchasing end is used for carrying out hash operation on the identifier of the target data and the third random number to obtain a cryptology commitment of the identifier of the target data; performing hash operation on each output UTXO to obtain the hash of each output UTXO; and carrying out hash operation on each first random number to obtain the hash of each first random number.
10. The system of claim 9,
the data purchasing end is used for generating the zero knowledge proof according to preset constraint conditions;
the constraint conditions include: the hash of each input UTXO can be inquired in the hash of the output UTXO recorded by the blockchain, the signature of each input UTXO is generated by a private key of a corresponding data purchaser, the hashes of the first random numbers do not belong to the hashes of the first random numbers recorded by the blockchain, the sum of the face values of the input UTXOs of the input UTXO list is equal to the sum of the face values of the output UTXOs of the output UTXO list, and the sum of the face values of the output UTXOs corresponding to the output UTXOs containing the public key of the data provider is not lower than any one or more of preset resource limit;
the data transaction device is used for verifying the zero knowledge proof based on the constraint condition.
11. The system of claim 9 or 10,
and the data providing end is used for verifying whether the hash of each output UTXO in the transaction encryption information stored in the block chain corresponds to the hash of each output UTXO in the transaction plaintext information one by one, if so, the verification is passed, and otherwise, the verification is not passed.
CN202211129514.8A 2022-09-16 2022-09-16 Data transaction method and system based on block chain Active CN115203749B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211129514.8A CN115203749B (en) 2022-09-16 2022-09-16 Data transaction method and system based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211129514.8A CN115203749B (en) 2022-09-16 2022-09-16 Data transaction method and system based on block chain

Publications (2)

Publication Number Publication Date
CN115203749A CN115203749A (en) 2022-10-18
CN115203749B true CN115203749B (en) 2023-01-17

Family

ID=83572475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211129514.8A Active CN115203749B (en) 2022-09-16 2022-09-16 Data transaction method and system based on block chain

Country Status (1)

Country Link
CN (1) CN115203749B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115994806B (en) * 2023-02-16 2023-07-25 天聚地合(苏州)科技股份有限公司 Power transaction method, device and system based on blockchain and privacy calculation
CN116051172B (en) * 2023-03-07 2023-08-08 天聚地合(苏州)科技股份有限公司 Data element auxiliary pricing method, device and system based on blockchain
CN117252702A (en) * 2023-11-20 2023-12-19 深圳奥联信息安全技术有限公司 Block chain-based data asset transaction method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110011781B (en) * 2019-03-04 2020-05-19 华中科技大学 Homomorphic encryption method and medium for transaction amount encryption and supporting zero knowledge proof
CN111666337B (en) * 2020-05-19 2023-04-25 武汉理工大学 Patent technology conversion operation platform and transaction method based on blockchain technology
CN112541766A (en) * 2020-11-30 2021-03-23 北京八分量信息科技有限公司 UTXO-based zero-knowledge proof transaction verification method and device and related products
CN114358782A (en) * 2021-12-06 2022-04-15 北京众享比特科技有限公司 Block chain transaction auditing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115203749A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
US11349645B2 (en) Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
US10691835B1 (en) Verifying integrity of data stored in a consortium blockchain using a public sidechain
US10824701B2 (en) System and method for mapping decentralized identifiers to real-world entities
JP6908700B2 (en) Systems and methods for information protection
US10848315B2 (en) Contract agreement method, agreement verification method, contract agreement system, agreement verification device, contract agreement device, contract agreement program and agreement verification program
CN115203749B (en) Data transaction method and system based on block chain
CN111292041B (en) Electronic contract generation method, device, equipment and storage medium
KR20180114182A (en) Secure personal devices using elliptic curve cryptography for secret sharing
CN113162752B (en) Data processing method and device based on hybrid homomorphic encryption
US11729000B2 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
CN110597836B (en) Information inquiry request response method and device based on block chain network
CN109754226B (en) Data management method, device and storage medium
US11870654B2 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
CN115604038B (en) Cloud storage data auditing system and method based on blockchain and edge computing
CN113206746B (en) Digital certificate management method and device
CN115705601A (en) Data processing method and device, computer equipment and storage medium
CN111915302B (en) Associated data processing method and device, electronic equipment and computer readable medium
KR20220079751A (en) Smart Contract System Using External Storage Based on Blockchain And Method Therefor
CN111010283A (en) Method and apparatus for generating information
CN113159767A (en) Transfer processing method, device and system based on block chain
CN113179169A (en) Digital certificate management method and device
US11770263B1 (en) Systems and methods for enforcing cryptographically secure actions in public, non-permissioned blockchains using bifurcated self-executing programs comprising shared digital signature requirements
US20240137280A1 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
CN117544312A (en) Cross-domain digital signature method based on attribute encryption and related equipment thereof
CN115706672A (en) Verification method, device, electronic equipment and medium for 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