Privacy protection method and system based on homomorphic encryption and blockchain

By employing multi-key fully homomorphic encryption, hash commitment mechanism, and zero-knowledge proof technology, the problems of high computational complexity and large storage overhead in blockchain privacy protection are solved, enabling efficient and secure transaction data processing and smart contract verification, and improving the scalability and privacy protection capabilities of the blockchain.

CN120541863BActive Publication Date: 2026-02-03内蒙古自治区教育考试院 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510714544.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2026-02-03
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

Existing blockchain privacy protection technologies suffer from high computational complexity, poor smart contract compatibility, and high storage overhead, making them difficult to widely apply in data-sensitive industries.

Method used

The transaction amount is encrypted using multi-key fully homomorphic encryption, transaction metadata is stored using a hash commitment mechanism, and a homomorphic encryption computation module is introduced into the smart contract. Zero-knowledge proof and multi-party computation techniques are used to transfer the computation task off-chain, and the legality of the transaction is verified through proxy homomorphic signature and hash commitment mechanism.

Benefits of technology

It reduces computational complexity, improves the security and efficiency of privacy protection, reduces storage overhead, enhances the compatibility of smart contracts with encrypted data, increases the throughput and transaction processing efficiency of the blockchain, and ensures the integrity and immutability of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120541863B_ABST
    Figure CN120541863B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of blockchain privacy protection, and discloses a homomorphic encryption and blockchain privacy protection method and system, which encrypts a transaction amount through multi-key full homomorphic encryption, and stores transaction metadata in combination with a hash commitment mechanism, so that the data on the chain is always in an encrypted state, and unauthorized access is prevented.Secondly, in order to solve the problem that a smart contract cannot directly process ciphertext, the scheme adopts homomorphic calculation combined with zero-knowledge proof, so that the smart contract can verify the legality of a transaction without decrypting the data, and multi-party calculation is combined to reduce the calculation burden.Finally, in order to optimize the storage and query efficiency, off-chain encrypted storage is combined, only the encrypted hash value is stored on the chain, and proxy homomorphic signature is adopted to enhance data access permission management, so that the scalability and calculation efficiency of the blockchain are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain privacy protection technology, and in particular to a privacy protection method and system based on homomorphic encryption and blockchain. Background Technology

[0002] Blockchain technology, with its decentralized, immutable, and transparent characteristics, has been widely applied in fields such as financial payments, medical data management, and government data sharing. However, its public ledger nature makes all transaction data publicly visible on-chain, which can easily lead to user privacy leaks. For example, even though transaction addresses are anonymous, attackers can deduce the identity of the transacting party and the transaction amount through on-chain analysis technology. This privacy issue limits the application of blockchain in data-sensitive industries and has spurred the development of various privacy protection schemes. Existing research indicates that blockchain privacy protection technologies mainly include zero-knowledge proofs (ZKP), homomorphic encryption (HE), ring signatures, and coin mixing technology. However, these technologies suffer from high computational complexity, poor smart contract compatibility, and high storage overhead. For example, traditional ZKP schemes rely on complex mathematical calculations, resulting in long transaction verification times; homomorphic encryption (HE) cannot be directly applied to smart contracts and is difficult to process directly, while anonymous transaction methods based on ring signatures or coin mixing technology may face regulatory compliance issues. Summary of the Invention

[0003] This invention provides a privacy protection method based on homomorphic encryption and blockchain, aiming to solve the technical problems of high computational complexity, poor smart contract compatibility, and large storage overhead in existing blockchain privacy protection technologies.

[0004] This invention provides a privacy protection method based on homomorphic encryption and blockchain, comprising:

[0005] Acquire transaction data, wherein the transaction data includes transaction amount and transaction metadata;

[0006] The transaction amount is encrypted using multi-key fully homomorphic encryption, and ciphertext is generated and stored in an off-chain database.

[0007] Transaction metadata is stored off-chain based on a hash commitment mechanism.

[0008] Execute smart contracts on the blockchain and introduce homomorphic cryptographic computation modules into the smart contracts to directly compute the ciphertext;

[0009] Simultaneously, zero-knowledge proof technology and multi-party computation technology are introduced to transfer the computation task of directly computing the ciphertext to an off-chain database, and the multi-party computation server executes and generates the target proof. The smart contract verifies the validity of the target proof.

