In the current state of cloud computing, encrypting data during transmission is a standard practice. However, to perform any computation on this data, servers must decrypt it first. In such scenarios, the security of the data is only as robust as the security of the server itself. Furthermore, this grants centralized entities controlling these servers unrestricted access to the data, posing a significant risk to data privacy.
Enter Fully Homomorphic Encryption (FHE), an encryption methodology often hailed as the "holy grail" of encryption for its promise to transform data security. Imagine sending your private information through the cloud, having it processed, analyzed, and returned to you without ever being exposed—like a letter analyzed without breaking its seal. FHE makes this possible by allowing computations to be performed directly on encrypted data. This method not only enhances security but also opens up new possibilities for applications that were previously unattainable due to security constraints. Within the realms of blockchain ecosystems, FHE paves the way for several innovative use cases, significantly improving privacy and security for blockchain transactions. In this post, I will explore the unique opportunities that FHE presents in the context of the blockchain protocols.
Current State of FHE
The landscape of FHE has been rapidly evolving over the last several years, with numerous companies leading the charge in research and development to unlock its vast potential. Microsoft has introduced SEAL, an accessible open-source library aimed at simplifying the creation of FHE based applications. Google has developed HEIR and Jaxite, libraries specifically designed for FHE application development, while IBM’s HElib provides another open-source alternative, implementing a variety of FHE schemes. On the other hand, Zama is concentrating its efforts on constructing libraries for practical FHE use cases, with a keen focus on the web3 ecosystem. Additionally, OpenFHE stands out as a comprehensive library that offers efficient implementations of widely used FHE schemes.
Beyond these initiatives, an array of teams is engaged in developing FHE libraries and applications that utilize them, significantly advancing the march toward the mainstream adoption of FHE technologies. Given that FHE has traditionally been slow and deemed impractical for real-world applications, extensive work is now underway to benchmark the performance of various FHE schemes and libraries. Moreover, industry giants such as IBM, Microsoft, and Google have established a consortium to help establish FHE standards, aiming to clarify and simplify the security properties of standardized FHE schemes. In parallel, Intel has entered into an agreement with DARPA to create custom hardware solutions designed to facilitate high-performance FHE at scale, signaling a new era of encryption technology.
Use-Cases for FHE in web3 / blockchain
In his recent blog post, Vitalik discusses the evolution of Ethereum's privacy features. He notes that while Ethereum's data was entirely public in 2010s, but in 2020s, user data will default to being private. Fully Homomorphic Encryption (FHE) will be instrumental in making this vision a reality. Below are a few use cases that will immediately benefit from FHE.
Decentralized ID
Traditionally, while the DID tokens themselves are issued and managed on the blockchain, the critical identity attributes they represent are stored off-chain, often in centralized databases. This dichotomy exposes sensitive user information to potential threats from malicious actors and also provides control of that data to centralized entities. FHE, however, enables these identity components to be embedded directly within the DID tokens on-chain or on decentralized data solutions. This allows for the attributes to be used across various smart contracts and applications without the need for decryption. By doing so, FHE not only ensures the utmost privacy of individual identities but also maintains the integrity and accessibility of data across the decentralized ecosystem, marking a significant leap forward in how identity is managed and utilized on the blockchain.
DAO Management & Voting
As blockchain technology has matured and its adoption broadened, there has been a growing emphasis on balancing transparency with the privacy of user data and actions. In the context of Decentralized Autonomous Organizations (DAOs), governance activities and voting historically have taken place on a fully public ledger, posing notable privacy concerns. These concerns could potentially influence the behavior of DAO members, who might act differently if their decisions remained confidential. FHE presents a solution to this challenge by allowing for end-to-end encryption of individual votes and governance decisions. While the process ensures the confidentiality of member actions, it still enables the aggregation and execution of these decisions to guide the DAO. This approach maintains the integrity of the voting process, while safeguarding member privacy, thus fostering a more secure and trustworthy environment for DAO management.
Private On-Chain transactions
FHE when used in the context of the blockchain technology paves the way for private on-chain transactions, a critical feature as blockchain finds increased adoption among institutions that prioritize data privacy. FHE's capability to perform computations on encrypted data means that sensitive transaction details, such as wallet balances and transaction amounts, can remain encrypted on the blockchain. This negates the need for transaction mixers or other obfuscation techniques traditionally used to preserve transaction privacy. For institutions engaging with blockchain technology, this level of privacy is not just a preference but a requirement, particularly to meet stringent data protection standards like GDPR and CCPA. By enabling private transactions, FHE addresses these privacy concerns, making blockchain a more viable and compliant option for entities that must adhere to strict data privacy regulations.
AI Inference, Training & Fine-tuning
Using artificial intelligence (AI) in blockchain for tasks like inference, training, and fine-tuning is impractical without FHE. The main problem is that you can only use publicly available datasets for these tasks. Utilizing private data is not only against privacy and compliance but also results in making that data public. FHE, however, changes this landscape by facilitating the use of both public and private datasets for training AI models without disclosing the private data. This technology enables multiple enterprises to collaborate, pooling their private data to collectively develop models. Such collaboration is particularly pertinent in sectors like healthcare, where pharmaceutical companies, insurance providers, hospitals etc possess vast amounts of data but are constrained by privacy laws and the need to protect proprietary information. Additionally, enterprises have the option to leverage publicly available models on the blockchain, applying their own data to fine-tune these models or conduct inferences on encrypted data in a secure manner. This integration of Web3, AI, and FHE minimizes privacy concerns and expands the potential applications of web3 + AI based applications.
Open Auctions
In open auctions on the blockchain, FHE can be used to encrypt bids. This ensures that bids remain hidden, preventing anyone with powerful computing resources from placing a last-minute, strategic winning bid to outmaneuver others.
Gambling
In the context of blockchain-based gambling, employing FHE allows the encryption of game elements like moves and cards directly on the blockchain. This method helps prevent individuals with advanced computing power from gaining an unfair advantage by predicting or seeing others' moves. Traditionally, hosting fully on-chain gambling games has been impractical due to the potential exposure of these sensitive game details. FHE offers a solution by ensuring these aspects remain encrypted and secure, making genuinely on-chain gambling games feasible.
While the use cases outlined above represent the current applications of FHE in Web3, they are just the beginning. As FHE technology continues to evolve, developers will undoubtedly create a multitude of innovative applications on the Web3 platform. The potential for FHE to revolutionize privacy and security in decentralized applications is vast, promising a future where more complex and secure applications can be built.
Integrating FHE with blockchain
FHE can be integrated into the blockchain in several different ways. However, a hybrid approach, where it can be used directly from the smart contract or as an outsourced coprocessor, seems most appropriate.
Fully Composable and Interoperable Rollup
Integrating FHE with blockchain can be achieved through the development of an EVM (Ethereum Virtual Machine) based rollup that incorporates FHE libraries directly into the smart contract layer. This integration allows smart contracts to process and operate on encrypted data, enabling the creation of advanced applications. This model emphasizes full composability, meaning that developers can build complex applications that leverage encrypted data without compromising on functionality or security.
However, smart contracts designed within this framework may face limitations in portability between Layer 1 (L1) blockchains and Layer 2 (L2) scaling solutions or across different L2 platforms. Despite this, the approach offers significant advantages in terms of user adoption by targeting existing blockchain ecosystems where there's already a substantial user base. Additionally, it inherits the benefits of rollups, such as enhanced interoperability supported by existing bridging infrastructures, modular architectures that can utilize alternate DA solutions etc. Additionally, this specialized L2 can serve as an FHE co-processor for other L2s, allowing them to delegate FHE based workloads to enhance performance and security. A similar approach can also be taken for non EVM based chains such as Solana, Cosmos, Aptos etc.
FHE Coprocessor
Integrating FHE as a coprocessor within the blockchain ecosystem presents an innovative approach to handling FHE-based workloads. In this model, different blockchain networks can offload tasks requiring FHE to a dedicated coprocessor network. This setup is particularly fitting within the modular blockchain architecture, where the FHE coprocessor acts as an additional component that can be seamlessly incorporated by various Layer 1 (L1) and Layer 2 (L2) blockchains. This method offers enhanced flexibility and versatility, enabling a broad spectrum of blockchains to leverage this coprocessor for their encrypted data processing needs.
For applications to utilize this FHE coprocessor, a portion of their application logic—specifically, the part that necessitates computation on FHE-encrypted data—would need to be deployed to the coprocessor. This requirement introduces a layer of complexity but also opens up new possibilities for applications to benefit from FHE's privacy-preserving capabilities without fully integrating FHE into their native infrastructure. By externalizing the computationally intensive FHE tasks to a coprocessor, blockchain networks can maintain efficiency while offering advanced encryption capabilities.
Hybrid Approach
Adopting a hybrid approach in integrating FHE with blockchain combines the benefits of both direct integration and the coprocessor model. In this scenario, the network functions as a Layer 2 (L2) chain that supports fully composable smart contracts with native FHE capabilities while also serving as a coprocessor within a modular blockchain architecture. This strategy aims to offer comprehensive solutions by addressing a wide range of needs. However, the creation of such a hybrid network introduces additional complexities in its architecture. As the integration of Web3 and FHE is still in its infancy, we expect to see a lot of new innovation in the next few years aimed at enhancing privacy and security on blockchain platforms through FHE computation.
Useful Links
https://homomorphicencryption.org/ - An Open Industry / Government / Academic Consortium to Advance Secure Computation
https://fhe.org/ - A community of researchers and developers interested in advancing Fully Homomorphic Encryption (FHE)