Transaction method, device and node equipment based on blockchain

By using committed random numbers and homomorphic encryption algorithms in blockchain transactions, calculating and submitting transaction amount commitments and random number ciphertext, the problem of transaction information leakage is solved, and privacy protection and interaction-free transaction processes are achieved.

CN111833057BActive Publication Date: 2024-10-29ANTCHAIN TECHNOLOGY PTE LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010578979.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-30
Publication Date
2024-10-29
Estimated Expiration
2038-09-30

AI Technical Summary

Technical Problem

In blockchain transaction scenarios, transaction information is easily leaked to unrelated third parties and lacks a privacy protection mechanism.

Method used

Through committed random numbers and homomorphic encryption algorithms, the transaction amount commitment and random number ciphertext are calculated, and transaction data is submitted to the blockchain to achieve privacy protection and avoid interaction with the importer's device.

Benefits of technology

It realizes the completion of transactions on the blockchain without the participation of the remittance device, ensuring the privacy protection of transaction information, avoiding the direct registration of transaction amounts and random numbers, and reducing the burden of off-chain storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111833057B_ABST
    Figure CN111833057B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a transaction method, apparatus and remitter device based on blockchain. The method includes: calculating a transaction amount commitment, a first ciphertext of a commitment random number and a second ciphertext of a commitment random number; submitting transaction data to the blockchain; the transaction data includes the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number; so as to record the transaction amount commitment and the first ciphertext of the commitment random number in the remitter's account, and record the transaction amount commitment and the second ciphertext of the commitment random number in the remitter's account.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application number 201811160480.2, application date September 30, 2018, and invention name “Blockchain-based transaction method, device and remitter equipment”. Technical Field

[0002] The embodiments of this specification relate to the field of computer technology, and in particular to a transaction method, apparatus, and remitter device based on blockchain. Background Art

[0003] Blockchain technology is a distributed database technology that uses cryptography and consensus mechanisms to ensure that data cannot be tampered with or forged. With the development of computer and Internet technologies, blockchain technology has gained popularity for its advantages of decentralization, openness, transparency, non-tamperability, and trustworthiness. It has been widely used in many fields, including smart contracts, securities trading, e-commerce, the Internet of Things, social communications, file storage, proof of existence, identity verification, and equity crowdfunding.

[0004] Currently, when blockchain technology is applied to transaction scenarios, since transaction information needs to be sent to the blockchain for verification, implementation and uploading, there is a risk that the transaction information will be leaked to third parties not related to the transaction.

[0005] The business urgently needs a technical solution that can achieve privacy protection during the transaction process. Summary of the invention

[0006] The purpose of the embodiments of this specification is to provide a blockchain-based transaction method, apparatus, and remitter device to achieve privacy protection without interacting with the remitter device.

[0007] To achieve the above purpose, the embodiment of this specification provides a transaction method based on blockchain, including:

[0008] Calculate the transaction amount commitment based on the committed random number and transaction amount;

[0009] Encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a first ciphertext of the commitment random number;

[0010] According to the homomorphic encryption public key of the remitter's account and the transaction amount, the commitment random number is encrypted using a homomorphic encryption algorithm to obtain a second ciphertext of the commitment random number;

[0011] Submitting transaction data to the blockchain; the transaction data includes the transaction amount commitment, the first ciphertext of the commitment random number, and the second ciphertext of the commitment random number; so that the transaction amount commitment and the first ciphertext of the commitment random number are recorded in the remitter's account, and the transaction amount commitment and the second ciphertext of the commitment random number are recorded in the remitter's account.

[0012] To achieve the above objectives, the present specification provides a blockchain-based transaction device, including:

[0013] A calculation unit, used to calculate the transaction amount commitment according to the commitment random number and the transaction amount;

[0014] A first encryption unit is used to encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a first ciphertext of the commitment random number;

[0015] A second encryption unit is used to encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a second ciphertext of the commitment random number;

[0016] A submission unit is used to submit transaction data to the blockchain; the transaction data includes the transaction amount commitment, the first ciphertext of the commitment random number, and the second ciphertext of the commitment random number; so that the transaction amount commitment and the first ciphertext of the commitment random number are recorded in the remitter's account, and the transaction amount commitment and the second ciphertext of the commitment random number are recorded in the remitter's account.

[0017] To achieve the above purpose, the present invention provides a remitter device, including:

[0018] Memory, for storing computer instructions;

[0019] A processor is used to execute computer instructions to implement the method described in any embodiment of this specification.