[0010] Smart contracts verify the legality of transactions based on proxy homomorphic signatures and hash commitment mechanisms.

[0011] Preferably, the step of encrypting the transaction amount based on multi-key fully homomorphic encryption and generating ciphertext includes:

[0012] The sender generates the first public / private key based on the transaction amount;

[0013] The recipient generates a second public / private key based on the transaction amount;

[0014] The first public-private key and the second public-private key are jointly encrypted using multi-key fully homomorphic encryption to obtain the ciphertext.

[0015] Preferably, the step of storing transaction metadata off-chain based on the hash commitment mechanism includes:

[0016] Retrieve the index information from the transaction metadata and store the index information on the blockchain in the form of a root hash;

[0017] Other transaction metadata, excluding index information, is distributed and stored in different blocks in the form of hash numbers, and the root hash corresponding to other transaction metadata is stored on each second blockchain chain.

[0018] Preferably, the step of introducing a homomorphic cryptographic computation module into the smart contract to directly compute the ciphertext includes:

[0019] Introduce homomorphic cryptographic computation modules into smart contracts;

[0020] Obtain pre-compiled contract instructions;

[0021] Based on contract instructions, the same-platform computing module is invoked to perform homomorphic operations such as addition, subtraction, multiplication, and division on the ciphertext.

[0022] Preferably, the smart contract completes the transaction legality verification steps based on proxy homomorphic signatures and hash commitment mechanisms, including:

[0023] User equipment generates a proxy key with a time window and operation permissions based on an attribute-based encryption strategy, and authorizes it to the proxy device through blockchain signature;

[0024] The agent device signs the encrypted text in the off-chain database of the blockchain based on the agent key and generates a zero-knowledge identity authentication protocol development certificate. The agent key is generated based on the homomorphic encryption key.

[0025] The agent device submits the zero-knowledge identity authentication protocol development certificate in batches to the multi-party computing server cluster to complete the aggregation of computing tasks;

[0026] Obtain the hash tree path of multiple blockchain nodes based on the hash commitment mechanism;

[0027] Smart contracts use a random sampling mechanism to randomly verify the availability of the hash tree path of the target blockchain node;

[0028] If the hash tree path of the target blockchain node is available, the proxy device is defined as a compliant proxy device.

[0029] It also incorporates penalty contracts to constrain the behavior of malicious nodes across multiple blockchain nodes;

[0030] The key management contract periodically and automatically rotates a portion of the homomorphic encryption keys and synchronizes them to the multi-party computing server cluster.

[0031] The smart contract verifies the validity of the attribute-based encryption strategy in real time and only allows compliant proxy devices to access the off-chain ciphertext hash.

[0032] Preferably, in the step of the user equipment generating a proxy key with a time window and operation permissions based on the attribute-based encryption strategy, when the authorization conditions of the proxy key are triggered to change, a proof is developed based on the zero-knowledge identity authentication protocol to achieve decentralized strategy migration and consistency verification.

[0033] As a preferred approach, when applied to large-scale computing scenarios, the multi-party computing server adopts a sharded aggregation architecture, which splits the computing tasks of the off-chain database of the blockchain into parallel subtasks and executes them in shards. After each shard generates a local proof, multiple local proofs are aggregated into a target proof based on recursive proof technology.

[0034] The present invention also provides a privacy protection system based on homomorphic encryption and blockchain, including multiple execution modules, which are used to implement the steps of any of the methods described above.

[0035] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.

[0036] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.

[0037] The beneficial effects of this invention are as follows: This application employs multi-key fully homomorphic encryption and zero-knowledge proof technology, ensuring that transaction data is calculated and verified under a fully encrypted state throughout the process. Compared with traditional zero-knowledge proof schemes, this reduces computational complexity and improves privacy protection security. Secondly, unlike the high computational overhead of traditional fully homomorphic encryption, this application combines partial homomorphic encryption and secure multi-party computation. To ensure the hash consistency of off-chain data and prevent tampering, zero-knowledge proof technology is used to verify the consistency between off-chain data and the hash value stored on-chain, without exposing the data itself. The off-chain multi-party computation server calculates the hash value and generates a zero-knowledge proof (target proof). The blockchain smart contract verifies the validity of the proof, which also reduces the on-chain computational burden and improves blockchain throughput and transaction processing efficiency. Furthermore, this application enhances the compatibility of smart contracts with encrypted data through proxy homomorphic signatures and hash commitment mechanisms, enabling them to complete transaction legality verification without decrypting the data. Traditional solutions struggle to efficiently compute encrypted data in smart contracts. Finally, this application employs off-chain encrypted storage, which significantly reduces on-chain storage overhead compared to existing solutions, improves system scalability, and ensures the integrity and immutability of transaction data. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of a method flow according to an embodiment of the present invention.

