Blockchain transaction method and device, and electronic equipment
The homomorphic encryption algorithm is used to generate and verify transaction amount commitment ciphertext on the blockchain, which solves the problems of privacy protection and network dependence in blockchain transactions, realizes a non-interactive, privacy-protecting transfer scheme, and improves the security of transactions. Reliability and privacy.
Patent Information
- Application Number
- CN202011554075.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2038-08-30
AI Technical Summary
The lack of privacy protection functions in blockchain transactions results in the inability to effectively protect account balances and transaction amounts, and existing transfer solutions rely on the recipient's online status and network connection, making them susceptible to network delays or failures.
The homomorphic encryption algorithm is used to generate the ciphertext of the transaction amount commitment of the remittance party and the receiver, and the transaction is verified and updated through the blockchain node to ensure that only the participants of the transaction can see the amount, and the homomorphic encryption algorithm is used to encrypt the transaction amount in the block. Account balances and transaction amounts are hidden on the chain, enabling non-interactive transfers.
It realizes the privacy protection of account balance and transaction amount under the blockchain account model, avoids the recipient's network dependence, improves the reliability and privacy of transactions, and reduces the impact of network delays and failures.
Smart Images

Figure CN112651740B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of blockchain technology, and in particular, to a blockchain transaction method and device, and electronic equipment. Background Art
[0002] Blockchain can reach a consensus among various blockchain nodes, thereby jointly maintaining a unified blockchain ledger between various blockchain nodes to permanently record transaction information that has occurred in the blockchain network. The blockchain ledger is completely public, so that historical data of transactions that have occurred can be viewed and verified at any time, so the blockchain ledger itself has no privacy protection function. Summary of the invention
[0003] In view of this, one or more embodiments of this specification provide a blockchain transaction method, which is applied to a remitter device, and the method includes:
[0004] Determine the transaction amount to be remitted from the remitter's blockchain account to the recipient's blockchain account, wherein the remitter's blockchain account has a remitter's balance commitment ciphertext registered in the blockchain, and the recipient's blockchain account has a recipient's balance commitment ciphertext registered in the blockchain, the remitter's balance commitment ciphertext is calculated by a homomorphic encryption algorithm based on the remitter's balance and the remitter's public key, and the recipient's balance commitment ciphertext is calculated by the homomorphic encryption algorithm based on the recipient's balance and the recipient's public key;
[0005] Generate a transaction amount commitment ciphertext of the remitting party and a transaction amount commitment ciphertext of the receiving party, wherein the transaction amount commitment ciphertext of the remitting party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the remitting party, and the transaction amount commitment ciphertext of the receiving party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the receiving party;
[0006] Submit a transaction to the blockchain, wherein the transaction includes information of the remitter's blockchain account, information of the recipient's blockchain account, the remitter's transaction amount commitment ciphertext, and the recipient's transaction amount commitment ciphertext, so that the remitter's balance commitment ciphertext is deducted from the remitter's transaction amount commitment ciphertext after the transaction is completed, and the recipient's balance commitment ciphertext is increased by the recipient's transaction amount commitment ciphertext after the transaction is completed.
[0007] Accordingly, this specification also provides a blockchain transaction device, which is applied to a remitter device, and the device includes:
[0008] A determination unit determines the transaction amount to be remitted from the remitter's blockchain account to the receiver's blockchain account, wherein the remitter's blockchain account has a remitter's balance commitment ciphertext registered in the blockchain, and the receiver's blockchain account has a receiver's balance commitment ciphertext registered in the blockchain, the remitter's balance commitment ciphertext is calculated by a homomorphic encryption algorithm based on the remitter's balance and the remitter's public key, and the receiver's balance commitment ciphertext is calculated by the homomorphic encryption algorithm based on the receiver's balance and the receiver's public key;
[0009] A generating unit, generating a transaction amount commitment ciphertext of the remitting party and a transaction amount commitment ciphertext of the receiving party, wherein the transaction amount commitment ciphertext of the remitting party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the remitting party, and the transaction amount commitment ciphertext of the receiving party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the receiving party;
[0010] The submitting unit submits a transaction to the blockchain, wherein the transaction includes information of the remitter's blockchain account, information of the recipient's blockchain account, the remitter's transaction amount commitment ciphertext, and the recipient's transaction amount commitment ciphertext, so that the remitter's balance commitment ciphertext is deducted from the remitter's transaction amount commitment ciphertext after the transaction is completed, and the recipient's balance commitment ciphertext is increased by the recipient's transaction amount commitment ciphertext after the transaction is completed.
[0011] Correspondingly, this specification also provides a computer device, including: a memory and a processor; the memory stores a computer program that can be executed by the processor; when the processor runs the computer program, it executes the blockchain transaction method as described above.
[0012] The blockchain transaction method, device and computer equipment provided in this specification provide a non-interactive transfer solution, which protects the privacy of account balance and transaction amount under the account model of blockchain, and can complete the transfer without the participation of the recipient. Using the technical solution provided in this specification, the balance of the account can only be seen by the owner of the account, and the amount of the transaction can only be seen by the transferor and transferee of the transaction. In addition, the blockchain node can verify the legality of the encrypted transaction amount and update the legal transaction to the account balance of the transferor and transferee. The advantage of this non-interactive implementation scheme is that the initiation of the transaction only requires the operation of the remitting party, and does not rely on the recipient and the network transmission with the recipient, thereby avoiding interference from factors such as the recipient being offline, response delays or network failures, network delays, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a flowchart of a blockchain transaction method provided by an exemplary embodiment.
[0014] Figure 2It is a schematic diagram of implementing a remittance transaction in a blockchain network provided by an exemplary embodiment.
[0015] Figure 3 A flowchart of implementing a remittance transaction in a blockchain network is provided by an exemplary embodiment.
[0016] Figure 4 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0017] Figure 5 It is a block diagram of a blockchain transaction device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0018] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0019] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0020] Figure 1 This is a flowchart of a blockchain transaction method provided by an exemplary embodiment. Figure 1 As shown, the method is applied to the remitter device and may include the following steps:
[0021] Step 102, determining the transaction amount to be remitted from the remitter's blockchain account to the receiver's blockchain account, wherein the remitter's blockchain account has a remitter's balance commitment ciphertext registered in the blockchain, and the receiver's blockchain account has a receiver's balance commitment ciphertext registered in the blockchain, the remitter's balance commitment ciphertext is calculated by a homomorphic encryption algorithm based on the remitter's balance and the remitter's public key, and the receiver's balance commitment ciphertext is calculated by the homomorphic encryption algorithm based on the receiver's balance and the receiver's public key.
[0022] The blockchain described in the above embodiment may specifically refer to a P2P network system with a distributed data storage structure, in which each node reaches a consensus mechanism. The data in the blockchain is distributed in "blocks" connected in time, and the latter block contains the data summary of the previous block. According to the specific consensus mechanism (such as POW, POS, DPOS or PBFT, etc.), the data of all or part of the nodes are fully backed up. It is well known to those skilled in the art that since the blockchain system operates under the corresponding consensus mechanism, the data included in the blockchain database is difficult to be tampered by any node. For example, for a blockchain using Pow consensus, at least 51% of the computing power of the entire network is required to tamper with the existing data. Therefore, the blockchain system has the characteristics of ensuring data security and anti-attack tampering that other centralized database systems cannot match. It can be seen that in the embodiments provided in this specification, the data included in the distributed database of the blockchain will not be attacked or tampered, thereby providing evidence for the transactions published to the blockchain.
[0023] In one embodiment, the remitter user and the recipient user can agree on the value of the transaction amount; wherein the remitter user corresponds to the remitter device, and the recipient user corresponds to the recipient device. The remitter device and the recipient device can implement a blockchain transaction solution based on this specification, and the asset certificate corresponding to the transaction amount is remitted (or transferred) from the remitter blockchain account to the recipient blockchain account. The asset certificate can correspond to smart assets such as tokens and digital assets in the blockchain, and the asset certificate can also correspond to off-chain assets such as cash, securities, coupons, and real estate outside the blockchain, and this specification does not limit this.
[0024] The remitter balance commitment ciphertext or receiver balance commitment ciphertext described in the above embodiment is calculated using a homomorphic encryption algorithm based on the balance of the remitter or receiver and the public key of the remitter or receiver. Since each blockchain node in the blockchain needs to maintain a unified blockchain account book based on consensus, by registering the remitter balance commitment ciphertext and the receiver balance commitment ciphertext in the blockchain, the blockchain account book maintained by the blockchain node will only record the ciphertext of the remitter balance commitment and the ciphertext of the receiver balance commitment, and will not directly record the remitter balance and the receiver balance, so that the blockchain balance held by the remitter user and the blockchain balance held by the receiver user are hidden as private data, which not only stores the account balance of the remitter and the receiver in the blockchain, but also prevents the balance value from being tampered with, and maintains the privacy of the blockchain account.
[0025] The above-mentioned method of registering the remitter's balance commitment ciphertext or the recipient's balance commitment ciphertext in the blockchain is not limited. The above-mentioned remitter's balance commitment ciphertext or the recipient's balance commitment ciphertext can be published in the blockchain in the form of a transaction, or the above-mentioned remitter's balance commitment ciphertext or the recipient's balance commitment ciphertext can be registered in the account attributes of the remitter or the recipient, or other methods that can be easily thought of by technicians in this field.
[0026] In one embodiment, the homomorphic encryption algorithm can generate a random number so that the random number and the unencrypted data are calculated together as the corresponding commitment ciphertext data, so that the random number can be obtained to decrypt the commitment ciphertext data to obtain the corresponding unencrypted data, or the random number can be obtained to verify whether the commitment ciphertext data corresponds to the unencrypted data. For example, the homomorphic encryption algorithm can be based on the Pedersen commitment mechanism in the related art, and of course this specification is not limited to this.
[0027] For example, the remitter's account balance t is encrypted using homomorphic encryption technology including Pedersen Commitment (PC): the public parameters (G, H) are two generators of the elliptic curve. Based on the elliptic curve, the remitter has a pair of public and private keys (Pk, Sk), Pk = SkG; the commitment ciphertext of the remitter's balance t is (rG+tH, rPk), where rG+tH is Pedersen Commitment, and r is the random number used in the homomorphic encryption. When the remitter checks its own account balance, the part containing the random number r can be eliminated when decrypting with the private key Sk, so there is no need to record r. When decrypting (T, T') = (rG+tH, rPk), first use the key sk to get rG = T'Sk from T' = rPk = rSkG -1 , thus eliminating the part containing random numbers and obtaining tH = T-rG. In addition, in order to decrypt the ciphertext tH of the amount, there is the following setting, that is, the amount t has a valid interval, such as [0,2 32 There are many ways to decrypt the ciphertext tH of the amount, such as Pollard's Kangaroo method, or pre-calculating and saving the corresponding ciphertext set of this interval, and finally determining the value of t by looking up the table according to the value of tH. Of course, this manual does not limit this.
[0028] Similarly, the receiver's balance commitment ciphertext should also be generated using the same homomorphic encryption algorithm as the sender's balance commitment ciphertext, for example, using the same elliptic curve generators G and H, and based on the receiver's public key and account balance, so that the balance of the receiver's account can only be known by decrypting the receiver's balance commitment ciphertext with the receiver's private key, thereby protecting the privacy of user accounts on the blockchain.
[0029] Step 104, generating a transaction amount commitment ciphertext of the remitting party and a transaction amount commitment ciphertext of the receiving party, wherein the transaction amount commitment ciphertext of the remitting party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the remitting party, and the transaction amount commitment ciphertext of the receiving party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the receiving party.
[0030] The remitter transaction amount commitment ciphertext described in the above embodiment should use the same homomorphic encryption algorithm as the remitter balance commitment ciphertext, and the recipient transaction amount commitment ciphertext should use the same homomorphic encryption algorithm as the recipient balance commitment ciphertext, so that the remitter balance commitment ciphertext can directly deduct the remitter transaction amount commitment ciphertext, and the recipient balance commitment ciphertext can directly increase the recipient transaction amount commitment ciphertext.
[0031] In one embodiment, the remitter transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter transaction amount random number r_A, the transaction amount t_A and the remitter's public key Pk_A, and the remitter transaction amount commitment ciphertext is (T_A, T'_A) = (r_AG + t_AH, r_APk_A); similarly, the receiver transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm according to the receiver transaction amount random number r_B, the transaction amount t_B and the receiver's public key Pk_B, and the receiver transaction amount commitment ciphertext is (T_B, T'_B) = (r_BG + t_BH, r_BPk_B); wherein, t_A = t_B. It is also worth noting that in order for the recipient to generate a corresponding interval proof for the new transaction based on the updated account balance after receiving the transaction amount, the recipient needs to know the specific value of r_B; in order to prevent other nodes on the blockchain from knowing the value of r_B to decrypt the transaction amount, the remitter needs to send r_B in this transaction to the recipient through an off-chain channel. This action does not affect the ongoing transaction. After the transaction, the remitter can send it via email or other methods agreed with the recipient in advance. This manual does not limit this.
[0032] Because the remitter's transaction commitment and the receiver's transaction commitment issued by the remitter are both ciphertext, other nodes cannot know the value of the amount t_A remitted by the remitter, let alone whether t_A issued by the remitter is the same as t_B received by the receiver; the receiver decrypts the receiver's transaction commitment issued by the remitter with its own private key. Although it can know the value of t_B, it still cannot know whether the received t_B is the same as t_A issued by the remitter. Therefore, in another embodiment of the present specification, the remitter also publishes the difference r between the random number r_A and the random number r_B on the blockchain, so that the blockchain nodes in the blockchain can verify whether the values of rG and T_A-T_B are equal. If they are equal, it proves that t_A=t_B.
[0033] The above includes a special case, that is, using the same r = r_A = r_B and the same t = t_A = t_B to calculate the remitting party transaction amount commitment ciphertext (T_A, T'_A) = (rG + tH, rPk_A) and the receiving party transaction amount commitment ciphertext (T_B, T'_B) = (rG + tH, rPk_B). In this special case, the transaction amount does not need to be distinguished as the remitting party transaction amount and the receiving party transaction amount, and the commitment ciphertext can be aggregated into one (rG + tH, rPk_A, rPk_B). For this special case, some of the following technical details can be simplified. Since the simplification method is obvious, the present invention does not further explain this special case in detail on each simplifiable detail.
[0034] In one embodiment, when the remitter's transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm based on the transaction amount and the public key of the remitter, and the recipient's transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm based on the transaction amount and the recipient's public key, since other nodes in the blockchain cannot know from the recipient's transaction amount commitment ciphertext whether the recipient's transaction amount commitment ciphertext is generated based on the recipient's public key (whether it is the same as the public key used in the recipient's balance commitment ciphertext), it is even more impossible to know whether the recipient's transaction amount commitment ciphertext is Whether it can be decrypted by the private key of the above-mentioned recipient to obtain the transaction amount; complete the verification of the recipient's transaction amount commitment ciphertext issued by the remitter by other nodes to prevent transaction fraud by the remitter. The remitter should also publish a recipient public key certificate to the blockchain for the blockchain nodes in the blockchain to verify that the recipient's transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm based on the same public key as the recipient's balance commitment ciphertext, wherein the recipient public key certificate is generated by the homomorphic encryption algorithm based on the recipient's transaction amount commitment ciphertext.
[0035] In one embodiment, the remitter generates a public key certificate Pf in the following manner to prove that the recipient's transaction amount commitment ciphertext (T_B, T'_B) = (r_BG + t_BH, r_BPk_B) is encrypted using B's public key Pk_B:
[0036] Generate a pair of random numbers (r', t'), and use the same homomorphic encryption algorithm as used to generate the recipient's transaction amount commitment ciphertext to calculate the random number commitment ciphertext (T, T') = (r'G + t'H, r'Pk_B), where Pk_B is the public key used in the recipient's balance commitment ciphertext;
[0037] Calculate Hash u=Hash(T_B, T'_B, T, T') and v=ur_B+r', w=ut_B+t', where Hash represents a hash operation, v is a first verification element corresponding to the first verification random number r', and w is a second verification element corresponding to the second verification random number t';
[0038] Generate Pf = (T, T'; v, w).
[0039] When other nodes in the blockchain verify whether the recipient's transaction amount commitment ciphertext sent by the remitter is the same as the public key used in the recipient's balance commitment ciphertext, they obtain the above Pf=(T,T';v,w) to verify whether (vG+wH,v Pk_B)=(uT_B+T,uT'_B+T') is correct;
[0040] If correct, it means that the recipient transaction amount commitment ciphertext and the recipient balance commitment ciphertext are calculated by the homomorphic encryption algorithm based on the same public key, and the recipient transaction amount commitment ciphertext can be decrypted by the private key corresponding to the public key to obtain the transaction amount;
[0041] If it is incorrect, the transaction should be rejected. At this time, the remitter encrypts the transaction amount with a public key other than the receiver to generate the receiver's transaction amount commitment ciphertext, or even uses a random number to impersonate the receiver's transaction amount commitment ciphertext. After the receiver's transaction amount commitment ciphertext is updated to the receiver's balance commitment ciphertext, the receiver will not be able to decrypt its balance commitment ciphertext, nor can it remit assets from its account, which means that the receiver's account is destroyed.
[0042] The implementation scheme of the recipient's public key certification adopted by the present invention prevents the above-mentioned account from being destroyed, and does not require the participation of the payee, which is a non-interactive method.
[0043] In another embodiment, as described in the above embodiment, the remitter balance commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter random number, the remitter balance, and the remitter's public key. As described in the above embodiment, the remitter balance commitment ciphertext (S_A, S'_A) = (r'_AG + s_AH, r'_APk_A), where s_A is the remitter balance, and the remitter transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter transaction amount random number, the transaction amount, and the remitter's public key, that is, the remitter transaction amount commitment ciphertext is (T_A, T'_A) = (r _AG+t_AH,r_APk_A), where t_A is the transaction amount; the remitter device can generate an interval proof based on the remitter random number r'_A, the remitter balance s_A, the remitter balance commitment ciphertext (S_A, S'_A), the remitter transaction amount random number r_A, the transaction amount t_A and the transaction commitment ciphertext (T_A, T'_A), and add the interval proof to the transaction, so that the blockchain node in the blockchain can verify whether the transaction amount satisfies: the transaction amount t_A is not less than 0 and the transaction amount t_A is not greater than the remitter balance s_A. For example, the range proof technology in the relevant technology can be adopted, such as the Bulletproofs scheme or the Borromean ring signature scheme, etc., and this specification does not limit this.
[0044] In one embodiment, the remitter device can generate an electronic signature related to the remitter transaction amount commitment ciphertext and the recipient transaction amount commitment ciphertext through the remitter private key, and add the electronic signature to the transaction published by the remitter to the blockchain, so that the blockchain nodes in the blockchain can verify the electronic signature. In another embodiment, the remitter signature can also be related to the difference between the remitter transaction amount random number and the recipient transaction amount random number, or the recipient public key certificate, or the interval certificate. When the transaction does not contain the remitter signature, the blockchain node can determine that the consensus has failed, thereby refusing to execute the transaction.
[0045] Step 106, submitting a transaction to the blockchain, wherein the transaction includes the information of the remitter's blockchain account, the information of the recipient's blockchain account, the remitter's transaction amount commitment ciphertext and the recipient's transaction amount commitment ciphertext, so that the remitter's balance commitment ciphertext deducts the remitter's transaction amount commitment ciphertext after the transaction is completed, and the recipient's balance commitment ciphertext increases the recipient's transaction amount commitment ciphertext after the transaction is completed, that is:
[0046] (S_A,S'_A)-(T_A,T'_A)=(S_A-T_A,S'_A-T'_A),
[0047] (S_B,S'_B)+(T_B,T'_B)=(S_B+T_B,S'_B+T'_B).
[0048] In the above embodiment, by using the remitter transaction amount commitment ciphertext and the receiver transaction amount commitment ciphertext in the transaction, only the transaction commitment ciphertext will be recorded in the blockchain account book, and the corresponding transaction amount cannot be known, so as to hide and keep the transaction amount value confidential. At the same time, by using the same homomorphic encryption algorithm to generate the remitter balance commitment ciphertext corresponding to the remitter balance, the receiver balance commitment ciphertext corresponding to the receiver balance, the remitter transaction amount commitment ciphertext corresponding to the transaction amount, and the receiver transaction amount commitment ciphertext, so that when other nodes of the blockchain do not need to know the remitter balance, the receiver balance and the transaction amount, the deduction operation can be directly realized between the remitter balance commitment ciphertext and the remitter transaction amount commitment ciphertext, and the increase operation can be directly realized between the receiver balance commitment ciphertext and the receiver transaction commitment ciphertext, so as to ensure that the transaction is successfully completed without revealing private data.
[0049] In one embodiment, after receiving the above transaction, the blockchain node can check whether the transaction has been executed through the anti-double-spending or anti-replay mechanism in the relevant technology; if it has been executed, the transaction is refused to be executed.
[0050] For ease of understanding, the technical solution of this specification is described in detail below using a remittance transaction in a blockchain network as an example. Figure 2 FIG. 1 is a schematic diagram of an exemplary embodiment of implementing a remittance transaction in a blockchain network. Figure 2 As shown, it is assumed that user A transfers money to user B via blockchain; wherein, the "user" in this specification can be represented as a logged-in user account, and the user account can actually belong to an individual or an organization, and this specification does not limit this.
[0051] Assume that the sending device used by user A is user device 1, for example, the user account corresponding to user A is logged in on user device 1; similarly, the receiving device used by user B is user device 2. User device 1 can run a blockchain client program, so that user device 1 has a corresponding blockchain node in the blockchain network, such as Figure 2 Node 1 shown. Similarly, a blockchain client program can be run on user device 2, so that the user device 2 has a corresponding blockchain node in the blockchain network, such as Figure 2 Node 2 shown. There are other blockchain nodes in the blockchain network, such as Figure 2The nodes i, etc. shown are not listed here one by one. Through the above nodes 1, 2, etc., the remittance transaction between user A and user B can be implemented through the blockchain network, and the relevant transaction information can be recorded in the blockchain ledger maintained by each blockchain node, which can avoid tampering and facilitate subsequent inspection.
[0052] against Figure 2 The remittance transaction scenario shown, Figure 3 is a flowchart of implementing a remittance transaction in a blockchain network provided by an exemplary embodiment; Figure 3 As shown, the interaction process between the remitter and the blockchain node may include the following steps:
[0053] Step 301, determine the transaction amount t_A to be transferred from the sender's blockchain account to the recipient's blockchain account.
[0054] In one embodiment, the remitter refers to the role that remits money or other resources in a remittance transaction, and the recipient refers to the role that receives money or other resources in a remittance transaction. Figure 2 In the illustrated embodiment, user device 1 may be configured as a remitter, and user device 2 may be configured as a receiver.
[0055] The remitter's blockchain account has the remitter's balance commitment ciphertext registered in the blockchain:
[0056] (S_A,S'_A)=(r'_AG+s_AH,r'_APk_A);
[0057] The recipient's blockchain account has the recipient's balance commitment ciphertext registered in the blockchain:
[0058] (S_B,S'_B)=(r'_BG+s_BH,r'_BPk_B);
[0059] The remitter balance commitment ciphertext (S_A, S'_A) is calculated by the homomorphic encryption algorithm based on the remitter balance s_A and the remitter's public key Pk_A, and the receiver balance commitment ciphertext (S_B, S'_B) is calculated by the homomorphic encryption algorithm based on the receiver balance s_B and the receiver's public key Pk_B; the remitter balance random number r'_A and the receiver balance random number r'_B are the random numbers used by the above-mentioned homomorphic encryption algorithm, and G and H are two tuples of the elliptic curve algorithm.
[0060] Step 302, generate the remitter's transaction amount commitment ciphertext (T_A, T'_A) = (r_AG + t_AH, r_APk_A) and the receiver's transaction amount commitment ciphertext (T_B, T'_B) = (r_BG + t_BH, r_BPk_B);
[0061] Among them, the remitter's transaction amount commitment ciphertext (T_A, T'_A) is calculated by the homomorphic encryption algorithm according to the transaction amount t_A and the public key Pk_A of the remitter, and the receiver's transaction amount commitment ciphertext (T_B, T'_B) is calculated by the homomorphic encryption algorithm according to the transaction amount t_B and the public key Pk_B of the receiver, and t_B=t_A; the remitter's transaction amount random number r_A and the receiver's transaction amount random number r_B are the random numbers used by the above homomorphic encryption algorithm, and the two-tuple G and H of the original elliptic curve algorithm are still used in the generation process of the above ciphertext.
[0062] Furthermore, in order to enable other nodes in the blockchain to verify that t_B=t_A, r=r_A-r_B should be generated in the next step 303.
[0063] In another embodiment, in order to ensure that the remittance transaction is successfully completed, the blockchain node needs to determine the remittance amount t_A, the account balance s A The value of satisfies the following conditions: t_A≥0, s A -t≥0; and the interval proof technology can enable the blockchain node to verify whether the transaction meets the preset conditions in the encrypted state. For example, this specification can use the Bulletproofs scheme and Borromean ring signature scheme in the relevant technology to implement it, and this specification does not limit this. The remitter can use the interval proof technology to generate (r A ,s A ,S A ,r,t,T) related interval proof PR, so that the blockchain node can verify whether t_A≥0, s A -t≥0. For example Figure 3 Shown:
[0064] Step 304: Generate an interval proof RP1 to prove t_A≥0.
[0065] Step 305: Generate an interval proof RP2 to prove that s_A-t_A≥0.
[0066] In order to enable the nodes in the blockchain to verify that the above-mentioned recipient transaction amount commitment ciphertext (T_B, T'_B) is encrypted in the same way as the recipient balance commitment ciphertext (s_B, s'_B) and can be decrypted by the recipient's private key, so as to correctly obtain the transaction amount and update it to the account balance, the remitter should also generate a recipient public key certificate, such as Figure 3 As shown:
[0067] Step 306, generate proof Pf to prove that (T_B, T'_B) is encrypted using B's public key Pk_B.
[0068] In one embodiment, the process of generating proof Pf may include:
[0069] Generate a pair of random numbers (r',t');
[0070] The same homomorphic encryption algorithm as used to generate the above-mentioned recipient's transaction amount commitment ciphertext is used to calculate the random number commitment ciphertext (T, T') = (r'G + t'H, r'Pk_B), where Pk_B is the public key used in the recipient's balance commitment ciphertext;
[0071] Calculate Hash u = Hash (T_B, T'_B, T, T'), v = ur_B + r', w = ut_B + t', where Hash represents a hash operation, v is a first verification element corresponding to the first verification random number r', and w is a second verification element corresponding to the second verification random number t';
[0072] Generate Pf = (T, T'; v, w).
[0073] In step 307, the remitter uses the private key pair (A, T_A, T'_A; B, T_B, T'_B) corresponding to Pk_A to electronically sign SignA, where A and B are the account or account address and other identification information of the remitter and the recipient, respectively, to assist other nodes of the blockchain in verifying the remitter and the recipient of this transaction transfer; it is worth noting here that this embodiment does not limit the content object signed by the electronic signature of the remitter, which can include A, T_A, T'_A, B, T_B, T'_B, and can further include one or more of r, RP1, RP2, and Pf.
[0074] In step 308, the remitter submits the above-generated ciphertexts (T_A, T'_A; T_B, T'_B) and identification information such as the remitter's and recipient's accounts or account addresses to the blockchain network in the format of a transaction, waiting for the blockchain nodes to perform consensus verification on the transaction, so as to eventually include it in the distributed ledger of the blockchain; preferably, in order to assist the blockchain nodes in performing consensus verification on this transaction, the above-generated proof parameters (r, RP1, RP2, Pf) and electronic signature Sign A may also be added to the content of the transaction.
[0075] In one embodiment, the remitter can submit the corresponding above-mentioned transaction to the blockchain through node 1 to execute the remittance. The transaction will be transmitted to all blockchain nodes in the blockchain network, and each blockchain node will verify the content and format of the transaction respectively, so as to execute the remittance operation when the verification passes, and refuse the remittance when the verification fails.
[0076] The blockchain node here can represent any blockchain node in the blockchain network, that is, each blockchain node in the blockchain network will receive the above transaction, such as (A, T_A, T'_A; B, T_B, T'_B; r, RP1, RP2, Pf; SignA), and implement verification and other operations through steps 309 to 312.
[0077] Step 309, the blockchain node checks whether the transaction has been executed.
[0078] In one embodiment, after receiving the remittance transaction (A, T_A, T'_A; B, T_B, T'_B; r, RP1, RP2, Pf; Sign A), the blockchain node can use the anti-double-spending or anti-replay mechanism in the blockchain-related technology to verify whether the remittance transaction has been executed; if it has been executed, the remittance transaction can be refused to be executed, otherwise it proceeds to step 310.
[0079] Step 310, the blockchain node checks the signature Sign A.
[0080] In one embodiment, the blockchain node may check whether the signature Sign A included in the remittance transaction is correct; if it is incorrect, the remittance transaction may be refused to be executed, otherwise the process proceeds to step 311.
[0081] Step 311, the blockchain node verifies whether t_A is equal to t_B.
[0082] In one embodiment, by verifying whether rG=T_A-T_B is correct, it is possible to verify whether t_A is equal to t_B; if not, the remittance transaction may be rejected, otherwise the process proceeds to step 312.
[0083] Step 312, the blockchain node verifies that t_A ≥ 0;
[0084] In one embodiment, the blockchain node may check the interval proof PR1 included in the remittance transaction based on the interval proof technology to determine whether t_A≥0 is satisfied; if not, the remittance transaction may be refused to be executed, otherwise proceed to step 313.
[0085] Step 313, the blockchain node verifies that s_A-t_A≥0;
[0086] In one embodiment, the blockchain node may check the interval proof PR2 included in the remittance transaction based on the interval proof technology to determine whether s_A-t_A≥0 is satisfied; if not, the remittance transaction may be refused to be executed, otherwise proceed to step 314.
[0087] In step 314, the blockchain node verifies whether the amount ciphertext (T_B, T'_B) and the recipient's balance commitment ciphertext (s_B, s'_B) are calculated by the homomorphic encryption algorithm based on the same public key Pk_B.
[0088] In one embodiment, the blockchain node may verify whether (vG+wH,v Pk_B)=(uT_B+T,uT'_B+T') is correct for each parameter in Pf included in the remittance transaction; if it is incorrect, the remittance transaction may be refused to be executed, otherwise the process proceeds to step 315.
[0089] In step 315, the blockchain node updates the account balances of the blockchain accounts corresponding to user A and user B in the maintained blockchain ledger.
[0090] In one embodiment, after passing the verification of steps 309 to 314, the blockchain node can deduct the remitter's transaction amount commitment ciphertext (T_A, T'_A) from the balance commitment ciphertext (S_A, S'_A) corresponding to the remitter's account balance s_A recorded in the blockchain ledger, and the balance commitment ciphertext (S_B, S'_B) corresponding to the recipient's account balance s_B, and add the recipient's transaction amount commitment ciphertext (T_B, T'_B), so that the balance commitment of blockchain account 1 corresponding to user A is updated to s_A-t_A, and the balance commitment of blockchain account 2 corresponding to user B is updated to s_B+t_B, where t_A=t_B.
[0091] Based on the properties of the homomorphic encryption algorithm, when the balance commitment ciphertext (S_A, S'_A) is updated to [(S_A, S'_A)-(T_A, T'_A)], due to
[0092] (S_A,S'_A)-(T_A,T'_A)=(S_A-T_A,S'_A-T'_A),
[0093] And (S_A-T_A,S'_A-T'_A)=(r'_A-r_A)G+(s_A-t_A)H,(r'_A-r_A)Pk_A),
[0094] Therefore, other nodes in the blockchain, without knowing the specific value of the remitter's account balance s_A or the transaction amount t_A remitted by the remitter, update the remitter's account balance to (s_A-t_A) after consensus verification by the blockchain nodes.
[0095] Similarly, based on the properties of the homomorphic encryption algorithm, when the balance commitment ciphertext (S_B, S'_B) is updated to [(S_B, S'_B) + (T_B, T'_B)], due to
[0096] (S_B,S'_B)+(T_B,T'_B)=(S_B+T_B,S'_B+T'_B),
[0097] And (S_B+T_B,S'_B+T'_B)=(r'_B+r_B)G+(s_B+t_B)H,(r'_B+r_B)Pk_B),
[0098] Therefore, other nodes in the blockchain, without knowing the specific value of the recipient's account balance s_B or the transaction amount t_B remitted by the remitter, update the recipient's account balance to (s_B+t_B) after consensus verification by the blockchain nodes.
[0099] Optionally, to ensure that the recipient can perform a transfer transaction based on its account balance after accepting this transaction, the above embodiment may include step 316: the remitter may send the above recipient transaction amount random number r_B to the recipient through an off-chain channel.
[0100] In summary, by adopting the homomorphic encryption mechanism, the account balance of the blockchain account can be encrypted, and the encrypted balance commitment ciphertext can be recorded in the blockchain account book. The remittance amount can also be encrypted during the remittance transaction, and the encrypted remittance commitment ciphertext can be used to implement the remittance transaction. The remittance transaction can be successfully completed through the blockchain network while keeping the account balance and the remittance amount confidential, and it does not affect the verification operation of the blockchain node on the transaction conditions, so that the blockchain network has a privacy protection function. In addition, in the above-mentioned embodiments provided by this specification, only the remitter generates the remittance and verification parameters and submits the transaction. After the consensus verification of the transaction content is completed by other nodes of the blockchain, the above-mentioned remittance operation can be completed. The whole process does not require the participation of the receiving party's node equipment, and does not rely on the receiving party and the network transmission with the receiving party, thereby avoiding interference from factors such as the receiving party being offline, response delays or network failures, and network delays.
[0101] It is worth noting that this specification does not limit the order in which the various certificates or electronic signatures (such as r, RP1, RP2, Pf, Sign A, etc.) are generated, nor does it limit the order in which the nodes in the blockchain verify the various contents and certificates or electronic signatures in the transaction proposed by the remitter. Figure 3 This is merely one embodiment of the transaction generation and verification method provided in this specification, and this specification is not limited thereto.
[0102] Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4, at the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it, forming a blockchain transaction device at the logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0103] Please refer to Figure 5 In a software implementation, the blockchain transaction device is applied to the remitter device 50 and may include:
[0104] The determining unit 502 determines the transaction amount to be remitted from the remitter's blockchain account to the receiver's blockchain account, wherein the remitter's blockchain account has a remitter's balance commitment ciphertext registered in the blockchain, and the receiver's blockchain account has a receiver's balance commitment ciphertext registered in the blockchain, and the remitter's balance commitment ciphertext is calculated by a homomorphic encryption algorithm based on the remitter's balance and the remitter's public key, and the receiver's balance commitment ciphertext is calculated by the homomorphic encryption algorithm based on the receiver's balance and the receiver's public key;
[0105] A generating unit 504 generates a transaction amount commitment ciphertext of the remitting party and a transaction amount commitment ciphertext of the receiving party, wherein the transaction amount commitment ciphertext of the remitting party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the remitting party, and the transaction amount commitment ciphertext of the receiving party is calculated by the homomorphic encryption algorithm according to the transaction amount and the public key of the receiving party;
[0106] The submitting unit 506 submits a transaction to the blockchain, wherein the transaction includes information of the remitter's blockchain account, information of the recipient's blockchain account, the remitter's transaction amount commitment ciphertext, and the recipient's transaction amount commitment ciphertext, so that the remitter's balance commitment ciphertext is deducted from the remitter's transaction amount commitment ciphertext after the transaction is completed, and the recipient's balance commitment ciphertext is increased by the recipient's transaction amount commitment ciphertext after the transaction is completed.
[0107] More preferably, the remitter transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter transaction amount random number, the transaction amount and the remitter's public key, and the receiver transaction amount commitment ciphertext is calculated by the homomorphic encryption algorithm according to the receiver transaction amount random number, the transaction amount and the receiver's public key;
[0108] The generating unit 504:
[0109] Generate the difference between the random number of the remitter's transaction amount and the random number of the recipient's transaction amount;
[0110] The difference between the remitter's transaction amount random number and the recipient's transaction amount random number is added to the transaction, so that the blockchain nodes in the blockchain can verify that the transaction amount encrypted by the remitter's transaction amount commitment ciphertext is equal to the transaction amount encrypted by the recipient's transaction amount commitment ciphertext.
[0111] More preferably, the generating unit 504:
[0112] Generate a recipient public key certificate, where the recipient public key certificate is generated by the homomorphic encryption algorithm based on the recipient transaction amount commitment ciphertext;
[0113] The recipient public key certificate is added to the transaction so that the blockchain nodes in the blockchain can verify that the recipient transaction amount commitment ciphertext and the recipient balance commitment ciphertext are calculated by the homomorphic encryption algorithm based on the same public key.
[0114] More preferably, the generating unit 504:
[0115] Generate a first verification random number and a second verification random number;
[0116] The homomorphic encryption algorithm generates a random number commitment ciphertext based on the first verification random number, the second verification random number and the public key of the recipient;
[0117] Performing a hash operation on the recipient's transaction amount commitment ciphertext to obtain a hash summary;
[0118] Generate a first verification element corresponding to the first verification random number and a second verification element corresponding to the second verification random number according to the hash summary calculation;
[0119] The above-mentioned recipient public key certificate includes the random number commitment ciphertext, the first verification element and the second verification element.
[0120] More preferably, the remitter balance commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter balance, the remitter public key and the remitter random number;
[0121] The generating unit 504:
[0122] Generate an interval certificate based on the remitter random number, the remitter transaction amount random number, the remitter balance, the remitter balance commitment ciphertext, the transaction amount, and the remitter transaction amount commitment ciphertext;
[0123] The interval proof is added to the transaction so that the blockchain nodes in the blockchain can verify whether the transaction amount satisfies: the transaction amount is not less than 0 and the transaction amount is not greater than the balance of the remitter.
[0124] More preferably, the generating unit 504:
[0125] Generate the remitter's electronic signature related to the remitter's transaction amount commitment ciphertext and the recipient's transaction amount commitment ciphertext through the remitter's private key;
[0126] The electronic signature is added to the transaction for electronic signature verification by blockchain nodes in the blockchain.
[0127] More preferably, the above device also includes:
[0128] The off-chain sending unit sends the recipient's transaction amount random number to the recipient through an off-chain channel.
[0129] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically detailed in the implementation process of the corresponding steps in the above-mentioned method. For relevant parts, please refer to the partial description of the method embodiment, which will not be repeated here.
[0130] 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, which may be in the form of 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 transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0131] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer device, which includes a memory and a processor. Among them, the memory stores a computer program that can be run by the processor; when the processor runs the stored computer program, it executes each step of the blockchain transaction method in the embodiment of this specification. For a detailed description of each step of the blockchain transaction method, please refer to the previous content and will not be repeated.
[0132] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
[0133] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0134] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0135] Computer readable media include permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer readable instructions, data structures, program modules or other data.
[0136] Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0137] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0138] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
Claims
1. A blockchain transaction method, applied to a remitter device, comprising: Determine the transaction amount to be remitted from the remitter's blockchain account to the recipient's blockchain account; wherein the remitter's blockchain account has a remitter's balance commitment ciphertext registered in the blockchain, and the remitter's balance commitment ciphertext is calculated by a homomorphic encryption algorithm based on the remitter's balance and the remitter's public key; the recipient's blockchain account has a recipient's balance commitment ciphertext registered in the blockchain, and the recipient's balance commitment ciphertext is calculated by the homomorphic encryption algorithm based on the recipient's balance and the recipient's public key; The homomorphic encryption algorithm is used to calculate based on the remitter's transaction amount random number, the transaction amount and the public key of the remitter to generate the remitter's transaction amount commitment ciphertext, and the homomorphic encryption algorithm is used to calculate based on the receiver's transaction amount random number, the transaction amount and the public key of the receiver to generate the receiver's transaction amount commitment ciphertext; and the difference between the remitter's transaction amount random number and the receiver's transaction amount random number is generated; Submit a transaction to the blockchain, wherein the transaction includes information of the remitter's blockchain account, information of the recipient's blockchain account, the remitter's transaction amount commitment ciphertext, the recipient's transaction amount commitment ciphertext, and the difference between the remitter's transaction amount random number and the recipient's transaction amount random number, so that the blockchain nodes in the blockchain verify that the transaction amount encrypted by the remitter's transaction amount commitment ciphertext is equal to the transaction amount encrypted by the recipient's transaction amount commitment ciphertext, and that the remitter's balance commitment ciphertext deducts the remitter's transaction amount commitment ciphertext after the transaction is completed, and the recipient's balance commitment ciphertext increases the recipient's transaction amount commitment ciphertext after the transaction is completed.
2. The method according to claim 1, further comprising: Generate a recipient public key certificate, where the recipient public key certificate is generated by the homomorphic encryption algorithm based on the recipient transaction amount commitment ciphertext; Adding the recipient's public key certificate to the transaction, so that the blockchain nodes in the blockchain can verify that the recipient's transaction amount commitment ciphertext and the recipient's balance commitment ciphertext are calculated by the homomorphic encryption algorithm based on the same public key; Generating the recipient's public key certificate includes: Generate a first verification random number and a second verification random number; The homomorphic encryption algorithm generates a random number commitment ciphertext based on the first verification random number, the second verification random number and the public key of the recipient; Performing a hash operation on the recipient's transaction amount commitment ciphertext and the random number commitment ciphertext to obtain a hash summary; Generate a first verification element corresponding to the first verification random number and a second verification element corresponding to the second verification random number according to the hash summary calculation; The above-mentioned recipient public key certificate includes the random number commitment ciphertext, the first verification element and the second verification element.
3. According to the method of claim 2, the remitter balance commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter balance, the remitter public key and the remitter random number; The method further comprises: Generate an interval certificate based on the remitter random number, the remitter transaction amount random number, the remitter balance, the remitter balance commitment ciphertext, the transaction amount, and the remitter transaction amount commitment ciphertext; The interval proof is added to the transaction so that the blockchain nodes in the blockchain can verify whether the transaction amount satisfies: the transaction amount is not less than 0 and the transaction amount is not greater than the balance of the remitter.
4. The method according to any one of claims 1 to 3, further comprising: Generate the remitter's electronic signature related to the remitter's transaction amount commitment ciphertext and the recipient's transaction amount commitment ciphertext through the remitter's private key; The electronic signature is added to the transaction for electronic signature verification by blockchain nodes in the blockchain.
5. The method according to claim 1, further comprising: The recipient's transaction amount random number is sent to the recipient through an off-chain channel.
6. A blockchain transaction device, applied to a remitter device, comprising: A determination unit determines the transaction amount to be remitted from the remitter's blockchain account to the receiver's blockchain account; wherein the remitter's blockchain account has a remitter's balance commitment ciphertext registered in the blockchain, and the remitter's balance commitment ciphertext is calculated by a homomorphic encryption algorithm based on the remitter's balance and the remitter's public key; the receiver's blockchain account has a receiver's balance commitment ciphertext registered in the blockchain, and the receiver's balance commitment ciphertext is calculated by the homomorphic encryption algorithm based on the receiver's balance and the receiver's public key; A generating unit, wherein the homomorphic encryption algorithm is used to calculate the remitter's transaction amount random number, the transaction amount and the public key of the remitter to generate the remitter's transaction amount commitment ciphertext, and the homomorphic encryption algorithm is used to calculate the receiver's transaction amount random number, the transaction amount and the public key of the receiver to generate the receiver's transaction amount commitment ciphertext; and, the difference between the remitter's transaction amount random number and the receiver's transaction amount random number is generated; A submission unit submits a transaction to a blockchain, wherein the transaction includes information of the remitter's blockchain account, information of the recipient's blockchain account, the remitter's transaction amount commitment ciphertext, the recipient's transaction amount commitment ciphertext, and the difference between the remitter's transaction amount random number and the recipient's transaction amount random number, so that the blockchain nodes in the blockchain verify that the transaction amount encrypted by the remitter's transaction amount commitment ciphertext is equal to the transaction amount encrypted by the recipient's transaction amount commitment ciphertext, and that the remitter's balance commitment ciphertext deducts the remitter's transaction amount commitment ciphertext after the transaction is completed, and the recipient's balance commitment ciphertext increases the recipient's transaction amount commitment ciphertext after the transaction is completed.
7. The device according to claim 6, wherein the generating unit: Generate a recipient public key certificate, where the recipient public key certificate is generated by the homomorphic encryption algorithm based on the recipient transaction amount commitment ciphertext; Adding the recipient's public key certificate to the transaction, so that the blockchain nodes in the blockchain can verify that the recipient's transaction amount commitment ciphertext and the recipient's balance commitment ciphertext are calculated by the homomorphic encryption algorithm based on the same public key; Generating the recipient's public key certificate includes: Generate a first verification random number and a second verification random number; The homomorphic encryption algorithm generates a random number commitment ciphertext based on the first verification random number, the second verification random number and the public key of the recipient; Performing a hash operation on the recipient's transaction amount commitment ciphertext and the random number commitment ciphertext to obtain a hash summary; Generate a first verification element corresponding to the first verification random number and a second verification element corresponding to the second verification random number according to the hash summary calculation; The above-mentioned recipient public key certificate includes the random number commitment ciphertext, the first verification element and the second verification element.
8. The device according to claim 7, wherein the remitter balance commitment ciphertext is calculated by the homomorphic encryption algorithm according to the remitter balance, the remitter public key and the remitter random number; The generating unit: Generate an interval certificate based on the remitter random number, the remitter transaction amount random number, the remitter balance, the remitter balance commitment ciphertext, the transaction amount, and the remitter transaction amount commitment ciphertext; The interval proof is added to the transaction so that the blockchain nodes in the blockchain can verify whether the transaction amount satisfies: the transaction amount is not less than 0 and the transaction amount is not greater than the balance of the remitter.
9. The device according to any one of claims 6 to 8, wherein the generating unit: Generate the remitter's electronic signature related to the remitter's transaction amount commitment ciphertext and the recipient's transaction amount commitment ciphertext through the remitter's private key; The electronic signature is added to the transaction for electronic signature verification by blockchain nodes in the blockchain.
10. The apparatus according to claim 7, further comprising: The off-chain sending unit sends the recipient's transaction amount random number to the recipient through an off-chain channel.
11. A computer device comprising: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, the processor performs the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and system for performing a transaction and for performing a verification of legitimate access to, or use of digital data
AU2004248501A1
Block chain privacy protection method based on addition homomorphic encryption
CN106549749A
Multi-center block chain transaction privacy protection system and method
CN108021821A
Supply chain management method based on financial blockchain technology
CN108288157A
Blockchain transaction methods, devices, and electronic equipment
CN109359974B
