💛 Community support | 📚 FHE resources by Zama
Note
Important Notice
This repository is not actively maintained. It is a snapshot intended for our submission to the NIST call for Multi-Party Threshold Cryptography.
For the latest, actively maintained code (including management wrapper functionality), please visit our KMS repository. The code relevant to NIST is located at: kms/core/threshold.
This repository provides threshold multi-party computation protocols such as threshold key generation and threshold decryption for TFHE, BFV and BGV. Our protocols are designed to be both secure and robust when a fraction of the parties are malicious.
- Threshold key generation for the three FHE schemes
- Distributed decryption for FHE ciphertexts with two techniques:
- Resharing of FHE key shares
- Distributed setup for CRS (common reference string) using in ZK proofs
See the requirements for the benchmarks.
Important
threshold-fhe is a snapshot of the work-in-progress code of what will eventually become a NIST submission. Use at your own risk!
The main way to use the repository is to run experiments and benchmarks on the various threshold protocols, which we describe in detail in the file docs/threshold-benchmark.md. It is also possible to use the the repository as a library (see the example in examples/distributed_decryption.rs, but the public API is not well-documented yet, so use your own discretion.
To start the benchmarked system moby
in a dockerized environment locally with 4 parties and threshold 1:
$ cargo make tfhe-docker-image
$ cargo make tfhe-bench-run
You can then start interacting with it via the mobygo
cli.
- Initiate an insecure Key Generation
$ cargo run --bin mobygo --features="choreographer" -- -c temp/tfhe-bench-run.toml threshold-key-gen-result --sid 1 --storage-path temp --generate-params bc-params-sam-sns
- Initialize PRSS (one time setup)
$ cargo run --bin mobygo --features="choreographer" -- -c temp/tfhe-bench-run.toml prss-init --ring residue-poly-z128 --sid 2
- Perform 10 distributed decryptions
# Prepare correlated randomness
$ cargo run --bin mobygo --features="choreographer" -- -c temp/tfhe-bench-run.toml preproc-decrypt --decryption-mode noise-flood-small --path-pubkey temp/pk.bin --tfhe-type u16 --num-ctxts 10 --sid 3
# Perform online phase
$ cargo run --bin mobygo --features="choreographer" -- -c temp/tfhe-bench-run.toml threshold-decrypt --decryption-mode noise-flood-small --path-pubkey temp/pk.bin --tfhe-type u16 --num-ctxts 10 --sid 4 --preproc-sid 3
# Check the status
$ cargo run --bin mobygo --features="choreographer" -- -c temp/tfhe-bench-run.toml status-check --sid 4 --keep-retry true
# Fetch the result
$ cargo run --bin mobygo --features="choreographer" -- -c temp/tfhe-bench-run.toml threshold-decrypt-result --sid 4
- Blog post on our threshold key management system
- The Noah's ark paper contains the technical details of some of our protocols
- An initial, preliminary version of our proposed NIST submission, which contains the detailed specification of all contained protocols
Documentation is current limited to the docs repository. It will be extended when we open-source our larger repositoru.
To cite threshold-fhe in academic papers, please use the following entry:
@Misc{ZamaThresholdFHE,
title={threshold-fhe: Threshold MPC protocols for FHE},
author={Zama},
year={2025},
note={\url{https://github.com/zama-ai/threshold-fhe}},
}
This repository is currently not open to external contributions, but we receive feedback as issues or messages (see the Support section).
This software is distributed under the BSD-3-Clause-Clear license. Read this for more details.
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.
All our work is open source and we strive for full transparency about Zama's IP strategy. To know more about what this means for Zama product users, read about how we monetize our open source products 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 of 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].
🌟 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.