A privacy protection method for fully homomorphic blockchain based on Shamir threshold secret sharing
Through Shamir threshold secret sharing technology, the balance information in the blockchain transaction is divided into secret shares and stored in the logical chain to verify the legality of the transaction, solving the problem of blockchain privacy protection method being difficult to balance availability and confidentiality, and realizing Efficient private transactions and blockchain usability.
Patent Information
- Application Number
- CN202210238846.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-03-11
AI Technical Summary
Existing blockchain transaction privacy protection methods are difficult to balance the usability of the blockchain and the confidentiality of private information, especially when the ciphertext is encrypted by different keys, making it difficult to simultaneously satisfy the verifiability and computability of the ciphertext. .
Adopting a fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing, the participants in the transaction are used as nodes to build a physical chain and a logical chain. By dividing the balance secret share and storing it in the physical chain, the transaction amount secret share is used for verification. Transaction legality, ensuring the confidentiality of private information and the availability of the blockchain.
It achieves the completion of transactions without disclosing the balance and transaction amount, meets the confidentiality of private information, ensures the availability of the blockchain, and improves the effectiveness and privacy of transactions.
Smart Images

Figure CN114598446B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet privacy protection, and in particular to a fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing. Background Art
[0002] As the core technology of the underlying support, blockchain has attracted widespread attention in the industry. Blockchain is a shared distributed database used to record transactions between participants. Due to the advantages of blockchain technology such as decentralization, trustworthiness, transparency, security and efficiency, more and more fields are beginning to explore the application of blockchain and seek effective solutions. As blockchain technology gradually becomes an important strategy for distributed storage, its application model will also expand rapidly, and the provision of storage services and access services will also be refined. It can be foreseen that more and more third-party institutions will join this system by providing intermediary services.
[0003] The transparency of blockchain makes transaction records visible to all participants. However, in some transaction scenarios, full disclosure will expose sensitive information of the transaction, which may be used by criminals, which poses a serious threat to sensitive information such as business secrets and personal privacy. To this end, the Chinese patent with publication number CN106549749B discloses "A blockchain privacy protection method based on additive homomorphic encryption", which includes: homomorphic key generation; splitting the visible balance of the sender's account into transaction amount and remaining balance; encrypting the transaction amount and remaining balance with the whole network homomorphic public key, recorded as ciphertext X1 and X2; encrypting the transaction amount with the receiver's public key to obtain ciphertext Y1; the sender initiates a transaction, and the transaction content contains three fields: X1, X2 and Y1; the whole network nodes verify the transaction information and maintain the public account book; and update the receiver's visible balance.
[0004] The blockchain transaction privacy protection method in the above-mentioned existing scheme hides the transaction amount and user balance on the blockchain through additive homomorphic encryption technology, thereby realizing privacy protection on the blockchain. However, the applicant found that the existing method is to upload the encrypted information to the blockchain so that no node except the node holding the secret key can decrypt the information. However, this is inconsistent with the basic principles of the blockchain to a certain extent, because the blockchain is a distributed database whose blocks must be approved and maintained in the usual way, and the existing scheme is difficult to simultaneously meet the requirements of verifiability and computability of the ciphertext, especially when the ciphertext is encrypted by different keys, which makes it difficult to balance the availability of the blockchain and the confidentiality of private information. Therefore, how to design a method that can balance improving the availability of the blockchain and the confidentiality of private information is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing, so as to take into account both the availability of the blockchain and the confidentiality of private information, thereby improving the effectiveness and privacy of transactions.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] The fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing includes:
[0008] S1: Use the participants in the transaction as nodes to build the corresponding physical chain, and at the same time build the logical chain corresponding to each physical chain;
[0009] S2: Secret sharing based on Shamir threshold divides the balance information of the node into corresponding balance secret shares, and stores the balance secret shares in the physical chain of the corresponding node;
[0010] S3: The payer and the recipient of the transaction publish the secret share of the transaction amount to other nodes participating in the transaction;
[0011] S4: Based on the secret share of the transaction amount, each participant verifies whether the transaction amounts published by the payer and the recipient are equal and whether the balance of the payer is greater than the transaction amount, and determines whether the transaction is legal based on the verification results of each participant.
[0012] Preferably, in step S1, the physical chain includes the node's block Block, the Transaction that records transaction information, the log information Log saved by each node, and the set UTXO of the node's latest balance secret share.
[0013] Preferably, in step S2, the local physical chain of each node stores the secret balance shares of all nodes.
[0014] Preferably, in step S2, the balance secret share is divided by the following formula:
[0015] f a (x) = a + a1x + a2x + a3x + ... a t x t mod p;
[0016] Where: f a (x i ) represents the divided secret share; a represents the balance, and the balance secret share is expressed as [a] p , where the bitwise sharing of a is represented by [a l-1 ] p ,...,[a0] p; x represents the key used to calculate the secret share of each node; p represents the set modulus.
[0017] Preferably, step S4 specifically includes the following steps:
[0018] S401: The participants use the transaction amount secret share combined with the consistency comparison protocol to determine whether the transaction amounts published by the payer and the recipient are consistent;
[0019] S402: The participants determine whether the payer's balance is greater than the transaction amount by comparing the transaction amount secret share and the payer's balance secret share stored in the local physical chain with the protocol;
[0020] S403: Each participant elects a Leader node, and then sends the comparison results in step S401 and step S402 to the Leader node for recovery: if the recovery result is 1, the transaction is legal, and each node updates the corresponding balance secret share in the local physical chain; if the recovery result is 0, the transaction is illegal and the transaction is invalid.
[0021] Preferably, step S401 specifically includes the following steps:
[0022] S4011: Secret share of transaction amount based on payer and recipient [w1] p and [w2] p Calculate [a1] p =[w1] p -[w2] p ;
[0023] S4012: The participants share a random number [r∈ R Z p ] B Get [r1] p , calculate [c1] p =[a1] p +[r1] p , and recover c1; where c1=a1+r1modp∈{0,1,…p-1};
[0024] S4013: The binary representation of c1 is c l-1 ,c l-2 ,…,c0, the participants calculate [c i '] p , 0≤i≤l-1; among them,
[0025] S4014: Participants are calculated according to unlimited fan-in and agreement And based on the calculation results, determine whether the transaction amounts posted by both parties are equal.
[0026] Preferably, in step S4014, the calculation process of infinite fan-in and protocol is as follows:
[0027] The following formula is used to calculate [f l (A)] p Come get
[0028]
[0029] By calculating [A i ] p ,1≤i≤l to obtain [f l (A)] p ;
[0030] The participants generate two shared random numbers [b i ∈ R Z p ] p and [b i '∈ R Z p ] p , calculate [B i ] p =[b i ] p ×[b i '] p , and restore B i :
[0031] in,
[0032] Each participant calculates [c i '] p ,1≤i≤l:
[0033]
[0034] Participants recover c i ', all parties involved calculate in parallel Get [f l (A)] p and Finally, it can be judged that [a1] p Whether it is a secret share of 1 or 0, and then the secret share of the transaction amount of the payer and the recipient is obtained [w1] p and [w2] p Are they equal?
[0035] Preferably, in an infinite fan-in AND protocol, by non-interactive multiplication calculation [B i ] p =[b i ] p ×[bi '] p , and restore B i ;
[0036] The calculation process of non-interactive multiplication is as follows:
[0037] For the balances a3 and b3 of node i, the secret share of the balances a3b3 is calculated using the following formula:
[0038]
[0039] Where: f a (x i ), f b (x i ) and x i represents the secret share owned by node i.
[0040] Preferably, step S402 specifically includes the following steps:
[0041] S4021: The participants calculate the transaction amount w1 and the payer's balance T based on the least significant bit protocol of the wraparound A The size relationship between the set modulus p;
[0042] S4022: Determine the relationship between the transaction amount and the payer's balance using the following formula:
[0043] 1) If and Then [T A <w1] p =1;
[0044] 2) If and Then [T A <w1] p =0;
[0045] 3) If and Then [T A <w1] p =1;
[0046] 4) If and Then [T A <w1] p =0;
[0047] 5) If and Then [T A <w1] p =1;
[0048] 6) If and Then [T A <w1] p =0.
[0049] Preferably, in step S4021, the calculation process based on the least significant bit protocol of the surround is as follows:
[0050] Participants generate share[r2] bit by bit B , get secret share [r2] p ;
[0051] Participant calculation [c2] p =[a2] p +[r2] p And restore c2;
[0052] like and no wraparound occurs, then calculate
[0053] like and wraparound occurs, then calculate
[0054] By comparing r2 and c2, we can determine whether wraparound occurs: if r2<c2, no wraparound occurs; if r2>c2, wraparound occurs, c2=a2+r2-p;
[0055] Among them, the sharing of the least significant bit of a2 can be expressed as:
[0056]
[0057] Where [c2< B r2] p It means that c2 is less than r2 in bits;
[0058] Calculated by the following formula The value of (c2)0 is determined by:
[0059]
[0060] By [(a2)0] p We get [(a2)0] p , the participants pass [(2a2)0] p Determine whether a2 is greater than
[0061] in,
[0062] Compared with the prior art, the blockchain transaction privacy protection method of the present invention has the following beneficial effects:
[0063] The present invention divides the node balance information (transaction sensitive information) into corresponding balance secret shares and stores them in the logical chain through the sharing principle of Shamir threshold, so that the balance of each node can be effectively hidden, and whether the transaction amount published by the transaction parties is equal and whether the balance of the payer is greater than the transaction amount can be verified based on the transaction amount secret share, so that the transaction can be completed without disclosing the balance and transaction amount (transaction sensitive information), that is, the confidentiality of private information can be met and the transaction can be effectively completed, thereby improving the validity and privacy of the transaction. At the same time, the present invention can ensure the availability of the blockchain through the logical chain by constructing a logical chain-physical chain structure, that is, the basic functions of the blockchain such as consensus, auditing and transactions can be executed normally and safely, thereby ensuring the availability of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0065] Figure 1 This is a logical block diagram of the fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing;
[0066] Figure 2 It is a result diagram of the logical chain and the physical chain;
[0067] Figure 3 This is a schematic diagram of the structure of the node's block Block;
[0068] Figure 4 A schematic diagram of a transaction that records transaction information;
[0069] Figure 5 This is a schematic diagram of log information Log;
[0070] Figure 6 Schematic diagram of the UTXO packaging process;
[0071] Figure 7 Schematic diagram of UTXO;
[0072] Figure 8 This is a schematic diagram of the transaction process;
[0073] Fig. 9 This is a schematic diagram of the process of selecting the Leader node;
[0074] Fig.10 A comparison chart of the number of interactive rounds between interactive multiplication and non-interactive multiplication;
[0075] Fig.11 Schematic diagram of consensus time under congestion and non-congestion conditions;
[0076] Fig.12 A comparison chart of storage with privacy protection and storage without privacy protection. DETAILED DESCRIPTION
[0077] The following is a further detailed description through specific implementation methods:
[0078] Example:
[0079] This embodiment discloses a fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing.
[0080] like Figure 1 As shown in the figure, the fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing includes:
[0081] S1: Use the participants in the transaction as nodes to build the corresponding physical chain, and at the same time build the logical chain corresponding to each physical chain;
[0082] S2: Secret sharing based on Shamir threshold divides the balance information of the node into corresponding balance secret shares, and stores the balance secret shares in the physical chain of the corresponding node; in this embodiment, the local physical chain of each node stores the balance secret shares of all nodes.
[0083] S3: The payer and the recipient of the transaction publish the secret share of the transaction amount to other nodes participating in the transaction;
[0084] S4: Based on the secret share of the transaction amount, each participant verifies whether the transaction amounts published by the payer and the recipient are equal and whether the balance of the payer is greater than the transaction amount, and determines whether the transaction is legal based on the verification results of each participant.
[0085] It should be noted that the Shamir threshold is an existing technology, which is implemented based on the Lagrange interpolation formula of the polynomial, that is, given the function value Φ(xi) of Φ(x) at k different points, a k-1th order interpolation polynomial can be constructed as f(x)=∑Φ(xi)∏(x-xj) / (xi-xj).
[0086] Given Φ(2)=10, Φ(5)=3, Φ(4)=7, and Φ(1), we can construct:
[0087] f(x)=10[(x-5)(x-4)] / [(2-5)(2-4)]+3[(x-2)(x-4)] / [(5-2)(5-4)]+7*[(x-2)(x-5)] / [(4-2)(4-5)]; substitute x=1 and we get the result.
[0088] Therefore, a polynomial f(x) (q is a large random prime number) can be constructed on a GF(q), the secret s is a random number above, n participants are given sub-keys f(i), and k of them can be restored. The Lagrange interpolation formula can be used to construct the polynomial, and f(0) is the secret share.
[0089] In this embodiment, the balance secret share is divided by the following formula:
[0090] f a (x) = a + a1x + a2x + a3x + ... a t x t mod p;
[0091] Where: f a (x i ) represents the divided secret share; a represents the balance, and the balance secret share is expressed as [a] p , where the bitwise sharing of a is represented by [a l-1 ] p ,...,[a0] p ; x represents the key used to calculate the secret share of each node, which can be the ID number of the node and other information; mod represents the modulus in the mathematical sense; p represents the set modulus.
[0092] The present invention divides the node balance information (transaction sensitive information) into corresponding balance secret shares and stores them in the logical chain through the sharing principle of Shamir threshold, so that the balance of each node can be effectively hidden, and whether the transaction amount published by the transaction parties is equal and whether the balance of the payer is greater than the transaction amount can be verified based on the transaction amount secret share, so that the transaction can be completed without disclosing the balance and transaction amount (transaction sensitive information), that is, the confidentiality of private information can be met and the transaction can be effectively completed, thereby improving the validity and privacy of the transaction. At the same time, the present invention can ensure the availability of the blockchain through the logical chain by constructing a logical chain-physical chain structure, that is, the basic functions of the blockchain such as consensus, auditing and transactions can be executed normally and safely, thereby ensuring the availability of the blockchain.
[0093] In this embodiment, Figure 2 The blockchain shown includes a logical chain and a physical chain. For participants, each participant is regarded as a node in the system. The blockchain saved by the node does not directly save the balance of each transaction, but uses the principle of Shamir threshold secret sharing to split the balance of each node into different balance secret shares and store them in the physical chain of each node, that is, each node saves a physical chain composed of different balance secret shares, and different balance secret shares correspond to the same transaction, so different physical chains can be mapped to the same logical chain.
[0094] During the specific implementation process, the physical chain includes the node's block Block, the Transaction that records transaction information, the log information Log saved by each node, and the collection UTXO of the node's latest balance secret share.
[0095] The structure of the node's block is as follows Figure 3 shown.
[0096] Transaction, which records transaction information, is the basic unit of the block that makes up the node. It consists of two main parts: Vin and Vout. Vin represents the input of the transaction, which points to the most recent secret share in the UTXO set. UTXO holds the remaining share here. Even if the account balance is not enough to pay, the calculated secret share is not necessarily zero, so UTXO does not show the account balance. In the case of a coinbase transaction, the initial balance can be allocated to each account, and the transaction corresponds to one input and multiple outputs. to_spend in Vin is a pointer to UTXO, and Vout contains the output address and the secret share to be allocated. The schematic diagram of Transaction is as follows Figure 4 shown.
[0097] The log recorded locally by each node includes the type, timestamp, and secret share of the updated balance after calculation. Figure 5 It can be clearly seen that each node will hold many secret shares, which are the balances of different nodes. Here, only the secret shares after the transaction calculation are retained, and no data related to the transaction value is involved. Among them, the records saved in each node’s local log are as follows Figure 5 shown.
[0098] To update UTXO, you only need to package Vout in each Transaction. For a verified Transaction, Ponter points to the latest unused secret share, and the output secret share is packaged as a UTXO unit and added to UTXO_SET. Since a Transaction has multiple outputs, it is necessary to specify the output of the Transaction when packaging it into a UTXO unit. The packaging process of UTXO is as follows: Figure 6 As shown, an example of UTXO is Figure 7 shown.
[0099] The present invention constructs a logical chain-physical chain structure, so that the availability of the blockchain can be well guaranteed through the logical chain, and the confidentiality of private information can be met through the physical chain, thereby improving the effectiveness and privacy of transactions.
[0100] In step S4, Figure 8As shown, the specific steps include:
[0101] S401: The participants use the transaction amount secret share combined with the consistency comparison protocol to determine whether the transaction amounts published by the payer and the recipient are consistent;
[0102] S402: The participants determine whether the payer's balance is greater than the transaction amount by comparing the transaction amount secret share and the payer's balance secret share stored in the local physical chain with the protocol;
[0103] S403: Each participant elects a Leader node, and then sends the comparison results in step S401 and step S402 to the Leader node for recovery: if the recovery result is 1, the transaction is legal, and each node updates the corresponding balance secret share in the local physical chain; if the recovery result is 0, the transaction is illegal and the transaction is invalid. In this embodiment, each node in the local physical chain completes the update of the local balance secret share by subtracting the transaction amount secret share from the payer's balance secret share and adding the transaction amount secret share to the income party's balance secret share.
[0104] Selecting the Leader node is a mature method. The selection process is as follows: Fig. 9 As shown. In this embodiment, the improved Raft consensus algorithm is used to reach a consensus: first, in the election of the central node, each node randomly starts a timer, and starts voting after the timer ends. If more than half of the votes are obtained, it will be elected as a temporary central node; secondly, in the process of completing the transaction, the temporary central node is used to allocate different secret shares to the nodes, instead of the original Raft consensus algorithm publishing the same log, and collecting the calculated secret shares to restore the comparison result without exposing any specific values of the relevant amounts.
[0105] During the transaction, the two parties first negotiate the transaction amount and send it to other nodes in the form of a secret share of the transaction amount. After receiving it, other nodes first calculate the Boolean result share of whether the balance is greater than the transaction amount locally according to the comparison protocol based on the secret share. Any k nodes send the result to the temporary central node (Leader node) selected by the raft consensus algorithm to restore the result and determine whether the transaction is valid. If valid, the node updates the balance share locally.
[0106] Through the above steps, the present invention can effectively verify whether the transaction amounts published by the two parties to the transaction are equal and whether the balance of the payer is greater than the transaction amount based on the secret share of the transaction amount, and judge whether the transaction is legal, so that the transaction can be completed without disclosing the balance and transaction amount (transaction sensitive information), that is, the confidentiality of privacy information can be met and the transaction can be effectively completed, thereby improving the effectiveness and privacy of the transaction.
[0107] Step S401 specifically includes the following steps:
[0108] In the transaction process, in order to verify whether the transaction amount published by both parties is consistent, it is necessary to compare whether the two secrets are equal. The core idea is to convert [a=b] p Convert to [d] p =[ab=0] p , that is, we only need to be able to judge [d=0] p You can then compare whether two secrets are equal.
[0109] S4011: Secret share of transaction amount based on payer and recipient [w1] p and [w2] p Calculate [a1] p =[w1] p -[w2] p ;
[0110] S4012: The participants share a random number [r∈ R Z p ] B , we get [r1] p , calculate [c1] p =[a1] p +[r1] p , and recover c1; where c1=a1+r1modp∈{0,1,…p-1};
[0111] S4013: The binary representation of c1 is c l-1 ,c l-2 ,…,c0, the participants calculate [c i '] p , 0≤i≤l-1; among them,
[0112] S4014: Participants are calculated according to unlimited fan-in and agreement And based on the calculation results, determine whether the transaction amounts posted by both parties are equal.
[0113] The calculation process of infinite fan-in and protocol is as follows:
[0114] Based on the secret share of transaction amount between payer and recipient [w1] p and [w2] p Calculate [a1] p =[w1] p -[w2] p ; Only need to judge [a] p Whether the secret share is 1, the transaction amount can be determined [w1] p and [w2] pAre they equal?
[0115] [a l-1 ] p ,...,[a0] p It is represented by [a] p Bitwise sharing of i ∈{0,1}, by calculating It can be directly judged that [a] p Is it a share of 1? Assume
[0116] Participants can calculate separately
[0117] This means that A is a i Add 1 to the number of 1s.
[0118] Next, the participants construct a l-degree polynomial f l (x), where f l (1)=0,f l (2)=0,...,f l (l)=0,f l (l+1)=1.
[0119] Obviously,
[0120] The following formula is used to calculate [f l (A)] p Come get
[0121]
[0122] By calculating [A i ] p ,1≤i≤l to obtain [f l (A)] p ;
[0123] The participants generate two shared random numbers [b i ∈ R Z p ] p and [b i '∈ R Z p ] p , calculate [B i ] p =[b i ] p ×[b i '] p , and restore B i :
[0124] in,
[0125] Each participant calculates [c i '] p ,1≤i≤l:
[0126]
[0127] Participants recover c i ', all parties involved calculate in parallel Get [f l (A)] p and Finally, it can be judged that [a1] p Whether it is a secret share of 1 or 0, and then the secret share of the transaction amount of the payer and the recipient is obtained [w1] p and [w2] p Are they equal? Among them, [a1] p is 0, then [w1] p and [w2] p equal.
[0128] The consistency comparison protocol in the present invention calls the infinite fan-in protocol as a sub-protocol, so that it can verify whether the transaction amounts published by the two parties to the transaction are equal based on the secret share of the transaction amount, and then complete the transaction without disclosing the balance and transaction amount (transaction sensitive information), that is, it can meet the confidentiality of privacy information and effectively complete the transaction, thereby improving the effectiveness and privacy of the transaction.
[0129] In the specific implementation process, in the infinite fan-in and protocol, it is necessary to calculate [B i ] p =[b i ] p ×[b i '] p And restore B i ,At this time, it is necessary to use secret sharing-based multiplication. Interactive multiplication is essentially to use the product of two shares as secret sharing again, which requires interaction between nodes.
[0130] In order to achieve the goal that nodes can complete all secret sharing locally, the present invention designs a multiplication secret sharing that does not require interaction, that is, non-interactive multiplication. The calculation steps are as follows:
[0131] The direct multiplication of two secret shares is in the form of:
[0132] f a (x i )f b (x i )=ab+r1x+r2x 2 +…r2t-2 x i 2t-2 ;
[0133] Convert the polynomial into vector multiplication, the two random polynomials are as follows:
[0134] f a (x i )=(a,a1,a2,…,a t-1 )(x i 0 ,x i 1 ,x i 2 ,…,x i t-1 ) T ;
[0135] f b (x i )=(b,b1,b2,…,b t-1 )(x i 0 ,x i 1 ,x i 2 ,…,x i t-1 ) T ;
[0136] Let f a (x i )f b (x i )=α+β, where
[0137]
[0138]
[0139] From the above formula, we can clearly see that the order of α is exactly the order t-1 we need, and its leading coefficient is ab. All nodes can use the secret share f a (x i )f b (x i ) minus β, which is the required α.
[0140] First, construct the following random polynomial, where s is a secret:
[0141] f s (x) = s + a1x + a2x + a3x + ... a t-1 x t-1 mod(x i t -1);
[0142] f s (x i ) is the secret share assigned to node i, where p<x i <q,f a (x i ), f b (x i ) and x i represents the secret share owned by node i.
[0143] For the balances a3 and b3 of node i, the secret share of the balances a3b3 is calculated using the following formula:
[0144]
[0145] Through the above operations, even if multiplication operations are required in the transaction, the node can complete the secret sharing calculation locally without interacting with other nodes.
[0146] The present invention realizes that nodes complete all secret sharing locally through non-interactive secret sharing multiplication, reduces the number of interaction rounds and communication time of the protocol, eliminates the interaction bottleneck between participants, and performs nonlinear function processing on hidden data without communication delay, thereby ensuring transaction efficiency.
[0147] Step S402 specifically includes the following steps:
[0148] Through the least significant bit protocol based on wraparound, the participants can determine the difference between the secret a and The size relationship.
[0149] S4021: The participants calculate the transaction amount w1 and the payer's balance T based on the least significant bit protocol of the wraparound A The size relationship between the set modulus p;
[0150] S4022: Determine the relationship between the transaction amount and the payer's balance using the following formula:
[0151] 1) If and Then [T A <w1] p =1;
[0152] 2) If and Then [T A <w1] p =0;
[0153] 3) If and Then [T A<w1] p =1;
[0154] 4) If and Then [T A <w1] p =0;
[0155] 5) If and Then [T A <w1] p =1;
[0156] 6) If and Then [T A <w1] p =0.
[0157] Among them, 1 and 0 represent the result is true or false.
[0158] The calculation process of the least significant bit protocol based on wraparound is as follows:
[0159] In the transaction calculation process, in order to determine whether the balance is greater than the transaction amount to ensure the legality of the transaction, it is necessary to implement a comparison operation based on secret sharing and use the wrap-around feature under the modulus p to estimate the size of the secret.
[0160] Under modulus p, numbers less than p retain their properties, while numbers greater than p wrap around. Then (2amodp)0=0; and when Then (2amodp)0=1.
[0161] Because when When , the property of 2amodp remains unchanged and is an even number. 2amodp wraps around and is an odd number. Therefore, the relative position of the secret a can be determined by judging whether the least significant bit is 0 or 1. size.
[0162] In this process, we first need to share the secret a [a] p Get the share of the least significant bit of a [(a)0] p , we only need to follow the central idea of the bit decomposition protocol, randomize the secret a to be hidden with r, and then use the obtained random value and r to perform bit calculations to get the required [(a)0] p The specific process is as follows:
[0163] Participants generate share[r2] bit by bit B , get secret share [r2] p ;
[0164] Participant calculation [c2] p =[a2] p +[r2] p And restore c2;
[0165] like and no wraparound occurs, then calculate
[0166] like and wraparound occurs, then calculate
[0167] By comparing r2 and c2, we can determine whether wraparound occurs: if r2<c2, no wraparound occurs; if r2>c2, wraparound occurs, c2=a2+r2-p;
[0168] Among them, the sharing of the least significant bit of a2 can be expressed as:
[0169]
[0170] Where [c2< B r2] p It means that c2 is less than r2 in bits;
[0171] Because each participant holds a bitwise share of r and c, [c< B r] p It is easy to calculate the comparison result. Therefore, we only need to calculate Since the participants have already recovered c, it is easy to get (c)0.
[0172]
[0173] Calculated by the following formula The value of (c2)0 is determined by:
[0174]
[0175] By [(a2)0] p We get [(a2)0] p , the participants pass [(2a2)0] p Determine whether a2 is greater than
[0176] in,
[0177] The comparison protocol in the present invention calls the least significant bit protocol based on the surround as a sub-protocol, so that it can verify whether the payer's balance is greater than the transaction amount and judge whether the transaction is legal based on the secret share of the transaction amount, and then complete the transaction without disclosing the balance and transaction amount (transaction sensitive information), that is, it can meet the confidentiality of privacy information and effectively complete the transaction, thereby improving the effectiveness and privacy of the transaction.
[0178] In order to better illustrate the advantages of the present invention, the following experiments are disclosed in this embodiment.
[0179] This experiment was run on a 6-core AMD machine with a CPU of 3600 3.9GHz, a memory of 16GB, and a 64-bit Win10 operating system.
[0180] The number of nodes in the blockchain is 11, based on two aspects of complexity: 1) the complexity of communication to reach consensus on the blockchain and 2) the computational complexity when verifying transactions.
[0181] This experiment found that the number of interactive rounds is related to the number of transactions through the change of the number of rounds and the time to reach consensus as the number of transactions increases. Due to the optimization of multiplication by the present invention, the number of rounds required for transactions is reduced. The comparison chart of the number of interactive rounds between interactive multiplication and non-interactive multiplication is as follows: Fig.10 As shown in the experimental results, it can be seen that the time efficiency of reaching consensus is relatively high. Considering the actual communication congestion, the congestion time is set to 2 seconds, and the consensus time is as follows: Fig.11 shown.
[0182] For consensus protocols without privacy protection, allocating secret shares for computation will increase the storage efficiency of nodes. However, according to the privacy requirements of transactions, we need to increase storage to meet their privacy computing requirements. The storage comparison between privacy protection and non-privacy protection is as follows: Fig.12 shown.
[0183] Since the present invention proposes non-interactive multiplication, the communication cost of a single node is also greatly reduced. For interactive multiplication, the node needs to multiply the received shares and then distribute them, resulting in a single node communication volume of 2log2p+nlog2p, while non-interactive multiplication reduces this communication volume to 2log2p.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. A fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing, characterized in that: include: S1: Use the participants in the transaction as nodes to build the corresponding physical chain, and at the same time build the logical chain corresponding to each physical chain; S2: Secret sharing based on Shamir threshold divides the balance information of the node into corresponding balance secret shares, and stores the balance secret shares in the physical chain of the corresponding node; S3: The payer and the recipient of the transaction publish the secret share of the transaction amount to other nodes participating in the transaction; S4: Based on the secret share of the transaction amount, each participant verifies whether the transaction amounts published by the payer and the recipient are equal and whether the balance of the payer is greater than the transaction amount, and determines whether the transaction is legal based on the verification results of each participant; Step S4 specifically includes the following steps: S401: The participants use the transaction amount secret share combined with the consistency comparison protocol to determine whether the transaction amounts published by the payer and the recipient are consistent; S402: The participants determine whether the payer's balance is greater than the transaction amount by comparing the transaction amount secret share and the payer's balance secret share stored in the local physical chain with the protocol; S403: Each participant elects a Leader node, and then sends the comparison results in step S401 and step S402 to the Leader node for recovery: if the recovery result is 1, the transaction is legal, and each node updates the corresponding balance secret share in the local physical chain; if the recovery result is 0, the transaction is illegal and the transaction is invalid; Step S401 specifically includes the following steps: S4011: Secret share of transaction amount based on payer and recipient [w1] p and [w2] p Calculate [a1] p =[w1] p -[w2] p ; S4012: The participants share a random number [r∈ R Z p ] B Get [r1] p , calculate [c1] p =[a1] p +[r1] p , and recover c1; where c1=a1+r1modp∈{0,1,…p-1}; S4013: The binary representation of c1 is c l-1 ,c l-2 ,…,c0, the participants calculate [c' i ] p , 0≤i≤l-1; among them, S4014: Participants are calculated according to unlimited fan-in and agreement And based on the calculation results, determine whether the transaction amounts posted by both parties are equal; In step S4014, the calculation process of infinite fan-in and protocol is as follows: The following formula is used to calculate [f l (A)] p Come get By calculating [A i ] p ,1≤i≤l to obtain [f l (A)] p ; The participants generate two shared random numbers [b i ∈ R Z p ] p and [b i '∈ R Z p ] p , calculate [B i ] p =[b i ] p ×[b i '] p , and restore B i ; in, Each participant calculates [c' i ] p ,1≤i≤l: Participants recover c' i , all parties involved calculate in parallel Get [f l (A)] p and Finally, it can be judged that [a1] p Whether it is a secret share of 1 or 0, and then the secret share of the transaction amount of the payer and the recipient is obtained [w1] p and [w2] p whether they are equal; Step S402 specifically includes the following steps: S4021: The participants calculate the transaction amount w1 and the payer's balance T based on the least significant bit protocol of the wraparound A The size relationship between the set modulus p; S4022: Determine the relationship between the transaction amount and the payer's balance using the following formula: 1) If and Then [T A <w1] p =1; 2) If and Then [T A <w1] p =0; 3) If and Then [T A <w1] p =1; 4) If and Then [T A <w1] p =0; 5) If and Then [T A <w1] p =1; 6) If and Then [T A <w1] p =0; In step S4021, the calculation process based on the least significant bit protocol of the surround is as follows: Participants generate share[r2] bit by bit B , get secret share [r2] p ; Participant calculation [c2] p =[a2] p +[r2] p And restore c2; like and no wraparound occurs, then calculate like and wraparound occurs, then calculate By comparing r2 and c2, we can determine whether wraparound occurs: if r2<c2, no wraparound occurs; if r2>c2, wraparound occurs, c2=a2+r2-p; Among them, the sharing of the least significant bit of a2 is expressed as: Where [c2< B r2] p It means that c2 is less than r2 in bits; Calculated by the following formula The value of (c2)0 is determined by: By [(a2)0] p We get [(a2)0] p , the participants pass [(2a2)0] p Determine whether a2 is greater than in, 2. The fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing as claimed in claim 1, characterized in that: In step S1, the physical chain includes the node's block Block, the transaction information recorded in Transaction, the log information Log saved by each node, and the set of the node's latest balance secret share UTXO.
3. The fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing as claimed in claim 1, characterized in that: In step S2, the local physical chain of each node stores the secret balance shares of all nodes.
4. The fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing as claimed in claim 1, characterized in that: In step S2, the balance secret share is divided by the following formula: f a (x)=a+a1x+a2x+a3x+…a t x t mod p; Where: f a (x i ) represents the divided secret share; a represents the balance, and the balance secret share is expressed as [a] p , where the bitwise sharing of a is represented by [a l-1 ] p ,...,[a0] p ; x represents the key used to calculate the secret share of each node; p represents the set modulus.
5. The fully homomorphic blockchain privacy protection method based on Shamir threshold secret sharing as claimed in claim 1, characterized in that: In infinite fan-in and protocol, non-interactive multiplication is computed [B i ] p =[b i ] p ×[b' i ] p , and restore B i ; The calculation process of non-interactive multiplication is as follows: For the balances a3 and b3 of node i, the secret share of the balances a3b3 is calculated using the following formula: Where: f a (x i ), f b (x i ) and x i represents the secret share owned by node i.