[0020] It can be seen from the technical solutions provided in the above embodiments of this specification that in the embodiments of this specification, through the commitment mechanism and the homomorphic encryption mechanism, the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number can be obtained; the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number can be submitted to the chain; so as to facilitate recording the transaction amount commitment and the first ciphertext of the commitment random number into the account of the remitter, and recording the transaction amount commitment and the second ciphertext of the commitment random number into the account of the remitter. In this way, on the one hand, through the commitment mechanism and the homomorphic encryption mechanism, the privacy protection of transaction information such as the transaction amount can be achieved; on the other hand, by submitting the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number to the chain, the transaction can be successfully completed on the blockchain without the participation of the remitter's device. Therefore, this embodiment can achieve privacy protection under non-interactive conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0022] Figure 1 This is a schematic diagram of implementing a transaction based on blockchain according to an embodiment of this specification;

[0023] Figure 2 This is a flowchart of a transaction method based on blockchain according to an embodiment of this specification;

[0024] Figure 3 This is a flowchart of implementing a transaction based on blockchain according to an embodiment of this specification;

[0025] Figure 4 This is a functional structure diagram of a blockchain-based transaction device according to an embodiment of this specification;

[0026] Figure 5 This is a functional structure diagram of a remitter device according to an embodiment of this specification. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0028] See also Figure 1 and Figure 2 The embodiments of this specification provide a transaction method based on blockchain.

[0029] In this embodiment, the blockchain can be a distributed ledger that organizes multiple block data in a chain structure in chronological order and uses cryptographic algorithms to ensure security, traceability, and non-tamperability. The blockchain can include a public blockchain, a joint blockchain (also called a consortium blockchain), and a private blockchain. The blockchain can be implemented based on a blockchain network. The blockchain network can include a P2P network (peer-to-peer network), etc. The blockchain network can include multiple blockchain nodes. Each blockchain node jointly maintains a unified blockchain account book.

[0030] In this embodiment, the transaction method can be performed by the remitter device as the execution subject. The remitter device can join the blockchain network as a blockchain node. A remitter account can be logged in the remitter device. The remitter account can be the remitter's account in the blockchain. The remitter account can have a signature public-private key pair and an encryption public-private key pair. The signature public-private key pair can include an associated signature public key and a signature private key. The signature private key can be used to sign the transaction data to be submitted to the blockchain. The signature public key can be disclosed to other blockchain nodes in the blockchain network for other blockchain nodes to verify the signed transaction data. The encryption public-private key pair can include an associated homomorphic encryption public key and a homomorphic encryption private key. The homomorphic encryption public key can be disclosed to other blockchain nodes in the blockchain network for itself and other blockchain nodes to use a homomorphic encryption algorithm to encrypt data (such as the remitter balance, the remitter random number, and the commitment random number, etc.). The homomorphic encryption private key can be used to decrypt the encrypted ciphertext. The remitter account may also register the remitter balance commitment and the remitter random number ciphertext in the blockchain.

[0031] The remitter balance commitment can be calculated by the remitter device based on the remitter random number and the remitter balance. The remitter random number can be a random number corresponding to the remitter account for constructing the remitter balance commitment. The remitter balance can be the balance of any type of resource. The resources may include, for example, securities, coupons, real estate, virtual currency, and funds. Specifically, the remitter balance commitment can be implemented based on any type of homomorphic commitment mechanism (Commitment Scheme), such as the Pedersen commitment mechanism. Taking the Pedersen commitment mechanism as an example, the remitter balance commitment can be based on the formula PC(r_A,s_A)=g r_Ah s_A Calculated. Among them, PC (r_A, s_A) is the remitter balance commitment; r_A is the remitter random number; s_A is the remitter balance; g and h are known parameters respectively. Of course, the remitter balance commitment can also be implemented by a homomorphic encryption algorithm. That is, the ciphertext obtained by encrypting the remitter balance based on the homomorphic encryption algorithm is used as the remitter balance commitment. The homomorphic encryption algorithm will be introduced in detail in the subsequent process. In this way, on the one hand, by registering the remitter balance commitment in the blockchain, the direct registration of the remitter balance can be avoided, so that the remitter balance can be hidden and kept confidential. On the other hand, given that the commitment mechanism can support efficient zero-knowledge proof (Zero-Knowledge Proof), the remitter balance commitment can make the zero-knowledge proof process involving the remitter balance in the subsequent process (such as the third zero-knowledge proof in the subsequent process) more efficient.

[0032] The remitter random number ciphertext can be obtained by encrypting the remitter random number based on the remitter balance using a homomorphic encryption algorithm. Specifically, the remitter device can encrypt the remitter random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter account and the remitter balance to obtain the remitter random number ciphertext. The homomorphic encryption algorithm may include, for example, the Okamoto-Uchiyama algorithm, the Boneh-Goh-Nissim algorithm, and the like. Taking the Okamoto-Uchiyama algorithm as an example, the remitter random number ciphertext can be obtained based on the formula OU_A(r_A)=u1 r_A v1 s_A Calculated. Among them, OU_A (r_A) is the remitter's random number ciphertext; r_A is the remitter's random number; u1 and v1 are respectively part of the homomorphic encryption public key of the remitter's account; s_A is the remitter's balance. In this embodiment, the remitter's random number can be used as the encrypted plaintext, and the remitter's balance can be used as the random number for homomorphic encryption operations, thereby realizing the encryption of the remitter's random number. In this way, on the one hand, by registering the remitter's random number in the blockchain, the burden of keeping the remitter's random number locally off-chain can be avoided. On the other hand, by registering the remitter's random number ciphertext in the blockchain, it is possible to avoid directly registering the remitter's random number, so that the remitter's random number can be hidden and kept confidential.

