Introduction
In the progression of human civilization, cryptographic technology has played a crucial role, particularly in the fields of information security and privacy protection. It not only provides solid protection for data transmission and storage in various domains but also incorporates innovative elements such as asymmetric encryption, public-private key systems, and hash functions, which were creatively fused by Satoshi Nakamoto in 2008. This fusion led to the development of proof-of-work mechanisms to solve the double-spending problem, paving the way for the birth of Bitcoin, a revolutionary digital currency, and ushering in a new era for the blockchain industry.
With the continuous evolution and rapid development of the blockchain industry, a series of cutting-edge cryptographic technologies have emerged, among which Zero-Knowledge Proofs (ZKP), Multi-Party Computation (MPC), and Fully Homomorphic Encryption (FHE) have been particularly prominent. These technologies have found widespread applications in various scenarios. For example, ZKP combined with the Rollup solution addresses the “impossible triangle” problem in blockchain, while MPC combined with public-private key systems promotes mass adoption of user entry. As for FHE, considered one of the holy grails of cryptography, its unique characteristics enable third parties to perform arbitrary computations and operations on encrypted data without decryption. This facilitates composable on-chain privacy computation, bringing new possibilities to various fields and scenarios.
A Quick Overview of FHE
When we mention Fully Homomorphic Encryption (FHE), it is helpful to understand the meaning behind its name. First, “HE” stands for Homomorphic Encryption, which is characterized by the ability to perform computations and operations on ciphertext that directly map to plaintext, preserving the mathematical properties of the encrypted data. The “F” in FHE signifies an enhancement of this homomorphic property, allowing for an unlimited number of computations and operations on encrypted data.
To aid understanding, let’s consider the simplest linear function as the encryption algorithm and combine it with a description of additive and multiplicative homomorphisms through single operations. Of course, in practice, FHE employs a series of more complex mathematical algorithms that have high computational resource requirements (CPU and memory). Though the mathematical principles of FHE are profound and complex, we won’t delve into them extensively here. It’s worth mentioning that besides FHE, there are partially homomorphic encryption and somewhat homomorphic encryption, which differ mainly in the types of supported operations and the number of allowed computations. Nevertheless, to maintain conciseness, we won’t discuss them in depth here.
In the FHE industry, although many well-known companies are involved in research and development, Microsoft and Zama stand out with their outstanding open-source products (code repositories), highlighting unparalleled usability and influence. They provide stable and efficient FHE implementations, greatly promoting the continuous development and widespread application of FHE technology.
Microsoft’s SEAL is an FHE library meticulously crafted by Microsoft Research. It not only supports Fully Homomorphic Encryption but also partially homomorphic encryption. SEAL provides an efficient C++ interface and significantly enhances computational performance and efficiency through the integration of numerous optimization algorithms and techniques.
Zama’s TFHE, on the other hand, is an open-source library focused on high-performance Fully Homomorphic Encryption. TFHE offers services through a C language interface and utilizes a range of advanced optimization techniques and algorithms to achieve faster computation speeds and lower resource consumption.
In a simplified approach, the operational flow of experiencing FHE is roughly as follows:
1. Generate keys: Use an FHE library/framework to generate a pair of public and private keys.
2. Encrypt data: Use the public key to encrypt the data that needs FHE computation.
3. Perform homomorphic computation: Utilize the homomorphic computation functionality provided by the FHE library to perform various operations on the encrypted data, such as addition and multiplication.
4. Decrypt the result: When it is necessary to view the computation result, authorized users decrypt the result using the private key.
In the practice of FHE, the management of decryption keys (generation, circulation, and usage) is particularly crucial. Since the computation and operation results of encrypted data may need to be decrypted for use in certain moments and scenarios, the management of decryption keys becomes the core for ensuring the security and integrity of both the original and processed data. Regarding the management of decryption keys, the actual schemes bear many similarities to traditional key management. However, given the unique nature of FHE, more rigorous and meticulous strategies can also be designed and implemented.
For blockchain, due to its decentralized, transparent, and tamper-resistant nature, the introduction of threshold-based Multi-Party Secure Computation (TMPC) is a highly promising choice. This scheme allows multiple participants to jointly manage and control decryption keys, ensuring successful decryption of data only when the predetermined threshold (i.e., the number of participants) is reached. This not only enhances the security of key management but also reduces the risk of a single node being compromised, providing robust guarantees for the application of FHE in blockchain environments.
Laying the Foundation with fhEVM
To implement the application of FHE on the blockchain with minimal intrusion, the ideal approach is to package FHE as a generic smart contract code library to ensure lightweightness and flexibility. However, this solution relies on the prerequisite that the smart contract virtual machine must pre-support a specific instruction set for the complex mathematical computations and encryption operations required by FHE. If the virtual machine cannot meet these requirements, it is necessary to delve into the core architecture of the virtual machine for customization and modification to accommodate the needs of FHE algorithms and achieve seamless integration.
As an extensively adopted and long-standing virtual machine, the Ethereum Virtual Machine (EVM) naturally becomes the preferred choice for implementing FHE. However, there are few practitioners in this field, with Zama, the company behind the open-source TFHE, being noteworthy once again. Zama not only provides the foundational TFHE library but also, as a technology company dedicated to applying FHE in the fields of artificial intelligence and blockchain, has introduced two important open-source products: Concrete ML and fhEVM. Concrete ML focuses on privacy-preserving machine learning computations. With Concrete ML, data scientists and machine learning practitioners can train and infer machine learning models using sensitive data while ensuring privacy without the risk of data leakage. fhEVM, on the other hand, is a fully homomorphic EVM that supports privacy-preserving computations implemented in Solidity. fhEVM enables developers to utilize fully homomorphic encryption technology in Ethereum smart contracts to achieve privacy protection and secure computations.
From reading the documentation of fhEVM, we understand that its core features are:
– fhEVM: At the non-EVM bytecode level, fhEVM provides support for FHE through the integration of multiple precompiled contracts with different states from Zama’s open-source FHE library, in the form of embedded functions. Additionally, a specific EVM memory and storage area have been designed exclusively for FHE to store, read, write, and verify FHE ciphertext.
– Decryption mechanism designed based on distributed threshold protocols: Supports asynchronous encryption of global FHE keys that mix encrypted data among multiple users and multiple contracts, and shares decryption keys among multiple verifiers through a threshold-based Multi-Party Secure Computation scheme.
– Solidity contract library that reduces the entry barrier for developers: Designed FHE-specific encrypted data types, operation types, decryption invocations, and encrypted outputs.
Zama’s fhEVM provides a solid starting point for the application of FHE technology in blockchain. However, considering Zama’s primary focus on technological research and development, its solution leans more towards the technical aspects, with relatively less consideration given to engineering implementation and commercial applications. Therefore, in the process of promoting the practical application of fhEVM, various unforeseen challenges may arise, including but not limited to technical barriers and performance optimization issues.
Building the FHE-Rollups Ecosystem
fhEVM alone cannot constitute an independent project or a complete ecosystem. It is more akin to one of the diverse clients within the Ethereum ecosystem. To establish itself as an independent project, fhEVM must rely on either a public-chain-level architecture or adopt Layer 2/Layer 3 solutions. The development direction of an FHE public chain inevitably needs to address how to reduce the redundancy and wastage of FHE computational resources among distributed validator nodes. Conversely, Layer 2/Layer 3 solutions that already exist as execution layers in public chains can distribute the computational workload among a small number of nodes, significantly reducing the scale of computational overhead. It is for this reason that Fhenix, as a pioneer, actively explores the integration of fhEVM into Layer 2/Layer 3 solutions, aiming to construct an efficient and scalable FHE-Rollups ecosystem.Introducing FHE-Rollups: A Revolutionary Layer 2 Solution Combined with Rollup Technology
Considering the complexity of ZK Rollups technology involving intricate ZKP mechanisms and the enormous computational resources required to generate proofs for verification, implementing FHE-Rollups based on ZK Rollups presents numerous challenges. Therefore, at this stage, compared to ZK Rollups, adopting Optimistic Rollups as the technical choice for Fhenix is more practical and efficient, given the inherent characteristics of FHE.
Fhenix’s technology stack primarily consists of several key components: a variant of Arbitrum Nitro’s fraud prover that allows fraud proofs to be executed in WebAssembly, enabling secure execution of FHE logic by compiling it into WebAssembly; the core library fheOS, which provides all the necessary functionality to integrate FHE logic into smart contracts; and the Threshold Service Network (TSN), which hosts the network keys for secret sharing and divides them into multiple shares using specific algorithms to ensure security. The TSN is also responsible for decrypting data when necessary.
Based on the aforementioned technology stack, Fhenix has released its first public version, Fhenix Frontier. Although this early version has limitations and missing features, it provides comprehensive instructions for using smart contract code libraries, Solidity API, contract development toolchains (such as Hardhat/Remix), and frontend interaction JavaScript libraries. Developers and ecosystem projects interested in Fhenix can explore these resources in the official documentation.
Chain-Agnostic FHE Coprocessors
Building on FHE-Rollups, Fhenix ingeniously introduces the Relay module, aiming to empower various public chains, L2, and L3 networks to access FHE Coprocessors and utilize FHE capabilities. This means that even if the original Host Chain does not support FHE, it can indirectly benefit from the powerful features of FHE. However, due to the typically long proof challenge period of FHE-Rollups, which can last up to 7 days, the widespread application of FHE is somewhat limited. To overcome this challenge, Fhenix collaborates with EigenLayer to provide a faster and more convenient channel for FHE Coprocessors’ services through EigenLayer’s Restaking mechanism, greatly enhancing the efficiency and flexibility of the entire FHE Coprocessors.
The usage process of FHE Coprocessors is straightforward:
1. The application contract calls the FHE Coprocessor on the Host Chain to perform encrypted computation operations.
2. The Relay contract queues the request.
3. Relay nodes listen to the Relay contract and forward the call to the dedicated Fhenix Rollup.
4. FHE Rollup performs FHE computation operations.
5. The Threshold Service Network decrypts the output.
6. Relay nodes transmit the result and optimistic proof back to the contract.
7. The contract verifies the optimistic proof and sends the result to the caller.
8. The application contract continues execution based on the combined result.
Fhenix Participation Guide
If you are a developer, you can delve into Fhenix’s documentation and develop your own FHE-based applications to explore their potential in practical applications.
If you are a user, you can try out the dApps provided by Fhenix’s FHE-Rollups and experience the data security and privacy protection brought by FHE.
If you are a researcher, we highly recommend carefully reading Fhenix’s documentation to gain in-depth knowledge of FHE’s principles, technical details, and application prospects, so that you can make valuable contributions in your research field.
Best Applications for FHE
FHE technology has shown broad application prospects, especially in areas such as blockchain gaming, DeFi, and AI. We firmly believe in its huge development potential and vast application space in these fields:
Privacy-protected blockchain gaming: FHE technology provides robust encryption protection for financial transactions and player actions in the gaming economy, effectively preventing real-time manipulation and ensuring fairness and equity in games. Moreover, FHE can anonymize player activities, significantly reducing the risk of player financial asset and personal information leakage, thus comprehensively protecting player privacy.
DeFi/MEV: With the booming development of DeFi activities, many DeFi operations have become targets of MEV attacks in the dark forest. To address this challenge, FHE can effectively protect sensitive data in DeFi, such as position quantities, liquidation thresholds, and transaction slippage, while ensuring the processing of business logic calculations. By applying FHE, the health of DeFi on the chain can be significantly improved, thereby greatly reducing the frequency of adverse MEV behaviors.
AI: The training of AI models relies on datasets, and when it comes to using individual data for training, ensuring the security of individual sensitive data becomes a top priority. FHE technology becomes an ideal solution for training AI models with individual privacy data, allowing AI to process encrypted data without revealing any personal sensitive information during the training process.
Recognition of FHE in the Community
The development of technology is not solely dependent on its hardcore features. To achieve the maturity and continuous progress of technology, it must rely on continuous academic research and the active construction of community forces. In this regard, FHE has been hailed as the holy grail of the cryptography community, and its potential and value have been widely recognized. In 2020, Vitalik Buterin highly recognized and supported FHE technology in his article “Exploring Fully Homomorphic Encryption.” Recently, he voiced his support again on social media, undoubtedly reinforcing this stance and calling for more resources and efforts for the development of FHE technology. Correspondingly, emerging projects, non-profit research and education organizations, and continuous market funding all seem to herald the prelude to a technological breakthrough.
The Potential of the Early FHE Ecosystem
In the early development of the FHE ecosystem, in addition to Zama, a core foundational technology service company, and the highly anticipated Fhenix project, there are several other outstanding projects that are worth exploring and paying attention to:
1. Sunscreen: A self-developed FHE compiler that supports traditional programming languages for FHE conversion and designs corresponding FHE ciphertext decentralized storage, ultimately outputting FHE features in the form of an SDK for Web3 applications.
2. Mind Network: An FHE network that combines EigenLayer’s Restaking mechanism to enhance security for AI and DePIN networks.
3. PADO Labs: Introducing zkFHE, which combines ZKP and FHE, and constructing a decentralized computing network on top of it.
4. Arcium: Formerly known as Elusiv, a privacy protocol for Solana, Arcium has recently transformed into a parallel confidential computing network that incorporates FHE.
5. Inco Network: Focusing on optimizing the computational cost and efficiency of FHE, Inco Network utilizes fhEVM based on Zama to develop a complete Layer 1 ecosystem.
6. Treat: A collaboration between the Shiba team and Zama, Treat aims to extend the Shiba ecosystem with an FHE Layer 3.
7. octra: An FHE network developed using OCaml, AST, ReasonML, and C++ that supports isolated execution environments.
8. BasedAI: A distributed network that supports introducing FHE capabilities to LLM models.
9. Encifher: Formerly known as BananaHQ and now renamed Rize Labs, Encifher focuses on FHEML based on FHE.
10. Privasea: A network built by the NuLink core team using Zama’s Concrete ML framework to achieve data privacy protection in AI’s ML inference process.
For non-profit research and education institutions, we strongly recommend FHE.org and FHE Onchain, as they provide valuable resources for academic research and educational outreach within the entire ecosystem.
Due to limited space, we were unable to list all the excellent projects in the FHE ecosystem. However, please believe that this ecosystem contains infinite potential and opportunities, which are worth continuous exploration and discovery.
Conclusion
We are optimistic about the future of FHE technology and have high expectations for the Fhenix project. Once the Fhenix mainnet is released and officially launched, we anticipate that applications in various fields will be enhanced by FHE technology. We firmly believe that this innovative and vibrant future is within reach.
References:
– Zama: https://zama.ai/
– Microsoft SEAL: https://github.com/microsoft/SEAL
– Fhenix: https://www.fhenix.io/
– Mind Network: https://mindnetwork.xyz/
– Inco Network: https://www.inco.org/
– Treat: https://x.com/treatsforShib
– octra: https://docs.octra.org/
– Encifher: https://x.com/encifherio
– BasedAI: https://www.getbased.ai/
– Privasea: https://www.privasea.ai/
– FHE.org: https://x.com/fhe_org
– FHE Onchain: https://x.com/FHEOnchain
– Vitalik Buterin’s article: https://vitalik.eth.limo/general/2020/07/20/homomorphic.html
– MessariCrypto’s tweet: https://x.com/MessariCrypto/status/1720134959875457352
– Foresight News article: https://foresightnews.pro/article/detail/59947