Share & Anchor a ZK Proof

View as Markdown
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
  1. From the proof’s detail page, click Anchor on chain.
  2. The wallet prompts for confirmation. Approve.
  3. The wallet calls submitProof(proofHash, proverDID, credentialId, predicateHash) on the ZKProofVerifier contract (see §11.6).
  4. After receipt, the proof’s record on the platform shows the txHash and onChain: 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
cURL — verify
$curl -X POST https://adid.dev/api/v1/zkp/verify \
> -H "Content-Type: application/json" \
> -d '{
> "proof":"<hex>",
> "predicate":"age_gte",
> "params":{"threshold":18},
> "challenge":"f9c8b3e0...",
> "proverDid":"did:adi:0x9a2c..."
> }'

(No auth — /api/v1/zkp/verify is public per router.go:71.)

Verify

After anchoring, query verifyProofOnChain(proofHash) on the contract via the API:

$curl https://adid.dev/api/v1/zkp/proofs/<id>?includeOnChain=true \
> -H "Authorization: Bearer $ACCESS_TOKEN"
Troubleshooting
CodeCauseFix
409 ALREADY_ANCHOREDThis proof’s hash is already on chainNo action needed.
503 CHAIN_UNREACHABLERPC downRetry.
403 NOT_PROVERYou are not the original proverOnly the prover may anchor / revoke.

⚠️ Warning — On-chain anchoring is permanent. Proof revocation is supported (call revokeProof(proofHash)) but the original anchor record remains visible (just with revoked: true). Do not anchor a proof unless you intend it to be auditable forever.