[0033] It should be noted that when it is necessary to obtain the remitter's balance, the remitter's device can use the homomorphic encryption private key of the remitter's account to decrypt the remitter's random number ciphertext to obtain the remitter's random number; the remitter's balance can be calculated based on the remitter's random number and the remitter's balance commitment. The remitter's device can, for example, use the Kangaroo method in the Pollard algorithm to calculate the remitter's balance. Of course, the Kangaroo method here is only an example. In fact, the remitter's device can also use other methods to calculate the remitter's balance. For example, the remitter's random number ciphertext can be OU_A(r_A)=u1 r_A v1 s_A , the remitter's balance commitment can be PC(r_A,s_A)=g r_A h s _A Then, the remitter device can use the homomorphic encryption private key of the remitter account to decrypt the remitter random number ciphertext OU_A(r_A) to obtain the remitter random number r_A; h can be calculated based on the remitter random number r_A and the remitter balance commitment PC(r_A,s_A) s_A ; Kangaroo method in Pollard algorithm can be used, according to h s_A The remitter balance s_A is calculated. In addition, when the remitter balance commitment is implemented by a homomorphic encryption algorithm, the remitter device can also use the homomorphic encryption private key of the remitter account to decrypt the remitter balance commitment to obtain the remitter balance. Specifically, for example, the remitter balance commitment implemented by the Okamoto-Uchiyama algorithm can be PC(r_A,s_A)=u1 s_ A v1 r_A .

[0034] In this embodiment, the transaction method can realize the transfer of the transaction amount from the remitter account to the remitter account. The remitter account can be the remitter account in the blockchain. The remitter account can be logged in the remitter device. The remitter device can join the blockchain network as a blockchain node. The transaction amount can be negotiated and agreed upon by the remitter and the remitter. Similar to the remitter account, the remitter account can have a signature public-private key pair and an encryption public-private key pair; the remitter account can also register the remitter balance commitment and the remitter random number ciphertext in the blockchain. The remitter balance commitment can be calculated by the remitter device based on the remitter random number and the remitter balance. The remitter random number ciphertext can be obtained by encrypting the remitter random number based on the remitter balance by a homomorphic encryption algorithm.

[0035] The transaction method may include the following steps. It should be noted that although this specification provides method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative labor. In addition, the order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the device or product is actually executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment).

[0036] Step S10: Calculate the transaction amount commitment based on the commitment random number and the verification amount.

[0037] In this embodiment, the commitment random number can be generated by the remitter device. The transaction amount can be agreed upon by the remitter and the receiver. The transaction amount commitment can be implemented based on any type of homomorphic commitment scheme, such as the Pedersen commitment scheme. Taking the Pedersen commitment scheme as an example, the transaction amount commitment can be based on the formula PC(r, t) = g r h t Calculated. Among them, PC(r,t) is the transaction amount commitment; r is the committed random number; t is the transaction amount; g and h are known parameters. In this way, the transaction amount can be hidden and kept confidential through the transaction amount commitment.

[0038] Step S12: Encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a first ciphertext of the commitment random number.

[0039] In this embodiment, the homomorphic encryption algorithm may include, for example, the Okamoto-Uchiyama algorithm and the Boneh-Goh-Nissim algorithm. Taking the Okamoto-Uchiyama algorithm as an example, the first ciphertext of the committed random number may be based on the formula OU_A(r)=u1 r v1 t Calculated. Wherein, OU_A(r) is the first ciphertext of the commitment random number; r is the commitment random number; u1 and v1 are respectively part of the homomorphic encryption public key of the remitter's account; t is the transaction amount. In this embodiment, the commitment random number can be used as the encrypted plaintext, and the transaction amount can be used as the random number for homomorphic encryption operation, so as to realize the encryption of the commitment random number.

[0040] Step S14: Encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a second ciphertext of the commitment random number.

