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

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

Info

Publication number
CN114629663B
CN114629663B CN202210514289.3A CN202210514289A CN114629663B CN 114629663 B CN114629663 B CN 114629663B CN 202210514289 A CN202210514289 A CN 202210514289A CN 114629663 B CN114629663 B CN 114629663B
Authority
CN
China
Prior art keywords
transaction
quantum
information
block chain
verification
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
CN202210514289.3A
Other languages
Chinese (zh)
Other versions
CN114629663A (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.)
Wuhan Heyue Digital Technology Co ltd
Original Assignee
Wuhan Heyue Digital 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 Wuhan Heyue Digital Technology Co ltd filed Critical Wuhan Heyue Digital Technology Co ltd
Priority to CN202210514289.3A priority Critical patent/CN114629663B/en
Publication of CN114629663A publication Critical patent/CN114629663A/en
Application granted granted Critical
Publication of CN114629663B publication Critical patent/CN114629663B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • H04L9/3255Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using group based signatures, e.g. ring or threshold 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3218Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs
    • H04L9/3221Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs interactive zero-knowledge proofs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/56Financial cryptography, e.g. electronic payment or e-cash

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Electromagnetism (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention relates to a block chain technology, and discloses a digital commodity transaction method based on a block chain, which comprises the following steps: generating a pair of quantum keys for a transaction information transfer user based on a quantum block chain, carrying out hash calculation on related transaction information of the transaction information transfer user to obtain a transaction hash value, carrying out encryption processing on the transaction hash value and the related transaction information by using a main public key in the quantum keys to obtain encrypted transaction information, writing the related transaction information into the quantum block chain when signature verification of a transaction ring signature passes, carrying out zero knowledge certification on the related transaction information and commodity information, and storing a digital commodity transaction success record in the quantum block chain when the transaction verification passes. The invention also provides a digital commodity transaction device based on the block chain. The invention can solve the problem of low safety of digital commodity transaction.

Description

Block chain-based digital commodity transaction method and device
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for digital commodity transaction based on blockchain.
Background
With the development of network and communication technologies, e-commerce applications are becoming more and more popular. Digital goods online transactions represented by software, multimedia, and electronic books have become an important component of electronic commerce applications. Identity authentication and trust establishment in a network environment have congenital defects, so that two parties in a transaction often do not trust each other, and further the digital commodity transaction is lack of accuracy and safety. Therefore, a method for trading digital commodities with higher security is urgently needed.
Disclosure of Invention
The invention provides a block chain-based digital commodity transaction method, a block chain-based digital commodity transaction device and a computer-readable storage medium, and mainly aims to solve the problem of low safety of block chain-based digital commodity transaction.
In order to achieve the above object, the present invention provides a block chain-based digital commodity transaction method, including:
obtaining quantum blocks in a preset time period, and connecting the quantum blocks according to a time sequence to obtain a quantum block chain, wherein the quantum blocks at least comprise two quantum blocks, and the quantum blocks are:
Figure DEST_PATH_IMAGE001
wherein,
Figure DEST_PATH_IMAGE002
represents the first
Figure DEST_PATH_IMAGE003
The expression of the quantum block is shown,
Figure DEST_PATH_IMAGE004
is shown as
Figure 863368DEST_PATH_IMAGE004
A sub-block of quantities,
Figure 655743DEST_PATH_IMAGE003
the number of the quantum blocks is represented,
Figure DEST_PATH_IMAGE005
which represents a pre-set time parameter that is,
Figure DEST_PATH_IMAGE006
representing a preset quantum parameter;
receiving a transaction establishing instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, wherein the quantum keys comprise a main public key;
performing hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, encrypting the transaction hash value and the related transaction information by using a main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and performing information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information;
generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature;
performing signature verification on the transaction ring signature, and writing the related transaction information into the quantum block chain when the signature verification is passed;
acquiring commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, and performing zero knowledge certification on the related transaction information and the commodity information so that the miner node of the quantum block chain performs transaction verification according to a zero knowledge certification result;
and when the transaction verification passes, storing a digital commodity transaction success record in the quantum blockchain.
Optionally, the connecting the quantum blocks in time order to obtain a quantum block chain includes:
acquiring a preset quantum block chain structure, and screening out quantum blocks with preset number from the quantum blocks;
randomly combining a preset number of quantum blocks to obtain a plurality of combined quantum blocks, and storing the combined quantum blocks into the quantum block chain structure to obtain a quantum block chain.
Optionally, the preset quantum block chain structure is:
Figure DEST_PATH_IMAGE007
wherein,
Figure DEST_PATH_IMAGE008
it is shown that the chain structure of the quantum blocks,
Figure DEST_PATH_IMAGE009
the number of the quantum blocks is represented,
Figure DEST_PATH_IMAGE010
which represents a pre-set time parameter that is,
Figure 544196DEST_PATH_IMAGE004
is shown as
Figure 347679DEST_PATH_IMAGE004
A quantum block.
Optionally, the generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain includes:
generating a sequence of qubit pairs for the transaction information transfer user using the chain of qubits;
splitting the qubit pair sequence into a first qubit pair subsequence and a second qubit pair subsequence according to a preset splitting rule;
taking the first qubit subsequence as a main public key and the second qubit subsequence as a main private key;
and summarizing the main public key and the main private key to obtain a pair of quantum keys.
Optionally, the signing and generating the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature includes:
acquiring a public key set of a preset input ring in the ring signature algorithm, the encrypted transaction information and a quantum key corresponding to the encrypted transaction information;
encrypting the encrypted transaction information again based on the public key set of the preset input ring to obtain double encrypted information;
calculating to obtain a symmetrical value corresponding to the double encryption information through a preset information symmetrical formula and the transaction hash value;
and constructing a multi-element array according to the public key set, the symmetric value and the double encryption information, and taking the multi-element array as the transaction ring signature.
Optionally, the preset information symmetry formula is:
Figure DEST_PATH_IMAGE011
wherein,
Figure DEST_PATH_IMAGE012
for the purpose of the transaction hash value,
Figure DEST_PATH_IMAGE013
for a plurality of double encrypted information, v is a fixed parameter,
Figure DEST_PATH_IMAGE014
and the symmetric value is corresponding to the double encryption information.
Optionally, the signature verification of the transaction ring signature includes:
acquiring a verification data set, wherein the verification data set comprises a verification public key and information to be verified;
encrypting the information to be verified by using the verification public key to obtain encrypted verification information;
inputting the encrypted verification information into the transaction ring signature, and judging that the signature verification is passed when the transaction ring signature is established;
and inputting the encryption verification information into the transaction ring signature, and judging that the signature verification is not passed when the transaction ring signature is not established.
Optionally, the performing zero-knowledge proof on the related transaction information and the commodity information includes:
acquiring a preset certification function, and performing binding verification processing on the related transaction information and the encrypted transaction information by using the certification function to obtain a first binding verification result;
if the first binding verification result is that the verification is passed, the certification function is used for carrying out binding verification processing on the commodity information and the encrypted commodity information to obtain a second binding verification result;
if the second binding verification result is that the verification is passed, calculating cosine similarity between the encrypted transaction information and the encrypted commodity information by using a cosine similarity formula;
when the cosine similarity is smaller than a preset similarity threshold, judging that the zero knowledge proof fails;
and when the cosine similarity is greater than or equal to the similarity threshold, judging that the zero knowledge proof is successful.
Optionally, the performing, by using the attestation function, binding verification processing on the related transaction information and the encrypted transaction information to obtain a first binding verification result includes:
generating certification processing is carried out on the related transaction information and the encrypted transaction information by using a preset certification generating function to obtain a certification;
and inputting the generation certification and the related transaction information into a verification certification function to obtain a first binding verification result.
In order to solve the above problems, the present invention also provides a block chain-based digital goods transaction apparatus, comprising:
the system comprises a block chain construction module, a quantum block chain construction module and a transaction information transfer module, wherein the block chain construction module is used for acquiring quantum blocks in a preset time period, connecting the quantum blocks according to a time sequence to obtain a quantum block chain, the quantum blocks at least comprise two quantum blocks, receiving a transaction establishment instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, and the quantum keys comprise main public keys;
the transaction information encryption module is used for carrying out hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, carrying out encryption processing on the transaction hash value and the related transaction information by using a main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and carrying out information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information;
the signature verification module is used for generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature, performing signature verification on the transaction ring signature, and writing the related transaction information into the quantum block chain when the signature verification is passed;
and the transaction verification module is used for acquiring commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, performing zero knowledge certification on the related transaction information and the commodity information so as to ensure that the miner node of the quantum block chain performs transaction verification according to the result of the zero knowledge certification, and storing a digital commodity transaction success record in the quantum block chain when the transaction verification is passed.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the block chain-based digital commodity transaction method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, which stores at least one instruction, where the at least one instruction is executed by a processor in an electronic device to implement the above block chain-based digital goods transaction method.
In the embodiment of the invention, quantum blocks are connected according to the time sequence to obtain the quantum block chain, and the quantum block chain can resist the risk of counterfeiting, provide strong safety protection for block chain users and resist quantum computation attack. The related transaction information is encrypted, the data security is protected, the problem of information leakage caused by commodity transaction on a quantum block chain by directly utilizing a plaintext is solved, zero knowledge certification is carried out on the related transaction information and the commodity information, the verification of the digital commodity transaction is guaranteed to be a verifiable process, and the verification process of the digital commodity transaction is more transparent and visual. Therefore, the block chain-based digital commodity transaction method, the block chain-based digital commodity transaction device, the electronic equipment and the computer-readable storage medium can solve the problem of low safety of digital commodity transaction.
Drawings
Fig. 1 is a schematic flow chart of a block chain-based digital commodity transaction method according to an embodiment of the present invention;
fig. 2 is a functional block diagram of a block chain-based digital merchandise transaction apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for implementing the blockchain-based digital commodity transaction method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a block chain-based digital commodity transaction method. The execution subject of the block chain-based digital commodity transaction method includes, but is not limited to, at least one of a server, a terminal, and the like that can be configured to execute the method provided by the embodiment of the present invention. In other words, the blockchain-based digital goods transaction method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a flow chart of a block chain-based digital commodity transaction method according to an embodiment of the present invention is shown. In this embodiment, the block chain-based digital commodity transaction method includes:
and S1, obtaining quantum blocks in a preset time period, and connecting the quantum blocks according to a time sequence to obtain a quantum block chain, wherein the quantum blocks at least comprise two quantum blocks.
In the embodiment of the present invention, useful quantum data is stored in the quantum blocks, and a plurality of quantum blocks may be connected by adopting a quantum entanglement state in time to obtain a quantum block chain. Compared with the prior block chain technology, the quantum block chain is based on the quantum unclonable principle, so that the risk of counterfeiting can be resisted, and meanwhile, the quantum block chain combines the quantum password and the quantum principle, so that strong safety protection is provided for block chain users, and quantum computing attack can be resisted.
In detail, the quantum block comprises at least two quantum blocks, wherein the quantum blocks are:
Figure 383900DEST_PATH_IMAGE001
wherein,
Figure DEST_PATH_IMAGE015
represents the first
Figure DEST_PATH_IMAGE016
The expression of the quantum block is shown,
Figure DEST_PATH_IMAGE017
is shown as
Figure 58594DEST_PATH_IMAGE017
A sub-block of quantities,
Figure 392099DEST_PATH_IMAGE016
the number of the quantum blocks is represented,
Figure DEST_PATH_IMAGE018
which is indicative of a pre-set time parameter,
Figure DEST_PATH_IMAGE019
representing a preset quantum parameter.
E.g. by analogy, the first
Figure DEST_PATH_IMAGE020
The quantum block is
Figure DEST_PATH_IMAGE021
The quantum block at least comprises two quantum blocks, namely the quantum block
Figure 759627DEST_PATH_IMAGE015
And quantum block
Figure DEST_PATH_IMAGE022
Specifically, the connecting the quantum blocks according to the time sequence to obtain a quantum block chain includes:
acquiring a preset quantum block chain structure, and screening out a preset number of quantum blocks from the quantum blocks;
randomly combining a preset number of quantum blocks to obtain a plurality of combined quantum blocks, and storing the combined quantum blocks into the quantum block chain structure to obtain a quantum block chain.
In detail, the preset number is selected differently according to a specific scheme, and quantum blocks with the preset number are combined with the quantum block chain structure to obtain a quantum block chain.
Further, the preset quantum block chain structure is as follows:
Figure 283143DEST_PATH_IMAGE007
wherein,
Figure DEST_PATH_IMAGE023
it is shown that the chain structure of the quantum blocks,
Figure DEST_PATH_IMAGE024
the number of the quantum blocks is represented,
Figure DEST_PATH_IMAGE025
which represents a pre-set time parameter that is,
Figure 27108DEST_PATH_IMAGE017
is shown as
Figure 492418DEST_PATH_IMAGE017
A quantum block.
For example, assume that the first three quantum blocks are respectively
Figure 100002_DEST_PATH_IMAGE026
Figure DEST_PATH_IMAGE027
And
Figure 100002_DEST_PATH_IMAGE028
generating the quantum block chain structure by the quantum block chain structure
Figure DEST_PATH_IMAGE029
S2, receiving a transaction establishing instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, wherein the quantum keys comprise a master public key.
In the embodiment of the present invention, the transaction node refers to a certain client or server accessing the quantum block chain, and the client or server is a system platform for performing business operations in organization structures such as units. The instruction refers to a code which is sent by the node and needs to perform a specific operation. For example, in the embodiment of the present invention, the node represents a transaction party, and the instruction for creating a transaction is an instruction for issuing funds sent by a transaction party to a bank.
Specifically, the instruction is triggered after a node receives an instruction of other nodes. The instruction comprises information about the transaction user, and the transaction information transfer user can be further determined according to the instruction.
Further, the generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain includes:
generating a sequence of qubit pairs for the transaction information transfer user using the chain of qubits;
splitting the qubit pair sequence into a first qubit pair subsequence and a second qubit pair subsequence according to a preset splitting rule;
taking the first qubit pair subsequence as a main public key and the second qubit pair subsequence as a main private key;
and summarizing the main public key and the main private key to obtain a pair of quantum keys.
In detail, a sequence of qubit pairs is generated for the transaction information transferring user using the chain of quantum blocks
Figure 100002_DEST_PATH_IMAGE030
The quantum blockchain generates a pair of quantum keys for each user. Splitting the sequence of qubit pairs into a first sequence of qubit pairs according to a preset splitting rule
Figure DEST_PATH_IMAGE031
And a second qubit pair subsequence
Figure 100002_DEST_PATH_IMAGE032
. And taking the first qubit subsequence as a main public key and the second qubit subsequence as a main private key.
S3, performing hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, encrypting the transaction hash value and the related transaction information by using the main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and performing information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information.
In the embodiment of the invention, the preset hash function can be used for carrying out hash calculation on the related transaction information of the transaction information transfer user to obtain the transaction hash value. The preset hash function may be a hash () function.
Specifically, the encrypting the transaction hash value and the related transaction information by using the master public key in the quantum key means that the transaction hash value and the related transaction information are collected, and the collected information is encrypted by using the master public key in the quantum key to obtain encrypted transaction information.
And S4, generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature.
In the embodiment of the present invention, the ring signature algorithm is a signature technology, and generally, there is a group of public keys, and a signer knows a private key corresponding to a public key in the group of public keys (only needs to know one public key). This allows a ring signature to be generated using the set of public keys and the corresponding private key. The verifier can verify that the ring signature was indeed generated by the owner of a private key in the set of public keys, but does not know which private key corresponds to which public key.
Specifically, the signing and generating the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature includes:
acquiring a public key set of a preset input ring in the ring signature algorithm, the encrypted transaction information and a quantum key corresponding to the encrypted transaction information;
carrying out secondary encryption processing on the encrypted transaction information based on the public key set of the preset input ring to obtain dual encrypted information;
calculating to obtain a symmetrical value corresponding to the double encryption information through a preset information symmetrical formula and the transaction hash value;
and constructing a multi-element array according to the public key set, the symmetric value and the double encryption information, and taking the multi-element array as the transaction ring signature.
In detail, the public key set of the preset input ring comprises a plurality of public keys, for example, the public key is
Figure DEST_PATH_IMAGE033
Figure 100002_DEST_PATH_IMAGE034
Figure DEST_PATH_IMAGE035
The encrypted transaction information is
Figure DEST_PATH_IMAGE036
Figure DEST_PATH_IMAGE037
,…,
Figure DEST_PATH_IMAGE038
Further, the preset information symmetry formula is as follows:
Figure DEST_PATH_IMAGE039
wherein,
Figure DEST_PATH_IMAGE040
for the purpose of the transaction hash value,
Figure DEST_PATH_IMAGE041
for a plurality of double encrypted information, v is a fixed parameter,
Figure DEST_PATH_IMAGE042
and the symmetric value is corresponding to the double encryption information.
S5, performing signature verification on the transaction ring signature, and writing the relevant transaction information into the quantum block chain when the signature verification is passed.
In an embodiment of the present invention, the signature verification of the transaction ring signature includes:
acquiring a verification data set, wherein the verification data set comprises a verification public key and information to be verified;
encrypting the information to be verified by using the verification public key to obtain encrypted verification information;
inputting the encrypted verification information into the transaction ring signature, and judging that the signature verification is passed when the transaction ring signature is established;
and inputting the encryption verification information into the transaction ring signature, and judging that the signature verification is not passed when the transaction ring signature is not established.
In detail, the verification data set is data proposed for signature verification of the transaction ring signature.
Specifically, when the signature verification passes, the related transaction information is written into the quantum block chain.
S6, commodity information corresponding to the transaction information transfer user pre-stored in the quantitative block chain by the node is obtained, zero knowledge certification is conducted on the related transaction information and the commodity information, and therefore the miner node of the quantitative block chain conducts transaction verification according to the result of the zero knowledge certification.
In the embodiment of the present invention, the commodity information corresponding to the transaction information transfer user refers to the relevant reference information such as the commodity name, the commodity number, and the commodity specification corresponding to the commodity transaction. The Zero-Knowledge Proof (Zero-Knowledge Proof) refers to the prover being able to convince the verifier that some argument is correct without providing the verifier with any useful information. Zero knowledge proof is essentially an agreement involving two or more parties, i.e., a series of steps that are required by two or more parties to complete a task.
Specifically, the zero-knowledge proof of the related transaction information and the commodity information includes:
acquiring a preset certification function, and performing binding verification processing on the related transaction information and the encrypted transaction information by using the certification function to obtain a first binding verification result;
if the first binding verification result is that the verification is passed, the certification function is used for carrying out binding verification processing on the commodity information and the encrypted commodity information to obtain a second binding verification result;
if the second binding verification result is that the verification is passed, calculating cosine similarity between the encrypted transaction information and the encrypted commodity information by using a cosine similarity formula;
when the cosine similarity is smaller than a preset similarity threshold, judging that the zero knowledge proof fails;
and when the cosine similarity is greater than or equal to the similarity threshold, judging that the zero knowledge proof is successful.
Specifically, the binding verification processing of the relevant transaction information and the encrypted transaction information by using the attestation function to obtain a first binding verification result includes:
generating certification processing is carried out on the related transaction information and the encrypted transaction information by using a preset certification generating function to obtain a certification;
and inputting the generation certification and the related transaction information into a verification certification function to obtain a first binding verification result.
The preset certification function comprises a generation certification function and a verification certification function.
In detail, the proof of generation function is pi = Prvoe (x, w), where pi represents proof of generation, x is plaintext, and w is ciphertext, in this embodiment of the present invention, x is the relevant transaction information, w is the encrypted transaction information, the proof of verification function is Yes = Verify (x, pi), Yes is one of the first binding verification results, and generally, the first binding verification result includes Yes and No, Yes represents proof correct and No represents proof error.
Specifically, the calculating the cosine similarity between the encrypted transaction information and the encrypted commodity information by using a cosine similarity formula includes:
Figure 76851DEST_PATH_IMAGE043
wherein,
Figure DEST_PATH_IMAGE044
the similarity between the two signals is a cosine similarity,
Figure 336932DEST_PATH_IMAGE045
Figure DEST_PATH_IMAGE046
vectors corresponding to the encrypted transaction information and the encrypted commodity information respectively,
Figure 228795DEST_PATH_IMAGE047
Figure DEST_PATH_IMAGE048
respectively, the modulus corresponding to the two vectors.
Further, before the cosine similarity between the encrypted transaction information and the encrypted commodity information is calculated by using a cosine similarity formula, vectorizing the encrypted transaction information and the encrypted commodity information according to a preset word2vec algorithm.
And S7, when the transaction passes the verification, storing a digital commodity transaction success record in the quantum block chain.
In the embodiment of the invention, when the transaction verification is passed, the successful record of the digital commodity transaction is stored in the quantum block chain, so that the digital commodity transaction is realized, and the safety and the accuracy of the record of the digital commodity transaction are improved.
In the embodiment of the invention, quantum blocks are connected according to the time sequence to obtain the quantum block chain, and the quantum block chain can resist the risk of counterfeiting, provide strong safety protection for block chain users and resist quantum computation attack. The related transaction information is encrypted, the data security is protected, the problem of information leakage caused by commodity transaction on a quantum block chain by directly utilizing a plaintext is solved, zero knowledge certification is carried out on the related transaction information and the commodity information, the verification of the digital commodity transaction is guaranteed to be a verifiable process, and the verification process of the digital commodity transaction is more transparent and visual. Therefore, the digital commodity transaction method based on the block chain can solve the problem of low safety of digital commodity transaction.
Fig. 2 is a functional block diagram of a digital commodity transaction apparatus based on a blockchain according to an embodiment of the present invention.
The digital commodity transaction apparatus 100 based on the blockchain according to the present invention may be installed in an electronic device. According to the implemented functions, the blockchain-based digital commodity transaction apparatus 100 may include a blockchain construction module 101, a transaction information encryption module 102, a signature verification module 103, and a transaction verification module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the block chain construction module 101 is configured to obtain quantum blocks within a preset time period, connect the quantum blocks according to a time sequence to obtain a quantum block chain, where the quantum blocks at least include two quantum blocks, receive an instruction for creating a transaction triggered by a transaction node of the quantum block chain, determine a transaction information transfer user according to the instruction, and generate a pair of quantum keys for the transaction information transfer user based on the quantum block chain, where each quantum key includes a master public key;
the transaction information encryption module 102 is configured to perform hash calculation on the relevant transaction information of the transaction information transfer user to obtain a transaction hash value, encrypt the transaction hash value and the relevant transaction information by using a master public key in the quantum key to obtain an encrypted hash value and encrypted relevant information, and perform information fusion on the encrypted hash value and the encrypted relevant information to obtain encrypted transaction information;
the signature verification module 103 is configured to perform signature generation on the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature, perform signature verification on the transaction ring signature, and write the relevant transaction information into the quantum block chain when the signature verification passes;
the transaction verification module 104 is configured to obtain commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, perform zero knowledge certification on the relevant transaction information and the commodity information, so that the miner node of the quantum block chain performs transaction verification according to a result of the zero knowledge certification, and when the transaction verification passes, store a digital commodity transaction success record in the quantum block chain.
In detail, the block chain-based digital commodity transaction apparatus 100 includes the following modules:
the method comprises the steps of firstly, obtaining quantum blocks in a preset time period, and connecting the quantum blocks according to a time sequence to obtain a quantum block chain, wherein the quantum blocks at least comprise two quantum blocks.
In the embodiment of the present invention, useful quantum data is stored in the quantum blocks, and a plurality of quantum blocks may be connected by adopting a quantum entanglement state in time to obtain a quantum block chain. Compared with the prior block chain technology, the quantum block chain is based on the quantum unclonable principle, so that the risk of counterfeiting can be resisted, and meanwhile, the quantum block chain combines the quantum password and the quantum principle, so that strong safety protection is provided for block chain users, and quantum computing attack can be resisted.
In detail, the quantum block comprises at least two quantum blocks, wherein the quantum blocks are:
Figure 130368DEST_PATH_IMAGE001
wherein,
Figure 370856DEST_PATH_IMAGE049
represents the first
Figure DEST_PATH_IMAGE050
The expression of the quantum block is shown,
Figure 728019DEST_PATH_IMAGE051
is shown as
Figure 79366DEST_PATH_IMAGE051
A sub-block of quantities,
Figure DEST_PATH_IMAGE052
the number of the quantum blocks is represented,
Figure 838375DEST_PATH_IMAGE053
which represents a pre-set time parameter that is,
Figure DEST_PATH_IMAGE054
representing preset quantum parameters.
E.g. by analogy, the first
Figure 312081DEST_PATH_IMAGE055
The quantum block is
Figure 94224DEST_PATH_IMAGE021
The quantum block at least comprises two quantum blocks, namely the quantum block
Figure DEST_PATH_IMAGE056
And quantum block
Figure DEST_PATH_IMAGE057
. Specifically, the connecting the quantum blocks according to the time sequence to obtain a quantum block chain includes:
acquiring a preset quantum block chain structure, and screening out quantum blocks with preset number from the quantum blocks;
randomly combining a preset number of quantum blocks to obtain a plurality of combined quantum blocks, and storing the combined quantum blocks into the quantum block chain structure to obtain a quantum block chain.
In detail, the preset number is selected differently according to a specific scheme, and quantum blocks with the preset number are combined with the quantum block chain structure to obtain a quantum block chain.
Further, the preset quantum block chain structure is as follows:
Figure 387277DEST_PATH_IMAGE007
wherein,
Figure DEST_PATH_IMAGE058
it is shown that the chain structure of the quantum blocks,
Figure 391005DEST_PATH_IMAGE059
the number of the quantum blocks is represented,
Figure DEST_PATH_IMAGE060
which is indicative of a pre-set time parameter,
Figure 645400DEST_PATH_IMAGE061
is shown as
Figure 649260DEST_PATH_IMAGE061
A quantum block.
For example, assume that the first three quantum blocks are respectively
Figure DEST_PATH_IMAGE062
Figure 404726DEST_PATH_IMAGE063
And
Figure DEST_PATH_IMAGE064
generating the quantum block chain structure by the quantum block chain structure
Figure 872748DEST_PATH_IMAGE065
Step two, receiving a transaction establishing instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, wherein the quantum keys comprise a main public key.
In the embodiment of the present invention, the transaction node refers to a certain client or server accessing the quantum block chain, and the client or server is a system platform for performing business operations in organization structures such as units. The instruction refers to a code which is sent by the node and needs to perform a specific operation. For example, in the embodiment of the present invention, the node represents a transaction party, and the instruction for creating a transaction is an instruction for issuing funds sent by a transaction party to a bank.
Specifically, the instruction is triggered after a node receives an instruction of other nodes. The instruction comprises information about the transaction user, and the transaction information transfer user can be further determined according to the instruction.
Further, the generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain includes:
generating a sequence of qubit pairs for the transaction information transfer user using the chain of qubits;
splitting the qubit pair sequence into a first qubit pair subsequence and a second qubit pair subsequence according to a preset splitting rule;
taking the first qubit subsequence as a main public key and the second qubit subsequence as a main private key;
and summarizing the main public key and the main private key to obtain a pair of quantum keys.
In detail, a sequence of qubit pairs is generated for the transaction information transferring user using the chain of quantum blocks
Figure 891519DEST_PATH_IMAGE030
Quantum regionThe blockchain generates a pair of quantum keys for each user. Splitting the sequence of qubit pairs into a first sequence of qubit pairs according to a preset splitting rule
Figure 391464DEST_PATH_IMAGE031
And a second qubit pair subsequence
Figure DEST_PATH_IMAGE066
. And taking the first qubit subsequence as a main public key and the second qubit subsequence as a main private key.
Performing hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, encrypting the transaction hash value and the related transaction information by using the main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and performing information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information.
In the embodiment of the invention, the preset hash function can be used for carrying out hash calculation on the related transaction information of the transaction information transfer user to obtain the transaction hash value. The preset hash function may be a hash () function.
Specifically, the encrypting the transaction hash value and the related transaction information by using the master public key in the quantum key means that the transaction hash value and the related transaction information are collected, and the collected information is encrypted by using the master public key in the quantum key to obtain encrypted transaction information.
And fourthly, carrying out signature generation on the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature.
In the embodiment of the present invention, the ring signature algorithm is a signature technology, and generally, there is a group of public keys, and a signer knows a private key corresponding to a public key in the group of public keys (only needs to know one public key). This allows a ring signature to be generated using the set of public keys and the corresponding private key. The verifier can verify that the ring signature is indeed generated by the owner of a private key of the set of public keys, but does not know which private key corresponds to which public key.
Specifically, the signing and generating the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature includes:
acquiring a public key set of a preset input ring in the ring signature algorithm, the encrypted transaction information and a quantum key corresponding to the encrypted transaction information;
encrypting the encrypted transaction information again based on the public key set of the preset input ring to obtain double encrypted information;
calculating to obtain a symmetrical value corresponding to the double encryption information through a preset information symmetrical formula and the transaction hash value;
and constructing a multi-element array according to the public key set, the symmetric value and the double encryption information, and taking the multi-element array as the transaction ring signature.
In detail, the public key set of the preset input ring comprises a plurality of public keys, for example, the public key is
Figure 950621DEST_PATH_IMAGE067
Figure DEST_PATH_IMAGE068
Figure 538728DEST_PATH_IMAGE069
The encrypted transaction information is
Figure DEST_PATH_IMAGE070
Figure 541450DEST_PATH_IMAGE071
,…,
Figure DEST_PATH_IMAGE072
Further, the preset information symmetry formula is as follows:
Figure 972432DEST_PATH_IMAGE073
wherein,
Figure DEST_PATH_IMAGE074
for the purpose of the transaction hash value,
Figure 945067DEST_PATH_IMAGE075
for a plurality of double encrypted information, v is a fixed parameter,
Figure DEST_PATH_IMAGE076
and the symmetric value is corresponding to the double encryption information.
And fifthly, signature verification is carried out on the transaction ring signature, and when the signature verification is passed, the related transaction information is written into the quantum block chain.
In an embodiment of the present invention, the signature verification of the transaction ring signature includes:
acquiring a verification data set, wherein the verification data set comprises a verification public key and information to be verified;
encrypting the information to be verified by using the verification public key to obtain encrypted verification information;
inputting the encrypted verification information into the transaction ring signature, and judging that the signature verification is passed when the transaction ring signature is established;
and inputting the encryption verification information into the transaction ring signature, and judging that the signature verification is not passed when the transaction ring signature is not established.
In detail, the verification data set is data proposed for signature verification of the transaction ring signature.
Specifically, when the signature verification passes, the related transaction information is written into the quantum block chain.
And sixthly, acquiring commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, and performing zero knowledge certification on the related transaction information and the commodity information so that the miner node of the quantum block chain performs transaction verification according to a result of the zero knowledge certification.
In the embodiment of the present invention, the commodity information corresponding to the transaction information transfer user refers to the relevant reference information such as the commodity name, the commodity number, and the commodity specification corresponding to the commodity transaction. The Zero-Knowledge Proof (Zero-Knowledge Proof) refers to the prover being able to convince the verifier that some argument is correct without providing the verifier with any useful information. Zero knowledge proof is essentially a protocol involving two or more parties, i.e., a series of steps that are required by two or more parties to complete a task.
Specifically, the zero-knowledge proof of the related transaction information and the commodity information includes:
acquiring a preset certification function, and performing binding verification processing on the related transaction information and the encrypted transaction information by using the certification function to obtain a first binding verification result;
if the first binding verification result is that the verification is passed, the certification function is used for carrying out binding verification processing on the commodity information and the encrypted commodity information to obtain a second binding verification result;
if the second binding verification result is that the verification is passed, calculating cosine similarity between the encrypted transaction information and the encrypted commodity information by using a cosine similarity formula;
when the cosine similarity is smaller than a preset similarity threshold, judging that the zero knowledge proof fails;
and when the cosine similarity is greater than or equal to the similarity threshold, judging that the zero knowledge proof is successful.
Specifically, the performing, by using the attestation function, binding verification processing on the related transaction information and the encrypted transaction information to obtain a first binding verification result includes:
generating certification processing is carried out on the related transaction information and the encrypted transaction information by using a preset certification generating function to obtain a certification;
and inputting the generation certification and the related transaction information into a verification certification function to obtain a first binding verification result.
The preset certification function comprises a generation certification function and a verification certification function.
In detail, the proof of generation function is pi = Prvoe (x, w), where pi represents proof of generation, x is plaintext, and w is ciphertext, in this embodiment of the present invention, x is the relevant transaction information, w is the encrypted transaction information, the proof of verification function is Yes = Verify (x, pi), Yes is one of the first binding verification results, and generally, the first binding verification result includes Yes and No, Yes represents proof correct and No represents proof error.
Specifically, the calculating the cosine similarity between the encrypted transaction information and the encrypted commodity information by using a cosine similarity formula includes:
Figure 56855DEST_PATH_IMAGE043
wherein,
Figure 886271DEST_PATH_IMAGE077
the similarity between the two signals is a cosine similarity,
Figure DEST_PATH_IMAGE078
Figure 945494DEST_PATH_IMAGE079
vectors corresponding to the encrypted transaction information and the encrypted commodity information respectively,
Figure DEST_PATH_IMAGE080
Figure DEST_PATH_IMAGE081
respectively, the modulus corresponding to the two vectors.
Further, before the cosine similarity between the encrypted transaction information and the encrypted commodity information is calculated by using a cosine similarity formula, vectorizing the encrypted transaction information and the encrypted commodity information according to a preset word2vec algorithm.
And seventhly, when the transaction passes the verification, storing the transaction success record of the digital commodity in the quantum block chain.
In the embodiment of the invention, when the transaction verification is passed, the successful record of the digital commodity transaction is stored in the quantum block chain, so that the digital commodity transaction is realized, and the safety and the accuracy of the record of the digital commodity transaction are improved.
In the embodiment of the invention, quantum blocks are connected according to the time sequence to obtain the quantum block chain, and the quantum block chain can resist the risk of counterfeiting, provide strong safety protection for block chain users and resist quantum computation attack. The related transaction information is encrypted, the data security is protected, the problem of information leakage caused by commodity transaction on a quantum block chain by directly utilizing a plaintext is solved, zero knowledge certification is carried out on the related transaction information and the commodity information, the verification of the digital commodity transaction is guaranteed to be a verifiable process, and the verification process of the digital commodity transaction is more transparent and visual. Therefore, the digital commodity transaction device based on the blockchain can solve the problem of low safety of digital commodity transaction based on the blockchain.
Fig. 3 is a schematic structural diagram of an electronic device for implementing a block chain-based digital commodity transaction method according to an embodiment of the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication interface 12 and a bus 13, and may further comprise a computer program, such as a blockchain based digital goods transaction program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a digital commodity transaction program based on a block chain, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., a digital commodity transaction program based on a block chain, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication interface 12 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 13 may be divided into an address bus, a data bus, a control bus, etc. The bus 13 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions such as charge management, discharge management, and power consumption management are implemented through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the electronic device may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The memory 11 in the electronic device stores a blockchain-based digital commodity transaction program which is a combination of instructions that, when executed in the processor 10, enable:
obtaining quantum blocks in a preset time period, and connecting the quantum blocks according to a time sequence to obtain a quantum block chain, wherein the quantum blocks at least comprise two quantum blocks;
receiving a transaction establishing instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, wherein the quantum keys comprise a main public key;
performing hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, encrypting the transaction hash value and the related transaction information by using a main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and performing information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information;
generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature;
performing signature verification on the transaction ring signature, and writing the related transaction information into the quantum block chain when the signature verification is passed;
acquiring commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, and performing zero knowledge certification on the related transaction information and the commodity information so that the miner node of the quantum block chain performs transaction verification according to a zero knowledge certification result;
and when the transaction verification passes, storing a digital commodity transaction success record in the quantum blockchain.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
obtaining quantum blocks in a preset time period, and connecting the quantum blocks according to a time sequence to obtain a quantum block chain, wherein the quantum blocks at least comprise two quantum blocks;
receiving a transaction establishing instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, wherein the quantum keys comprise a main public key;
performing hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, encrypting the transaction hash value and the related transaction information by using a main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and performing information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information;
generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature;
performing signature verification on the transaction ring signature, and writing the related transaction information into the quantum block chain when the signature verification is passed;
obtaining commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, and performing zero knowledge certification on the relevant transaction information and the commodity information so as to enable the miners' nodes of the quantum block chain to perform transaction verification according to the result of the zero knowledge certification;
and when the transaction verification passes, storing a digital commodity transaction success record in the quantum blockchain.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (9)

1. A blockchain-based digital merchandise transaction method, the method comprising:
obtaining quantum blocks in a preset time period, and connecting the quantum blocks according to a time sequence to obtain a quantum block chain, wherein the quantum blocks at least comprise two quantum blocks, and the quantum blocks are:
Figure 838557DEST_PATH_IMAGE002
wherein,
Figure 443982DEST_PATH_IMAGE004
is shown as
Figure 644019DEST_PATH_IMAGE006
The expression of the quantum block is shown,
Figure 43907DEST_PATH_IMAGE008
denotes the first
Figure 329395DEST_PATH_IMAGE010
A sub-block of quantities,
Figure 738511DEST_PATH_IMAGE012
the number of the quantum blocks is represented,
Figure 793055DEST_PATH_IMAGE014
which represents a pre-set time parameter that is,
Figure 393538DEST_PATH_IMAGE016
representing a preset quantum parameter;
receiving a transaction establishing instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, wherein the quantum keys comprise a main public key;
performing hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, encrypting the transaction hash value and the related transaction information by using a main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and performing information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information;
generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature;
performing signature verification on the transaction ring signature, and writing the related transaction information into the quantum block chain when the signature verification is passed;
acquiring commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, and performing zero knowledge certification on the related transaction information and the commodity information so that the miner node of the quantum block chain performs transaction verification according to a zero knowledge certification result;
when the transaction verification passes, storing a digital commodity transaction success record in the quantum block chain;
the signing generation of the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature comprises the following steps:
acquiring a public key set of a preset input ring in the ring signature algorithm, the encrypted transaction information and a quantum key corresponding to the encrypted transaction information;
carrying out secondary encryption processing on the encrypted transaction information based on the public key set of the preset input ring to obtain dual encrypted information;
calculating to obtain a symmetrical value corresponding to the double encryption information through a preset information symmetrical formula and the transaction hash value;
and constructing a multi-element array according to the public key set, the symmetric value and the double encryption information, and taking the multi-element array as the transaction ring signature.
2. The method for trading digital commodities based on a blockchain according to claim 1, wherein the connecting the quantum blocks in time order to obtain the quantum blockchain comprises:
acquiring a preset quantum block chain structure, and screening out quantum blocks with preset number from the quantum blocks;
randomly combining a preset number of quantum blocks to obtain a plurality of combined quantum blocks, and storing the combined quantum blocks into the quantum block chain structure to obtain a quantum block chain.
3. The blockchain-based digital merchandise trading method of claim 2, wherein the predetermined quantum blockchain structure is:
Figure 41688DEST_PATH_IMAGE018
wherein,
Figure 847970DEST_PATH_IMAGE020
it is shown that the chain structure of the quantum blocks,
Figure 897966DEST_PATH_IMAGE022
the number of the quantum blocks is represented,
Figure 764290DEST_PATH_IMAGE024
which represents a pre-set time parameter that is,
Figure DEST_PATH_IMAGE026
is shown as
Figure 696474DEST_PATH_IMAGE026
A quantum block.
4. The blockchain-based digital merchandise transaction method of claim 1, wherein the generating a pair of quantum keys for the transaction information transferring user based on the quantum blockchain comprises:
generating a sequence of qubit pairs for the transaction information transfer user using the chain of qubits;
splitting the qubit pair sequence into a first qubit pair subsequence and a second qubit pair subsequence according to a preset splitting rule;
taking the first qubit subsequence as a main public key and the second qubit subsequence as a main private key;
and summarizing the main public key and the main private key to obtain a pair of quantum keys.
5. The block chain-based digital commodity transaction method according to claim 1, wherein the preset information symmetry formula is:
Figure DEST_PATH_IMAGE028
wherein,
Figure DEST_PATH_IMAGE030
for the purpose of the transaction hash value,
Figure DEST_PATH_IMAGE032
for a plurality of double encrypted information, v is a fixed parameter,
Figure DEST_PATH_IMAGE034
and the symmetric value is corresponding to the double encryption information.
6. The blockchain-based digital goods transaction method of claim 1, wherein the signature verification of the transaction ring signature comprises:
acquiring a verification data set, wherein the verification data set comprises a verification public key and information to be verified;
encrypting the information to be verified by using the verification public key to obtain encrypted verification information;
inputting the encrypted verification information into the transaction ring signature, and judging that the signature verification is passed when the transaction ring signature is established;
and inputting the encryption verification information into the transaction ring signature, and judging that the signature verification is not passed when the transaction ring signature is not established.
7. The blockchain-based digital merchandise transaction method of claim 1, wherein the zero-knowledge proof of the related transaction information and the merchandise information comprises:
acquiring a preset certification function, and performing binding verification processing on the related transaction information and the encrypted transaction information by using the certification function to obtain a first binding verification result;
if the first binding verification result is that the verification is passed, the certification function is used for carrying out binding verification processing on the commodity information and the encrypted commodity information to obtain a second binding verification result;
if the second binding verification result is that the verification is passed, calculating cosine similarity between the encrypted transaction information and the encrypted commodity information by using a cosine similarity formula;
when the cosine similarity is smaller than a preset similarity threshold, judging that the zero knowledge proof fails;
and when the cosine similarity is greater than or equal to the similarity threshold, judging that the zero knowledge proof is successful.
8. The blockchain-based digital goods transaction method according to claim 7, wherein the binding verification processing of the related transaction information and the encrypted transaction information using the attestation function to obtain a first binding verification result includes:
generating certification processing is carried out on the relevant transaction information and the encrypted transaction information by using a preset certification generating function to obtain a certification;
and inputting the generation certification and the related transaction information into a verification certification function to obtain a first binding verification result.
9. A blockchain-based digital goods transaction apparatus for performing the method of any one of claims 1 to 8, the apparatus comprising:
the system comprises a block chain construction module, a quantum block chain construction module and a transaction information transfer module, wherein the block chain construction module is used for acquiring quantum blocks in a preset time period, connecting the quantum blocks according to a time sequence to obtain a quantum block chain, the quantum blocks at least comprise two quantum blocks, receiving a transaction establishment instruction triggered by a transaction node of the quantum block chain, determining a transaction information transfer user according to the instruction, and generating a pair of quantum keys for the transaction information transfer user based on the quantum block chain, and the quantum keys comprise main public keys;
the transaction information encryption module is used for carrying out hash calculation on the related transaction information of the transaction information transfer user to obtain a transaction hash value, carrying out encryption processing on the transaction hash value and the related transaction information by using a main public key in the quantum key to obtain an encrypted hash value and encrypted related information, and carrying out information fusion on the encrypted hash value and the encrypted related information to obtain encrypted transaction information;
the signature verification module is used for generating a signature for the encrypted transaction information by using a ring signature algorithm to obtain a transaction ring signature, performing signature verification on the transaction ring signature, and writing the related transaction information into the quantum block chain when the signature verification is passed;
and the transaction verification module is used for acquiring commodity information corresponding to the transaction information transfer user prestored in the quantum block chain by the node, performing zero knowledge certification on the related transaction information and the commodity information so as to ensure that the miner node of the quantum block chain performs transaction verification according to the result of the zero knowledge certification, and storing a digital commodity transaction success record in the quantum block chain when the transaction verification is passed.
CN202210514289.3A 2022-05-12 2022-05-12 Block chain-based digital commodity transaction method and device Active CN114629663B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210514289.3A CN114629663B (en) 2022-05-12 2022-05-12 Block chain-based digital commodity transaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210514289.3A CN114629663B (en) 2022-05-12 2022-05-12 Block chain-based digital commodity transaction method and device

Publications (2)

Publication Number Publication Date
CN114629663A CN114629663A (en) 2022-06-14
CN114629663B true CN114629663B (en) 2022-08-05

Family

ID=81905702

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210514289.3A Active CN114629663B (en) 2022-05-12 2022-05-12 Block chain-based digital commodity transaction method and device

Country Status (1)

Country Link
CN (1) CN114629663B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116016235A (en) * 2023-01-06 2023-04-25 北京工业大学 Block chain transaction packaging method oriented to dependent transaction

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108737114A (en) * 2018-06-19 2018-11-02 天津中兴云链技术有限公司 A kind of endorsement method and device of the block catenary system based on quantum key distribution
CN109672518A (en) * 2019-03-02 2019-04-23 西安邮电大学 The node data processing of the block chain of anti-quantum attack
US10708046B1 (en) * 2018-11-08 2020-07-07 Nxgen Partners Ip, Llc Quantum resistant blockchain with multi-dimensional quantum key distribution
CN111970111A (en) * 2020-10-22 2020-11-20 深圳职业技术学院 Quantum zero knowledge proof-based block chain consensus mechanism establishing method and system
CN113422681A (en) * 2021-06-16 2021-09-21 国网电子商务有限公司 Block chain digital signature method, device and system based on quantum cryptography

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101924026B1 (en) * 2017-11-10 2018-11-30 부산대학교 산학협력단 System and method for blockchain using hash-based signature scheme
CN112003707A (en) * 2020-08-25 2020-11-27 湖南宸瀚信息科技有限责任公司 Quantum computation attack resistant block chain digital signature encryption method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108737114A (en) * 2018-06-19 2018-11-02 天津中兴云链技术有限公司 A kind of endorsement method and device of the block catenary system based on quantum key distribution
US10708046B1 (en) * 2018-11-08 2020-07-07 Nxgen Partners Ip, Llc Quantum resistant blockchain with multi-dimensional quantum key distribution
CN109672518A (en) * 2019-03-02 2019-04-23 西安邮电大学 The node data processing of the block chain of anti-quantum attack
CN111970111A (en) * 2020-10-22 2020-11-20 深圳职业技术学院 Quantum zero knowledge proof-based block chain consensus mechanism establishing method and system
CN113422681A (en) * 2021-06-16 2021-09-21 国网电子商务有限公司 Block chain digital signature method, device and system based on quantum cryptography

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Quantum Blockchain Using Entanglement in Time;Rajan D 等;《Quantum Reports》;20191231;全文 *
区块链的交易安全和隐私保护关键技术研究;高玉龙;《中国优秀博硕士学位论文全文数据库(博士)信息科技辑》;20220115;第4.4.2、6.3节 *

Also Published As

Publication number Publication date
CN114629663A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
EP3741082B1 (en) Proof chaining and decomposition
US20230421355A1 (en) Systems and methods for storage, generation and verification of tokens used to control access to a resource
CN111770200B (en) Information sharing method and system
CN109478223A (en) Method and system for realizing block chain
CN113994357A (en) Method for directly transmitting electronic coin data records between a terminal and a payment system
CN111770199B (en) Information sharing method, device and equipment
CN113112252B (en) Resource transfer method and device based on block chain, electronic equipment and storage medium
CN111818186B (en) Information sharing method and system
CN103999402A (en) Method and system for securely computing a base point in direct anonymous attestation
CN111695097A (en) Login checking method and device and computer readable storage medium
CN113158207A (en) Block chain based report generation method and device, electronic equipment and storage medium
Maleh et al. Blockchain for cyber-physical systems: Challenges and applications
CN113822675A (en) Block chain based message processing method, device, equipment and storage medium
CN113129017A (en) Information sharing method, device and equipment
CN114629663B (en) Block chain-based digital commodity transaction method and device
CN112217639B (en) Data encryption sharing method and device, electronic equipment and computer storage medium
CN114514550A (en) Partitioning requests into blockchains
CN115643090A (en) Longitudinal federal analysis method, device, equipment and medium based on privacy retrieval
CN114331460A (en) Method, device, equipment and storage medium for confirming fund transaction based on block chain
CN114298321A (en) Joint modeling method and device, electronic equipment and storage medium
CN112037056A (en) Transaction processing method, device, equipment and storage medium
CN112182598A (en) Public sample ID identification method, device, server and readable storage medium
CN114826613B (en) Identity information query method, device, equipment and storage medium based on blockchain
CN118585991B (en) Data processing method, device, equipment and storage medium
WO2021081803A1 (en) Blockchain system, supervision method, system, device, and computer storage medium

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Digital commodity trading method and device based on blockchain

Effective date of registration: 20220928

Granted publication date: 20220805

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: Wuhan Heyue Digital Technology Co.,Ltd.

Registration number: Y2022420000334

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230925

Granted publication date: 20220805

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: Wuhan Heyue Digital Technology Co.,Ltd.

Registration number: Y2022420000334

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Blockchain based digital commodity trading methods and devices

Effective date of registration: 20230927

Granted publication date: 20220805

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: Wuhan Heyue Digital Technology Co.,Ltd.

Registration number: Y2023980059448