Loading...
Loading...
Generate and verify zero-knowledge compliance proofs using snarkjs Groth16 circuits. Prove that agents satisfy governance policies, meet trust thresholds, and hold valid credentials — all without revealing the underlying sensitive data.
DRD uses zero-knowledge proofs (ZKPs) to enable privacy-preserving compliance verification. Organizations can prove they meet regulatory requirements, agents can demonstrate policy adherence, and federations can share trust signals — all without exposing confidential business data or personally identifiable information.
Prove an agent satisfies a compliance policy without revealing the underlying data or score details.
Prove a value exceeds a threshold (e.g., DRD Score above 70) without disclosing the exact value.
Prove an agent belongs to a federation or allowlist without revealing the full membership set.
Prove possession of a valid W3C Verifiable Credential without exposing the credential contents.
DRD's ZKP system is built on Groth16, a pairing-based zk-SNARK protocol that produces constant-size proofs (192 bytes) verifiable in constant time. Circuits are authored in Circom and compiled via snarkjs.
Circuit Compilation
Circom circuits are compiled to R1CS constraint systems and WASM witness generators.
Trusted Setup
Groth16 requires a one-time trusted setup ceremony to generate proving and verification keys.
Witness Generation
Private inputs are used to compute the witness (all intermediate wire values in the circuit).
Proof Generation
The prover uses the witness and proving key to generate a succinct zk-SNARK proof.
On-Chain Verification
The verifier checks the proof against public inputs using the verification key in constant time.
Use the SDK to generate a zero-knowledge proof that an agent meets a specific compliance policy. The proof is generated client-side — private inputs never leave your environment.
import { DRD } from '@drd/sdk';
const drd = new DRD({ apiKey: process.env.DRD_API_KEY });
// Generate a compliance proof for an agent
const proof = await drd.zkp.generateComplianceProof({
agentId: 'agent_abc123',
policyId: 'policy_gdpr_2026',
privateInputs: {
drdScore: 87,
complianceFlags: ['gdpr', 'ccpa', 'eu_ai_act'],
auditTimestamp: Date.now(),
},
circuit: 'compliance_threshold_v2',
});
console.log(proof.proofHash); // '0x1a2b3c...'
console.log(proof.publicSignals); // ['1'] (1 = compliant)
console.log(proof.proofSize); // 192 bytes
console.log(proof.generationTime); // ~1200ms// Prove DRD Score exceeds a threshold without revealing exact value
const thresholdProof = await drd.zkp.generateComplianceProof({
agentId: 'agent_abc123',
policyId: 'policy_min_score_70',
privateInputs: {
drdScore: 87, // Private: not revealed
threshold: 70, // Public: the minimum required
},
circuit: 'score_threshold_v1',
});
// The proof attests: drdScore >= 70 (true)
// without revealing that the actual score is 87Verification is extremely fast (sub-millisecond) and requires only the proof, public signals, and verification key. No access to private data is needed.
// Verify a compliance proof
const result = await drd.zkp.verify({
proof: proof.proof,
publicSignals: proof.publicSignals,
verificationKey: 'vk_compliance_threshold_v2',
});
console.log(result.valid); // true
console.log(result.verifiedAt); // '2026-02-12T10:00:00Z'
console.log(result.verificationTime); // 0.4ms
// Batch verification for multiple proofs
const batchResult = await drd.zkp.verifyBatch([
{ proof: proof1.proof, publicSignals: proof1.publicSignals, vk: 'vk_compliance_v2' },
{ proof: proof2.proof, publicSignals: proof2.publicSignals, vk: 'vk_score_threshold_v1' },
{ proof: proof3.proof, publicSignals: proof3.publicSignals, vk: 'vk_membership_v1' },
]);
console.log(batchResult.allValid); // true
console.log(batchResult.results); // [true, true, true]ZKPs are deeply integrated with the DRD federation system. Members can share compliance proofs across organizations without revealing proprietary governance data.
// Share a compliance proof with the federation
await drd.federation.shareProof({
federationId: 'fed_alliance_01',
proof: proof.proof,
publicSignals: proof.publicSignals,
circuit: 'compliance_threshold_v2',
metadata: {
agentId: 'agent_abc123',
policyType: 'gdpr',
validUntil: '2026-03-12T00:00:00Z',
},
});
// Federation members verify without seeing private data
const federationProofs = await drd.federation.getProofs({
federationId: 'fed_alliance_01',
agentId: 'agent_abc123',
policyType: 'gdpr',
});Core ZKP endpoints for proof generation and verification.
/api/zkp/prove
Generate a zero-knowledge proof for a given circuit and private inputs
/api/zkp/verify
Verify a proof against public signals and a verification key
/api/zkp/verify-batch
Verify multiple proofs in a single request
/api/zkp/circuits
List available ZKP circuits and their parameters
/api/zkp/keys/:circuit
Retrieve the verification key for a circuit