DEV Community

Manuel Felipe Arias Pineda
Manuel Felipe Arias Pineda

Posted on

๐Ÿ‡ฎ๐Ÿ‡ณ India devs: Add Aadhaar / PAN to the AI identity standard โ€” Soulprint open source (30 min PR)

AI agents make millions of decisions daily in India โ€” and no system verifies if a real person is behind them.

Soulprint solves this with ZK Proofs: 100% on-device, open source (MIT), free.

๐Ÿ‡ฎ๐Ÿ‡ณ Aadhaar and PAN are not fully in Soulprint yet. You can complete the implementation in ~30 minutes.

Aadhaar / PAN format

Aadhaar: 12 digits. Verhoeff algorithm check digit. Format on card: XXXX XXXX XXXX.
PAN: 5 uppercase letters + 4 digits + 1 letter (AAAAA9999A). 4th letter = taxpayer type.

const IN: CountryVerifier = {
  countryCode: "IN", countryName: "India",
  documentTypes: ["aadhaar", "pan"],
  parse(ocrText: string): DocumentResult {
    const aadhaar = ocrText.match(/(\d{4}\s\d{4}\s\d{4})/)?.[1]?.replace(/\s/g,"")
                  ?? ocrText.match(/(\d{12})/)?.[1] ?? "";
    if(aadhaar) return { valid: true, doc_number: aadhaar, country: "IN", document_type: "aadhaar" };
    const pan = ocrText.match(/([A-Z]{5}\d{4}[A-Z])/)?.[1] ?? "";
    return { valid: !!pan, doc_number: pan, country: "IN", document_type: "pan" };
  },
  validate(docNumber: string): NumberValidation {
    if(/^\d{12}$/.test(docNumber)) return { valid: true }; // add Verhoeff
    if(/^[A-Z]{5}\d{4}[A-Z]$/.test(docNumber)) return { valid: true };
    return { valid: false };
  },
};
export default IN;
Enter fullscreen mode Exit fullscreen mode

๐Ÿ’ป GitHub ยท ๐ŸŒ€ soulprint.digital

One PR. One country. The future of AI identity is open source.

Top comments (0)