facezk-core
Version:
ZKP-AI Proof of Humanity: Live Selfie Check with Biometric Template Extraction and Fuzzy Hashing
29 lines • 1.41 kB
TypeScript
/**
* Biometric Template Extraction
* ZK-AI Proof of Humanity: Face Descriptor Generation
*/
import type { BiometricTemplate, FaceZKConfig } from '../types';
import type { FuzzyHashConfig } from './fuzzy-hash';
/** Face mesh keypoints for biometric analysis */
export interface FaceMesh {
/** 468 face mesh points */
points: number[][];
/** Face bounding box */
box: [number, number, number, number];
/** Confidence score */
confidence: number;
}
/** Extract biometric template from face mesh */
export declare function extractTemplate(faceMesh: FaceMesh, config: FaceZKConfig): Promise<BiometricTemplate>;
/** Generate non-reversible biometric ID (Sₐ) using fuzzy-tolerant hashing */
export declare function generateBiometricId(template: BiometricTemplate, fuzzyConfig?: FuzzyHashConfig): string;
/** Generate Humanity Code (Hₐ = SHA256(Sₐ || SYSTEM_SALT)) */
export declare function generateHumanityCode(biometricId: string, systemSalt: string): string;
/** Compare two biometric templates using fuzzy-tolerant hashing */
export declare function compareTemplates(template1: BiometricTemplate, template2: BiometricTemplate, threshold?: number, fuzzyConfig?: FuzzyHashConfig): {
similarity: number;
match: boolean;
};
/** Validate biometric template */
export declare function validateTemplate(template: BiometricTemplate): string[];
//# sourceMappingURL=template.d.ts.map