Used in: §3.3.3 Generating a Proof in the Browser
Audience: Holder, Backend Developer
IA ID: D7
No
Yes
Holder picks predicate (age_gte, country_in, range, set_membership, not_equal)
POST /api/v1/zkp/challenge
API issues nonce (Redis TTL)
Build witness from credentialSubject + privateKey
Compile predicate to circuit input
Run prover (Airbender / snarkjs in browser or server)
Predicate satisfied?
422 PREDICATE_NOT_SATISFIED
Aggregate proof bytes
POST /api/v1/zkp/proofs (proof, proverDid, credentialId)
DB: INSERT zk_proofs (status=generated)
Return proofId + proof bundle
Reading guide: The challenge has a TTL in Redis; if the holder takes too long to submit, the API returns 410 CHALLENGE_EXPIRED (see zkp.go:128).