CN107358424B - Transaction method and device based on digital currency - Google Patents

Transaction method and device based on digital currency Download PDF

Info

Publication number
CN107358424B
CN107358424B CN201710494860.9A CN201710494860A CN107358424B CN 107358424 B CN107358424 B CN 107358424B CN 201710494860 A CN201710494860 A CN 201710494860A CN 107358424 B CN107358424 B CN 107358424B
Authority
CN
China
Prior art keywords
currency
transaction
amount
list
ciphertext
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
CN201710494860.9A
Other languages
Chinese (zh)
Other versions
CN107358424A (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.)
Digital Currency Institute of the Peoples Bank of China
Original Assignee
Digital Currency Institute of the Peoples Bank of China
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 Digital Currency Institute of the Peoples Bank of China filed Critical Digital Currency Institute of the Peoples Bank of China
Priority to CN201710494860.9A priority Critical patent/CN107358424B/en
Publication of CN107358424A publication Critical patent/CN107358424A/en
Application granted granted Critical
Publication of CN107358424B publication Critical patent/CN107358424B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • G06Q20/102Bill distribution or payments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/16Payments settled via telecommunication systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a transaction method and a transaction device based on digital currency, and relates to the technical field of computers. One embodiment of the method comprises: in the process of receiving and paying transactions based on the distributed account book technology, a collection end and a payment end encrypt plaintext amount related in the transactions to obtain ciphertext amount, and generate corresponding verification information for verifying or decrypting the ciphertext amount. The implementation mode solves the technical problem that funds are difficult to keep secret in the existing distributed account book technology, and achieves the technical effects of guaranteeing cooperative sharing and protecting transaction privacy.

Description