[0039] Figure 2 This is a schematic diagram of the specific process of step S6 in an embodiment of the present invention.

[0040] Figure 3 This is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.

[0041] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0042] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0043] like Figure 1-3 As shown, this invention applies for a privacy protection method based on homomorphic encryption and blockchain, comprising:

[0044] S1. Obtain transaction data, wherein the transaction data includes transaction amount and transaction metadata;

[0045] S2. Encrypt the transaction amount based on multi-key fully homomorphic encryption and generate ciphertext, which is then stored in an off-chain database.

[0046] S3. Store transaction metadata off-chain based on the hash commitment mechanism;

[0047] S4. Execute smart contracts on the blockchain and introduce homomorphic cryptographic computation modules into the smart contracts to directly compute the ciphertext;

[0048] S5. Simultaneously, zero-knowledge proof technology and multi-party computation technology are introduced to transfer the computation task of directly computing the ciphertext to the off-chain database, and the multi-party computation server executes and generates the target proof. The smart contract verifies the validity of the target proof.

[0049] S6: Smart contracts verify the legality of transactions based on proxy homomorphic signatures and hash commitment mechanisms.

[0050] As described in steps S1-S6 above, current blockchain privacy protection mainly relies on zero-knowledge proofs (ZKP) and fully homomorphic encryption (FHE). However, these technologies have high computational complexity. For example, zero-knowledge proof algorithms require complex exponential operations during transaction verification, while fully homomorphic encryption has extremely high computational costs, making it difficult to achieve efficient transactions in a blockchain environment. Furthermore, homomorphic encryption based on the Paillier algorithm, although having lower computational overhead, cannot meet the needs of high-throughput blockchain networks. This application employs multi-key fully homomorphic encryption and zero-knowledge proof technology, ensuring that transaction data is calculated and verified under end-to-end encryption. Compared to traditional zero-knowledge proof schemes, this reduces computational complexity and improves privacy protection security. Secondly, unlike the high computational overhead of traditional fully homomorphic encryption, this application combines partial homomorphic encryption and secure multi-party computation. To ensure the hash consistency of off-chain data and prevent tampering, zero-knowledge proof technology is used to verify the consistency between off-chain data and the hash value stored on-chain, without exposing the data itself. An off-chain multi-party computation server calculates hash values ​​and generates zero-knowledge proofs (target proofs). The blockchain smart contract verifies the validity of the proofs, reducing on-chain computational burden and improving blockchain throughput and transaction processing efficiency. Furthermore, this application enhances the compatibility of smart contracts with encrypted data through proxy homomorphic signatures and hash commitment mechanisms, enabling transaction legitimacy verification without data decryption. Traditional solutions struggle to efficiently compute encrypted data within smart contracts. Finally, this application employs off-chain encrypted storage, significantly reducing on-chain storage overhead compared to existing solutions, improving system scalability, and ensuring the integrity and immutability of transaction data. In addition, to ensure hash consistency of off-chain data and prevent tampering, zero-knowledge proofs are used to verify the consistency between off-chain data and on-chain stored hash values ​​without exposing the data itself. The off-chain server calculates hash values ​​and generates zero-knowledge proofs, which are then verified by the blockchain smart contract. To improve efficiency, batch proof technology is used to merge multiple verification requests, reducing computational burden. Simultaneously, security is enhanced through multi-party verification and periodic random sampling, and public keys are pre-computed to accelerate proof generation. All verification records are tracked in the on-chain log to ensure transparency and auditability.

[0051] In one embodiment, step S2, which encrypts the transaction amount based on multi-key fully homomorphic encryption and generates ciphertext, includes:

[0052] S21. The sender generates the first public / private key based on the transaction amount;

