Skip to content

vsrupeshkumar/Formalized-Federated-Runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🌐 Formalized Federated Runtime (FFR)

Theorem-Guided Sovereign Federated Intelligence

Latest Tag Build PQC Transport License

Formalized Federated Runtime (FFR) is a high-performance, theorem-guided federated learning (FL) substrate. It bridges the gap between theoretical privacy/security proofs and production-grade execution by integrating Lean formal verification, Byzantine resilience, and Post-Quantum Cryptography (PQC).


🧬 Core Architecture & Trust Model

The FFR architecture is designed to handle up to 10M nodes with hardened trust roots at every layer.

graph TD
    subgraph "Edge Layer (Untrusted)"
        N1[Client Node A] --> |Update + LDP| R1
        N2[Client Node B] --> |Update + LDP| R1
        N3[Client Node C] --> |Update + LDP| R2
    end

    subgraph "Regional Layer (Byzantine Filtering)"
        R1[Shard Router East] --> |Filtered Batch| AG1[Aggregator]
        R2[Shard Router West] --> |Filtered Batch| AG1
    end

    subgraph "Global Layer (Theorem Validation)"
        AG1 --> |Model Update| FV[Formal Verifier]
        FV --> |ZK-SNARK Proof| BC[Global Ledger]
        BC --> |State Finality| G[Global Model State]
    end

    %% Security Enforcements
    TPM{{TPM Attestation}} -.-> N1
    TPM -.-> N2
    PQC{{PQC Hybrid KEX}} ==> R1
    PQC ==> R2
Loading

📐 Mathematical Foundations

FFR implements the following formal primitives to ensure convergence and privacy.

1. Robust Federated Aggregation (FedAvg)

The global model $w$ is updated at round $t$ by averaging local gradients from $K$ selected clients:

$$ w_{t+1} = \sum_{k=1}^K \frac{n_k}{n} w_{t+1}^k $$

Where $n_k$ is the number of samples at client $k$, and $n = \sum n_k$.

2. Byzantine Resilience (Multi-Krum)

To defend against malicious updates, we employ the Krum selection rule. For $n$ updates, where $f$ are suspected to be Byzantine, we select the update $w_{i^*}$ that minimizes the sum of squared distances to its $n-f-2$ nearest neighbors:

$$ i^* = \arg\min_{i} \sum_{j \in \mathcal{N}(i)} |w_i - w_j|^2 $$

3. Rényi Differential Privacy (RDP)

Privacy loss is tracked using $(\alpha, \epsilon)$-RDP, which provides tighter composition bounds for iterative training:

$$ D_\alpha(P | Q) = \frac{1}{\alpha - 1} \log \mathbb{E}_{x \sim Q} \left[ \left( \frac{P(x)}{Q(x)} \right)^\alpha \right] \leq \epsilon $$

4. Post-Quantum Security

Key exchange is secured using a hybrid x25519-mlkem768 construction, ensuring resistance against both classical and Shor-class quantum attacks.


🚀 Getting Started

1. Install the SDK

FFR provides a Python SDK that integrates seamlessly with existing workflows.

pip install formalized-federated-runtime

2. Local Sandbox Execution

Launch a full 3-node federated stack with one command:

./genesis-launch.sh --all-nodes

3. Run a Verified Task

from mohawk import MohawkNode

node = MohawkNode()
node.start(config_path="capabilities.json")

# Submit a privacy-preserved update
node.aggregate([{
    "node_id": "edge-01",
    "gradient": [0.01, -0.05, 0.12],
    "dp_noise": "laplacian"
}])

✅ Formal Verification Status

Our runtime properties are machine-checked using Lean 4.

Property Theorem Lean Source Status
Byzantine Resilience Honest Majority ($>55%$) proofs/Theorem1BFT.lean ✅ Passed
Convergence $\epsilon$-Convergence proofs/Theorem2Conv.lean ✅ Passed
Privacy RDP Budget Bound proofs/Theorem3Privacy.lean ✅ Passed
Liveness Straggler Tolerance proofs/Theorem4Liveness.lean ✅ Passed

🛠️ Infrastructure Defaults

  • Transport: libp2p with Noise (PQC Hybrid)
  • Identity: TPM 2.0 XMSS Attestation
  • Runtime: WASM (Hot-reloadable modules)
  • Metrics: Prometheus + Grafana (Pre-configured)

📄 License

Apache License 2.0. See LICENSE.md for details.


Built with ❤️ for a Sovereign Federated Future.

About

A production-grade federated learning runtime that replaces trust with verification. Combines cryptographic proofs, hardware attestation, and formal guarantees to enable secure, large-scale distributed model training across untrusted environments.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages