IGradientCommitment<T>

Interfaces · AiDotNet.FederatedLearning.Verification

Defines the contract for committing to gradient values before revealing them.

Known implementations: HashCommitmentScheme<T>, PedersenCommitment<T>

For Beginners

In FL, a malicious client could wait to see other clients’ updates and then craft its own update to manipulate the result (an “adaptive attack”). Commitment schemes prevent this: each client first sends a “commitment” (a cryptographic lock on its gradient), and only after all commitments are received does anyone reveal the actual values.

How It Works

Properties:

Homomorphic commitments (like Pedersen) have an additional property: the server can verify that the sum of committed values matches the committed sum, without seeing individual values.

Methods

Method Summary
GradientCommitmentData<T> Commit(Tensor<T> gradient) Creates a commitment to a gradient tensor.
Tensor<T> Open(GradientCommitmentData<T> commitment) Opens a commitment, revealing the original gradient value.
bool Verify(GradientCommitmentData<T> commitment) Verifies that an opened commitment matches the original commitment.
bool VerifyAggregation(IReadOnlyList<GradientCommitmentData<T>> individualCommitments, GradientCommitmentData<T> aggregateCommitment) Verifies that the sum of individual commitments matches a claimed aggregate commitment.