> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.adid.dev/llms.txt.
> For full documentation content, see https://docs.adid.dev/llms-full.txt.

# SDK — ZKP Operations

Source: `packages/sdk/src/zkp.ts`.

| SDK method                        | Endpoint                      |
| --------------------------------- | ----------------------------- |
| `generateChallenge()`             | `POST /api/v1/zkp/challenge`  |
| `generateZKProof(params)`         | `POST /api/v1/zkp/proofs`     |
| `verifyZKProof(proof, proverDid)` | `POST /api/v1/zkp/verify`     |
| `getZKProof(proofId)`             | `GET /api/v1/zkp/proofs/{id}` |

#### Example: predicate proof

```ts
const challenge = await client.generateZKChallenge();

const { proof } = await client.generateZKProof({
  credentialId: vc.id,
  proverDid: 'did:adi:alice…',
  privateKey: holderPrivateKeyB64Url,
  credentialSubject: { age: 25, country: 'US' },
  predicates: [
    { attributeName: 'age', type: 'gte', value: 18 },
    { attributeName: 'country', type: 'membership', memberSet: ['US','UK','EU'] },
  ],
  challenge: challenge.challenge,
  anchorOnChain: false,
});

const verification = await verifierClient.verifyZKProof(proof, 'did:adi:alice…');
console.log('All predicates satisfied?', verification.valid);
```

> **Important:** The wallet uses this exact API on mobile (§8.4). When `anchorOnChain: true`, the response includes `onChainHash` — use it to fetch the on-chain `ProofRecord` from the ZKProofVerifier contract (§11.6).