[0041] In this embodiment, the homomorphic encryption algorithm may include, for example, the Okamoto-Uchiyama algorithm and the Boneh-Goh-Nissim algorithm. Taking the Okamoto-Uchiyama algorithm as an example, the second ciphertext of the commitment random number may be based on the formula OU_B(r)=u2 r v2 t Calculated. Wherein, OU_B(r) is the second ciphertext of the commitment random number; r is the commitment random number; u2 and v2 are respectively part of the homomorphic encryption public key of the remitter's account; t is the transaction amount. In this embodiment, the commitment random number can be used as the encrypted plaintext, and the transaction amount can be used as the random number for homomorphic encryption operation, so as to realize the encryption of the commitment random number.

[0042] Step S16: Submit transaction data to the blockchain.

[0043] In this embodiment, the transaction data may include the transaction amount commitment, the first ciphertext of the commitment random number, and the second ciphertext of the commitment random number. The remitter device may submit the transaction data to the blockchain, so as to record the transaction amount commitment and the first ciphertext of the commitment random number into the remitter account, and record the transaction amount commitment and the second ciphertext of the commitment random number into the remitter account.

[0044] Specifically, after submitting the transaction data to the blockchain, the consensus blockchain node in the blockchain can update the remitter's balance commitment based on the transaction amount commitment; can update the remitter's random number ciphertext based on the commitment random number first ciphertext; can update the remitter's balance commitment based on the transaction amount commitment; can update the remitter's random number ciphertext based on the commitment random number second ciphertext. Among them, the consensus blockchain node can be a blockchain node determined based on the consensus mechanism of the blockchain. In this way, the transaction data can be recorded in the blockchain ledger maintained by each blockchain node in the blockchain network to avoid tampering.

[0045] The updated remitter balance commitment may be the quotient of the remitter balance commitment and the transaction amount commitment. Given that the remitter balance commitment and the transaction amount commitment are implemented by a commitment mechanism based on homomorphism, it is possible to deduct the transaction amount from the remitter balance and deduct the commitment random number from the remitter random number. For example, the remitter balance commitment may be PC(r_A,s_A)=g r_A h s_A ; The transaction amount commitment can be PC(r,t)=g r h t; The updated balance commitment of the remitting party can be PC(r_A-r,s_A-t)=PC(r_A,s_A) / PC(r,t)=g (r _A-r) h (s_A-t) .

[0046] The updated remitter random number ciphertext may be the quotient of the remitter random number ciphertext and the commitment random number first ciphertext. Given that the remitter random number ciphertext and the commitment random number first ciphertext are calculated by a homomorphic encryption algorithm, it is possible to deduct the transaction amount from the remitter balance and deduct the commitment random number from the remitter random number. For example, the remitter random number ciphertext may be OU_A(r_A)=u1 r_A v1 s_A ; The first ciphertext of the committed random number can be OU_A(r)=u1 r v1 t ; The updated random number ciphertext of the remitter can be OU_A(r_A-r)=OU_A(r_A) / OU_A(r)=u1 r_A-r v1 s_A-t .

[0047] The updated remitter balance commitment may be the product of the remitter balance commitment and the transaction amount commitment. Given that the remitter balance commitment and the transaction amount commitment are implemented by a commitment mechanism based on homomorphism, it is possible to add the transaction amount to the remitter balance and add the commitment random number to the remitter random number. For example, the remitter balance commitment may be PC(r_B,s_B)=g r_B h s_B ; The transaction amount commitment can be PC(r,t)=g r h t ; The updated balance commitment of the remitting party can be PC(r_B+r,s_B+t)=PC(r_B,s_B)PC(r,t)=g (r _B+r) h (s_B+t) Among them, r_B is the random number of the remitting party; s_B is the balance of the remitting party; g and h are known parameters.

[0048] The updated random number ciphertext of the remitter can be the product of the random number ciphertext of the remitter and the second ciphertext of the commitment random number. Since the random number ciphertext of the remitter and the first ciphertext of the commitment random number are calculated by the homomorphic encryption algorithm, it is possible to increase the transaction amount in the balance of the remitter and increase the commitment random number in the random number of the remitter. For example, the random number ciphertext of the remitter can be OU_B(r_B)=u2 r_B v2 s_B; The second ciphertext of the committed random number may be OU_B(r)=u2 r v2 t ; The updated random number ciphertext of the importer can be OU_B(r_B+r)=OU_B(r_B)OU_B(r)=u2 r_B+r v2 s_B+t .

[0049] In one implementation of this embodiment, the remitter device may also generate a first zero-knowledge proof based on zero-knowledge proof technology; the first zero-knowledge proof may be added to the transaction data; for the consensus blockchain node to verify that the transaction amount is not less than 0. The zero-knowledge proof technology may be implemented, for example, based on the zkSNARK scheme. Further, the zero-knowledge proof technology may include range proof technology (Range Proof). In this way, the remitter device may generate a first range proof based on the range proof technology; the first range proof may be added to the transaction data; for the consensus blockchain node to verify that the transaction amount is not less than 0. The range proof technology may be implemented, for example, based on the Bulletproofs scheme or the Borromean ring signature scheme.