[0053] S22. The recipient generates a second public / private key based on the transaction amount;

[0054] S23. The first public-private key and the second public-private key are jointly encrypted based on multi-key fully homomorphic encryption to obtain ciphertext.

[0055] As described in steps S21-S23 above, the first step in blockchain privacy protection is to ensure the encrypted storage of transaction data. First, users encrypt the transaction amount using Multi-Key Fully Homomorphic Encryption (MKFHE). The transaction amount is jointly encrypted using the public keys of the sender and receiver, and the resulting ciphertext is stored on the blockchain, making it unreadable without authorization. Transaction metadata (such as the transaction initiator, receiver, and timestamp) is stored using a hash commitment mechanism and verified only when necessary, while the encrypted transaction amount (ciphertext) is stored in an off-chain database.

[0056] In one embodiment, step S3, which involves off-chain storage of transaction metadata based on a hash commitment mechanism, includes:

[0057] S31. Obtain the index information from the transaction metadata and store the index information on the blockchain in the form of a root hash.

[0058] S32. Other transaction metadata, except for index information, are distributed and stored in different blocks in the form of hash numbers, and the root hash corresponding to other transaction metadata is stored on each second blockchain chain.

[0059] As described in steps S31-S32 above, existing privacy protection schemes mainly rely on encryption technologies such as ring signatures and blind signatures to hide transaction amounts and user identities. However, these schemes typically have high computational complexity and cannot support multi-party joint encryption. Furthermore, traditional blockchain privacy protection technologies usually store the complete ciphertext of the transaction on-chain, resulting in a significant storage and computational burden and making it difficult to scale to large-scale transaction environments. This scheme introduces multi-key fully homomorphic encryption, allowing multiple public keys to encrypt the same transaction amount, enabling different users to perform legitimate calculations on the ciphertext without decryption. The blockchain only stores the hash index information of the transaction; the actual data is distributed and stored in different blocks (e.g., block 1, block 2, block 3) and organized using a hash tree. Only the root hash is stored on-chain, thereby reducing storage overhead. Simultaneously, this application adopts an "on-chain-off-chain collaborative storage" model, where encrypted transaction data is stored off-chain, and only the hash index is stored on-chain, significantly reducing the storage cost of the blockchain.

[0060] In one embodiment, step S4, which involves introducing a homomorphic cryptographic computation module into the smart contract to directly compute the ciphertext, includes:

[0061] S41. Introduce a homomorphic cryptographic computation module into smart contracts;

[0062] S42, Obtain the pre-compiled contract instructions;

[0063] S43. Call the same-platform computing module based on the contract instruction to perform homomorphic operations such as addition, subtraction, multiplication and division on the ciphertext.

[0064] As described in steps S41-S43 above, after encrypted storage, transaction verification and calculation must be performed in the ciphertext state to ensure the legality and security of the transaction. This application enables smart contracts to perform calculations on ciphertext through homomorphic encryption technology, and combines zero-knowledge proofs and multi-party computation techniques to improve privacy protection and computational efficiency. For example, the homomorphic encryption operation module can be the SEAL library, which supports homomorphic operations such as addition and multiplication on encrypted data. In smart contracts, these homomorphic operations can be called through pre-compiled contract instructions to directly calculate encrypted transaction data (such as balance, amount, etc.) without decryption, thus ensuring privacy protection. In addition, when performing ciphertext calculations in a transfer transaction, assuming the user's account balance is balance and the transaction amount is amount, these two values ​​will be encrypted using a homomorphic encryption algorithm to obtain the encrypted ciphertext Enc(balance) and Enc(amount). In the transfer transaction, the smart contract calculates Enc(balance) - Enc(amount) by calling homomorphic addition (or homomorphic subtraction) operations, thereby obtaining the account balance after the transfer. The specific formula is: Enc(balance) − Enc(amount) = Enc(balance − amount). During transaction verification, to verify whether the user's account balance is sufficient to pay the transaction amount, the user generates a proof that Enc(balance) ≥ Enc(amount). This proof is generated using a zero-knowledge proof algorithm. After receiving the proof, the smart contract does not need to decrypt `balance` and `amount`, but directly verifies the validity of the zero-knowledge proof, thus confirming whether the balance is sufficient. Even better, for complex computational scenarios (such as transaction statistics involving multiple users), an off-chain multi-party computation (MPC) server is responsible for performing the computation and generating the zero-knowledge proof. The blockchain smart contract only verifies the zero-knowledge proof and does not need to perform the computation. This application combines homomorphic encryption, zero-knowledge proofs, and multi-party computation technologies to achieve transaction verification and computation under privacy protection. Integrating a homomorphic computation module into the smart contract enables the blockchain to directly process encrypted data without decryption, avoiding data leakage. Simultaneously, by introducing multi-party computation technology and a zero-knowledge proof joint computation mode, complex computational tasks are transferred off-chain, where multi-party computation servers execute and generate zero-knowledge proofs. On-chain smart contracts only need to verify these zero-knowledge proofs, significantly reducing computational overhead. Furthermore, pre-compiled contract instructions are used to optimize smart contract calls to homomorphic computation, reducing contract execution costs, and batch zero-knowledge verification technology is used to merge multiple transaction verification requests, improving efficiency. Compared to existing solutions, this application demonstrates significant improvements in computational performance, privacy protection, and scalability, making it suitable for large-scale blockchain privacy transaction scenarios.

