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 combines asymmetric encryption public-private key systems and hash functions, which were creatively integrated by Satoshi Nakamoto in 2008. This integration led to the creation of proof-of-work mechanisms to solve the double-spending problem, thereby promoting the birth of Bitcoin as 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) stand out. These technologies have been widely applied in various scenarios, such as using ZKP combined with the Rollup solution to solve the “impossible triangle” problem in blockchain, and using MPC combined with public-private key systems to promote mass adoption. As for fully homomorphic encryption (FHE), which is considered one of the holy grails of cryptography, its unique characteristics enable third parties to perform unlimited computations and operations on encrypted data without decryption. This enables composable on-chain privacy computation, bringing new possibilities to multiple domains and scenarios.
A Quick Overview of FHE
When we mention Fully Homomorphic Encryption (FHE), we can first understand the meaning behind its name. “HE” stands for homomorphic encryption technology, which allows computations and operations on ciphertext that directly map to plaintext while preserving the mathematical properties of encrypted data. The “F” in FHE signifies that this homomorphism reaches new heights, allowing unlimited computations and operations on encrypted data.
To aid understanding, let’s use the simplest linear function as an encryption algorithm and combine it with a single operation to illustrate additive and multiplicative homomorphisms. However, in practice, FHE uses a series of more complex mathematical algorithms, which have high requirements for computational resources (CPU and memory).
Although the mathematical principles of FHE are profound and complex, we will not delve into them here. It is worth mentioning that in the field of homomorphic encryption, apart from FHE, there are partially homomorphic encryption and somewhat homomorphic encryption. They mainly differ in the types of operations they support and the number of allowed computations but provide possibilities for performing computations and operations on encrypted data. However, to keep the content concise, we will not discuss them in-depth here.
In the FHE industry, although many well-known companies are involved in research and development, Microsoft and Zama have highlighted their unparalleled usability and influence through their outstanding open-source products (code libraries). They provide stable and efficient FHE implementations, which greatly promote the continuous development and widespread application of FHE technology.
Microsoft’s SEAL: It is an FHE library meticulously created by Microsoft Research. It not only supports fully homomorphic encryption but also is compatible with partially homomorphic encryption. SEAL provides an efficient C++ interface and significantly improves computational performance and efficiency through the integration of numerous optimization algorithms and techniques.
Zama’s TFHE: It is an open-source library dedicated to high-performance fully homomorphic encryption. TFHE provides services through a C language interface and utilizes a series of advanced optimization techniques and algorithms to achieve faster computation speed and lower resource consumption.
Following a simplified approach, the operational process of experiencing FHE is roughly as follows:
Key Generation: Use an FHE library/framework to generate a pair of public and private keys.
Data Encryption: Encrypt the data that needs FHE computation and processing using the public key.
Perform Homomorphic Computation: Utilize the homomorphic computation functionality provided by the FHE library to perform various computations on the encrypted data, such as addition, multiplication, etc.
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 use) 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 of ensuring the security and integrity of original and processed data. Regarding the management of decryption keys, the solution is similar to traditional key management. However, due to the uniqueness of FHE, more rigorous and detailed strategies can also be designed and implemented.
For blockchain, considering its characteristics of decentralization, transparency, and immutability, the introduction of threshold multi-party secure computation (TMPC) is a highly potential choice. This solution allows multiple participants to jointly manage and control decryption keys, and decryption of data can only be successful when a preset 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 strong security guarantees for the application of FHE in the blockchain environment.
Laying the Foundation with fhEVM
To implement the application of FHE on the blockchain with minimal intrusion, the ideal approach is to package it as a universal smart contract code library to ensure lightweight and flexibility. However, this approach relies on the prerequisite that the smart contract virtual machine must pre-support a specific instruction set for the complex mathematical operations 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, thereby achieving seamless integration.
As a widely adopted and time-tested virtual machine, the Ethereum Virtual Machine (EVM) naturally becomes the preferred choice for implementing FHE. However, there are only a few practitioners in this field, and among them, we once again notice Zama, the company behind the open-source TFHE. Zama not only provides the basic TFHE library but also, as a technology company focused on applying FHE technology to artificial intelligence and the blockchain industry, has launched two important open-source products: Concrete ML and fhEVM. Concrete ML focuses on privacy computation for machine learning. Through Concrete ML, data scientists and ML practitioners can train and infer machine learning models on sensitive data while protecting privacy, fully utilizing data resources without worrying about privacy breaches. The other product, fhEVM, is a fully homomorphic EVM that supports privacy computation in Solidity. fhEVM allows developers to use fully homomorphic encryption technology in Ethereum smart contracts to achieve privacy protection and secure computation.
Based on the information provided by fhEVM, we understand that its core features are as follows:
fhEVM: At the bytecode level outside the EVM, it provides FHE operation support through embedded functions, integrating multiple different-state precompiled contracts from Zama’s open-source FHE library. Additionally, it has a specific EVM memory and storage area designed specifically for FHE to store, read, and verify FHE ciphertext.
Decryption mechanism based on distributed threshold protocols: It supports asynchronous encryption mechanism for sharing global FHE keys for encryption of mixed encrypted data among multiple users and contracts, as well as encryption keys for on-chain storage, and sharing decryption keys among multiple validators using a threshold multi-party secure computation scheme.
Solidity contract library that reduces the entry barrier for developers: It designs encrypted data types, operation types, decryption invocations, and encrypted outputs for FHE.
Zama’s fhEVM provides a solid starting point for FHE technology in blockchain applications. However, considering that Zama mainly focuses on technical research and development, its solution leans more towards the technical aspects, with relatively less consideration for engineering implementation and commercial applications. Therefore, in the process of bringing fhEVM into practical applications, various unforeseen challenges may be encountered, including but not limited to technical barriers and performance optimization issues.
Building the FHE-Rollups Ecosystem
fhEVM itself cannot form an independent project or a complete ecosystem; it is more like one of the diversified clients in the Ethereum ecosystem. To establish itself as an independent project, fhEVM must rely on a public chain-level architecture or adopt Layer 2/Layer 3 solutions. The development direction of the FHE public chain inevitably needs to address how to reduce the redundancy and waste of FHE computing resources among distributed validating nodes. Conversely, Layer 2/Layer 3 solutions, which exist as an execution layer of the public chain, can distribute the computational workload to a small number of nodes, greatly reducing the level of computational overhead. For this reason, Fhenix, as a pioneer, actively explores the integration of fhEVMIntroducing an Innovative FHE-Rollups Layer 2 Solution with Rollup Technology
In order to construct an advanced FHE-Rollups Layer 2 solution, it is proposed to combine it with Rollup technology. However, directly implementing FHE-Rollups based on ZK Rollups presents numerous challenges due to the complex ZKP mechanism and the significant computational resources required to generate the necessary proofs for verification. Therefore, at this stage, adopting Optimistic Rollups as the technical choice for Fhenix is more practical and efficient compared to ZK Rollups.
The Fhenix technology stack primarily consists of several key components. Variations of Arbitrum Nitro’s fraud prover enable fraud proofs to be conducted in WebAssembly, allowing for secure execution of FHE logic. The core library, fheOS, provides all the necessary functionalities for integrating FHE logic into smart contracts. The Threshold Services Network (TSN) is another crucial component that hosts the network keys for secret sharing. It utilizes secret sharing techniques with specific algorithms to ensure security by splitting the keys into multiple parts. When necessary, it is responsible for decrypting data and performing other tasks.
Fhenix has released its first public version, Fhenix Frontier, based on the aforementioned technology stack. Although this early version has limitations and missing features, it comprehensively provides documentation for using the smart contract code library, Solidity API, contract development toolchains like Hardhat/Remix, and frontend interaction JavaScript libraries. Developers and ecosystem projects interested in Fhenix can explore and refer to the official documentation.
Chain-Agnostic FHE Coprocessors
Building upon FHE-Rollups, Fhenix cleverly introduces the Relay module, aiming to empower various public chains, L2, and L3 networks to access FHE Coprocessors and utilize FHE functionalities. This means that even if the original Host Chain does not support FHE, it can indirectly benefit from the powerful capabilities of FHE. However, the proof challenge period of FHE-Rollups usually lasts up to 7 days, which somewhat limits the widespread application of FHE. To overcome this challenge, Fhenix collaborates with EigenLayer to provide a faster and more convenient channel for the services of FHE Coprocessors through EigenLayer’s Restaking mechanism, greatly improving 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. The Relay node listens to the Relay contract and forwards the call to the dedicated Fhenix Rollup.
4. The FHE Rollup executes the FHE computation operation.
5. The threshold network decrypts the output.
6. The Relay node returns the result and optimistic proof to the contract.
7. The contract verifies the optimistic proof and sends the result to the caller.
8. The application contract continues executing 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 to experience the data security and privacy protection offered by FHE.
If you are a researcher, we highly recommend carefully reading Fhenix’s documentation to gain a deeper understanding of the principles, technical details, and application prospects of FHE, enabling you to make valuable contributions in your research field.
Best Application Scenarios for FHE
FHE technology exhibits extensive application prospects, particularly in the fields of blockchain gaming, DeFi, and AI. We firmly believe that it has tremendous potential for development and a broad application space in these areas:
Privacy-preserving blockchain gaming: FHE technology provides strong encryption protection for financial transactions and player actions in game economies, effectively preventing real-time manipulation behavior and ensuring fairness. Additionally, FHE can anonymize player activities, significantly reducing the risk of player financial asset and personal information leakage, thereby 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 computation of business logic, significantly improving the health of on-chain DeFi and reducing the frequency of malicious MEV behavior.
AI: The training of AI models relies on datasets, and ensuring the security of individual sensitive data becomes a top priority when using such data for training. In this regard, 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 the FHE 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 ongoing academic research and the active building of community strength. In this regard, FHE has been hailed as the holy grail of the cryptography field, with its potential and value 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 reaffirming his stance and calling for more resources and efforts for the development of FHE technology. Correspondingly, the emergence of new projects, non-profit research and educational organizations, and continuous market funding all seem to indicate the prelude to a technological breakthrough.
Potential Early Ecoystem of FHE
In the early stages of FHE ecosystem development, in addition to the core foundational technology service company Zama and the highly anticipated project Fhenix, there are several other outstanding projects worth delving into and paying attention to:
– Sunscreen: A self-developed FHE compiler that supports traditional programming languages for FHE transformation. It is designed to store FHE ciphertext in a decentralized manner and outputs FHE features as an SDK for Web3 applications.
– Mind Network: An FHE network that combines EigenLayer’s Restaking mechanism to enhance security for AI and DePIN networks.
– PADO Labs: Introduces zkFHE, which combines ZKP and FHE, and builds a decentralized computing network on top of it.
– Arcium: Formerly Elusiv, a privacy protocol for Solana, which has transformed into a parallel confidential computing network that incorporates FHE.
– Inco Network: Optimizes the computational cost and efficiency of FHE, focusing on developing a complete Layer 1 ecosystem, based on FHEVM by Zama.
– Treat: Jointly developed by the Shiba team and Zama, dedicated to expanding the Shiba ecosystem with FHE Layer 3.
– octra: An FHE network developed using OCaml, AST, ReasonML, and C++, supporting isolated execution environments.
– BasedAI: A distributed network that supports introducing FHE capabilities to LLM models.
– Encifher: Formerly BananaHQ, now Rize Labs, focuses on FHEML around FHE.
– Privasea: An FHE network developed by the NuLink core team, using Zama’s Concrete ML framework, aiming to achieve data privacy protection in AI’s ML inference process.
For non-profit research and educational institutions, we highly recommend FHE.org and FHE Onchain, which provide valuable resources for academic research and education in the entire ecosystem.
Due to space limitations, we were unable to list all the excellent projects in the FHE ecosystem. However, please believe that this ecosystem holds infinite potential and opportunities, deserving 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 just around the corner.
References:
– https://zama.ai/
– https://github.com/microsoft/SEAL
– https://www.fhenix.io/
– https://mindnetwork.xyz/
– https://www.inco.org/
– https://x.com/treatsforShib
– https://docs.octra.org/
– https://x.com/encifherio
– https://www.getbased.ai/
– https://www.privasea.ai/
– https://x.com/fhe_org
– https://x.com/FHEOnchain
– https://vitalik.eth.limo/general/2020/07/20/homomorphic.html
– https://x.com/MessariCrypto/status/1720134959875457352
– https://foresightnews.pro/article/detail/59947