[0050] In one implementation of this embodiment, the remitter device may also generate a second zero-knowledge proof based on zero-knowledge proof technology; the second zero-knowledge proof may be added to the transaction data; for the consensus blockchain node to verify that the transaction amount is not greater than the remitter's balance. Further, the zero-knowledge proof technology may include interval proof technology. In this way, the remitter device may generate a second interval proof based on the interval proof technology; the second interval proof may be added to the transaction data; for the consensus blockchain node to verify that the transaction amount is not greater than the remitter's balance.

[0051] In one implementation of this embodiment, the remitter device may also generate a third zero-knowledge proof based on zero-knowledge proof technology; the third zero-knowledge proof may be added to the transaction data; for the consensus blockchain node to verify that: the commitment random number used to calculate the transaction amount commitment, the commitment random number used to calculate the first ciphertext of the commitment random number, and the commitment random number used to calculate the second ciphertext of the commitment random number are consistent, and the transaction amount used to calculate the transaction amount commitment, the transaction amount used to calculate the first ciphertext of the commitment random number, and the transaction amount used to calculate the second ciphertext of the commitment random number are consistent.

[0052] For example, the third zero-knowledge proof may be (C, D, E, a, b). x=Hash(C,D,E); a=r * +xr;b=t *+xt. Among them, r * ,t * The random number generated for the remitter's device corresponds to the committed random number r and the transaction amount t respectively; Hash represents a hash operation.

[0053] The consensus blockchain nodes can verify g a h b = = CT x 、u1 a v1 b ==DM x 、u2 a v2 b ==EN x When the two conditions are established at the same time, it is considered that: the commitment random number used to calculate the transaction amount commitment, the commitment random number used to calculate the first ciphertext of the commitment random number, and the commitment random number used to calculate the second ciphertext of the commitment random number are consistent, and the transaction amount used to calculate the transaction amount commitment, the transaction amount used to calculate the first ciphertext of the commitment random number, and the transaction amount used to calculate the second ciphertext of the commitment random number are consistent. Where T is the transaction amount commitment PC(r,t); M is the first ciphertext of the commitment random number OU_A(r); and N is the second ciphertext of the commitment random number OU_B(r).

[0054] In one implementation of this embodiment, the remitter device may calculate the first transaction amount commitment based on the first commitment random number and the first transaction amount; and calculate the second transaction amount commitment based on the second commitment random number and the second transaction amount. The first commitment random number and the second commitment random number may be generated by the remitter device. The first transaction amount may be the transaction amount to be transferred from the remitter account; the second transaction amount may be the transaction amount to be transferred to the remitter account. In this way, the transaction amount to be transferred from the remitter account and the transaction amount to be transferred to the remitter account may be distinguished.

[0055] The remitter device may encrypt the first commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter account and the first transaction amount to obtain a first ciphertext of the commitment random number; may encrypt the second commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter account and the second transaction amount to obtain a second ciphertext of the commitment random number; and may submit transaction data to the blockchain. The transaction data may include the first transaction amount commitment, the second transaction amount commitment, the first ciphertext of the commitment random number, and the second ciphertext of the commitment random number; so as to facilitate recording the first transaction amount commitment and the first ciphertext of the commitment random number into the remitter account, and recording the second transaction amount commitment and the second ciphertext of the commitment random number into the remitter account.

[0056] Specifically, after submitting the transaction data to the blockchain, the consensus blockchain node can update the remitter's balance commitment based on the first transaction amount commitment; can update the remitter's random number ciphertext based on the commitment random number first ciphertext; can update the remitter's balance commitment based on the second transaction amount commitment; can update the remitter's random number ciphertext based on the commitment random number second ciphertext.

[0057] The updated remitter balance commitment may be the quotient of the remitter balance commitment and the first transaction amount commitment; the updated remitter random number ciphertext may be the quotient of the remitter random number ciphertext and the commitment random number first ciphertext; the updated remitter balance commitment may be the product of the remitter balance commitment and the second transaction amount commitment; the updated remitter random number ciphertext may be the product of the remitter random number ciphertext and the commitment random number second ciphertext.

[0058] Furthermore, the remitter device can also generate a fourth zero-knowledge proof based on zero-knowledge proof technology; the fourth zero-knowledge proof can be added to the transaction data; for the consensus blockchain node to verify: the first transaction amount used to calculate the first transaction amount commitment is consistent with the second transaction amount used to calculate the second transaction amount commitment; thereby avoiding inconsistency between the transaction amount transferred from the remitter's account and the transaction amount transferred to the remitter's account.

[0059] In one implementation of this embodiment, the remitter device may also use the signature private key of the remitter account to sign the transaction data to obtain signature data; the signature data may be added to the transaction data; for the consensus blockchain node to perform signature verification.

