1. Certify
Provider registers model on-chain with cryptographic commitments. ZK proof verifies training fairness.
ZKFair is a trustless platform for proving ML model fairness using Zero-Knowledge Proofs.
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.
| Component | Description |
|---|---|
| CLI | Register models, generate proofs, submit certifications |
| Server | Inference API with batching, receipts, audit handling |
| Web App | User interface with Sentinel fraud detection |
| SDK | ProviderSDK (server) and BrowserSDK (client) |
| Contracts | Model registry, batching, disputes, slashing |
| ZK Circuits | Training certification + fairness audit proofs |
Provider registers model with cryptographic commitments:
# Hash weights + build dataset Merkle treezkfair commit --dir ./my-model
# Generate ZK training proof + submitzkfair proof generate-and-submit --weights-hash 0x...Provider runs inference and batches queries:
// POST /predictconst receipt = await provider.createSignedReceipt({ seqNum, modelId, features, prediction, timestamp});
// Auto-batch when thresholds metawait provider.createBatchIfNeeded();Anyone can challenge batches:
// Request audit (stakes 0.00005 ETH)requestAudit(batchId);
// Provider auto-responds with ZK proofprovider.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);}| Parameter | Value |
|---|---|
| Provider Stake | 0.0001 ETH |
| Audit Stake | 0.00005 ETH |
| Dispute Stake | 0.0001 ETH |
| Audit Deadline | 24 hours |
| Grace Period | 1 hour |
Slashing conditions: