Skip to content

ZKFair

ZKFair is a trustless platform for proving ML model fairness using Zero-Knowledge Proofs.

  • Privacy-Preserving: Prove fairness without exposing training data or model weights
  • Trustless: On-chain commitments + ZK proofs eliminate trusted third parties
  • Continuous: Runtime auditing of inference queries, not just training
  • Economic Security: Stake-based incentives with slashing for misbehavior

1. Certify

Provider registers model on-chain with cryptographic commitments. ZK proof verifies training fairness.

2. Serve

Provider runs inference, issues signed receipts. Queries batched into Merkle trees on-chain.

3. Audit

Anyone can challenge batches. Provider must respond with ZK fairness proof within 24h.

4. Detect

Users verify receipts against blockchain. Disputes slash malicious providers.



ComponentDescription
CLIRegister models, generate proofs, submit certifications
ServerInference API with batching, receipts, audit handling
Web AppUser interface with Sentinel fraud detection
SDKProviderSDK (server) and BrowserSDK (client)
ContractsModel registry, batching, disputes, slashing
ZK CircuitsTraining certification + fairness audit proofs

Provider registers model with cryptographic commitments:

Terminal window
# Hash weights + build dataset Merkle tree
zkfair commit --dir ./my-model
# Generate ZK training proof + submit
zkfair proof generate-and-submit --weights-hash 0x...

Provider runs inference and batches queries:

// POST /predict
const receipt = await provider.createSignedReceipt({
seqNum, modelId, features, prediction, timestamp
});
// Auto-batch when thresholds met
await provider.createBatchIfNeeded();

Anyone can challenge batches:

// Request audit (stakes 0.00005 ETH)
requestAudit(batchId);
// Provider auto-responds with ZK proof
provider.watchAuditRequests((result) => {
console.log(result.passed ? "PASSED" : "FAILED");
});

Users verify receipts locally:

const result = await verifyReceipt(receipt);
if (result.status === "FRAUD_NON_INCLUSION") {
// Provider never batched the query
disputeNonInclusion(receipt);
}
if (result.status === "FRAUD_INVALID_PROOF") {
// Provider tampered with batch data
disputeFraudulentInclusion(batchId, seqNum);
}

ParameterValue
Provider Stake0.0001 ETH
Audit Stake0.00005 ETH
Dispute Stake0.0001 ETH
Audit Deadline24 hours
Grace Period1 hour

Slashing conditions:

  • Failed audit → stake to challenger
  • Missed deadline → slashed
  • Valid dispute → slashed, user compensated