[0060] In this embodiment, through the commitment mechanism and homomorphic encryption mechanism, the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number can be obtained; the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number can be submitted to the chain; so that the transaction amount commitment and the first ciphertext of the commitment random number can be recorded in the remitter's account, and the transaction amount commitment and the second ciphertext of the commitment random number can be recorded in the remitter's account. In this way, on the one hand, through the commitment mechanism and homomorphic encryption mechanism, the privacy protection of transaction information such as the transaction amount can be achieved; on the other hand, by submitting the transaction amount commitment, the first ciphertext of the commitment random number and the second ciphertext of the commitment random number to the chain, the transaction can be successfully completed on the blockchain without the participation of the remitter's device. Therefore, this embodiment can achieve privacy protection under non-interactive conditions.

[0061] Furthermore, the remitter account can register the remitter balance commitment and the remitter random number ciphertext in the blockchain; the remitter account can register the remitter balance commitment and the remitter random number ciphertext in the blockchain. In this way, on the one hand, the account balance and transaction amount can be protected from privacy; on the other hand, by registering the remitter random number ciphertext and the remitter random number ciphertext on the chain, the burden of keeping the remitter random number and the remitter random number locally off the chain can be avoided, eliminating the risk of loss.

[0062] See also Figure 1 , Figure 2 and Figure 3 For ease of understanding, a scenario example of an embodiment of this specification is introduced below.

[0063] In this embodiment, it is assumed that the remitter account may be Account_A. The remitter account Account_A may have a signature public-private key pair and an encryption public-private key pair. The remitter account Account_A may also register the remitter balance commitment PC(r_A,s_A)=g in the blockchain. r_A h s_A 、The sender's random number ciphertext OU_A(r_A)=u1 r_A v1 s_A Among them, r_A is the random number of the remitter; s_A is the balance of the remitter; g and h are known parameters; u1 and v1 are parts of the homomorphic encryption public key of the remitter's account.

[0064] Assume that the remitter account can be Account_B. The remitter account Account_B can have a signature public-private key pair and an encryption public-private key pair. The remitter account Account_B can also register the remitter balance commitment PC(r_B,s_B)=g in the blockchain. r_B h s_B 、The importer's random number ciphertext OU_B(r_B)=u2 r_B v2 s_B Among them, r_B is the random number of the remitter; s_B is the balance of the remitter; g and h are known parameters; u2 and v2 are parts of the homomorphic encryption public key of the remitter's account.

[0065] In this embodiment, the transaction in this scenario example can realize the transfer of transaction amount t from the remitting party account Account_A to the receiving party account Account_B. Specifically, the remitting party device can generate a commitment random number r; based on the commitment random number r and the transaction amount t, the transaction amount commitment PC(r,t)=g r h t; The commitment random number r can be encrypted using the homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount t to obtain the first ciphertext of the commitment random number OU_A(r)=u1 r v1 t ; The commitment random number r can be encrypted using the homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount t to obtain the second ciphertext of the commitment random number OU_B(r)=u2 r v2 t .

[0066] In this embodiment, the remitter device can generate a first zero-knowledge proof RP1, a second zero-knowledge proof RP2, and a third zero-knowledge proof RP3. The first zero-knowledge proof RP1 can be used to verify: t≥0. The second zero-knowledge proof RP2 can be used to verify: s_A-t≥0. The third zero-knowledge proof RP3 can be used to verify: PC(r,t)=g r h t The commitment random number r in OU_A(r)=u1 r v1 t The commitment random number r in OU_B(r)=u2 r v2 t The commitment random number r in is consistent, and PC(r,t)=g r h t The transaction amount in t, OU_A(r)=u1 r v1 t The transaction amount in t, OU_B(r)=u2 r v2 t The transaction amount t in is consistent.

[0067] In this embodiment, the remitter device can use the signature private key of the remitter account to sign [PC(r,t), OU_A(r), OU_B(r), RP1, RP2, RP3] to obtain signature data SIG; and can submit transaction data [PC(r,t), OU_A(r), OU_B(r), RP1, RP2, RP3, SIG] to the blockchain.

[0068] In this embodiment, the blockchain can determine the consensus blockchain node according to the consensus mechanism. The consensus blockchain node can use the anti-double-spending or anti-replay mechanism in the relevant technology to verify whether the transaction has been executed. If it has been executed, the consensus blockchain node can reject the transaction.

[0069] If it has not been executed, the consensus blockchain node can verify whether the signature data SIG in the transaction data is correct. If it is incorrect, the consensus blockchain node can reject the transaction.

[0070] If correct, the consensus blockchain node may check the first zero-knowledge proof RP1 in the transaction data to verify whether t≥0 is satisfied. If not, the consensus blockchain node may reject the transaction.