[0065] In one embodiment, step S6 of the smart contract completing transaction legality verification based on proxy homomorphic signatures and hash commitment mechanisms includes:

[0066] S61. The user equipment generates a proxy key with a time window and operation permissions based on the attribute-based encryption strategy, and authorizes it to the proxy device through blockchain signature;

[0067] S62. The agent device signs the encrypted text in the off-chain database of the blockchain according to the agent key and generates a zero-knowledge identity authentication protocol development certificate, wherein the agent key is generated according to the homomorphic encryption key;

[0068] S63. The agent device submits the zero-knowledge identity authentication protocol development certificate in batches to the multi-party computing server cluster to complete the aggregation of computing tasks;

[0069] S64. Obtain the hash tree path of multiple blockchain nodes based on the hash commitment mechanism;

[0070] S65. Smart contracts use a random sampling mechanism to randomly verify the availability of the hash tree path of the target blockchain node;

[0071] S66. If the hash tree path of the target blockchain node is available, define the proxy device as a compliant proxy device.

[0072] S67, and combine penalty contracts to constrain the behavior of malicious nodes in multiple blockchain nodes;

[0073] S68. The key management contract periodically and automatically rotates some homomorphic encryption keys and synchronizes them to the multi-party computing server cluster.

[0074] S69. The smart contract verifies the validity of the attribute-based encryption strategy in real time and only allows compliant agent devices to access the off-chain ciphertext hash.

[0075] As described in steps S61-S69 above, this application can achieve efficient querying and security optimization of the blockchain through the above steps. Specifically, through on-chain and off-chain collaborative verification and dynamic key management mechanisms, efficient execution and secure control of privacy computation can be achieved. For example, user A can generate a proxy key sk_proxy with a time window (e.g., 2023Q1-Q4) and operation permissions (e.g., query only or verifiable computation) based on the attribute-based encryption (ABE) strategy, and authorize it to proxy B through blockchain signing; proxy B uses sk_proxy to sign off-chain encrypted data and generate zk-STARKs (zero-knowledge identity authentication protocol development) proofs, and submits them in batches to the multi-party computation server cluster to complete the aggregation of computation tasks. The smart contract requires nodes to provide hash tree paths to verify data availability through a random sampling mechanism, and combines this with a penalty contract to constrain the behavior of malicious nodes. The key management contract automatically rotates some homomorphic encryption keys periodically (e.g., every 24 hours) and synchronizes them to the off-chain multi-party computation server cluster to ensure forward security. Meanwhile, the smart contract verifies the validity of the ABE (Attribute-Based Encryption) strategy in real time, allowing only compliant agents to access off-chain ciphertext hashes. During the audit process, the zk-STARKs proofs and hash tree paths submitted by agent B are verified on-chain, enabling compliance audits to be completed without decrypting the data. By performing complex calculations and generating lightweight proofs through an off-chain multi-party computation server cluster, batch verifying transactions through on-chain smart contracts, and linking dynamic agent keys with the attribute-based encryption strategy, the verification overhead and Gas costs are significantly reduced while ensuring data encryption throughout its entire lifecycle. Gas costs (a unit of measurement for workload on Ethereum, similar to CPU time in a computer; various operations on Ethereum, such as transfers, smart contract deployments, and contract executions, all consume Gas. Gas costs include Gas limit (the maximum amount of Gas a user is willing to pay) and Gasprice (the price a user is willing to pay per Gas unit)) are supported, enabling cross-institutional audits and high-concurrency scenarios, providing a secure and efficient privacy computing infrastructure for fields such as finance and healthcare.