Transaction method and device based on digital currency
Technical Field
The invention relates to the technical field of computers, in particular to a transaction method and a transaction device based on digital currency.
Background
The blockchain is a novel distributed technology, a protocol maker formulates and publishes rules before a system runs, a client following the protocol is developed, then a plurality of organizations or individuals serve as nodes to be connected with each other and run the client, data which are generated by malicious nodes and do not conform to the protocol can be discarded by other honest nodes, a general ledger is maintained by adopting the method of adversarial consensus, and the assumption that no centralized right organization or individual can falsify the initial protocol is achieved.
The application scenario of the first block chain is bitcoin, which realizes a currency system that specifies the issuing rule and transfer logic in advance, the source of the currency issuing is the outbound reward Coinbase of the accounting node, and the transfer logic is called an Unspent Transaction Output (UTXO) model. Suppose user A currently has money
Figure BDA0001332380720000011
The sources of these currencies are from the payout award, user A wishes to transfer 7 dollars to user B, user A collects his/her own currency, finds a combination of 7 or more, initiates an input of A1 and A2 to change the currency
Figure BDA0001332380720000012
And new money
Figure BDA0001332380720000013
For transactions being outputs (output), i.e.
Figure BDA0001332380720000014
This equality requires first verification by the accounting node, and after passing and writing to the block chain, a1 and a2 become spent currency and a4 and B1 become new unspent currency, which can be used as inputs for the UTXO configuration at a later time.
Since the accounting node needs to verify whether each transaction has negative value currency, whether excess transfer occurs, whether currency creation exists, and the like, the blockchain system represented by bitcoin selects to store the unused currency information of all users in plain text, and the newly generated currency information in the transaction also needs plain text statement, so that the node can verify the input and output equivalent relation of all UTXOs.
However, in the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art: in real life, the amount of point-to-point transactions among users (enterprises or individuals) generally has a privacy requirement, and the total balance of the users in the system also has a privacy requirement. The traditional centralized scheme can conveniently set data access authority without cooperative accounting, can well solve the privacy problem, but a user still wants to store other documents and data cooperated by multiple parties by virtue of the advantages of distributed technologies such as block chains and the like for cooperative accounting, and a complete service closed loop needs funds to participate in real-time clearing and settlement, so that the problem that cooperative sharing and transaction privacy cannot coexist is caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a transaction method and apparatus based on digital currency, which can implement encryption of transaction amount in a transaction process based on digital currency, so as to protect privacy interests of users.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a digital currency based transaction method including:
the method comprises the steps that a receiving end encrypts received plaintext transaction amount to obtain ciphertext transaction amount, first verification information used for verifying the ciphertext transaction amount is generated, then a receiving request is generated, and the receiving request is broadcasted; the receiving request comprises the ciphertext transaction amount and the first verification information;
after receiving the money receiving request, the node confirms that the cipher text transaction amount accords with the rule according to the first verification information, then stores the money receiving request in a block chain, and updates a money list according to the money receiving request;
after the payment end acquires the payment request from the block chain, decrypting the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount, calculating a plaintext change amount according to the plaintext transaction amount and the currency list, encrypting the plaintext change amount to obtain a ciphertext change amount, generating second verification information for verifying the ciphertext change amount, generating a transfer data structure, and then generating a payment request and broadcasting the payment request; the payment request comprises the ciphertext change making amount, the second verification information and the transfer data structure;
after receiving the payment request, the node confirms that the cryptograph transaction amount accords with the rule according to the second verification information, confirms that the currency list accords with the rule according to the transfer data structure, stores the payment request to the block chain, and updates the currency list according to the transfer data structure.
In some optional embodiments, the step of encrypting the received plaintext transaction amount by the recipient to obtain a ciphertext transaction amount comprises:
the receiving end generates a transaction private key used for receiving the money;
the collection end stores a base point value, and the base point value is encrypted and calculated by using a base point encryption algorithm to obtain a base point check value;
the receiving end calculates the cipher text transaction amount according to a formula q ═ xG + mH; wherein q is the ciphertext transaction amount, x is the transaction private key, m is the received plaintext transaction amount, G is the base point value, and H is the base point verification value.
In some of the alternative embodiments, the first and second,
the first authentication information comprises a first transaction proof;
the step that the receiving end generates first verification information used for verifying the cryptograph transaction amount comprises the following steps:
the receiving end carries out binary splitting on the plaintext transaction amount m according to a preset digit n to obtain
Figure BDA0001332380720000031
Wherein m isi=2iOr mi0, i represents an index bit, and 0 ≦ i < n;
the receiving end randomly splits the transaction private key x according to a preset number n to obtain
Figure BDA0001332380720000032
Wherein x0To xn-2Are all generated at random and are all generated at random,
Figure BDA0001332380720000033
the receiving end is according to P (x) for each index biti,mi)=xiG+miH and P (x)i,mi-ki)=xiG+(mi-ki) H calculates P (x)i,mi) And P (x)i,mi-ki) (ii) a Wherein k isi=2i
The receiving end uses the x for each index bitiThe P (x)i,mi) And said P (x)i,mi-ki) Generate ring signature S of the index biti
The receiving end transmits all the index bits and the P (x)i,mi) The P (x)i,mi-ki) And said SiStitching is performed to obtain the first proof of transaction.
In some optional embodiments, the step of the node confirming that the ciphertext transaction amount meets the rule according to the first verification information comprises:
the node disassembles the first transaction certificate to obtain all the index bits, the P (x)i,mi) The P (x)i,mi-ki) And said Si
Node confirms for each of the index bits, the SiIs the P (x)i,mi) And said P (x)i,mi-ki) And confirming that P (x) is satisfied for each of the index bitsi,mi)-P(xi,mi-ki)=kiH, then confirm that
Figure BDA0001332380720000041
To confirm that the cryptograph transaction amount meets the rules; wherein k isi=2i
In some of the alternative embodiments, the first and second,
the first authentication information comprises a first communication message;
the step that the receiving end generates first verification information used for verifying the cryptograph transaction amount comprises the following steps:
the method comprises the steps that a collecting end generates a collecting end fixed private key, a paying end fixed public key is obtained, the product of the collecting end fixed private key and the paying end fixed public key is encrypted and calculated by using the base point encryption algorithm to obtain a shared key, then the plaintext transaction amount is spliced with the transaction private key, and the spliced result is encrypted and calculated by using the shared key to generate the first communication message.
In some optional embodiments, the step of the payer decrypting the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount includes:
the payment terminal stores the base point value and uses the base point encryption algorithm to encrypt and calculate the base point value to obtain the base point verification value;
and the payment end generates a payment end fixed private key, acquires a collection end fixed public key, uses the base point encryption algorithm to carry out encryption calculation on the product of the payment end fixed private key and the collection end fixed public key so as to obtain a shared key, and then splits the result of carrying out decryption calculation on the first communication message by using the shared key so as to obtain the plaintext transaction amount.
In some optional embodiments, the step of the payer calculating the clear text change amount according to the clear text transaction amount and the currency list comprises:
and the payment end selects the digital currency with the payee as the payment end and the total clear text amount greater than or equal to the clear text transaction amount from the currency list, then the digital currency forms the currency subset, and the clear text transaction amount is subtracted from the total clear text amount to obtain the clear text change amount.
In some of the alternative embodiments, the first and second,
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information;
the step of generating the transfer data structure by the payment terminal comprises the following steps:
the payment end generates a transfer data structure containing the hash value of the transaction currency, the hash value of the change currency, and the hash values of each digital currency in the subset of currency.
In some of the alternative embodiments, the first and second,
before the step of updating the currency list by the node according to the collection request, the method further comprises the following steps: the node establishes a currency list for storing currency, currency hash values and corresponding relations of the currency and the currency hash values; the currency list comprises an unconsumed currency list, a confirmed medium currency list and a spent currency list;
the step that the node updates the currency list according to the collection request comprises the following steps: the node stores the transaction currency and the hash value of the transaction currency to the confirmed currency list;
before the step of the node storing the payment request to the blockchain, the method further comprises the following steps: the node searches and confirms the transaction currency to be stored in the confirmed currency list according to the hash value of the transaction currency, searches and confirms the digital currency in the currency subset to be stored in the unspent currency list according to the hash value of the digital currency in the currency subset, and confirms that the sum of the cryptograph transaction amount and the cryptograph change amount is equal to the cryptograph total amount of the digital currency in the currency subset;
the step of the node updating the currency list according to the transfer data structure comprises: after the node finds the transaction currency according to the hash value of the transaction currency, the transaction currency and the hash value thereof are moved from the confirmed currency list to the unconsumed currency list, then the currency in the currency subset is found according to the hash value of the digital currency in the currency subset, the currency in the currency subset and the hash value thereof are moved from the unconsumed currency list to the consumed currency list, and the change-making currency and the hash value thereof are stored in the unconsumed currency list.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a digital money-based transaction apparatus including:
the transaction amount encryption module is used for encrypting the received plaintext transaction amount to obtain a ciphertext transaction amount;
the first verification information generation module is used for generating first verification information used for verifying the cryptograph transaction amount;
the collection request sending module is used for generating a collection request and broadcasting the collection request; the receiving request comprises the ciphertext transaction amount and the first verification information;
a receiving module for receiving the receiving request;
the transaction amount decryption module is used for decrypting the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount;
the change-making amount calculation module is used for calculating the plaintext change-making amount according to the plaintext transaction amount and the currency list;
the change-making amount encryption module is used for encrypting the plaintext change-making amount to obtain a ciphertext change-making amount;
the second verification information generation module is used for generating second verification information used for verifying the ciphertext change-making amount;
the transfer data structure generating module is used for generating a transfer data structure;
the payment request sending module is used for generating a payment request and broadcasting the payment request; the payment request comprises the ciphertext change making amount, the second verification information and the transfer data structure.
In some optional embodiments, the transaction amount encryption module is further to: generating a transaction private key used for the collection; storing a base point value, and carrying out encryption calculation on the base point value by using a base point encryption algorithm to obtain a base point check value; calculating the cipher text transaction amount according to a formula q ═ xG + mH; wherein q is the ciphertext transaction amount, x is the transaction private key, m is the received plaintext transaction amount, G is the base point value, and H is the base point verification value.
In some of the alternative embodiments, the first and second,
the first authentication information comprises a first transaction proof;
the first verification information generation module is further configured to: carrying out binary splitting on the plaintext transaction amount m according to a preset digit n to obtain
Figure BDA0001332380720000071
Wherein m isi=2iOr mi0, i represents an index bit, and 0 ≦ i < n; randomly splitting the transaction private key x according to a preset digit n to obtain the transaction private key x
Figure BDA0001332380720000072
Wherein x0To xn-2Are all generated at random and are all generated at random,
Figure BDA0001332380720000073
for each index bit, according to P (x)i,mi)=xiG+miH and P (x)i,mi-ki)=xiG+(mi-ki) H calculates P (x)i,mi) And P (x)i,mi-ki) (ii) a Wherein k isi=2i(ii) a For each of the index bits, using the xiThe P (x)i,mi) And said P (x)i,mi-ki) Generate ring signature S of the index biti(ii) a All the index bits, the P (x)i,mi) The P (x)i,mi-ki) And said SiStitching is performed to obtain the first proof of transaction.
In some of the alternative embodiments, the first and second,
the first authentication information comprises a first communication message;
the first verification information generation module is further configured to: generating a fixed private key of a collection end, acquiring a fixed public key of a payment end, carrying out encryption calculation on the product of the fixed private key of the collection end and the fixed public key of the payment end by using the base point encryption algorithm to obtain a shared key, splicing the plaintext transaction amount with the transaction private key, and carrying out encryption calculation on the spliced result by using the shared key to generate the first communication message.
In some optional embodiments, the transaction amount decryption module is further to: storing the base point value, and carrying out encryption calculation on the base point value by using the base point encryption algorithm to obtain the base point check value; generating a fixed private key of a payment end, acquiring a fixed public key of a collection end, carrying out encryption calculation on the product of the fixed private key of the payment end and the fixed public key of the collection end by using the base point encryption algorithm to obtain a shared key, and then splitting the result of carrying out decryption calculation on the first communication message by using the shared key to obtain the plaintext transaction amount.
In some optional embodiments, the change amount calculation module is further configured to: and selecting the digital currency with the payee as the payment end and the total clear text amount greater than or equal to the clear text transaction amount from the currency list, then forming the currency subset, and subtracting the clear text transaction amount from the total clear text amount to obtain the clear text change amount.
In some of the alternative embodiments, the first and second,
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information;
the transfer data structure generation module is further configured to: generating a transfer data structure containing the hash value of the transaction currency, the hash value of the change currency, and the hash values of each digital currency in the subset of currencies.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a digital money-based transaction apparatus including:
a receiving module for receiving a receiving request; the collection request comprises a ciphertext transaction amount and first verification information;
the collection request verification module is used for confirming that the cryptograph transaction amount accords with the rule according to the first verification information;
the collection request chaining module is used for storing the collection request to a block chain;
the money receiving updating module is used for updating a money list according to the money receiving request;
a payment request receiving module for receiving a payment request; the payment request comprises a ciphertext change making amount, second verification information and a transfer data structure;
the payment request verification module is used for confirming that the cryptograph transaction amount accords with the rule according to the second verification information and confirming that the currency list accords with the rule according to the transfer data structure;
a payment request chaining module for storing the payment request to the blockchain;
and the payment updating module is used for updating the currency list according to the transfer data structure.
In some of the alternative embodiments, the first and second,
the first authentication information comprises a first transaction proof;
the collection request verification module is further configured to: splitting the first transaction certificate to obtain all index bits i, P (x)i,mi)、P(xi,mi-ki) And Si(ii) a Confirming that for each of the index bits, the SiIs the P (x)i,mi) And said P (x)i,mi-ki) And confirming that P (x) is satisfied for each of the index bitsi,mi)-P(xi,mi-ki)=kiH, then confirm that
Figure BDA0001332380720000091
To confirm that the cryptograph transaction amount meets the rules; wherein k isi=2i
In some optional embodiments, the apparatus further comprises a currency list establishment module, wherein,
the currency list establishing module is used for establishing a currency list for storing currency, currency hash values and corresponding relations of the currency and the currency hash values; the currency list comprises an unconsumed currency list, a confirmed medium currency list and a spent currency list;
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information;
the collection updating module is also used for: storing the transaction currency and the hash value of the transaction currency to the confirmed currency list;
the transfer data structure including a hash value of the transaction currency, the transfer data structure further including a hash value of the change currency and a hash value of the digital currency within the currency subset;
the payment request validation module is further to: searching and confirming that the transaction currency is stored in the confirmed currency list according to the hash value of the transaction currency, searching and confirming that the currency in the currency subset is stored in the unspent currency list according to the hash value of the digital currency in the currency subset, and confirming that the sum of the ciphertext transaction amount and the ciphertext change amount is equal to the total ciphertext amount of the digital currency in the currency subset;
the payment update module is further to: after the transaction currency is found according to the hash value of the transaction currency, the transaction currency and the hash value thereof are moved from the confirmed currency list to the non-spent currency list, then the currency in the currency subset is found according to the hash value of the digital currency in the currency subset, the currency in the currency subset and the hash value thereof are moved from the non-spent currency list to the spent currency list, and the change-making currency and the hash value thereof are stored in the non-spent currency list.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium having computer instructions stored therein, wherein the computer instructions are executable by a computer or a computer system, thereby enabling the computer or the computer system to execute the digital currency-based transaction method.
One embodiment of the above invention has the following advantages or benefits: in the process of receiving and paying transactions based on the distributed account book technology, the collection end and the payment end encrypt plaintext amount related in the transactions to obtain ciphertext amount and generate corresponding verification information for verifying or decrypting the ciphertext amount, so that the technical problem that funds in the existing distributed account book technology are difficult to keep secret is solved, and the technical effects of guaranteeing cooperative sharing and protecting transaction privacy are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a digital currency based transaction method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main modules of a digital currency based transaction apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of main modules of a digital money-based transaction apparatus according to another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main steps of a digital currency based transaction method according to an embodiment of the present invention.
As shown in fig. 1, a digital currency based transaction method according to an embodiment of the present invention includes:
s10, the receiving end encrypts the received plaintext transaction amount to obtain a ciphertext transaction amount, generates first verification information for verifying the ciphertext transaction amount, and then generates a receiving request and broadcasts the receiving request; the receiving request comprises the ciphertext transaction amount and the first verification information.
And S11, after receiving the money receiving request, the node confirms that the ciphertext transaction amount meets the rule according to the first verification information, then stores the money receiving request in a block chain, and updates a money list according to the money receiving request.
S12, after the payment end obtains the collection request from the block chain, the payment end decrypts the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount, calculates the plaintext change amount according to the plaintext transaction amount and the currency list, encrypts the plaintext change amount to obtain the ciphertext change amount, generates second verification information for verifying the ciphertext change amount, generates a transfer data structure, and then generates a payment request and broadcasts the payment request; the payment request comprises the ciphertext change making amount, the second verification information and the transfer data structure.
And S13, after receiving the payment request, the node confirms that the cryptograph transaction amount accords with the rule according to the second verification information, confirms that the currency list accords with the rule according to the transfer data structure, stores the payment request into the block chain, and updates the currency list according to the transfer data structure.
In some optional embodiments, the collection request further includes a collection timestamp, and for convenience of sending, receiving and recording, the collection request further includes a collection party address and a payment party address. For identification, the collection request is signed by the collection end using a collection end fixed private key before broadcast. A payment timestamp is also included in the payment request. The payment request also includes a payee address and a payer address for ease of sending and receiving and recording. For identification purposes, the payment request is signed by the payment end using a payment end fixed private key before broadcast.
As can be seen from the above, in the embodiment of the present invention, in the process of a receipt and payment transaction based on the distributed ledger technology, the receiving end and the paying end encrypt the plaintext amount involved in the transaction to obtain the ciphertext amount, and generate the corresponding verification message to verify or decrypt the ciphertext amount, so that the technical problem that the fund in the existing distributed ledger technology is difficult to be kept secret is overcome, and the technical effects of ensuring cooperative sharing and protecting the transaction privacy are achieved.
In some optional embodiments, the step of encrypting the received plaintext transaction amount by the recipient to obtain a ciphertext transaction amount comprises:
the receiving end generates a transaction private key used for receiving the money; the collection end stores a base point value, and the base point value is encrypted and calculated by using a base point encryption algorithm to obtain a base point check value; the receiving end calculates the cipher text transaction amount according to a formula q ═ xG + mH; wherein q is the ciphertext transaction amount, x is the transaction private key, m is the received plaintext transaction amount, G is the base point value, and H is the base point verification value. The transaction private key is only used for receiving and paying the current time, and a new transaction private key is generated every time a new transaction is carried out.
The Base point encryption algorithm may be, for example, the SHA256 algorithm, the RIPEMD-160 algorithm, or the Base58 encoding, etc. The basic point encryption algorithm aims to obtain a public key of an unknown private key, namely a basic point verification value H, by calculation through a preset basic point value G; the base check value H obtained by using a hash algorithm such as SHA256 is relatively confident, but other algorithms that achieve the same or similar effect may be used. The base point encryption algorithm needs to ensure that there is no simple correspondence between H and G, which is obtained by calculation, and H ═ kG, so that when q ═ xG + mH is known, the values of x and m have unique solutions.
In some optional embodiments, the first verification information comprises a first proof of transaction;
the step that the receiving end generates first verification information used for verifying the cryptograph transaction amount comprises the following steps:
the receiving end carries out binary splitting on the plaintext transaction amount m according to a preset digit n to obtain
Figure BDA0001332380720000131
Wherein m isi=2iOr mi0, i represents an index bit, and 0 ≦ i < n;
the receiving end randomly splits the transaction private key x according to a preset number n to obtain
Figure BDA0001332380720000132
Wherein x0To xn-2Are all generated at random and are all generated at random,
Figure BDA0001332380720000133
during splitting, the larger the preset digit n is, the higher the encryption degree is, but the calculation cost is also increased, and the redundant digits do not have practical applicability, so that the value of n is usually more suitable at 64, and 32 or 128 can be selected according to the situation;
the receiving end is according to P (x) for each index biti,mi)=xiG+miH and P (x)i,mi-ki)=xiG+(mi-ki) H calculates P (x)i,mi) And P (x)i,mi-ki) (ii) a Wherein k isi=2i
The receiving end uses the x for each index bitiThe P (x)i,mi) And said P (x)i,mi-ki) Generate ring signature S of the index biti
The receiving end transmits all the index bits and the P (x)i,mi) The P (x)i,mi-ki) And said SiStitching is performed to obtain the first proof of transaction.
In some optional embodiments, the step of the node confirming that the ciphertext transaction amount meets the rule according to the first verification information comprises:
the node disassembles the first transaction certificate to obtain all the index bits, the P (x)i,mi) The P (x)i,mi-ki) And said Si
Node confirms for each of the index bits, the SiIs the P (x)i,mi) And said P (x)i,mi-ki) And confirming that P (x) is satisfied for each of the index bitsi,mi)-P(xi,mi-ki)=kiH, then confirm that
Figure BDA0001332380720000134
Thereby confirming that the plaintext transaction amount corresponding to the ciphertext transaction amount q is 0-2nWithin the range, to confirm that the cryptograph transaction amount meets the rules; wherein k isi=2i
In some optional embodiments, the first authentication information comprises a first communication message;
the step that the receiving end generates first verification information used for verifying the cryptograph transaction amount comprises the following steps:
the method comprises the steps that a collecting end generates a collecting end fixed private key, a paying end fixed public key is obtained, the product of the collecting end fixed private key and the paying end fixed public key is encrypted and calculated by using the base point encryption algorithm to obtain a shared key, then the plaintext transaction amount is spliced with the transaction private key, and the spliced result is encrypted and calculated by using the shared key to generate the first communication message.
In some optional embodiments, the step of the payer decrypting the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount includes:
the payment terminal stores the base point value and uses the base point encryption algorithm to encrypt and calculate the base point value to obtain the base point verification value;
and the payment end generates a payment end fixed private key, acquires a collection end fixed public key, uses the base point encryption algorithm to carry out encryption calculation on the product of the payment end fixed private key and the collection end fixed public key so as to obtain a shared key, and then splits the result of carrying out decryption calculation on the first communication message by using the shared key so as to obtain the plaintext transaction amount.
It should be noted that, because the first communication message is encrypted by using the fixed private key at one end of the payment end and the collection end and the fixed public key at the other end, only the payment end and the collection end can decrypt the first communication message, thereby decrypting the cryptograph transaction amount. Similarly, any user side can only decrypt and obtain the plaintext amount in the digital currency (which is a payer or a payee) related to the user side, but cannot obtain the plaintext transaction amount in the digital currency unrelated to the user side, so that the privacy of the transaction process and the transaction account book is ensured.
In some optional embodiments, the step of the payer calculating the clear text change amount according to the clear text transaction amount and the currency list comprises:
and the payment end selects the digital currency with the payee as the payment end and the total clear text amount greater than or equal to the clear text transaction amount from the currency list, then the digital currency forms the currency subset, and the clear text transaction amount is subtracted from the total clear text amount to obtain the clear text change amount. It should be noted that, if the total plaintext amount of the digital currency in the currency subset is equal to the plaintext transaction amount, the calculated plaintext change amount is zero; in this case, the subsequent processing may still be performed according to a method in which the plaintext change amount is not 0, or an individual determination condition may be set, and the plaintext change amount and the content related thereto appearing subsequently may not be processed any more. If the subsequent processing is carried out according to the method that the plaintext change amount is not 0, the verification of the node in the subsequent step on the ciphertext transaction amount, the ciphertext change amount and the plaintext total amount of the digital currency in the currency subset can be kept consistent, and the integrity and the safety of the method can be improved.
In some optional embodiments, the ciphertext transaction amount is referenced by the manner of generating, decrypting and verifying the ciphertext change amount; the generation and use of the second authentication information refers to the first authentication information. It should be noted that, when the second verification information is generated, the payment end generates the payment transaction private key used for the current payment, in some other embodiments, in order to meet the verification condition, the payment transaction private key also meets a certain condition, which is described in the following embodiments; and if the second communication message needs to be generated, the payment terminal generates the second communication message according to the fixed private key and the fixed public key of the payment terminal and by referring to the generation mode of the first verification message.
In some of the alternative embodiments, the first and second,
before the step of updating the currency list by the node according to the collection request, the method further comprises the following steps: the node establishes a currency list for storing currency, currency hash values and corresponding relations of the currency and the currency hash values; the currency list comprises an unconsumed currency list, a confirmed medium currency list and a spent currency list;
the step that the node updates the currency list according to the collection request comprises the following steps: the node stores the transaction currency and the hash value of the transaction currency to the confirmed currency list;
before the step of the node storing the payment request to the blockchain, the method further comprises the following steps: the node searches and confirms the transaction currency to be stored in the confirmed currency list according to the hash value of the transaction currency, searches and confirms the digital currency in the currency subset to be stored in the unspent currency list according to the hash value of the digital currency in the currency subset, and confirms that the sum of the cryptograph transaction amount and the cryptograph change amount is equal to the cryptograph total amount of the digital currency in the currency subset;
the step of the node updating the currency list according to the transfer data structure comprises: after the node finds the transaction currency according to the hash value of the transaction currency, the transaction currency and the hash value thereof are moved from the confirmed currency list to the unconsumed currency list, then the currency in the currency subset is found according to the hash value of the digital currency in the currency subset, the currency in the currency subset and the hash value thereof are moved from the unconsumed currency list to the consumed currency list, and the change-making currency and the hash value thereof are stored in the unconsumed currency list.
In this embodiment, since it is determined that the sum of the ciphertext transaction amount and the ciphertext change amount is equal to the total ciphertext amount of the digital currency in the currency subset, when the total plaintext amount of the digital currency in the currency subset is equal to the plaintext transaction amount, that is, the value of the plaintext change amount is 0, the plaintext change amount is still encrypted by referring to the method for encrypting the plaintext transaction amount; in addition, when the plaintext change amount is encrypted, a payment transaction private key is generated by a payment end, the generation mode of the payment transaction private key is different from the generation mode of the transaction private key by a collection end, the payment transaction private key is not randomly generated, and the result obtained by subtracting the transaction private key of the payment end from the sum of the transaction private keys of the digital currencies in the currency subset is used as the payment transaction private key of the payment end, so that the sum of the ciphertext transaction amount and the ciphertext change amount can still meet the requirement that the total ciphertext amount of the digital currencies in the currency subset is equal to the total ciphertext amount of the digital currencies in the currency subset when the plaintext change amount is 0, and the verification process is.
It should be noted that, if any user needs to query the account balance of itself, the money whose payee address is the address of itself in the unspent money list of the money list may be collected, the shared key of each money is calculated one by one according to the public keys of the money payers, and the ciphertext amounts in the money are decrypted respectively by using the shared key to obtain the plaintext amount of each money, and the account balance of itself may be obtained by adding the plaintext amounts.
In some optional embodiments, after obtaining the collection request from the blockchain, the payment terminal may further refuse to make a payment; at this time, the method further includes:
the payment terminal acquires the transaction currency contained in the collection request, calculates the hash value of the transaction currency, then generates a payment refusal request and broadcasts the payment refusal request; the request for refusal payment comprises a hash value of the transaction currency;
and after the node side receives the payment rejection request, searching the transaction currency in the currency list according to the hash value of the transaction currency, and deleting the transaction currency from the currency list after determining that the transaction currency exists in the confirmed currency list and the address of the payer of the transaction currency is the address of the payment side.
In some optional embodiments, the payee may also initiate a withdrawal receipt request before the payer initiates no payment request or rejects the payment request; at this time, the method further includes:
the receiving end calculates the hash value of the transaction currency, then generates a withdrawal request and broadcasts the withdrawal request; the withdrawal request comprises a hash value of the transaction currency;
and after the node end receives the withdrawal request, searching the transaction currency in the currency list according to the hash value of the transaction currency, and deleting the transaction currency from the currency list after determining that the transaction currency exists in the confirmed currency list and the address of a payee of the transaction currency is the address of the payee.
In some alternative embodiments, the data structures for the transaction currency, change currency, and digital currency are shown in Table 1:
table 1 currency data structure table
Field(s) Abbreviations Type (B) Explanation of the invention
AddressFrom Dx Address Payer address
AddressTo Dx Address Payee address
Money q Public key Amount of cipher text
Proof f Bytes Transaction proof
Message c Bytes Communicating messages
Timestamp s Time of day Millisecond time stamp
In some alternative embodiments, the data structure of the transaction certificate is shown in table 2:
table 2 transaction verification data structure table
Figure BDA0001332380720000171
Figure BDA0001332380720000181
In some alternative embodiments, the alternative data structures of the transfer data structure are shown in Table 3:
table 3 transfer data structure table
Field(s) Type (B) Explanation of the invention
Inputs Hash list Inputting currency hash lists
Outputs Hash list Exporting currency hash lists
Wherein the input currency hash list comprises hash values of digital currencies in the currency subset; the output currency hash list comprises the hash value of the transaction currency and also comprises the hash value of the change currency when the change exists.
Fig. 2 is a schematic diagram of main modules of a digital money-based transaction apparatus according to an embodiment of the present invention.
As shown in fig. 2, an embodiment of the invention provides a transaction apparatus 200 based on digital money, which is mainly applied to a user side with functions of collecting money and paying, and includes:
a transaction amount encryption module 201, configured to encrypt the received plaintext transaction amount to obtain a ciphertext transaction amount;
a first verification information generation module 202, configured to generate first verification information used for verifying the ciphertext transaction amount;
a collection request sending module 203, configured to generate a collection request and broadcast the collection request; the receiving request comprises the ciphertext transaction amount and the first verification information;
a receiving module 204 for receiving the receiving request;
the transaction amount decryption module 205 is configured to decrypt the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount;
a change amount calculation module 206, configured to calculate a plaintext change amount according to the plaintext transaction amount and the currency list;
a change-making amount encryption module 207 for encrypting the plaintext change-making amount to obtain a ciphertext change-making amount;
a second verification information generation module 208, configured to generate second verification information used for verifying the ciphertext change-making amount;
a transfer data structure generating module 209 for generating a transfer data structure;
a payment request transmitting module 210 for generating a payment request and broadcasting the payment request; the payment request comprises the ciphertext change making amount, the second verification information and the transfer data structure.
In some optional embodiments, the transaction amount encryption module 201 is further configured to: generating a transaction private key used for the collection; storing a base point value, and carrying out encryption calculation on the base point value by using a base point encryption algorithm to obtain a base point check value; calculating the cipher text transaction amount according to a formula q ═ xG + mH; wherein q is the ciphertext transaction amount, x is the transaction private key, m is the received plaintext transaction amount, G is the base point value, and H is the base point verification value.
The first authentication information comprises a first transaction proof;
the first verification information generation module 202 is further configured to: carrying out binary splitting on the plaintext transaction amount m according to a preset digit n to obtain
Figure BDA0001332380720000191
Wherein m isi=2iOr mi0, i represents an index bit, and 0 ≦ i < n; randomly splitting the transaction private key x according to a preset digit n to obtain the transaction private key x
Figure BDA0001332380720000192
Wherein x0To xn-2Are all generated at random and are all generated at random,
Figure BDA0001332380720000193
for each index bit, according to P (x)i,mi)=xiG+miH and P (x)i,mi-ki)=xiG+(mi-ki) H calculates P (x)i,mi) And P (x)i,mi-ki) (ii) a Wherein k isi=2i(ii) a For each of the index bits, using the xiThe P (x)i,mi) And said P (x)i,mi-ki) Generate ring signature S of the index biti(ii) a All the index bits, the P (x)i,mi) The P (x)i,mi-ki) And said SiStitching is performed to obtain the first proof of transaction.
The first authentication information comprises a first communication message;
the first verification information generation module 202 is further configured to: generating a fixed private key of a collection end, acquiring a fixed public key of a payment end, carrying out encryption calculation on the product of the fixed private key of the collection end and the fixed public key of the payment end by using the base point encryption algorithm to obtain a shared key, splicing the plaintext transaction amount with the transaction private key, and carrying out encryption calculation on the spliced result by using the shared key to generate the first communication message.
In some optional embodiments, the transaction amount decryption module 205 is further configured to: storing the base point value, and carrying out encryption calculation on the base point value by using the base point encryption algorithm to obtain the base point check value; generating a fixed private key of a payment end, acquiring a fixed public key of a collection end, carrying out encryption calculation on the product of the fixed private key of the payment end and the fixed public key of the collection end by using the base point encryption algorithm to obtain a shared key, and then splitting the result of carrying out decryption calculation on the first communication message by using the shared key to obtain the plaintext transaction amount.
In some optional embodiments, the change amount calculation module 206 is further configured to: and selecting the digital currency with the payee as the payment end and the total clear text amount greater than or equal to the clear text transaction amount from the currency list, then forming the currency subset, and subtracting the clear text transaction amount from the total clear text amount to obtain the clear text change amount.
In some of the alternative embodiments, the first and second,
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information;
the transfer data structure generation module 209 is further configured to: generating a transfer data structure containing the hash value of the transaction currency, the hash value of the change currency, and the hash values of each digital currency in the subset of currencies.
Fig. 3 is a schematic diagram of main modules of a digital money-based transaction apparatus according to another embodiment of the present invention.
As shown in fig. 3, another embodiment of the present invention provides a transaction apparatus 300 based on digital currency, which is mainly applied to a node with a verification function, and includes:
a receiving request receiving module 301, configured to receive a receiving request; the collection request comprises a ciphertext transaction amount and first verification information;
a receiving request verification module 302, configured to confirm that the ciphertext transaction amount meets a rule according to the first verification information;
a receive request chaining module 303, configured to store the receive request to a block chain;
a money receiving update module 304, configured to update the money list according to the money receiving request;
a payment request receiving module 305 for receiving a payment request; the payment request comprises a ciphertext change making amount, second verification information and a transfer data structure;
a payment request verification module 306, configured to confirm that the ciphertext transaction amount complies with a rule according to the second verification information, and confirm that the currency list complies with a rule according to the transfer data structure;
a payment request chaining module 307 for storing the payment request to the blockchain;
a payment update module 308 for updating the currency list according to the transfer data structure.
In some optional embodiments, the first verification information comprises a first proof of transaction;
the receipt request verification module 302 is further configured to: splitting the first transaction certificate to obtain all index bits i, P (x)i,mi)、P(xi,mi-ki) And Si(ii) a Confirming that for each of the index bits, the SiIs the P (x)i,mi) And said P (x)i,mi-ki) And confirming that P (x) is satisfied for each of the index bitsi,mi)-P(xi,mi-ki)=kiH, then confirm that
Figure BDA0001332380720000211
To confirm that the cryptograph transaction amount meets the rules; wherein k isi=2i
In some alternative embodiments, the apparatus further comprises a currency list creation module 309,
the currency list establishing module 309 is configured to establish a currency list for storing currency, a currency hash value, and a corresponding relationship therebetween; the currency list comprises an unconsumed currency list, a confirmed medium currency list and a spent currency list;
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information;
the collection update module 304: storing the transaction currency and the hash value of the transaction currency to the confirmed currency list;
the transfer data structure including a hash value of the transaction currency, the transfer data structure further including a hash value of the change currency and a hash value of the digital currency within the currency subset;
the payment request validation module 306 is further configured to: searching and confirming that the transaction currency is stored in the confirmed currency list according to the hash value of the transaction currency, searching and confirming that the currency in the currency subset is stored in the unspent currency list according to the hash value of the digital currency in the currency subset, and confirming that the sum of the ciphertext transaction amount and the ciphertext change amount is equal to the total ciphertext amount of the digital currency in the currency subset;
the payment update module 308 is further configured to: after the transaction currency is found according to the hash value of the transaction currency, the transaction currency and the hash value thereof are moved from the confirmed currency list to the non-spent currency list, then the currency in the currency subset is found according to the hash value of the digital currency in the currency subset, the currency in the currency subset and the hash value thereof are moved from the non-spent currency list to the spent currency list, and the change-making currency and the hash value thereof are stored in the non-spent currency list.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A digital currency based transaction method, comprising:
the method comprises the steps that a receiving end encrypts received plaintext transaction amount to obtain ciphertext transaction amount, first verification information used for verifying the ciphertext transaction amount is generated, then a receiving request is generated, and the receiving request is broadcasted; the receiving request comprises the ciphertext transaction amount and the first verification information;
after receiving the money receiving request, the node confirms that the cipher text transaction amount accords with the rule according to the first verification information, then stores the money receiving request in a block chain, and updates a money list according to the money receiving request;
after the payment end acquires the payment request from the block chain, decrypting the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount, calculating a plaintext change amount according to the plaintext transaction amount and the currency list, encrypting the plaintext change amount to obtain a ciphertext change amount, generating second verification information for verifying the ciphertext change amount, generating a transfer data structure, and then generating a payment request and broadcasting the payment request; the payment request comprises the ciphertext change making amount, the second verification information and the transfer data structure;
after receiving the payment request, the node confirms that the ciphertext change amount accords with the rule according to the second verification information, confirms that the currency list accords with the rule according to the transfer data structure, stores the payment request into the block chain, and updates the currency list according to the transfer data structure;
wherein, the step that the payment terminal calculates the clear text change amount according to the clear text transaction amount and the currency list comprises the following steps: the payment end selects the digital currency with the payee as the payment end and the total clear text amount greater than or equal to the clear text transaction amount from the currency list, then the digital currency forms a currency subset, and the clear text transaction amount is subtracted from the total clear text amount to obtain the clear text change amount;
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information; the step of generating the transfer data structure by the payment terminal comprises the following steps: the payment end generates a transfer data structure containing the hash value of the transaction currency, the hash value of the change currency, and the hash values of each digital currency in the subset of currency.
2. The method of claim 1, wherein the step of the recipient encrypting the received plaintext transaction amount to obtain the ciphertext transaction amount comprises:
the receiving end generates a transaction private key used for receiving the money;
the collection end stores a base point value, and the base point value is encrypted and calculated by using a base point encryption algorithm to obtain a base point check value;
the receiving end calculates the cipher text transaction amount according to a formula q ═ xG + mH; wherein q is the ciphertext transaction amount, x is the transaction private key, m is the received plaintext transaction amount, G is the base point value, and H is the base point verification value.
3. The method of claim 2,
the first authentication information comprises a first transaction proof;
the step that the receiving end generates first verification information used for verifying the cryptograph transaction amount comprises the following steps:
the receiving end carries out binary splitting on the plaintext transaction amount m according to a preset digit n to obtain
Figure FDA0002467782130000021
Wherein m isi=2iOr mi0, i represents an index bit, and 0 ≦ i < n;
the receiving end randomly splits the transaction private key x according to a preset number n to obtain
Figure FDA0002467782130000022
Wherein x0To xn-2Are all generated at random and are all generated at random,
Figure FDA0002467782130000023
the receiving end is according to P (x) for each index biti,mi)=xiG+miH and P (x)i,mi-ki)=xiG+(mi-ki) H calculates P (x)i,mi) And P (x)i,mi-ki) (ii) a Wherein k isi=2i
The receiving end uses the x for each index bitiThe P (x)i,mi) And said P (x)i,mi-ki) Generate ring signature S of the index biti
The receiving end transmits all the index bits and the P (x)i,mi) The P (x)i,mi-ki) And said SiStitching is performed to obtain the first proof of transaction.
4. The method of claim 3, wherein the step of the node confirming that the ciphertext transaction amount complies with the rule based on the first verification information comprises:
the node disassembles the first transaction certificate to obtain all the index bits, the P (x)i,mi) The P (x)i,mi-ki) And said Si
Node confirms for each of the index bits, the SiIs the P (x)i,mi) And said P (x)i,mi-ki) And confirming that P (x) is satisfied for each of the index bitsi,mi)-P(xi,mi-ki)=kiH, then confirm that
Figure FDA0002467782130000031
To confirm that the cryptograph transaction amount meets the rules; wherein k isi=2i
5. The method of claim 2,
the first authentication information comprises a first communication message;
the step that the receiving end generates first verification information used for verifying the cryptograph transaction amount comprises the following steps:
the method comprises the steps that a collecting end generates a collecting end fixed private key, a paying end fixed public key is obtained, the product of the collecting end fixed private key and the paying end fixed public key is encrypted and calculated by using the base point encryption algorithm to obtain a shared key, then the plaintext transaction amount is spliced with the transaction private key, and the spliced result is encrypted and calculated by using the shared key to generate the first communication message.
6. The method of claim 5, wherein the step of the payer terminal decrypting the ciphertext transaction amount to obtain the plaintext transaction amount based on the first authentication information comprises:
the payment terminal stores the base point value and uses the base point encryption algorithm to encrypt and calculate the base point value to obtain the base point verification value;
and the payment end generates a payment end fixed private key, acquires a collection end fixed public key, uses the base point encryption algorithm to carry out encryption calculation on the product of the payment end fixed private key and the collection end fixed public key so as to obtain a shared key, and then splits the result of carrying out decryption calculation on the first communication message by using the shared key so as to obtain the plaintext transaction amount.
7. The method of claim 1,
before the step of updating the currency list by the node according to the collection request, the method further comprises the following steps: the node establishes a currency list for storing currency, currency hash values and corresponding relations of the currency and the currency hash values; the currency list comprises an unconsumed currency list, a confirmed medium currency list and a spent currency list;
the step that the node updates the currency list according to the collection request comprises the following steps: the node stores the transaction currency and the hash value of the transaction currency to the confirmed currency list;
before the step of the node storing the payment request to the blockchain, the method further comprises the following steps: the node searches and confirms the transaction currency to be stored in the confirmed currency list according to the hash value of the transaction currency, searches and confirms the digital currency in the currency subset to be stored in the unspent currency list according to the hash value of the digital currency in the currency subset, and confirms that the sum of the cryptograph transaction amount and the cryptograph change amount is equal to the cryptograph total amount of the digital currency in the currency subset;
the step of the node updating the currency list according to the transfer data structure comprises: after the node finds the transaction currency according to the hash value of the transaction currency, the transaction currency and the hash value thereof are moved from the confirmed currency list to the unconsumed currency list, then the currency in the currency subset is found according to the hash value of the digital currency in the currency subset, the currency in the currency subset and the hash value thereof are moved from the unconsumed currency list to the consumed currency list, and the change-making currency and the hash value thereof are stored in the unconsumed currency list.
8. A digital currency based transaction apparatus, comprising:
the transaction amount encryption module is used for encrypting the received plaintext transaction amount to obtain a ciphertext transaction amount;
the first verification information generation module is used for generating first verification information used for verifying the cryptograph transaction amount;
the collection request sending module is used for generating a collection request and broadcasting the collection request; the receiving request comprises the ciphertext transaction amount and the first verification information;
a receiving module for receiving the receiving request;
the transaction amount decryption module is used for decrypting the ciphertext transaction amount according to the first verification information to obtain the plaintext transaction amount;
the change-making amount calculation module is used for calculating the plaintext change-making amount according to the plaintext transaction amount and the currency list;
the change-making amount encryption module is used for encrypting the plaintext change-making amount to obtain a ciphertext change-making amount;
the second verification information generation module is used for generating second verification information used for verifying the ciphertext change-making amount;
the transfer data structure generating module is used for generating a transfer data structure;
the payment request sending module is used for generating a payment request and broadcasting the payment request; the payment request comprises the ciphertext change making amount, the second verification information and the transfer data structure;
wherein, the change amount calculation module is further used for: selecting digital currency with a payee as a payment end and a total plaintext amount greater than or equal to the plaintext transaction amount from the currency list, forming a currency subset, and subtracting the plaintext transaction amount from the total plaintext amount to obtain a plaintext change amount;
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information; the transfer data structure generation module is further configured to: generating a transfer data structure containing the hash value of the transaction currency, the hash value of the change currency, and the hash values of each digital currency in the subset of currencies.
9. The apparatus of claim 8, wherein the transaction amount encryption module is further configured to: generating a transaction private key used for the collection; storing a base point value, and carrying out encryption calculation on the base point value by using a base point encryption algorithm to obtain a base point check value; calculating the cipher text transaction amount according to a formula q ═ xG + mH; wherein q is the ciphertext transaction amount, x is the transaction private key, m is the received plaintext transaction amount, G is the base point value, and H is the base point verification value.
10. The apparatus of claim 9,
the first authentication information comprises a first transaction proof;
the first verification information generation module is further configured to: carrying out binary splitting on the plaintext transaction amount m according to a preset digit n to obtain
Figure FDA0002467782130000051
Wherein m isi=2iOr mi0, i represents an index bit, and 0 ≦ i < n; randomly splitting the transaction private key x according to a preset digit n to obtain the transaction private key x
Figure FDA0002467782130000052
Wherein x0To xn-2Are all generated at random and are all generated at random,
Figure FDA0002467782130000053
for each index bit, according to P (x)i,mi)=xiG+miH and P (x)i,mi-ki)=xiG+(mi-ki) H calculates P (x)i,mi) And P (x)i,mi-ki) (ii) a Wherein k isi=2i(ii) a For each of the index bits, using the xiThe P (x)i,mi) And said P (x)i,mi-ki) Generate ring signature S of the index biti(ii) a All the index bits, the P (x)i,mi) The P (x)i,mi-ki) And said SiStitching is performed to obtain the first proof of transaction.
11. The apparatus of claim 9,
the first authentication information comprises a first communication message;
the first verification information generation module is further configured to: generating a fixed private key of a collection end, acquiring a fixed public key of a payment end, carrying out encryption calculation on the product of the fixed private key of the collection end and the fixed public key of the payment end by using the base point encryption algorithm to obtain a shared key, splicing the plaintext transaction amount with the transaction private key, and carrying out encryption calculation on the spliced result by using the shared key to generate the first communication message.
12. The apparatus of claim 11, wherein the transaction amount decryption module is further configured to: storing the base point value, and carrying out encryption calculation on the base point value by using the base point encryption algorithm to obtain the base point check value; generating a fixed private key of a payment end, acquiring a fixed public key of a collection end, carrying out encryption calculation on the product of the fixed private key of the payment end and the fixed public key of the collection end by using the base point encryption algorithm to obtain a shared key, and then splitting the result of carrying out decryption calculation on the first communication message by using the shared key to obtain the plaintext transaction amount.
13. A digital currency based transaction apparatus, comprising:
a receiving module for receiving a receiving request; the collection request comprises a ciphertext transaction amount and first verification information;
the collection request verification module is used for confirming that the cryptograph transaction amount accords with the rule according to the first verification information;
the collection request chaining module is used for storing the collection request to a block chain;
the money receiving updating module is used for updating a money list according to the money receiving request;
a payment request receiving module for receiving a payment request; the payment request comprises a ciphertext change making amount, second verification information and a transfer data structure;
the payment request verification module is used for confirming that the ciphertext change making amount accords with the rule according to the second verification information and confirming that the currency list accords with the rule according to the transfer data structure;
a payment request chaining module for storing the payment request to the blockchain;
a payment update module for updating the currency list according to the transfer data structure;
the collection request comprises transaction currency, and the transaction currency comprises the ciphertext transaction amount and the first verification information; the payment request comprises change making currency, and the change making currency comprises the ciphertext change making amount and the second verification information; the transfer data structure including a hash value of the transaction currency, the transfer data structure further including a hash value of the change currency and a hash value of the digital currency within the currency subset; the currency subset is composed of digital currencies which select a payee as a payer from the currency list and have a total amount in plaintext greater than or equal to a transaction amount in plaintext.
14. The apparatus of claim 13,
the first authentication information comprises a first transaction proof;
the collection request verification module is further configured to: splitting the first transaction certificate to obtain all index bits i, P (x)i,mi)、P(xi,mi-ki) And Si(ii) a Confirming that for each of the index bits, the SiIs the P (x)i,mi) And said P (x)i,mi-ki) And confirming that P (x) is satisfied for each of the index bitsi,mi)-P(xi,mi-ki)=kiH, and then confirming that:
Figure FDA0002467782130000071
to confirm that the cryptograph transaction amount meets the rules; wherein q is the cryptogram transaction amount, ki=2i
15. The apparatus of claim 13, further comprising a currency list creation module, wherein,
the currency list establishing module is used for establishing a currency list for storing currency, currency hash values and corresponding relations of the currency and the currency hash values; the currency list comprises an unconsumed currency list, a confirmed medium currency list and a spent currency list;
the collection updating module is also used for: storing the transaction currency and the hash value of the transaction currency to the confirmed currency list;
the payment request validation module is further to: searching and confirming that the transaction currency is stored in the confirmed currency list according to the hash value of the transaction currency, searching and confirming that the currency in the currency subset is stored in the unspent currency list according to the hash value of the digital currency in the currency subset, and confirming that the sum of the ciphertext transaction amount and the ciphertext change amount is equal to the total ciphertext amount of the digital currency in the currency subset;
the payment update module is further to: after the transaction currency is found according to the hash value of the transaction currency, the transaction currency and the hash value thereof are moved from the confirmed currency list to the non-spent currency list, then the currency in the currency subset is found according to the hash value of the digital currency in the currency subset, the currency in the currency subset and the hash value thereof are moved from the non-spent currency list to the spent currency list, and the change-making currency and the hash value thereof are stored in the non-spent currency list.
16. A computer-readable storage medium having computer instructions stored thereon, the computer instructions being executable by a computer or a computer system to cause the computer or computer system to perform the method of any one of claims 1 to 9.
CN201710494860.9A 2017-06-26 2017-06-26 Transaction method and device based on digital currency Active CN107358424B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710494860.9A CN107358424B (en) 2017-06-26 2017-06-26 Transaction method and device based on digital currency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710494860.9A CN107358424B (en) 2017-06-26 2017-06-26 Transaction method and device based on digital currency