[0071] If satisfied, the consensus blockchain node may check the second zero-knowledge proof RP2 in the transaction data to verify whether s_A-t≥0 is satisfied. If not satisfied, the consensus blockchain node may reject the transaction.

[0072] If so, the consensus blockchain node may check the third zero-knowledge proof RP3 in the transaction data to verify whether: PC(r, t) = g r h t The commitment random number r in OU_A(r)=u1 r v1 t The commitment random number r in OU_B(r)=u2 r v2 t The commitment random number r in is consistent, and PC(r,t)=g r h t The transaction amount in t, OU_A(r)=u1 r v1 t The transaction amount in t, OU_B(r)=u2 r v2 t If not, the consensus blockchain node may reject the transaction.

[0073] If satisfied, the consensus blockchain node can update the remitter balance commitment PC(r_A,s_A), the remitter random number ciphertext OU_A(r_A), the remitter balance commitment PC(r_B,s_B), and the remitter random number ciphertext OU_B(r_B). Specifically, the updated remitter balance commitment can be PC(r_A-r,s_A-t)=PC(r_A,s_A) / PC(r,t)=g (r_A-r) h (s _A-t) ; The updated random number ciphertext of the remitter can be OU_A(r_A-r)=OU_A(r_A) / OU_A(r)=u1 r_A-r v1 s _A-t ; The updated balance commitment of the remitting party can be PC(r_B+r,s_B+t)=PC(r_B,s_B)PC(r,t)=g (r_B+r) h (s _B+t) ; The updated random number ciphertext of the importer can be OU_B(r_B+r)=OU_B(r_B)OU_B(r)=u2r_B+r v2 s_B+t .

[0074] See also Figure 4 The embodiment of this specification also provides a transaction device based on blockchain. The transaction device may include the following units.

[0075] A calculation unit 20, used to calculate the transaction amount commitment according to the commitment random number and the transaction amount;

[0076] A first encryption unit 22 is used to encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a first ciphertext of the commitment random number;

[0077] The second encryption unit 24 is used to encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a second ciphertext of the commitment random number;

[0078] The submission unit 26 is used to submit transaction data to the blockchain; the transaction data includes the transaction amount commitment, the first ciphertext of the commitment random number, and the second ciphertext of the commitment random number; so that the transaction amount commitment and the first ciphertext of the commitment random number are recorded in the remitter's account, and the transaction amount commitment and the second ciphertext of the commitment random number are recorded in the remitter's account.

[0079] See also Figure 5 The embodiment of the present specification also provides a remitter device. The remitter device may include a memory and a processor.

[0080] In this embodiment, the memory may be implemented in any appropriate manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid-state hard disk, or a USB flash drive, etc. The memory may be used to store computer instructions.

[0081] In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The processor may execute the computer instructions to implement the following steps:

[0082] Calculate the transaction amount commitment based on the committed random number and transaction amount;

[0083] Encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a first ciphertext of the commitment random number;

[0084] Encrypt the commitment random number using a homomorphic encryption algorithm according to the homomorphic encryption public key of the remitter's account and the transaction amount to obtain a second ciphertext of the commitment random number;

[0085] Submitting transaction data to the blockchain; the transaction data includes the transaction amount commitment, the first ciphertext of the commitment random number, and the second ciphertext of the commitment random number; so that the transaction amount commitment and the first ciphertext of the commitment random number are recorded in the remitter's account, and the transaction amount commitment and the second ciphertext of the commitment random number are recorded in the remitter's account.

[0086] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment and the equipment embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0087] After reading this specification, those skilled in the art can conceive of any combination of some or all of the embodiments listed in this specification without creative work, and these combinations are also within the scope of disclosure and protection of this specification.

[0088] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip2. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog2. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0089] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0090] It can be known from the above description of the implementation mode that the technicians in this field can clearly understand that the present specification can be implemented by means of software plus the necessary general hardware platform. Based on such an understanding, the technical solution of the present specification can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.

[0091] This specification can be used in many general or special computer system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments that include any of the above systems or devices.

[0092] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0093] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.

Claims

1. A transaction method based on blockchain, applied to a node device, comprising: Receive transaction data, the transaction data including a transaction amount commitment, a first ciphertext of a commitment random number, and a second ciphertext of a commitment random number; wherein the transaction amount commitment is calculated based on the commitment random number and the transaction amount, the first ciphertext of the commitment random number is obtained by encrypting the commitment random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter's account and the transaction amount, and the second ciphertext of the commitment random number is obtained by encrypting the commitment random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter's account and the transaction amount; Recording the transaction amount commitment and the first ciphertext of the commitment random number into the remitter's account; The transaction amount commitment and the second ciphertext of the commitment random number are recorded in the account of the remitter.

