Generate a ZK Proof
When to use
You want to share a “I am over 18” / “I’m a verified European resident” / “I have ≥ 5 BTC” proof without revealing the underlying credential. The portal generates the proof in your browser (or, optionally, server-side if your client cannot run the prover).
Before you begin
- A credential containing the relevant claim (e.g., a KYC credential with
dateOfBirthforage_gte). - The verifier-supplied challenge (or generate one from the API).
Steps
- Open
/zk-identity. - Click Generate proof and pick a predicate from the dropdown.
3. Fill predicate-specific parameters (e.g. for
age_gte, the threshold =18). - Select the source credential.
- Click Generate. The portal:
- Calls
POST /api/v1/zkp/challengeto obtain a fresh nonce. - Builds the witness from the credential’s claims + your private signing share.
- Runs the prover (in-browser via WASM, or server-side fallback).
- Calls
POST /api/v1/zkp/proofsto register the proof in the platform.
- Calls
- The portal displays the proof ID and a copy/share button.
API & SDK
Verify
shows status: "verified" and the predicate / params / credentialId.
Troubleshooting
3.3.4. Sharing & Anchoring Proofs On-Chain ##### When to use
The verifier requires a public, immutable record of your proof — typically for high-stakes use (regulatory KYC, on-chain DAO voting). On-chain anchoring is opt-in.
Before you begin
- A generated proof (§3.3.3).
- (Optional) wallet permission to sign the chain transaction.
Steps
- From the proof’s detail page, click Anchor on chain.
- The wallet prompts for confirmation. Approve.
- The wallet calls
submitProof(proofHash, proverDID, credentialId, predicateHash)on the ZKProofVerifier contract (see §11.6). - After receipt, the proof’s record on the platform shows the
txHashandonChain: true.
Sharing
To share a proof off-chain, click Copy share link — generates a URL like https://adid.dev/proofs/abc123 that any party can visit (no auth needed) to verify.
API
(No auth — /api/v1/zkp/verify is public per router.go:71.)
Verify
After anchoring, query verifyProofOnChain(proofHash) on the contract via the API:
Troubleshooting
⚠️ Warning — On-chain anchoring is permanent. Proof revocation is supported (call
revokeProof(proofHash)) but the original anchor record remains visible (just withrevoked: true). Do not anchor a proof unless you intend it to be auditable forever.