A blockchain user privacy protection method based on trusted computing
By adopting off-chain trusted execution environment equipment and VRF random node selection methods based on trusted computing in the blockchain, the problem of low privacy protection of blockchain users is solved, and efficient, secure and user-friendly privacy is achieved Trading experience.
Patent Information
- Application Number
- CN202311234664.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-09-22
AI Technical Summary
The existing blockchain technology is not efficient in user privacy protection. The Layer-One method increases security risks and incompatibility, while the Layer-Two method does not consider user interaction friendliness, resulting in complex and inefficient interactions.
Adopt blockchain user privacy protection method based on trusted computing, perform environmental equipment registration through off-chain trustworthy execution and connect with the blockchain, generate temporary public and private key pairs, perform data encryption and privacy calculations, and randomly select blockchain using VRF Node, combined with Schelling point theory, ensure the accuracy and safety of the calculation results.
It realizes transparent and efficient privacy transactions for users, reduces transaction costs, provides a user-friendly interactive experience, and ensures the security and privacy protection of transaction information.
Smart Images

Figure CN117395034B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer data information processing security technology, and specifically relates to a blockchain user privacy protection method based on trusted computing. Background Art
[0002] In the financial system, the issue of user privacy protection is becoming increasingly important, especially in the traditional financial system, where personal transactions and capital flows need to be processed by intermediaries. However, the existence of such intermediaries also creates risks for user privacy to be violated and abused. The advent of blockchain technology provides a decentralized and transparent transaction model, allowing users to trade without the help of intermediaries, and to use pseudonyms instead of real identities. However, although blockchain technology has achieved the openness and transparency of transactions, it cannot completely ensure the security of user privacy.
[0003] To address this problem, researchers have been working hard to find ways to enhance the privacy protection of blockchain transactions. One of the methods is cryptography-based techniques, such as zero-knowledge proofs, ring signatures, and homomorphic encryption, which are used to protect the transaction privacy of users on the blockchain. However, these methods require a lot of computing resources when generating proofs, which may limit their applicability in blockchain systems that rely on user hardware performance. Another privacy enhancement method is the trusted execution environment (TEE). There are two TEE-based methods: Layer-One and Layer-Two. The Layer-One method integrates TEE into the blockchain, and each blockchain node is equipped with a TEE device to complete computing and consensus. Although it is practical, this method increases the size of the trusted computing base (TCB), thereby increasing security risks and causing incompatibility with existing public chains. In contrast, the Layer-Two method separates computing from consensus, which allows TEE nodes to perform computing off-chain while reaching consensus on the blockchain, thereby improving scalability and promoting compatibility with existing blockchains. However, the Layer-Two method does not take into account the issue of user interaction friendliness. It requires complex steps to achieve interaction between users, TEE nodes, and blockchain nodes, and is not efficient. Summary of the invention
[0004] The purpose of this application is to provide a blockchain user privacy protection method based on trusted computing to achieve user-transparent and user-privacy-protected blockchain transactions, so as to overcome the problem that the prior art is not efficient enough in dealing with user privacy protection.
[0005] In order to achieve the above purpose, the technical solution of this application is as follows:
[0006] A blockchain user privacy protection method based on trusted computing is applied to a blockchain including an off-chain trusted execution environment device. The blockchain user privacy protection method based on trusted computing includes:
[0007] The trusted execution environment device under the chain is registered with the blockchain and connected to the blockchain;
[0008] The trusted execution environment device off-chain generates a temporary public-private key pair locally and submits the public key to the blockchain;
[0009] The user uses the public key obtained from the blockchain to encrypt his or her on-chain data and sends it to the blockchain;
[0010] The public storage contract deployed in the blockchain receives the encrypted data sent by the user and stores it on the blockchain;
[0011] After listening to the encrypted data uploaded to the blockchain by the user, the trusted execution environment device off the chain obtains the encrypted data and performs privacy calculations in the security zone, and uploads the final calculation results together with the corresponding proof to the blockchain;
[0012] The blockchain verifies the proof submitted by the trusted execution environment device under the chain to complete the user's state transition.
[0013] Furthermore, the public-private key pair is an RSA public-private key pair.
[0014] Furthermore, submitting the public key to the blockchain includes:
[0015] The trusted execution environment device off-chain uploads the public key information to the blockchain, where the public key information includes the public key, hash value and digital signature;
[0016] The blockchain uses the public key to decrypt the signature to obtain a summary, and compares the hash value directly extracted from the public key information with the summary. If they match, the signature is valid to verify the integrity of the public key.
[0017] Furthermore, after monitoring the encrypted on-chain data of the user, the off-chain trusted execution environment device obtains the encrypted on-chain data, including:
[0018] Use VRF random function to select random blockchain nodes;
[0019] Obtain the block header hash value of the latest block from the selected blockchain nodes, group them according to whether the block header hash values are the same or not, select a group of blockchain nodes with the largest block header hash values as the Schelling node set for this game, and randomly select a blockchain node from the Schelling node set for this game as the final selected blockchain node;
[0020] Get the detailed information of the latest block from the finally selected blockchain node, thereby obtaining the user's encrypted on-chain data.
[0021] Furthermore, the trusted execution environment device under the chain is registered with the blockchain and establishes a connection with the blockchain, including:
[0022] The trusted execution environment device off-chain first performs remote authentication and generates an authentication report and submits it to the blockchain;
[0023] After the blockchain verifies the availability of the trusted execution environment device off-chain, it completes the registration of the trusted execution environment device off-chain on the blockchain and establishes a connection with it.
[0024] Furthermore, the public storage contract deployed in the blockchain receives the encrypted on-chain data sent by the user and stores it on the blockchain, including:
[0025] The public storage contract is provided with a function function. After the encrypted on-chain data sent by the user triggers an event corresponding to the function function, the function corresponding to the event receives the encrypted on-chain data sent by the user and stores it in a corresponding data structure on the blockchain.
[0026] This application proposes a blockchain user privacy protection method based on trusted computing, which enables users using blockchain to operate and submit data on the blockchain client and easily realize private transactions between each other. This approach simplifies transaction operations, reduces transaction costs, and can protect the security of user transaction information, while providing a user-friendly interactive experience.
[0027] This application ensures that the state changes on the blockchain reflect the correct execution of the given state and input through the confidential smart contract; when the system is running correctly, user input, calculation logic and calculation output remain private, and only the participants can see their own private information; when receiving transactions from the blockchain, it ensures that the messages received by the recipient are always the latest and continuous, ensuring freshness; making the client a lightweight application, users only need to complete operations on the blockchain client, which is convenient for user interaction. This application has many advantages in blockchain privacy transactions, providing users with many excellent features such as convenience, security, and privacy protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a flow chart of the blockchain user privacy protection method based on trusted computing in this application.
[0029] Figure 2 This is a schematic diagram of the device interaction for this application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] As an alternative to cryptography-based privacy protection technology, the Trusted Execution Environment (TEE) implements secure computing based on memory isolation based on hardware-secure CPUs, which can complete privacy-protected computing while ensuring computing efficiency. However, the current TEE Layer-One method is to deploy TEE devices on each blockchain node, and the Layer-Two method is for users to interact directly with TEE. The interaction between users, TEE nodes, and blockchain nodes is relatively complex and inefficient.
[0032] In one embodiment, Figure 1 , Figure 2 As shown, a blockchain user privacy protection method based on trusted computing is provided, which is applied to a blockchain including an off-chain trusted execution environment device, including:
[0033] Step S1: The trusted execution environment device under the chain is registered with the blockchain and establishes a connection with the blockchain.
[0034] In this embodiment, the trusted execution environment TEE device off-chain first performs remote authentication and generates an authentication report Report, which is submitted to the blockchain. After the blockchain platform verifies the availability of the TEE device, the TEE device is registered on the blockchain and a connection is established with it.
[0035] Specifically, the TEE device obtains the corresponding availability report (Report) by remotely authenticating with the Intel Attestation Service (IAS) off-chain, which proves that confidential computing is running in the secure area (enclave) of the TEE environment. The TEE device submits the obtained availability report (Report) to the blockchain. Subsequently, the blockchain platform verifies the availability of the TEE device to ensure that the device is trustworthy. After successful verification, a trusted connection with the TEE device is established.
[0036] Step S2: The trusted execution environment device off-chain generates a temporary public-private key pair locally and submits the public key to the blockchain.
[0037] In this embodiment, the TEE device generates a temporary public-private key pair (pk tx ,sk tx ), and the public key pk txSubmit to the chain for users to use. Users can query the public pk tx , and use pk tx The amount to be deposited, withdrawn or transferred is encrypted and the encrypted result is submitted to the chain through the blockchain client.
[0038] In a specific embodiment, the TEE device generates an RSA public-private key pair (pk tx ,sk tx ), each device has its own RSA key pair, in which the public key (pk tx ) information will be submitted and stored on the blockchain for users to encrypt information, and the private key (sk tx ) is securely stored in the local TEE device. When the TEE device monitors the user's encrypted data information on the chain, it can perform decryption operations.
[0039] In the key storage process, TEE first uploads the public key information to the blockchain. The public key information is represented by the public key pk tx 、Hash value hash(pk tx ) and digital signature sign(pk tx ). Then, the nodes in the blockchain use the public key pk tx Verify sign(pk tx ). The hash value can be hashed by applying the SHA-256 algorithm to the public key pk to ensure that the public key is not leaked.
[0040] When verifying, the blockchain uses the public key pk tx Decryption sign(pk tx ) signature to obtain the digest, and compare the hash value directly extracted from the public key information with the digest. If they match, the signature is valid to verify the integrity of the public key. This verification allows the public key to be stored on the blockchain, enhancing the security measures for confidential user input and preventing unauthorized data modification, further strengthening preventive measures and preventing attempts at tampering or forgery.
[0041] Step S3: The user uses the public key obtained from the blockchain to encrypt his or her own on-chain data and sends it to the blockchain.
[0042] Users can log in to the blockchain platform through the blockchain client. Users register account information on the blockchain and submit initial balances, and easily process their transactions through the client.
[0043] Users can query the public key (pk tx), and use the public key to encrypt the on-chain data (such as the amount to be deposited, withdrawn, or transferred). The user submits the encrypted information through the blockchain client, which includes the amount used by the user for the transaction and other information to be protected. These data requests can cover deposit, withdraw, and transfer operations, where deposit operations include information such as fromAddress, fromBalance, and value; transfer operations include information such as fromAddress, fromBalance, toAddress, toBalance, and value; and withdrawal operations include information such as fromAddress, fromBalance, and value. After the user encrypts this information, the encrypted result can be submitted to the chain through the blockchain client.
[0044] Step S4: The public storage contract deployed in the blockchain receives the encrypted on-chain data sent by the user and stores it on the blockchain.
[0045] In this embodiment, a public storage contract named AcepSC is deployed on the blockchain. Once the blockchain receives the encrypted data that the user wants to store, the data will be stored on the chain, and these data are all signed by the public key (pk tx ) is encrypted and uploaded. The public storage contract defines three functions (fund deposit, transfer transfer, and withdraw withdrawal). After the encrypted on-chain data sent by the user triggers the event corresponding to the function, the function corresponding to the event receives the encrypted on-chain data sent by the user and stores it in the corresponding data structure on the blockchain.
[0046] The data submitted by the user is all through the public key (pk tx ) is encrypted and uploaded, so the corresponding private key is needed for decryption. The RSA encryption algorithm in the asymmetric encryption algorithm is used here. The corresponding public key can be generated from the private key, but it is extremely difficult to reversely calculate the public key to generate the private key. This means that only those who have the corresponding private key (sk tx ) TEE device can decrypt and obtain the user's encrypted information, thereby effectively protecting the user's privacy and enhancing the security of the system.
[0047] Step S5: After listening to the user's encrypted on-chain data, the trusted execution environment device off-chain obtains the encrypted on-chain data and performs privacy calculations in the security zone, and uploads the final calculation results together with the corresponding proof to the blockchain.
[0048] After the TEE device is authenticated and available, it can run the web3js program in the application and establish a full connection mode with the blockchain through websocket. Once the connection is established, the data generated by the blockchain can be actively sent to the TEE device, and the TEE device can also obtain the data on the blockchain through monitoring and maintain the connection status throughout the process.
[0049] The trusted execution environment device (TEE device) under the chain needs to monitor the user's encrypted on-chain data. After monitoring the user's encrypted on-chain data stored in the blockchain, the user's encrypted on-chain data is obtained from the blockchain for privacy calculation. The TEE device monitors the user's encrypted on-chain data by monitoring whether a new block appears on the blockchain. When a new block appears, there will be a new block hash value. According to the different block hash values, it can be known that a new block has been generated. I will not go into details here. When the user's encrypted on-chain data is stored in the blockchain, a new block will be generated. Therefore, after the TEE device monitors the new block, it will obtain data from the blockchain node.
[0050] After the TEE device detects a new block, it will choose which blockchain node to obtain data from. Generally speaking, it can randomly select a blockchain node to obtain data. In order to avoid dependence on a single data source and reduce the risk of damage or attack, a specific embodiment of the present application includes:
[0051] 5.1. Use VRF random function to select random blockchain nodes.
[0052] The blockchain node generates a random number ri through the VRF random function using the block information and public key. After TEE obtains the random number R = {r1, r2, r3, …, rn}, it selects a random number that belongs to the specified threshold (for example, selects a node within the range of the generated random number r∈(20,40)), and the corresponding node is the selected node.
[0053] By establishing connections with multiple randomly selected nodes, TEE avoids reliance on a single data source while reducing the risk of corruption or attack, thereby enhancing the integrity of the system.
[0054] Block information includes block header and block body. The block header contains the block hash, which uniquely identifies the block; the block body contains smart contract transactions.
[0055] 5.2. Obtain the block header hash value of the latest block from the selected blockchain nodes, group them according to whether the block header hash values are the same or not, select the group of blockchain nodes with the largest block header hash values as the Schelling node set for this game, and randomly select a blockchain node from the Schelling node set for this game as the final selected blockchain node.
[0056] After selecting multiple blockchain nodes, the TEE device requests the latest block information from these blockchain nodes. The block body contains smart contract transactions, and the public storage contract belongs to the specific part of the block body (transaction field). That is, the TEE device uses the web3 API to obtain transaction data such as block headers and transaction lists.
[0057] The game theory method of Schelling point is the choice tendency of people in game theory without communication. This choice may be made because it seems natural, special, or related to the chooser. Blockchain nodes cannot communicate with each other. In this case, participants cannot negotiate the results through communication, but can only focus on a Schelling point to obtain the final reward. That is, only when most of the results submitted by participants are the same can they get rewards. Using the Schelling point theory, nodes can find the focus point to submit the correct information. By setting a public game point, that is, submitting the correct block header information to obtain rewards, the behavior of nodes can be coordinated, making it easier for nodes to reach cooperation and trust. In the absence of mutual communication, setting a public game point can motivate nodes to submit true answers, because in terms of effort, this is the cheapest thing that nodes can do.
[0058] Among the multiple block header information obtained, the game theory method based on Schelling point is used to improve the accuracy of block header information. Multiple random nodes are prompted to submit the latest block header information (block header hash value) at the same time, and then the information is classified according to whether the value is the same or not. Finally, the group with the most stored hash values is selected as the Schelling point of this game. Therefore, TEE can obtain the latest and most trusted block header and transaction data from most nodes.
[0059] Finally, a blockchain node is randomly selected from the Schelling point and its latest transaction data is obtained for privacy calculation.
[0060] 5.3. Obtain detailed information of the latest block from the finally selected blockchain node, thereby obtaining the user's encrypted on-chain data.
[0061] There is a Transactions field in the block information, and there are nonce and receipt in Transactions. Nonce is the serial number of each transaction, and receipt contains the input + value (transaction value) of each transaction.
[0062] Traverse the transactions list:
[0063] Get the transaction nonce information through web3.eth.getTransaction(transactionHash);
[0064] Get the transaction receipt through web3.eth.getTransactionReceipt(transactionHash), which contains the log records generated under the transaction;
[0065] Through web3.eth.abi.decodeLog(), pass in the ABI of the log record data, subject, and event, parse the content of the log record, and you can get the user's encrypted on-chain data.
[0066] This application uses a combination of VRF and Schelling point to randomly communicate with blockchain nodes to obtain block information. When user data is detected and verified, the TEE device calls the confidentiality program in the enclave to perform privacy calculations.
[0067] Through the above strategies, this application ensures that the block header information obtained by TEE is up-to-date and highly credible, while overcoming the dependence on a single data source and improving the security and robustness of the system.
[0068] TEE's privacy computing is a relatively mature technology in the existing technology and will not be elaborated here. Taking transfer as an example, for the user's privacy transactions, the transfer amount and the object of the transfer need to be protected. After obtaining the encrypted on-chain data, the TEE device performs privacy calculations in the security zone and obtains a certificate containing the settlement result and digitally signed. The settlement result includes the user's transfer amount, the calculation to be performed by the user (the sender's net worth minus the transfer amount, the receiver's net worth plus the transfer amount), and the specific transaction function to be performed "transfer".
[0069] Step S6: The blockchain verifies the proof submitted by the trusted execution environment device under the chain to complete the user's state transition.
[0070] After the privacy calculation is completed, the TEE device uploads the final calculation result together with the corresponding proof to the blockchain. Subsequently, the blockchain node verifies this data and completes the user's state transition. In this way, the user can obtain his or her own state information from the blockchain, and during the entire execution process, the user and others cannot view the intermediate execution details, thus realizing the user's privacy transaction.
[0071] Specifically, after the TEE device completes the calculation, it will generate the final calculation result (i.e., the account value), and then use the private key inside the TEE device to digitally sign the calculation result, and submit it to the blockchain as a proof of the correctness of the calculation result. Subsequently, the blockchain node will use the corresponding public key to verify this data to ensure that the data has not been tampered with. Once the verification is successful, the blockchain node will complete the user's state transition and record the transition in the blockchain block, so that all nodes know that the user's state has changed.
[0072] In the technical solution of this application, after the privacy calculation is completed, the TEE device uploads the final calculation result together with the corresponding proof to the blockchain. Subsequently, the blockchain node verifies this data to complete the user's state transition. This process ensures the correctness of the transaction and the integrity of the data. Users can obtain their own status information from the blockchain, and during the entire execution process, users and others cannot view the intermediate execution details, thereby realizing the user's private transactions. This method protects the user's transaction privacy and data security, so that sensitive information will not be exposed to the public network. By performing privacy calculations on the blockchain and uploading the encrypted calculation results, the user's privacy is effectively protected. After verification by the blockchain node, the credibility and security of the transaction are ensured.
[0073] During the entire transaction process, users only need to interact with the blockchain through the client, and users do not need to worry about the risk of data leakage or tampering. This achieves a user-friendly interactive experience, thereby achieving convenient and secure transactions. Only in certain circumstances can verified data be publicly viewed, protecting the privacy of users. This privacy protection mechanism provides users with a safe and confidential transaction environment, adding a strong privacy protection barrier to the development of blockchain technology.
[0074] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A blockchain user privacy protection method based on trusted computing, applied to a blockchain including an off-chain trusted execution environment device, characterized in that: The blockchain user privacy protection method based on trusted computing includes: The trusted execution environment device under the chain is registered with the blockchain and connected to the blockchain; The trusted execution environment device off-chain generates a temporary public-private key pair locally and submits the public key to the blockchain; The user uses the public key obtained from the blockchain to encrypt his or her on-chain data and sends it to the blockchain; The public storage contract deployed in the blockchain receives the encrypted data sent by the user and stores it on the blockchain; After listening to the encrypted data uploaded to the blockchain by the user, the trusted execution environment device off the chain obtains the encrypted data and performs privacy calculations in the security zone, and uploads the final calculation results together with the corresponding proof to the blockchain; The blockchain verifies the proof submitted by the trusted execution environment device under the chain and completes the user's state transition; The trusted execution environment device under the chain obtains the encrypted on-chain data after monitoring the encrypted on-chain data of the user, including: Use VRF random function to select random blockchain nodes; Obtain the block header hash value of the latest block from the selected blockchain nodes, group them according to whether the block header hash values are the same or not, select a group of blockchain nodes with the largest block header hash values as the Schelling node set for this game, and randomly select a blockchain node from the Schelling node set for this game as the final selected blockchain node; Get the detailed information of the latest block from the finally selected blockchain node, thereby obtaining the user's encrypted on-chain data.
2. The blockchain user privacy protection method based on trusted computing as claimed in claim 1, characterized in that: The public-private key pair is an RSA public-private key pair.
3. The blockchain user privacy protection method based on trusted computing as claimed in claim 1, characterized in that: Submitting the public key to the blockchain includes: The trusted execution environment device off-chain uploads the public key information to the blockchain, where the public key information includes the public key, hash value and digital signature; The blockchain uses the public key to decrypt the signature to obtain a summary, and compares the hash value directly extracted from the public key information with the summary. If they match, the signature is valid to verify the integrity of the public key.
4. The blockchain user privacy protection method based on trusted computing as claimed in claim 1, characterized in that: The trusted execution environment device under the chain is registered with the blockchain and connected to the blockchain, including: The trusted execution environment device off-chain first performs remote authentication and generates an authentication report and submits it to the blockchain; After the blockchain verifies the availability of the trusted execution environment device off-chain, it completes the registration of the trusted execution environment device off-chain on the blockchain and establishes a connection with it.
5. The blockchain user privacy protection method based on trusted computing as claimed in claim 1, characterized in that: The public storage contract deployed in the blockchain receives the encrypted data sent by the user and stores it on the blockchain, including: The public storage contract is provided with a function function. After the encrypted on-chain data sent by the user triggers an event corresponding to the function function, the function corresponding to the event receives the encrypted on-chain data sent by the user and stores it in a corresponding data structure on the blockchain.