[0076] In one embodiment, in step S61, when the user equipment generates a proxy key with a time window and operation permissions based on the attribute-based encryption strategy, when the authorization conditions of the proxy key are triggered to change, a decentralized strategy migration and consistency verification is achieved by developing a proof based on the zero-knowledge identity authentication protocol.

[0077] This application's dual dynamic policy-driven hybrid encryption verification mechanism achieves privacy protection through dynamic nesting of attribute-based encryption and partial homomorphic encryption. Highly sensitive data (such as medical records) uses attribute-based encryption to bind access permissions and is overlaid with partial homomorphic encryption to support ciphertext computation. Low-sensitivity data (such as log timestamps) only uses attribute-based encryption as needed to reduce overhead. At the same time, a zero-knowledge proof-driven policy self-update technology is introduced. When the authorization conditions of the proxy key (such as time window or number of operations) are triggered to change, decentralized policy migration and consistency verification are achieved through zk-STARKs proofs, completely eliminating the dependence on centralized policy managers in traditional schemes.

[0078] In one embodiment, when the privacy protection method based on homomorphic encryption and blockchain is applied to large-scale computing scenarios, the multi-party computing server adopts a sharded aggregation architecture. It breaks down the computing tasks of the off-chain blockchain database into parallel subtasks and executes them in shards. After each shard generates a local proof, multiple local proofs are aggregated into a target proof using recursive proof technology. Specifically, after each shard generates a local zk-STARKs proof, it is aggregated into a single lightweight proof using recursive proof technology. Compared to the traditional full-scale computing mode, this significantly reduces verification latency and on-chain load. This mechanism achieves dynamic coupling between encryption strategies and computational logic, breaking through existing technical frameworks in terms of access control, proof efficiency, and scalability, providing flexible and secure underlying support for high-concurrency, cross-institutional privacy computing scenarios.

[0079] This application also provides a privacy protection system based on homomorphic encryption and blockchain, including multiple execution modules, which are used to implement the steps of any of the methods described above. The specific implementation method is as described in the above method embodiments, and will not be repeated here.

[0080] This application proposes a homomorphic encryption and blockchain privacy protection system. Based on a blockchain privacy and security scheme using multi-key fully homomorphic encryption, zero-knowledge proofs, and multi-party computation, it aims to improve the privacy of transaction data while ensuring that smart contracts can execute computations in an encrypted environment, thereby enhancing the system's computational efficiency and scalability. First, transaction amounts are encrypted using multi-key fully homomorphic encryption, and transaction metadata is stored using a hash commitment mechanism, ensuring that on-chain data is always encrypted and preventing unauthorized access. Second, to address the issue that smart contracts cannot directly process encrypted data, this scheme employs homomorphic computation combined with zero-knowledge proofs, enabling smart contracts to verify transaction legitimacy without decrypting the data, and reducing the computational burden through multi-party computation. Finally, to optimize storage and retrieval efficiency, it combines off-chain encrypted storage, storing only encrypted hash values ​​on-chain, and uses proxy homomorphic signatures to enhance data access permission management, thereby improving the blockchain's scalability and computational efficiency.

[0081] like Figure 3 As shown, the present invention also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores all data required for the process of implementing a privacy-preserving method based on homomorphic encryption and blockchain. The network interface allows communication with external terminals via a network connection. The computer program, when executed by the processor, implements the privacy-preserving method based on homomorphic encryption and blockchain.

[0082] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.

[0083] An embodiment of this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements any of the above-described privacy protection methods based on homomorphic encryption and blockchain.

