fhevm README

The project's README from github.com/zama-ai/fhevm. As one markdown file: README.md.

fhevm


📃 Read white paper | 📒 Documentation | 💛 Community support | 📚 FHE resources by Zama

SLSA 3

About

What is FHEVM?

FHEVM is the core framework of the Zama Confidential Blockchain Protocol. It enables confidential smart contracts on EVM-compatible blockchains by leveraging Fully Homomorphic Encryption (FHE), allowing encrypted data to be processed directly onchain.

FHEVM ensures both confidentiality and composability, with the following guarantees:



Table of contents

Project structure

The directories of this repository are organized in the following way:

FHEVM Contracts
FHEVM Compute Engines
FHEVM Utilities

Main features

Learn more about FHEVM features in the documentation and in our whitepaper.

Use cases

FHEVM is built for developers to write confidential smart contracts without the need to learn cryptography. Leveraging FHEVM, you can unlock a myriad of new use cases such as DeFi, gaming, and more. For instance:

Learn more use cases in the list of examples.

Resources

↑ Back to top

Working with FHEVM

Citations

To cite FHEVM or the whitepaper in academic papers, please use the following entries:

@Misc{FHEVM,
title={{FHEVM: A full-stack framework for integrating Fully Homomorphic Encryption (FHE) with blockchain applications},
author={Zama},
year={2025},
note={\url{https://github.com/zama-ai/fhevm}},
}

Contributing

There are two ways to contribute to FHEVM:

Becoming an approved contributor involves signing our Contributor License Agreement (CLA). Only approved contributors can send pull requests, so please make sure to get in touch before you do!

License

This software is distributed under the BSD-3-Clause-Clear license. Read this for more details.

FAQ

Is Zama’s technology free to use?

Zama’s libraries are free to use under the BSD 3-Clause Clear license only for development, research, prototyping, and experimentation purposes. However, for any commercial use of Zama's open source code, companies must purchase Zama’s commercial patent license.

Everything we do is open source, and we are very transparent on what it means for our users, you can read more about how we monetize our open source products at Zama in this blog post.

What do I need to do if I want to use Zama’s technology for commercial purposes?

To commercially use Zama’s technology you need to be granted Zama’s patent license. Please contact us at [email protected] for more information.

Do you file IP on your technology?

Yes, all Zama’s technologies are patented.

Can you customize a solution for my specific use case?

We are open to collaborating and advancing the FHE space with our partners. If you have specific needs, please email us at [email protected].

Support

Support

🌟 If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development.

↑ Back to top

fhevm (zama-ai/fhevm)

Searching Database…

24.8K ·GitHub
这是什么?FHEVM 是 Zama 出品的一个用于机密智能合约的全栈框架:它把全同态加密(FHE)与兼容 EVM 的区块链结合起来,让加密数据可以直接在链上处理。
那这是我自己部署的一条区块链,还是我用来开发自己 dApp 的框架?它是一个框架:你基于 FHEVM 库编写标准 Solidity 合约,然后部署到任何兼容 EVM 的链上。这个仓库还附带链下技术栈——Rust 协处理器、网关和宿主合约、KMS 连接器、Helm 图表以及 Docker 镜像。
我怎么上手用它开发?从官方文档和示例仓库入手。合约像标准 Solidity 一样编写,用 Hardhat 构建(对 Foundry 的支持即将推出);仓库自带的 e2e 测试套件通过 cd test-suite/fhevm && bun run test 运行。
我要在本地跑完整套技术栈,电脑上需要装什么?e2e 技术栈通过 Docker Compose 运行,部署使用 Helm 图表,基础镜像则是 Node.js 和 Rust 的官方 golden Docker 镜像;测试脚本本身跑在 Bun 上。整个流程不涉及 Python 或 Go 工具链。
目前有哪些坑或者不完善的地方?Foundry 暂时还不支持——官方标注为即将推出,所以现在得用 Hardhat 来构建。另外,只有签署了 CLA 的获准贡献者才能提交 pull request;外部提交的 bug 和想法请通过 issue 或 [email protected] 反馈。
写这些合约需要懂密码学吗?不需要——FHEVM 的设计初衷就是让开发者无需学习密码学就能编写机密智能合约:你只需在 Solidity 里定义哪些数据保持加密状态、谁能访问它们。
到底谁能看到我的交易数据?谁都不行——交易和状态全程保持加密,状态更新也是在加密状态下进行的。解密要通过一个采用多方计算(MPC)的密钥管理系统来完成,因此没有任何一方能单独完成解密。
我能免费在上面发布商业产品吗?不能直接拿来商用:代码采用 BSD-3-Clause-Clear 许可证,仅限开发、研究、原型制作和实验时免费使用。任何商业用途都需要购买 Zama 的商业专利许可证——这项技术是有专利的。
它到底适合做哪类应用?README 中列举了这些场景:无需混币器的机密转账、隐私代币和 RWA 兑换、盲拍、隐藏走子或卡牌的链上游戏、防贿赂的机密投票,以及无需 ZK 就能附带声明的加密 DID。
加密的数字最大能做到多少位?精度最高可达 256 位,并且提供完整的运算符集合——加、减、乘、除、比较、三目条件判断和布尔运算——而且连续的 FHE 运算次数不受限制。
为什么在加密数据上做计算不会慢得难以忍受?所有 FHE 运算都在宿主链上以符号方式运行,而真正对加密数据的计算则被异步卸载到协处理器上执行,README 表示这样可以保持执行速度并具备良好的可扩展性。
这种加密方案能应对未来的威胁吗?可以——底层 FHE 加密方案被描述为抗量子的,而且基于 KMS 并通过 MPC 完成的解密,即使部分持有密钥的参与方被攻破或作恶,依然保持安全。
Creator
zama-ai
Size
192 MB
Stars
24.8K
Age
1y
Commits · 90 Days