๐ Country Support
Currently 7 countries supported โ and growing. Add yours in one PR.
Supported Countries
| Country | Document | Code | Format | Status |
|---|---|---|---|---|
| ๐จ๐ด Colombia | Cรฉdula de Ciudadanรญa | CO |
CC-XXXXXXXXXX (10 digits) |
Full โ |
| ๐ฒ๐ฝ Mexico | CURP / INE | MX |
AAAA######AAAAAA## (CURP 18 chars) |
Partial โก |
| ๐ฆ๐ท Argentina | DNI | AR |
XX.XXX.XXX (8 digits) |
Partial โก |
| ๐ป๐ช Venezuela | Cรฉdula V/E | VE |
V-XXXXXXXX or E-XXXXXXXX |
Partial โก |
| ๐ต๐ช Peru | DNI | PE |
XXXXXXXX (8 digits) |
Partial โก |
| ๐ง๐ท Brazil | CPF | BR |
XXX.XXX.XXX-XX (11 digits) |
Partial โก |
| ๐จ๐ฑ Chile | RUN / RUT | CL |
XX.XXX.XXX-X (8 digits + verifier) |
Partial โก |
Full support: OCR extraction + MRZ parsing + face match + biometric proof + all 6 credentials available.
Partial support: Document number validation + basic OCR; face match and biometric proof may have reduced accuracy.
Countries Planned (Phase 6)
- ๐ช๐ธ Spain โ DNI (
XXXXXXXX-X) / NIE (X-XXXXXXX-X) - ๐ฎ๐ณ India โ Aadhaar (
XXXX XXXX XXXX) - ๐ณ๐ฌ Nigeria โ NIN (
XXXXXXXXXXX) - ๐ฟ๐ฆ South Africa โ SA ID (
YYMMDD XXXX X XX) - ๐ต๐ญ Philippines โ PhilSys ID (
XXXX-XXXX-XXXX)
Add Your Country โ Contributor Guide
Adding a new country requires implementing a Document Adapter in the soulprint-verify package. Here's how:
1. Fork the repository
git clone https://github.com/manuelariasfz/soulprint
cd soulprint
npm install
cd packages/verify && npm install
2. Create the document adapter
// packages/verify/src/adapters/XX.ts (replace XX with country code)
import { DocumentAdapter, ExtractedIdentity } from "../types";
export const XXAdapter: DocumentAdapter = {
countryCode: "XX",
documentName: "Your Country ID Name",
// Validate format of the document number
validate(docNumber: string): boolean {
return /^[A-Z0-9]{8,12}$/.test(docNumber.replace(/[\s\-\.]/g, ""));
},
// Extract fields from OCR text
extract(ocrText: string): Partial<ExtractedIdentity> {
const docMatch = ocrText.match(/YOUR_REGEX_HERE/);
return {
documentNumber: docMatch?.[1] ?? null,
fullName: extractName(ocrText),
dateOfBirth: extractDOB(ocrText),
nationality: "XX"
};
}
};
3. Register the adapter
// packages/verify/src/adapters/index.ts
import { XXAdapter } from "./XX";
export const ADAPTERS = {
CO: COAdapter,
MX: MXAdapter,
// ... existing
XX: XXAdapter, // โ add your country
};
4. Add tests
// packages/verify/tests/adapters/XX.test.ts
import { XXAdapter } from "../../src/adapters/XX";
test("validates XX document number", () => {
expect(XXAdapter.validate("VALID_SAMPLE")).toBe(true);
expect(XXAdapter.validate("INVALID")).toBe(false);
});
test("extracts fields from OCR", () => {
const result = XXAdapter.extract("... sample OCR text ...");
expect(result.documentNumber).toBe("VALID_SAMPLE");
});
5. Open a Pull Request
Open a PR against main with:
- The adapter file (
packages/verify/src/adapters/XX.ts) - Registration in
index.ts - At least 5 test cases (valid formats, edge cases, invalid formats)
- Update to
README.mdcountry support table
PR template: PULL_REQUEST_TEMPLATE.md
No OCR data needed
You don't need real ID photos to contribute. All tests use synthetic OCR strings. Never commit real document data.
Document Format Registry
Country code 2-letter codes follow ISO 3166-1 alpha-2. The document number format for each country is used to derive the identity hash โ only the normalized number (digits only, no separators) is used in the hash computation.