[0084] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in this application and in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0085] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0086] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A privacy protection method based on homomorphic encryption and blockchain, characterized in that, include: Acquire transaction data, wherein the transaction data includes transaction amount and transaction metadata; The transaction amount is encrypted using multi-key fully homomorphic encryption, and ciphertext is generated and stored in an off-chain database. Transaction metadata is stored off-chain based on a hash commitment mechanism. Execute smart contracts on the blockchain and introduce homomorphic cryptographic computation modules into the smart contracts to directly compute the ciphertext; Simultaneously, zero-knowledge proof technology and multi-party computation technology are introduced to transfer the computation task of directly computing the ciphertext to an off-chain database, and the multi-party computation server executes and generates the target proof. The smart contract verifies the validity of the target proof. Smart contracts verify the legality of transactions based on proxy homomorphic signatures and hash commitment mechanisms. The smart contract completes the transaction legality verification steps based on proxy homomorphic signatures and hash commitment mechanisms, including: User equipment generates a proxy key with a time window and operation permissions based on an attribute-based encryption strategy, and authorizes it to the proxy device through blockchain signature; The agent device signs the encrypted text in the off-chain database of the blockchain based on the agent key and generates a zero-knowledge identity authentication protocol development certificate. The agent key is generated based on the homomorphic encryption key. The agent device submits the zero-knowledge identity authentication protocol development certificate in batches to the multi-party computing server cluster to complete the aggregation of computing tasks; Obtain the hash tree path of multiple blockchain nodes based on the hash commitment mechanism; Smart contracts use a random sampling mechanism to randomly verify the availability of the hash tree path of the target blockchain node; If the hash tree path of the target blockchain node is available, the proxy device is defined as a compliant proxy device. It also incorporates penalty contracts to constrain the behavior of malicious nodes across multiple blockchain nodes; The key management contract periodically and automatically rotates a portion of the homomorphic encryption keys and synchronizes them to the multi-party computing server cluster. The smart contract verifies the validity of the attribute-based encryption strategy in real time and only allows compliant proxy devices to access the off-chain ciphertext hash.

2. The privacy protection method based on homomorphic encryption and blockchain according to claim 1, characterized in that, The step of encrypting the transaction amount based on multi-key fully homomorphic encryption and generating ciphertext includes: The sender generates the first public / private key based on the transaction amount; The recipient generates a second public / private key based on the transaction amount; The first public-private key and the second public-private key are jointly encrypted using multi-key fully homomorphic encryption to obtain the ciphertext.

3. The privacy protection method based on homomorphic encryption and blockchain according to claim 1, characterized in that, The steps for storing transaction metadata off-chain based on the hash commitment mechanism include: Retrieve the index information from the transaction metadata and store the index information on the blockchain in the form of a root hash; Other transaction metadata, excluding index information, is distributed and stored in different blocks in the form of hash numbers, and the root hash corresponding to other transaction metadata is stored on each second blockchain chain.

4. The privacy protection method based on homomorphic encryption and blockchain according to claim 1, characterized in that, The step of introducing a homomorphic cryptographic computation module into the smart contract to directly compute the ciphertext includes: Introduce homomorphic cryptographic computation modules into smart contracts; Obtain pre-compiled contract instructions; Based on contract instructions, the same-platform computing module is invoked to perform homomorphic operations such as addition, subtraction, multiplication, and division on the ciphertext.

5. The privacy protection method based on homomorphic encryption and blockchain according to claim 1, characterized in that, In the step of generating a proxy key with a time window and operation permissions based on the attribute-based encryption strategy by the user equipment, when the authorization conditions of the proxy key are triggered to change, a proof is developed based on the zero-knowledge identity authentication protocol to realize decentralized strategy migration and consistency verification.

6. The privacy protection method based on homomorphic encryption and blockchain according to claim 1, characterized in that, When applied to large-scale computing scenarios, the multi-party computing server adopts a sharded aggregation architecture, which splits the computing tasks of the off-chain database of the blockchain into parallel subtasks and executes them in shards. After each shard generates a local proof, multiple local proofs are aggregated into a target proof based on recursive proof technology.

7. A privacy protection system based on homomorphic encryption and blockchain, characterized in that, It includes multiple execution modules, which are used to implement the steps of the method according to any one of claims 1 to 6.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • A block chain privacy preservation method based on homomorphic cryptographic commitment and zero knowledge range proof

    CN109257182A

  • Block chain privacy data sharing method based on zero knowledge proof

    CN114499900A