2. According to the method of claim 1, the remitter account has a remitter balance commitment and a remitter random number ciphertext registered in the blockchain; the remitter balance commitment is calculated based on the remitter random number and the remitter balance, and the remitter random number ciphertext is obtained by encrypting the remitter random number based on the remitter balance using a homomorphic encryption algorithm; The remitter account has a remitter balance commitment and a remitter random number ciphertext registered in the blockchain; the remitter balance commitment is calculated based on the remitter random number and the remitter balance, and the remitter random number ciphertext is obtained by encrypting the remitter random number based on the remitter balance using a homomorphic encryption algorithm.

3. The method according to claim 2, wherein the step of recording the transaction amount commitment and the first ciphertext of the commitment random number into the remitter's account comprises: Updating the remitter's balance commitment based on the transaction amount commitment; Updating the remitter random number ciphertext based on the committed random number first ciphertext; The step of recording the transaction amount commitment and the second ciphertext of the commitment random number into the remitter's account includes: Updating the remitter's balance commitment based on the transaction amount commitment; The importer random number ciphertext is updated based on the committed random number second ciphertext.

4. The method of claim 1, wherein the transaction data further comprises a first zero-knowledge proof; the method further comprising: Verification based on the first zero-knowledge proof: the transaction amount is not less than 0.

5. The method of claim 1, wherein the transaction data further comprises a second zero-knowledge proof; the method further comprising: Verification based on the second zero-knowledge proof: the transaction amount is not greater than the balance of the remitter.

6. The method of claim 1, wherein the transaction data further comprises a third zero-knowledge proof; the method further comprises: Based on the third zero-knowledge proof verification: the commitment random number used to calculate the transaction amount commitment, the commitment random number used to calculate the first ciphertext of the commitment random number, and the commitment random number used to calculate the second ciphertext of the commitment random number are consistent, and the transaction amount used to calculate the transaction amount commitment, the transaction amount used to calculate the first ciphertext of the commitment random number, and the transaction amount used to calculate the second ciphertext of the commitment random number are consistent.

7. The method according to claim 1, wherein the transaction data further includes signature data, and the signature data is obtained by signing the transaction data based on a signature private key of the remitter's account; the method further includes: The signature data is verified based on the signature public key of the remitter's account.

8. The method according to claim 1, wherein the commitment random number includes a first commitment random number and a second commitment random number, and the transaction amount includes a first transaction amount and a second transaction amount; Accordingly, the transaction amount commitment includes a first transaction amount commitment and a second transaction amount commitment; the first transaction amount commitment is calculated based on the first commitment random number and the first transaction amount, and the second transaction amount commitment is calculated based on the second commitment random number and the second transaction amount; The first ciphertext of the commitment random number is obtained by encrypting the first commitment random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter's account and the first transaction amount, and the second ciphertext of the commitment random number is obtained by encrypting the second commitment random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter's account and the second transaction amount.

9. The method according to claim 8, wherein the step of crediting the transaction amount commitment to the remitter's account comprises: Depositing the first transaction amount commitment into the remitting party's account; The commitment to credit the transaction amount to the account of the remitting party includes: The second transaction amount commitment is credited to the remitter's account.

10. The method according to claim 9, wherein the step of crediting the first transaction amount commitment to the remitter's account comprises: Updating the remitter's balance commitment based on the first transaction amount commitment; The step of crediting the second transaction amount commitment into the remitter's account includes: The remitter's balance commitment is updated based on the second transaction amount commitment.

11. The method of claim 8, wherein the transaction data further comprises a fourth zero-knowledge proof; the method further comprises: Verification based on the fourth zero-knowledge proof: the first transaction amount used to calculate the first transaction amount commitment is consistent with the second transaction amount used to calculate the second transaction amount commitment.

12. A transaction device based on blockchain, applied to a node device, comprising: A receiving unit, used to receive transaction data, wherein the transaction data includes a transaction amount commitment, a first ciphertext of a commitment random number, and a second ciphertext of a commitment random number; wherein the transaction amount commitment is calculated based on the commitment random number and the transaction amount, the first ciphertext of the commitment random number is obtained by encrypting the commitment random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter's account and the transaction amount, and the second ciphertext of the commitment random number is obtained by encrypting the commitment random number using a homomorphic encryption algorithm based on the homomorphic encryption public key of the remitter's account and the transaction amount; A first crediting unit, used to credit the transaction amount commitment and the first ciphertext of the commitment random number into the remitter's account; The second crediting unit is used to credit the transaction amount commitment and the second ciphertext of the commitment random number into the account of the remitter.

13. A node device in a blockchain network, comprising: Memory, for storing computer instructions; A processor, configured to execute computer instructions to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method of blockchain information encryption based on complete homomorphic encryption method

    CN107666388A

  • Zero knowledge proving method suitable for protecting privacy of block chain, and medium

    CN108418689A