Skip to main content

ppflx

CI

Privacy-preserving federated learning on Flower: each privacy mechanism is a plugin, so a run combines homomorphic encryption, zero-knowledge proofs of bounded model updates, and differential-privacy noise without the training code knowing which is in use.

Proofs are produced and checked by gnark-gradient-prover; benchmarks across datasets and modes live in ppflx-bench.

What the modes guarantee

Mode Confidentiality Integrity DP
baseline — — —
he_tenseal, he_concrete_tfhe server sees only ciphertexts — —
zkp — update bound to the downloaded model, norm bounded —
he_elgamal_zkp, he_elgamal_zkp_sampled additively homomorphic ciphertexts proof bound to the aggregated ciphertext —
he_*_zkp (CKKS/TFHE composites) server sees only ciphertexts none — the proof is not bound to the ciphertext —
dp — — noise in training; no end-to-end (ε, δ) guarantee
he_*_zkp_dp server sees only ciphertexts none as dp

DP as implemented. During local training each batch's mean gradient is clipped to norm C and Gaussian noise with standard deviation σ·C/B is added (B is the batch size), with σ = √(2 ln(1.25/δ))/ε (ppflx/core/engine.py). That is a single-step calibration with no per-example clipping and no accounting across steps or rounds, so the recorded ε sets the noise; it is not an (ε, δ) guarantee for the published model.

docs/ZKP.md documents the protocols, the update bound, the circuits and the limitations in full. Read SECURITY.md before relying on any of these properties.

Install

pip install ppflx            # core: Flower, TenSEAL, torch
pip install "ppflx[tfhe]"    # adds Concrete-ML — see the licence note below

Python 3.12 (Concrete-ML requires < 3.13; Flower 1.36 requires > 3.11). The tfhe extra builds onnxoptimizer (pinned by Concrete-ML, with no Python 3.12 wheel) from source, which needs CMake and a C++ compiler; with CMake 4 or later, install with CMAKE_POLICY_VERSION_MINIMUM=3.5 pip install "ppflx[tfhe]".

pip alone does not give working proofs. The zero-knowledge modes (zkp, zkp_sampled, he_elgamal_zkp, he_elgamal_zkp_sampled and the *_zkp* composites) prove and verify through a separate Go proof service that pip does not install. Build it from gnark-gradient-prover, set FL_GNARK_BINARY to the binary and make a local key set as in docs/ZKP.md, section 7.1. Without it those modes cannot run; the other modes do not use the proof service.

Use

from ppflx import FLConfig, get_privacy_mode
from ppflx.server import make_strategy
from ppflx.client import make_client

config = FLConfig(dataset="healthcare", privacy_mode="zkp", num_rounds=3)
mode = get_privacy_mode(config.privacy_mode)

strategy = make_strategy(config, mode, testloader)      # in a Flower ServerApp
client = make_client("0", trainloaders, valloaders, mode, config)  # in a ClientApp

ppflx_bench shows a complete ServerApp and ClientApp built on these.

Key generation:

python -m ppflx.keys generate he_tenseal
python -m ppflx.keys generate dp --output keys/dp/dp_params.json

Proof service

ZKP modes talk to the prover and verifier over HTTP:

export FL_ZKP_PROVER_URL=http://127.0.0.1:9000     # clients prove here
export FL_ZKP_VERIFIER_URL=http://127.0.0.1:9001   # the server verifies here

The verifying keys and manifest this library pins ship in ppflx/core/gnark_keys_data/; a proof made under any other key is rejected. Point FL_ZKP_KEYS_DIR elsewhere to pin different keys.

Tests

pytest tests

Tests that need proofs run against a built proof service; set FL_GNARK_BINARY to its binary, or they skip.

Licence

Apache-2.0 — see LICENSE. Copyright 2026 CorpiXo.

Concrete-ML (the tfhe extra) is BSD-3-Clause-Clear, which grants no patent rights; Zama requires a commercial patent licence for commercial use. See NOTICE.

Metadata

Release files for ppflx 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ppflx 0.9.2
File Size Uploaded Provenance Actions
ppflx-0.9.2.tar.gz 203.7 kB With provenance Details for ppflx-0.9.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ppflx 0.9.2
File Interpreter ABI Platform Actions
ppflx-0.9.2-py3-none-any.whl Python 3 none any Details for ppflx-0.9.2-py3-none-any.whl

Total release size: 396.8 kB

Release files / ppflx-0.9.2.tar.gz

Download URL ppflx-0.9.2.tar.gz
Size 203.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d725158d4ed3d1997b1e77ba8685fbf72ad8c3594461d5546074882feb1c8e6
BLAKE2b-256 checksum
How to use checksums
ca9b6dadf25814ce12ab2f7e9b236272dfd7ecacb5ec7a41560f8f0814c097f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / ppflx-0.9.2-py3-none-any.whl

Download URL ppflx-0.9.2-py3-none-any.whl
Size 193.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13da8e03dfba168661ab4175cec7ec284118c17c3e6eb2dfa5139fef41c585e1
BLAKE2b-256 checksum
How to use checksums
f0523fafe0413e65864d0881455b65819a526636b808e5cbc445c84ddb26a333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for ppflx 0.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ppflx-0.9.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page