A blockchain transaction privacy protection method based on homomorphic encryption in the Internet of Things
Through Paillier homomorphic encryption and payment channel network, the problem of privacy leakage and scalability in blockchain transactions is solved, privacy protection of high throughput and fast transactions in the Internet of Things is achieved, and the confidentiality and verifiability of transaction data are ensured. .
Patent Information
- Application Number
- CN202210211078.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-03-04
AI Technical Summary
Blockchain transactions have privacy leakage and scalability issues in the Internet of Things, and existing privacy protection solutions cannot meet the needs of high throughput and fast transactions.
The Paillier homomorphic encryption algorithm is used to encrypt the blockchain transaction data, and is combined with the payment channel network (PCN) to conduct off-chain transactions to ensure the confidentiality and verifiability of the transaction data. The authoritative certification center (CA) verifies the legality and validity of the transaction. Arbitrate Disputes.
It realizes the verification of the legality of blockchain transactions without exposing transaction data, supports fast and frequent off-chain payments by both parties to the transaction, reduces the confirmation time of the blockchain network, and provides effective privacy data protection and high throughput. trading plan.
Smart Images

Figure CN114547695B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a blockchain transaction privacy protection method based on homomorphic encryption in the Internet of Things, and belongs to the technical field of privacy protection methods in the Internet of Things. Background Art
[0002] In recent years, blockchain has been studied and applied in various transactions in the Internet of Things due to its advantages such as decentralization, trustlessness, distributed sharing, and tamper-proof transaction records. The distributed structure of blockchain weakens the functions of traditional centralized organizations. Cryptocurrency based on blockchain technology is an append-only distributed ledger shared between individuals who do not trust each other, providing a distributed storage mechanism. In recent years, there are more and more literatures on blockchain-based transaction models. For example, in the field of energy trading, Li Z et al. published "Consortium blockchain for secure energy trading in industrial internet of things" in IEEE transactions on industrial informatics in 2017, which proposed a credit-based payment scheme to support energy nodes to quickly pay for energy transactions through credit; Chaudhary R et al. published "BEST: Blockchain-based secure energy trading in SDN-enabled intelligent transportation system" in Computers & Security in 2019, which proposed a blockchain-based electric vehicle secure energy trading scheme, which uses SDN (Software De ned Networking) as the infrastructure to minimize the communication and computing costs of network resources. However, the blockchain mechanism on which these solutions are based is not unconditionally secure. Its trustless system relies on the disclosure of the global ledger. In order for all participants on the chain to reach a consensus, all participants are required to view and verify the transaction data of other participants to jointly maintain the global ledger, which exposes users to the risk of privacy leakage and brings about scalability issues in the blockchain system.
[0003] The distributed ledger of the blockchain system currently used for cryptocurrency mainly records transaction data. The privacy information is mainly divided into: (1) Transaction content: including the transfer payer, transfer recipient, transfer amount and other transaction information; (2) Account address: The account address of the blockchain is generated by the hash of the user's public key. A user can have multiple account addresses (i.e. pseudonyms), which contain information such as transaction records associated with an address, account balances, and related transactions between different account addresses. Since the entire transaction history of blockchain transactions in the global distributed ledger is public and the transactions are closely related, this means that attackers can steal users' transaction information by analyzing the transaction data in the ledger. So far, some studies have attempted to solve the privacy protection problem based on blockchain transactions. Some of them attempt to protect users' sensitive information by aggregating private data. Singh P et al. published "Blockchain and homomorphic encryption-based privacy-preserving data aggregation model in smart grid" in Computers & Electrical Engineering in 2021, which proposed a privacy-preserving data aggregation model based on deep learning, which ensures a secure data aggregation process and low computational overhead; Wang Y et al. published "Distributed meter data aggregation framework based on Blockchain and homomorphic encryption" in IET Cyber-Physical Systems in 2019, which proposed a distributed privacy-preserving and secure meter data aggregation framework, using a layered blockchain system to aggregate and verify meter data. Another direction is the privacy protection of transaction data. Another direction is the privacy protection of user identity information. For example, Aitzhan NZ et al. published "Security and privacy in decentralized energy trading through multi-signatures, blockchain and anonymous messaging streams" in IEEE Transactions on Dependable and Secure Computering in 20016, which proposed a distributed energy trading system using blockchain technology, multi-signatures and anonymous encrypted message streams, enabling peers to anonymously negotiate energy prices and securely execute transactions.Liu D et al. published "Anonymous reputation system for IIoT-enabled retail marketing atop PoS blockchain" in IEEE Transactions on Industrial Informatics in 2019. They established an anonymous reputation system that uses a random signature and non-interactive zero-knowledge proof technology to preserve consumer identity and personal review confidentiality. However, these solutions ignore the huge overhead and long confirmation time brought by blockchain transactions, and cannot meet the requirements of the IoT market.
[0004] In order to solve the above-mentioned scalability problem, off-chain payment is proposed to eliminate the requirement to submit each private transaction to the blockchain. The payment channel network is currently the most promising method. Transactions in PCN are essentially updates to the channel balance agreed upon by both parties to the transaction. The two parties to the transaction establish a common account for multi-payment and only need to register the first and last balances to the blockchain. The channel is protected by smart contracts to ensure the validity and non-repudiation of ongoing transactions. PCN transactions not only support fast and frequent payments, but also hide a large amount of information about intermediate transactions. However, it can be seen that PCN can only provide users with partial transaction privacy protection.
[0005] The privacy protection scheme for transaction data based on blockchain should have two characteristics: one is the complete confidentiality of transaction data, and the other is verifiability under the condition of ensuring that the data is not disclosed. Based on the above analysis, the present invention proposes a data privacy protection scheme based on Paillier homomorphic encryption, which can verify the legitimacy of blockchain transactions without exposing transaction data. Homomorphic encryption allows calculations such as addition and multiplication to be performed directly on encrypted data, and the calculation process will not leak any information of the original data. The result of the calculation is still encrypted, and the user with the key decrypts the processed ciphertext data, and the result is exactly the result of the processed original data. According to the supported calculation type and support level, homomorphic encryption can be divided into three types: semi-homomorphic encryption (such as RSA, GM, Elgamal, Paillier), partial homomorphic encryption (such as BGN) and full homomorphic encryption (such as Gentry, DGHV, LWE, BGV). Since fully homomorphic encryption requires huge overhead and does not meet the transaction throughput requirements, and the transaction volume is huge while partial homomorphic encryption only supports a limited number of calculations, homomorphic encryption that only meets the additive properties can complete the usual transaction verification. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a blockchain transaction privacy protection method based on homomorphic encryption in the Internet of Things, that is, an encryption scheme for blockchain off-chain transaction data based on the Paillier algorithm, which protects the privacy of blockchain transaction information while meeting the transaction throughput of the Internet of Things.
[0007] The contributions of the scheme of the present invention are as follows: (1) A blockchain transaction privacy protection mechanism based on additive homomorphic encryption is proposed, which provides a verifiable hiding scheme for the account balances of both parties to the transaction that need to be uploaded to the public blockchain. The two parties to the transaction send encrypted account balances respectively, and the scheme enables the common account balance to be obtained and uploaded to the blockchain without decrypting the amount; (2) The present invention adopts a payment scheme based on PCN to overcome the non-scalability problem of traditional blockchain. PCN off-chain transactions support frequent and fast payments between the two parties to the transaction, and each off-chain payment does not need to be uploaded to the blockchain. At the same time, the homomorphic encryption scheme is applied to hide the balances of both parties to the transaction that need to be uploaded to the public blockchain when starting and ending transactions, forming a complete privacy protection mechanism; (3) A simulation platform for the encryption scheme is built and the time overhead of the encryption algorithm is counted, and the encryption operations required for PCN transactions and the time overhead of each participant in performing these operations are analyzed. In summary, in order to solve the huge overhead and long confirmation time problems brought by blockchain transactions and meet the requirements of the energy market, the present invention adopts PCN and homomorphic encryption technology to realize a high-throughput and secure IoT transaction scheme.
[0008] In order to achieve the above-mentioned purpose, the technical solution adopted by the present invention is: a blockchain transaction privacy protection method based on homomorphic encryption in the Internet of Things, including a privacy data protection process based on homomorphic encryption technology and a transaction process based on a payment channel network PCN, and the steps are as follows:
[0009] Step 1: Establish system model: Denote the balance of the common account as B C , where the initial amount deposited by user A is B0, and the initial amount deposited by user B is B1, followed by multiple off-chain transactions {Tran1, Tran2, ..., Tran n}, the transfer amount of each transaction is {v1, v2, ..., v n}, when the transaction is completed and the payment channel needs to be closed, assuming that the remaining bitcoin amount of user A is b 0,n , the remaining bitcoin amount of user B is b 1,n , the balance information will be encrypted by both parties and uploaded to the blockchain;
[0010] Step 2: Using the blockchain transaction privacy protection mechanism based on Paillier additive homomorphic encryption, both parties encrypt their own private transaction data, including the initial deposit amount B0, B1, the transfer amount {v1, v2, ..., v n}, the transaction ends with an account balance of b 0,n , b 1,n , and then sent to CA for transaction verification and dispute arbitration;
[0011] Step 3: After the users in the network obtain their public and private keys through verification, the two parties use the PCN network payment channel to conduct peer-to-peer transactions off-chain;
[0012] Step 4: When a dispute occurs in a transaction, the CA collects the user's private key to decrypt the data and then complete the transaction verification.
[0013] Specifically, the specific steps of step one and step two are as follows:
[0014] Step 1: Generate key KeyGen()→(PK i , S.K. i ): Randomly select two large prime numbers a and b, find Let λ = lcm(a-1; b-1), select the parameters in So that g satisfies Definition In the above formula You can get the public key Private key SK = λ, user A's public-private key pair is (PK0, SK0), and user B's public-private key pair is (PK1, SK1);
[0015] Step 2: Encrypt Enc(PK i , B i )→(M i ): Select a random number User A and user B use their private keys to encrypt the initial amounts B0 and B1 deposited into the joint account, respectively, to obtain ciphertext M1 and M2, and send the ciphertext to CA, which calculates ENC(M1, M2) to obtain the balance B of the joint account. C , and write the balance to the blockchain;
[0016] Step 3: Encrypt Enc(PK i , v i , b 0,i )→(M i ): Before starting the first off-chain transaction Tran1, user A encrypts the transfer amount v1 and the account balance b after the transfer. 0,1, obtain the ciphertext m1, m2, and send it to CA to verify the legitimacy of its initial transfer Tran1;
[0017] Step 4: Encrypt Enc(PK i , b i,n )→(m i ): When the transaction ends and the payment channel needs to be closed, user A and user B will encrypt their current account balances b 0,n , b 1,n Get the ciphertext M3, M4 and send it to CA, CA verifies ENC(M3, M4) = B C Is it true? If the equation is true, CA writes the encrypted balance (M3, M4) of both parties into the blockchain and closes the payment channel. If CA verifies the equation ENC(M3, M4) = B C If not, both parties need to submit their private keys to decrypt M3 and M4 to obtain b 0,n , b 1,n ;
[0018] Step 5: When the two parties to the transaction have a dispute over the balance of the common account uploaded by the CA to the blockchain, they need to submit their private keys respectively, and input the private key pair M1 and M2 of both parties to decrypt and obtain B0 and B1.
[0019] Specifically, in step 3, the transaction parties use the PCN network payment channel to conduct a point-to-point transaction off-chain as follows:
[0020] Step 3.1: The system is initialized. After each node is registered with the CA, each node becomes a legal entity. After KeyGen()→(PK i , S.K. i ) method to obtain its public and private keys, PCN transactions can be carried out. Assume that from sender u0 to receiver u s Through the path (u1, u2...u i ...u n ) is a standard scheme for indirect payment;
[0021] Step 3.2: Before the transaction begins, u0 executes HTLC locally, and the contract locks a bitcoins that can only be released after the contract is fulfilled as scheduled; u0 randomly selects a random string α i , and define So that j ≥ i, α j is a random string α i The random string is generated according to the value range of j; then u0 sends a random string to each intermediate user u i Send(α i ,y i );
[0022] Step 3.3: The sender u0 sends a s Before payment, you need to create an initial account in advance, which contains the wallet addresses of both parties to the transaction (Addr0, Addr l ), initial channel capacity β, HTLC tolerance τ, channel transfer fee f and current account balance amount, both parties verify the account information and output a channel identifier δ(u0, u s ), you can establish a payment channel The account balance is then uploaded to the Blockchain;
[0023] 3.4: If there is a link from sender u0 to receiver u in PCN s The payment route, and each channel in the path There is at least a balance γ i ≥v' i , where v' i Represents each intermediate node u i The two parties can start the transaction only after they have confirmed the transfer amount.
[0024] The beneficial effects of the present invention are as follows: a blockchain transaction privacy protection scheme based on homomorphic encryption is proposed, and the Paillier encryption algorithm is used to provide an integrity privacy protection mechanism for transactions in the public blockchain. In addition, the PCN-based off-chain transaction scheme is used for the node P2P in the Internet of Things to quickly conduct transactions, which overcomes the limitation problem caused by the long transaction confirmation time of the blockchain network, and supports the transaction parties to quickly and frequently conduct multi-bi payments off-chain, wherein HTLC guarantees the security of its transaction funds and the non-repudiation of transactions. The homomorphic encryption algorithm is combined with the PCN transaction scheme, so that the account balances and transaction amounts that the transaction parties need to upload to the public blockchain are presented in ciphertext, and no private amount of the trader will be exposed if there is no dispute in the transaction. Security analysis shows that the proposed scheme provides effective integrity anonymity protection for both parties to the transaction. Compared with other schemes, while allowing users to quickly complete transactions point-to-point, it effectively solves the problem of privacy data being leaked when uploaded to the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is an off-chain example of a PCN transaction;
[0026] Figure 2 Example of channel capacity for PCN payment channel;
[0027] Figure 3 Formalize transaction data for encryption schemes;
[0028] Figure 4This is the flow chart of transaction data encryption based on the Paillier scheme;
[0029] Figure 5 This is a flow chart of the off-chain transaction privacy protection solution based on homomorphic encryption. DETAILED DESCRIPTION
[0030] In order to describe the present invention in more detail and facilitate understanding by those skilled in the art, the present invention is further described below in conjunction with the accompanying drawings and embodiments. The embodiments in this part are used to explain the present invention for the purpose of facilitating understanding, and are not intended to limit the present invention.
[0031] Example 1: Blockchain technology can be used to achieve real-time settlement between different currencies, but it cannot be widely used due to the high overhead of transaction broadcasting and proof of work mechanism, and the transaction processing rate is limited. In order to overcome this scalability problem, PCN-based transactions can complete instant payments without expensive and slow blockchain transactions. Users only need to register the initial and final balances of each channel when trading. In a PCN transaction, the two parties to the transaction need to establish a transaction channel in advance, each deposit a certain amount into a common account and add the transaction to the blockchain, which is essentially an update of the channel balance agreed upon by them. When the transfer is no longer needed or the deposit is exhausted and the channel needs to be closed, a transaction closure message will be broadcast to the blockchain, and a deposit amount notification will be sent to the user based on the latest balance.
[0032] Denote the joint account balance as B C , where the initial amount deposited by user A is B0, and the initial amount deposited by user B is B1. Subsequently, multiple off-chain transactions {Tran1, Tran2, ..., Tran n}, the transfer amount of each transaction is {v1, v2, ..., v n}. When the payment channel needs to be closed at the end of the transaction, assuming that the remaining bitcoin amount of user A is b 0,n , the remaining bitcoin amount of user B is b 1,n , the balance information will be uploaded to the blockchain. When a transaction needs to be verified or a dispute requires arbitration, it will be conducted by the authoritative certification center CA.
[0033] The specific encryption scheme is as follows:
[0034] 1. Generate key KeyGen()→(PK i , S.K. i ): Randomly select two large prime numbers a and b, find Let λ = lcm(a-1; b-1). Select the parameters in So that g satisfies
[0035]
[0036] Definition In the above formula You can get the public key Private key SK = λ. The public and private key pair (PK0, SK0) is generated for the transaction sender user A, and the public and private key pair generated for the transaction receiver user B is represented as (PK1, SK1).
[0037] 2. Encryption Enc(PK i , v i , B i , b 0,i )→(mi, Mi): Select a random number
[0038] Step 2.1: User A and User B encrypt the amounts B0 and B1 they deposit into the joint account to obtain ciphertext M1 and M2, and send the ciphertext to CA. CA calculates ENC(M1, M2) to obtain the balance B of the joint account C , and write the balance into the blockchain. The specific calculation process is as follows:
[0039]
[0040]
[0041]
[0042] Step 2.2: Before starting the first off-chain transaction, user A encrypts the transfer amount v1 and the account balance b after the transfer. 0,1 , obtain the ciphertext m1, m2, and send it to CA to verify the legitimacy of its initial transfer Tran1.
[0043]
[0044]
[0045] CA verifies the equation m1×m2=M1 based on the additive homomorphic property of the Paillier homomorphic encryption algorithm. If the equation holds, it means that b 0,1 +v1=B0, which satisfies the balance requirement of the initial account. The formula is valid only if the prerequisite r3×r4=r1 is met, so it is necessary to add constraints when generating random numbers.
[0046] Step 2.3: When the transaction is completed and the payment channel needs to be closed, user A and user B will encrypt their current account balances b respectively. 0,n , b 1,n And send it to CA. CA verifies ENC(M3, M4) = BC If the equation is true, CA writes the encrypted balances (M3, M4) of both parties into the blockchain and closes the payment channel.
[0047]
[0048]
[0049]
[0050] 3. Decryption: Corresponding to the above transaction process, the disputes that may occur in the transaction are as follows:
[0051] Step 3.1: When the two parties to the transaction have a dispute over the balance of the common account uploaded by the CA to the blockchain, they need to submit their private keys respectively. Enter the private key pair M1 and M2 of both parties to decrypt and get B0 and B1.
[0052]
[0053]
[0054] Step 3.2: Similarly, in Step 2.3, if the CA verifies the equation ENC(M3, M4) = B C If not, both parties need to submit their private keys to decrypt M3 and M4 to obtain b 0,n , b 1,n .
[0055] 4. System settings: Set nodes u0, u s represent the sender user A and the receiver user B respectively, and 0≤i<j≤s; each directed edge (u i ,u j ) represents the weight of the transferor u i Can be paid to the assignee j The remaining number of bitcoins β i,j ; At the same time, each edge (u i ,u j ) has an HTLC tolerance τ i,j , which is the maximum waiting time for the random number R to be submitted. Whether the payment between two users is successful depends on the capacity γ available on the path connecting the two users and the fee f charged by the intermediate node. Assume that user A passes through the path u0→u1→u2→...→u n →u s Pay α bitcoins to user B, f (i,j) represents the intermediate node u i to u j Total Fees Charged:
[0056]
[0057] For the payment to succeed, each channel must have a capacity of Y i,i+1 ≥β i,i+1 , where β i,i+1 ≥β 0,1 -f (1,i-1) (i.e. the initial payable bitcoin amount minus the fees charged by the intermediate nodes on the previous payment path). To ensure that user B successfully receives α bitcoins, user A's initial payment amount α0 = α + f (1,n) .
[0058] 5. System initialization: This system uses the Paillier homomorphic encryption scheme to initialize the system. After each node is registered with the CA, each node becomes a legal entity and passes through KeyGen()→(PK i , S.K. i ) method to obtain its public and private keys, PCN transactions can be carried out. Assume that from sender u0 to receiver u s Through the path (u1, u2...u n ) is the standard scheme for indirect payment.
[0059] Before the transaction begins, u0 executes HTLC locally, and the contract locks α bitcoins that can only be released after the contract is fulfilled as scheduled; u0 randomly selects a random string α i , and define So that j ≥ i; then u0 to each intermediate user u i Send(α i ,y i ). where τ i is the HTLC tolerance, which indicates the maximum tolerable time of using the current channel, for all i∈[n]: τ i-1 =τ i +Δ(Δ>0), Δ is any positive number.
[0060] 6. OpenChannel(u i ,u j , β, τ, f): u0 moves to u s Before payment, you need to create an initial account Acc = {PID0, Addr0, Addr l , β, τ, f, account}, which contains the wallet addresses of both parties to the transaction (Addr0, Addr l ), initial channel capacity β, HTLC tolerance τ, channel transfer fee f and current account balance account. Both parties verify the account information and output a channel identifier δ(u0, u s ). You can then establish a payment channel The account balance is then uploaded to the Blockchain.
[0061] 7. If there is a link from sender u0 to receiver u in PCN s The payment route, and each channel in the path There is at least a balance of β i,i+1 ≤γ i,i+1 , the transaction can start, and the algorithm description is as follows:
[0062] Before u0 sends a payment, it first calculates the s Total cost to send v bitcoins: β 0,1 =α+f (1,n) and the associated costs of each intermediate node in the payment path; if u0 does not have enough Bitcoin, the payment is abandoned, otherwise a contract is sent to each transferor.
[0063] Each intermediate node verifies that its HTLC associated value is less than or equal to the channel capacity in the subsequent payment path, and that the difference Δ between the timeout of the incoming HTLC and the timeout of the outgoing HTLC is positive. If the relevant verifications are correct, the corresponding HTLC is generated for the subsequent users in the payment path; otherwise, the payment will be aborted.
[0064] If each intermediate user in the path completes the contract within the specified time, the payment eventually reaches the recipient u. s , that is u n ,u n+1 The contract between s By publishing α i Propose v bitcoins; once you know α i The value of u n-1 Then we can simply calculate To launch u n-2 ,u n-1 The random number of the contract between them is published, and so on. This mechanism will enable all intermediate nodes in the route to obtain their transfer fees after the payee receives the transfer.
[0065] 8. closeChannel(δ(u0,u s ), v) → {1, 0}: shared payment channel CH ij Two users u0, u s After the transaction agreed upon by both parties is completed, the channel will be closed with the account balance locked, and the account balance on the blockchain will be updated. 1 will be returned if and only if the transaction is correctly added to the blockchain.
[0066] Example 2: This example provides a transaction process based on PCN chain, see Figure 1, user A and user B create a payment channel with an initial capacity of 10 bitcoins by instantiating a third-party account and depositing 6 bitcoins and 4 bitcoins respectively, and then conduct two transactions through intermediate nodes C, D, and E, user A pays user B 3 bitcoins and user B pays user A 5 bitcoins. Here, it is assumed that the channel transfer fee of nodes C, D, and E is 0. When the transaction ends and the channel is closed, the balance information of user A remaining 8 bitcoins and user B remaining 2 bitcoins will be written into the blockchain.
[0067] There are two differences between PCN and traditional computer temporary networks: First, in the process of transfer transactions, the fees for using the channel need to be sent to the recipient together. When charging fees according to the transaction routing order, it will cause balance requirements on different links, that is, feasibility constraints; for example, Figure 2 In the payment example shown, if user A wants to pay 3 bitcoins to user B through C, D, and E, where the channel transfer fees of nodes C, D, and E are 0.5, 1, and 0.5 bitcoins respectively, assuming that the capacity of each link channel is 10 bitcoins. To do this, she initially needs to pay 5 bitcoins (3 bitcoin payment plus 2 bitcoins, the fee charged by users in the payment path). The payment is then settled as follows: the channel capacity of user A→C is reduced by 5. In addition, if a channel usage fee of 0.5 bitcoin is required, C charges by reducing the capacity of link C→D by 4.5 bitcoins. Following the same principle, the capacity of link D→E is set to 6.5, and the capacity of link E→user B is set to 7. Second, in PCN, the transaction time is determined by the number of hops, and the user's tolerance for transaction time creates a timeliness constraint. The user specifies his maximum tolerance time in the HTLC hash time lock contract. HTLC consists of a hash lock and a time lock. In hash lock, the receiver generates a random number R and sends its hash value H to the sender. The sender or each intermediate node includes hash H in the transaction contract. The transfer funds can only be withdrawn when the confidential number R is submitted to the forwarder, which ensures the non-repudiation of payment receipt. In time lock, each transaction is subject to a completion deadline. If the forwarder does not receive the random number R within the specified time, the transfer funds will be returned.
[0068] Each energy node can obtain a pseudonym after being authenticated by participating nodes in the blockchain network, and use the pseudonym to conduct energy transactions. Since the applicant's real identity is sent to the CA for identity authentication after being signed by the applicant's P0 private key, except for the owner of the pseudonym, no node, including the energy station participating in the verification, can associate the pseudonym with the real ID of P0 before less than t participants cooperate to recover the secret. Therefore, this scheme has strong anonymity.
[0069] based on Figure 1 The transaction process, the common account balance is represented as BC , where the initial amount deposited by user A is B0, and the initial amount deposited by user B is B1. Then, multiple off-chain transactions {Tran1, Tran2, ..., Tran n}, the transfer amount of each transaction is {v1, v2, ..., v n}. When the payment channel needs to be closed at the end of the transaction, assuming that the remaining bitcoin amount of user A is b 0,n , the remaining bitcoin amount of user B is b 1,n , the balance information will be uploaded to the blockchain. When a transaction needs to be verified or a dispute needs to be arbitrated, it will be done by the authoritative certification center CA. The transaction data involved in the encryption scheme of the present invention is formalized as follows Figure 3 shown.
[0070] The data of the amounts involved in the above transactions are encrypted separately to carry out a complete encryption scheme for completely confidential transactions. The specific process is as follows Figure 4 shown.
[0071] Users who use PCN transactions need to upload the balance of the common account at the beginning of the transaction and the balance at the end to the blockchain. The HTLC regulations allow the payee to withdraw the payment only after publishing the correct HASH random number. No one can receive the transfer and deny the payment, and the payer and the intermediate node cannot get any reward before the payee receives the transfer, so as to ensure that both parties to the transaction cannot deny the existence and rationality of the transaction record. The scheme of the present invention mainly involves two aspects: a method for hiding the account balances of both parties to the transaction and a method for verifying the legitimacy of the transaction, which are analyzed separately below.
[0072] 1) Correctness analysis of hidden account balance: CA can use user A’s private key SK0 to decrypt formula M1 and obtain the amount B0 transferred by user A to the joint account.
[0073] 2) Correctness analysis of initial transaction legitimacy verification: CA can confirm whether user A’s initial transfer is legal by verifying whether the equation m1×m2=M1 holds.
[0074] 3) Algorithm security analysis: An attacker cannot obtain any information about the transfer amount or account balance from the encrypted ciphertext. Because the security of the Paillier algorithm is based on determining the n-order residue class problem, when the decomposition of n is unknown, the difficulty of cracking the Paillier encrypted ciphertext is equivalent to the decomposition of a large integer. Therefore, when the decomposition of a large integer is difficult, the encryption scheme of the present invention is secure.
[0075] Unless both parties submit their private keys for CA to verify the transaction dispute, all network nodes including CA cannot get any information about the transfer amount or account balance. At the beginning of the transaction, both parties encrypt the amount deposited in the joint account and send it to CA. CA calculates M1M2 to get the joint account balance B and uploads it to the blockchain. Before sending the first transaction, user A encrypts the current balance and the transfer amount and sends them to CA. Similarly, CA verifies the feasibility of the initial transaction by calculating whether m1×m2=M1. At the end of the transaction, both parties encrypt the account balance and send it to CA. CA verifies b 0,1 +v=B0.
[0076] This paper proposes a blockchain transaction privacy protection scheme based on homomorphic encryption, which uses the Paillier encryption algorithm to provide a privacy protection mechanism for the integrity of private data in transactions in the public blockchain. The overall scheme process is as follows: Figure 5 As shown. In addition, the PCN-based off-chain transaction scheme is used for fast P2P transactions in the Internet of Things, which overcomes the limitation caused by the long transaction confirmation time of the blockchain network, and supports the two parties to the transaction to make multiple payments quickly and frequently off-chain, where HTLC ensures the security of its transaction funds and the non-repudiation of transactions. The homomorphic encryption algorithm is combined with the PCN transaction scheme, so that the account balances and transaction amounts that the two parties need to upload to the public blockchain are presented in ciphertext. In the case of no dispute in the transaction, no private amount of the trader will be exposed. Security analysis shows that the proposed scheme provides effective integrity anonymity protection for both parties to the transaction. Compared with other schemes, while allowing users to complete transactions quickly point-to-point, it effectively solves the problem of privacy data being leaked when uploaded to the blockchain.
[0077] The above is only the specific idea of the present invention, which is for the convenience of understanding by researchers in this field. However, the implementation mode of the present invention is not limited to the above. Relevant technicians in this field can make improvements or modifications based on the present invention. All improvements or modifications based on the concept of the present invention are deemed to be within the protection scope of the present invention.
Claims
1. A blockchain transaction privacy protection method based on homomorphic encryption in the Internet of Things, characterized by: It includes the privacy data protection process based on homomorphic encryption technology and the transaction process based on the payment channel network PCN. The steps are as follows: Step 1: Establish system model: Denote the balance of the common account as B C , where the initial amount deposited by user A is B0, and the initial amount deposited by user B is B1, followed by multiple off-chain transactions {Tran1, Tran2, …, Tran n }, the transfer amount of each transaction is {v1, v2, ..., v n }, when the transaction is completed and the payment channel needs to be closed, assuming that the remaining bitcoin amount of user A is b 0,n , the remaining bitcoin amount of user B is b 1,n ,The balance information will be encrypted by both parties and uploaded to the blockchain; Step 2: Using the blockchain transaction privacy protection mechanism based on Paillier additive homomorphic encryption, both parties encrypt their own private transaction data, including the initial deposit amount B0, B1, the transfer amount {v1, v2, ..., v n }, the transaction ends with an account balance of b 0,n ,b 1,n , and then sent to the CA to verify the legitimacy of the transaction and arbitrate disputes; Step 3: After the users in the network obtain their public and private keys through verification, the two parties use the PCN network payment channel to conduct peer-to-peer transactions off-chain; Step 4: When a dispute occurs in a transaction, the CA collects the user's private key to decrypt the data and complete the transaction verification; The specific steps of step one and step two are as follows: Step 1: Generate key KeyGen()→(PKi, SKi): Randomly select two large prime numbers a and b, and find Let λ = lcm(a-1; b-1), select the parameters in So that g satisfies Definition In the above formula You can get the public key Private key SK = λ, user A's public-private key pair is (PK0, SK0), and user B's public-private key pair is (PK1, SK1); Step 2: Encrypt Enic (PK i , B i )→(M i ): Select a random number User A and user B use their private keys to encrypt the initial amounts B0 and B1 deposited into the joint account, respectively, to obtain ciphertext M1 and M2, and send the ciphertext to CA, which calculates ENC(M1, M2) to obtain the balance B of the joint account. C , and write the balance into the blockchain; Step 3: Encrypt Enc(PK i , v i , b 0,i )→(M i ): Before starting the first off-chain transaction Tran1, user A encrypts the transfer amount v1 and the account balance b after the transfer. 0,1 , obtain the ciphertext m1, m2, and send it to CA to verify the legitimacy of its initial transfer Tran1; Step 4: Encrypt Enc(PK i , b i,n )→(m i ): When the transaction ends and the payment channel needs to be closed, user A and user B will encrypt their current account balances b 0,n ,b 1,n Get the ciphertext M3, M4 and send it to CA, CA verifies ENC(M3, M4) = B C Is it true? If the equation is true, CA writes the encrypted balance (M3, M4) of both parties into the blockchain and closes the payment channel. If CA verifies the equation ENC(M3, M4) = B C If not, both parties need to submit their private keys to decrypt M3 and M4 to obtain b 0,n ,b 1,n ; Step 5: When the two parties to the transaction have a dispute over the balance of the common account uploaded by the CA to the blockchain, they need to submit their private keys respectively, and input the private key pair M1 and M2 of both parties to decrypt and obtain B0 and B1; In step 3, the transaction parties use the PCN network payment channel to conduct a point-to-point transaction off-chain. The steps are as follows: Step 3.1: The system is initialized. After each node is registered with the CA, each node becomes a legal entity. After KeyGen()→(PK i , S.K. i ) method to obtain its public and private keys and then conduct PCN transactions. Assume that from sender u0 to receiver u s Through the path (u1, u2...u i ...u n ) is a standard scheme for indirect payment; Step 3.2: Before the transaction begins, u0 executes HTLC locally, and the contract locks a bitcoins that can only be released after the contract is fulfilled as scheduled; u0 randomly selects a random string α i , and define So that j ≥ i, α j is a random string α i The random string generated according to the value range of j; Then u0 sends a i Send(α i ,y i ); Step 3.3: The sender u0 sends a s Before payment, you need to create an initial account in advance, which contains the wallet addresses of both parties to the transaction (Addr0, Addr l ), initial channel capacity β, HTLC tolerance τ, channel transfer fee f and current account balance amount, both parties verify the account information and output a channel identifier δ(u0, u s ), you can establish a payment channel The account balance is then uploaded to the Blockchain; 3.4: If there is a link from sender u0 to receiver u in PCN s The payment route, and each channel in the path There is at least a balance γ i ≥v′ i , where v′ i Represents each intermediate node u i The two parties can start the transaction only after they have confirmed the transfer amount.