Publications (2)

Publication Number Publication Date
CN107358424A CN107358424A (en) 2017-11-17
CN107358424B true CN107358424B (en) 2020-09-29

Family

ID=60273637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710494860.9A Active CN107358424B (en) 2017-06-26 2017-06-26 Transaction method and device based on digital currency

Country Status (1)

Country Link
CN (1) CN107358424B (en)

Families Citing this family (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009441B (en) * 2017-11-23 2023-05-30 创新先进技术有限公司 Method and apparatus for resource transfer and funds transfer
CN108418689B (en) * 2017-11-30 2020-07-10 矩阵元技术(深圳)有限公司 Zero-knowledge proof method and medium suitable for block chain privacy protection
US11227284B2 (en) 2017-12-13 2022-01-18 Mastercard International Incorporated Method and system for consumer-initiated transactions using encrypted tokens
CN108241979B (en) * 2017-12-20 2021-03-16 深圳壹账通智能科技有限公司 Multi-account book transfer method based on block chain, electronic device and readable storage medium
CN108335106A (en) * 2018-01-24 2018-07-27 深圳壹账通智能科技有限公司 The more account books of Zero Knowledge based on block chain exchange transfer account method, device and storage medium
CN108629584B (en) * 2018-04-25 2022-07-01 常海峰 Block chain based payment method, device and computer readable storage medium
CN108805574B (en) * 2018-05-19 2021-01-26 深圳市图灵奇点智能科技有限公司 Transaction method and system based on privacy protection
CN108830716B (en) * 2018-05-31 2021-12-17 上海万向区块链股份公司 Transaction system for protecting user privacy based on block chain and encryption processing
CN108846659B (en) * 2018-06-13 2021-09-14 深圳前海微众银行股份有限公司 Block chain-based transfer method and device and storage medium
CN108985760B (en) * 2018-06-15 2021-07-06 杭州复杂美科技有限公司 Payment method, payment system, payment device and storage medium
CN108985933A (en) * 2018-06-29 2018-12-11 联动优势科技有限公司 A kind of bookkeeping methods and device
CN108985752A (en) * 2018-06-29 2018-12-11 杭州复杂美科技有限公司 A kind of method of payment and system, equipment and storage medium
CN108854077B (en) * 2018-07-17 2021-05-18 广州瞪羚信息科技有限公司 Cross-game item circulation method based on block chain technology
CN109102286B (en) * 2018-08-02 2023-04-07 平安科技(深圳)有限公司 Cross-account book transaction method and device
CN109191122B (en) * 2018-08-10 2023-06-20 中国银行股份有限公司 Method and device for acquiring transaction information certificate
WO2020034151A1 (en) * 2018-08-16 2020-02-20 区链通网络有限公司 Block chain inter-node communication method and apparatus, and storage medium and block chain system
CN109064335A (en) * 2018-08-27 2018-12-21 深圳前海益链网络科技有限公司 A kind of data trade method and device based on intelligent contract
CN109325759B (en) * 2018-09-17 2023-09-19 简单汇信息科技(广州)有限公司 Online development method, management platform, device, system and storage medium
CN109285073B (en) * 2018-09-29 2022-03-04 数字钱包(北京)科技有限公司 Digital currency transaction method and device
CN109472602B (en) * 2018-11-23 2021-05-11 全链通有限公司 Transaction verification method, node and block chain system
CN109493057A (en) * 2018-12-10 2019-03-19 联动优势科技有限公司 A kind of method of commerce and device based on UTXO model
CN111325493A (en) * 2018-12-14 2020-06-23 阿里巴巴集团控股有限公司 Logistics management method, device and equipment based on block chain and storage medium
CN109658216A (en) * 2018-12-14 2019-04-19 深圳美图创新科技有限公司 Block chain moneytary operations method and device
CN111641504A (en) * 2019-03-01 2020-09-08 湖南天河国云科技有限公司 Block chain digital certificate application method and system based on bit currency system
CN111639997A (en) * 2019-03-01 2020-09-08 中国银联股份有限公司 Transaction management method and device based on associated transaction rules
CN111754342B (en) * 2019-03-26 2024-05-24 众安信息技术服务有限公司 Method, system and device for obtaining circulation speed of block chain encrypted currency
CN110414961A (en) * 2019-06-21 2019-11-05 深圳壹账通智能科技有限公司 Prevent transfer account method, device, equipment and the storage medium of the track transactions side of producing
CN110335042B (en) * 2019-06-26 2020-10-20 创新先进技术有限公司 Anonymous transaction method and device based on ring signature
CN110189131B (en) * 2019-06-26 2020-11-06 创新先进技术有限公司 Method and device for realizing confidential blockchain transaction by adopting ring signature
US10790990B2 (en) 2019-06-26 2020-09-29 Alibaba Group Holding Limited Ring signature-based anonymous transaction
US11238447B2 (en) 2019-06-26 2022-02-01 Advanced New Technologies Co., Ltd. Blockchain transactions with ring signatures
CN110706110A (en) * 2019-10-14 2020-01-17 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on exchange platform and storage medium
CN112712353B (en) * 2019-12-25 2024-04-12 深圳市文鼎创数据科技有限公司 Digital currency zero-payment method, system and terminal
CN111539816B (en) * 2020-02-19 2022-07-15 杭州溪塔科技有限公司 Method and device for determining transaction identification in block chain and electronic equipment
CN111222860A (en) * 2020-04-15 2020-06-02 傲林科技有限公司 Data asset processing method and device
CN111639923B (en) * 2020-05-07 2023-09-29 杭州云象网络技术有限公司 Digital currency transaction accounting method and system based on zero knowledge proof
CN111738712A (en) * 2020-07-17 2020-10-02 百度在线网络技术(北京)有限公司 Payment processing method, device, equipment and medium for block chain
CN112001714A (en) * 2020-07-28 2020-11-27 胡祥义 Digital currency implementation method based on block chain technology
CN112365252A (en) * 2020-07-31 2021-02-12 深圳市网心科技有限公司 Account model-based privacy transaction method and device and related equipment
CN112712359B (en) * 2020-12-31 2024-01-12 深圳市证通电子股份有限公司 Money collection method, money collection device, and readable storage medium
CN113052599B (en) * 2021-03-31 2024-05-28 中国人民银行数字货币研究所 Method, device, equipment and system for generating, verifying and storing transaction certificates
CN116318760A (en) * 2022-09-09 2023-06-23 广州玉明科技有限公司 Block chain and digital currency based security detection method and cloud computing device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392354A (en) * 2014-11-05 2015-03-04 中国科学院合肥物质科学研究院 Association and retrieval method and system used for public key addresses and user accounts of crypto-currency
CN106503994A (en) * 2016-11-02 2017-03-15 西安电子科技大学 Block chain private data access control method based on encryption attribute
CN106548330A (en) * 2016-10-27 2017-03-29 上海亿账通区块链科技有限公司 Transaction verification method and system based on block chain
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN106651331A (en) * 2016-12-22 2017-05-10 飞天诚信科技股份有限公司 Digital currency-based electronic transaction method and system
CN106779707A (en) * 2016-12-23 2017-05-31 中钞信用卡产业发展有限公司北京智能卡技术研究院 Monitoring and managing method, the apparatus and system of the digital cash Transaction Information based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392354A (en) * 2014-11-05 2015-03-04 中国科学院合肥物质科学研究院 Association and retrieval method and system used for public key addresses and user accounts of crypto-currency
CN106548330A (en) * 2016-10-27 2017-03-29 上海亿账通区块链科技有限公司 Transaction verification method and system based on block chain
CN106503994A (en) * 2016-11-02 2017-03-15 西安电子科技大学 Block chain private data access control method based on encryption attribute
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN106651331A (en) * 2016-12-22 2017-05-10 飞天诚信科技股份有限公司 Digital currency-based electronic transaction method and system
CN106779707A (en) * 2016-12-23 2017-05-31 中钞信用卡产业发展有限公司北京智能卡技术研究院 Monitoring and managing method, the apparatus and system of the digital cash Transaction Information based on block chain

Also Published As

Publication number Publication date
CN107358424A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN107358424B (en) Transaction method and device based on digital currency
CN107392603B (en) Transaction method and apparatus using digital money
US11349645B2 (en) Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
JP6724249B2 (en) System and method for information protection
EP3324355B1 (en) Contract agreement method, agreement verification method, contract agreement system, agreement verification device, contract agreement device, contract agreement program and agreement verification program
JP6908700B2 (en) Systems and methods for information protection
CN110582793B (en) Anonymity and traceability of digital property transactions on a distributed transaction consensus network
EP3296913B1 (en) Method and system for secure communication of a token and aggregation of the same
JP2022183325A (en) Secure multiparty loss-tolerant storage and transfer of encryption key for block chain-based system in conjunction with wallet management system
US20190295069A1 (en) Systems and methods for integrating cryptocurrency wallet identifiers with digital certificates
JP2020507222A (en) System and method for information protection
US20190108517A1 (en) Digital currency for performing cash-equivalent transactions
CN115176441A (en) Identity-based public key generation protocol
US20210035090A1 (en) System and method for secure data delivery
CN110545169B (en) Block chain method and system based on asymmetric key pool and implicit certificate
CN110599164A (en) Method for rapidly paying by any payee under supervision chain
CN112470423A (en) Computer-implemented system and method for asset blending
CN109687961B (en) Quantum computation resistant blockchain transaction method and system based on symmetric key pool routing device
Islam A privacy-preserving transparent central bank digital currency system based on consortium blockchain and unspent transaction outputs
CN109784917B (en) Anti-quantum computation blockchain secret transaction system and method based on symmetric key pool
CN113159767A (en) Transfer processing method, device and system based on block chain
US20210056624A1 (en) Secure communication framework for crypto-exchange services using asymmetric and symmetric encryption
CN112950356A (en) Personal loan processing method, system, device and medium based on digital identity
EP4181457A1 (en) Quantum based method and system for performing cryptocurrency asset transactions
CN115310976A (en) Non-contact transaction processing method, device and system

Legal Events

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