1. Installation
Install the published SDK package via npm, yarn, or pnpm.2. The 3-Line Frontend Integration
The client-side integration requires rendering the<Ciphera /> React widget. This widget handles the complete flow: XML upload, local parsing, snarkjs WASM proof generation, encryption, and Algorand chain submission.
Important: TheappIdstring YOU provide here is critical. The SDK uses this app ID to derive the nullifier (Poseidon(aadhaar, appId, targetWallet)). This ensures strict cross-app privacy. Users will have a completely different nullifier on your app versus someone else’s.
Widget UX Flow
- User clicks Verify KYC in your app.
- The Ciphera widget opens with an embedded UIDAI webview.
- User completes OTP on the UIDAI portal. The widget never sees the OTP.
- The offline Aadhaar XML ZIP is auto-detected.
- The widget displays:
"Generating your privacy proof..." snarkjsWASM runs locally in 2-5 seconds.- The proof is submitted to the Algorand testnet/mainnet.
- A credential ASA is issued to the wallet.
- The widget closes, and your
onVerified()callback fires. Your app grants access without ever touching the user’s data.
3. Server-Side Verification
If you are running a centralized matching engine or a Python/Node backend, you can independently verify that a user’s wallet holds a valid, non-revoked KYC credential.verifyKYC queries the Algorand blockchain (specifically the NullifierRegistry smart contract and the Sparse Merkle Root) to ensure the credential is valid and has not been revoked by a court order. It does not require any PII.
DPDP Compliance Guarantees for Developers
By using this SDK, your application guarantees:- Data Minimization: You receive only a boolean KYC status.
- Purpose Limitation: Your
appIdscopes the credential to your app only. - Storage Limitation: You never store PII; you store a cryptographic boolean.
- Security Safeguards: You offload all encryption and Shamir key management to the decentralized Ciphera protocol.