{"$id": "https://hst.tzzr.eu/schemas/nid.1.0.json", "type": "object", "title": "HST National Identity Document", "$schema": "https://json-schema.org/draft/2020-12/schema", "required": ["L1_document", "L2_holder", "L6_status", "L7_metadata"], "properties": {"L3_mrz": {"type": "object", "properties": {"lines": {"type": "array", "items": {"type": "string"}, "maxItems": 3, "minItems": 2}, "format": {"enum": ["TD1", "TD2"], "type": "string", "description": "TD1: 3×30 chars, TD2: 2×36 chars"}, "parsed": {"type": "object", "properties": {"sex": {"type": "string"}, "name": {"type": "string"}, "expiry_date": {"type": "string"}, "nationality": {"type": "string"}, "date_of_birth": {"type": "string"}, "document_type": {"type": "string"}, "issuing_state": {"type": "string"}, "optional_data": {"type": "string"}, "check_digit_dob": {"type": "string"}, "check_digit_doc": {"type": "string"}, "check_digit_exp": {"type": "string"}, "document_number": {"type": "string"}, "check_digit_composite": {"type": "string"}}}, "present": {"type": "boolean"}, "checksums_valid": {"type": "boolean"}, "checksum_details": {"type": "object", "properties": {"composite": {"type": "boolean"}, "expiry_date": {"type": "boolean"}, "date_of_birth": {"type": "boolean"}, "document_number": {"type": "boolean"}}}}, "description": "Machine Readable Zone (si presente)"}, "L4_chip": {"type": "object", "properties": {"present": {"type": "boolean"}, "pin_status": {"type": "object", "properties": {"blocked": {"type": "boolean"}, "pin_set": {"type": "boolean"}, "pin_retries_remaining": {"type": "integer"}, "puk_retries_remaining": {"type": "integer"}}}, "technology": {"enum": ["ISO_14443_A", "ISO_14443_B", "NFC", "CONTACT"], "type": "string", "description": "Tecnología del chip"}, "data_groups": {"type": "array", "items": {"type": "string", "pattern": "^DG([1-9]|1[0-6])$"}, "description": "Data Groups presentes (DG1-DG16)"}, "read_result": {"type": "object", "properties": {"success": {"type": "boolean"}, "chip_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED", "NOT_SUPPORTED"], "type": "string"}, "active_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED", "NOT_SUPPORTED"], "type": "string"}, "passive_auth": {"enum": ["PASSED", "FAILED", "NOT_PERFORMED"], "type": "string"}}}, "applications": {"type": "array", "items": {"enum": ["eID", "eSign", "ePassport", "eHealth", "ePay", "eVote"], "type": "string"}, "description": "Aplicaciones disponibles en el chip"}, "certificates": {"type": "object", "properties": {"signature": {"type": "object", "properties": {"issuer": {"type": "string"}, "present": {"type": "boolean"}, "valid_from": {"type": "string", "format": "date"}, "valid_until": {"type": "string", "format": "date"}}}, "authentication": {"type": "object", "properties": {"issuer": {"type": "string"}, "present": {"type": "boolean"}, "valid_from": {"type": "string", "format": "date"}, "valid_until": {"type": "string", "format": "date"}}}}}, "protocols_supported": {"type": "array", "items": {"enum": ["BAC", "PACE", "PA", "AA", "CA", "TA"], "type": "string"}}}, "description": "Chip electrónico (si presente)"}, "L2_holder": {"type": "object", "required": ["holder_ref", "primary_identifier", "date_of_birth", "nationality"], "properties": {"sex": {"enum": ["M", "F", "X", "<"], "type": "string", "description": "Sexo: M=Masculino, F=Femenino, X=No especificado"}, "photo": {"type": "object", "properties": {"format": {"enum": ["JPEG", "JPEG2000", "PNG"], "type": "string"}, "source": {"enum": ["SCAN", "CHIP", "PHOTO"], "type": "string"}, "present": {"type": "boolean"}}}, "address": {"type": "object", "properties": {"city": {"type": "string"}, "street": {"type": "string"}, "country": {"type": "string"}, "province": {"type": "string"}, "postal_code": {"type": "string"}}, "description": "Domicilio (si figura en el documento)"}, "parents": {"type": "object", "properties": {"father_name": {"type": "string"}, "mother_name": {"type": "string"}}, "description": "Filiación (si figura en el documento)"}, "signature": {"type": "object", "properties": {"digital": {"type": "boolean"}, "present": {"type": "boolean"}}}, "holder_ref": {"type": "string", "pattern": "^ppl:[a-f0-9-]{36}$", "description": "Referencia a la entidad persona (ppl:uuid)"}, "nationality": {"type": "string", "pattern": "^[A-Z]{3}$"}, "date_of_birth": {"type": "string", "format": "date"}, "full_name_viz": {"type": "string", "description": "Nombre completo como aparece impreso (VIZ)"}, "place_of_birth": {"type": "string"}, "full_name_local": {"type": "string", "description": "Nombre en escritura local si aplica"}, "primary_identifier": {"type": "string", "description": "Apellido(s) según MRZ"}, "secondary_identifier": {"type": "string", "description": "Nombre(s) según MRZ"}}, "description": "Datos del titular TAL COMO FIGURAN en el documento"}, "L6_status": {"type": "object", "required": ["status"], "properties": {"status": {"enum": ["VALID", "EXPIRED", "REVOKED", "LOST", "STOLEN", "DESTROYED", "RENEWED", "SUSPENDED"], "type": "string", "description": "Estado actual del documento"}, "renewal": {"type": "object", "properties": {"next_document": {"type": "string", "description": "ref:nid:uuid del documento renovado"}, "previous_document": {"type": "string", "description": "ref:nid:uuid del documento anterior"}}}, "validity": {"type": "object", "properties": {"is_valid": {"type": "boolean"}, "expired_days_ago": {"type": "integer"}, "days_until_expiry": {"type": "integer"}}}, "status_date": {"type": "string", "format": "date-time", "description": "Fecha del último cambio de estado"}, "status_reason": {"type": "string", "description": "Motivo del estado (si aplica)"}, "travel_validity": {"type": "object", "properties": {"can_travel": {"type": "boolean"}, "valid_regions": {"type": "array", "items": {"type": "string"}, "examples": [["EEA", "Schengen", "Mercosur"]]}}, "description": "Validez como documento de viaje"}}, "description": "Estado y ciclo de vida del documento"}, "L1_document": {"type": "object", "required": ["document_id", "issuing_country", "document_number", "national_id_number"], "properties": {"format": {"enum": ["TD1", "TD2", "OTHER"], "type": "string", "description": "Formato físico según ICAO"}, "version": {"type": "string", "description": "Versión del documento (ej: DNI 3.0, CIE 3.0)"}, "issue_date": {"type": "string", "format": "date"}, "document_id": {"type": "string", "format": "uuid", "description": "Identificador único HST del documento"}, "expiry_date": {"oneOf": [{"type": "string", "format": "date"}, {"type": "null"}], "description": "Fecha expiración (null si permanente)"}, "issue_place": {"type": "string"}, "document_type": {"type": "string", "examples": ["DNI", "Personalausweis", "CNI", "CIE", "Aadhaar", "MyKad"], "description": "Tipo de documento según el país"}, "document_number": {"type": "string", "description": "Número del documento (puede diferir del ID number)"}, "issuing_country": {"type": "string", "pattern": "^[A-Z]{3}$", "description": "País emisor (ISO 3166-1 alpha-3)"}, "issuing_authority": {"type": "string", "description": "Autoridad emisora"}, "national_id_number": {"type": "string", "description": "Número de identificación nacional (el que identifica a la persona)"}}, "description": "Información del documento físico"}, "L5_security": {"type": "object", "properties": {"hologram": {"type": "boolean"}, "watermark": {"type": "boolean"}, "uv_features": {"type": "boolean"}, "microprinting": {"type": "boolean"}, "laser_engraving": {"type": "boolean"}, "tactile_features": {"type": "boolean"}, "guilloche_patterns": {"type": "boolean"}, "optically_variable_device": {"type": "boolean"}}, "description": "Características de seguridad física"}, "L7_metadata": {"type": "object", "required": ["schema_version", "created_at"], "properties": {"created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "captured_at": {"type": "string", "format": "date-time", "description": "Fecha de captura/escaneo del documento"}, "verification": {"type": "object", "properties": {"verified": {"type": "boolean"}, "verified_at": {"type": "string", "format": "date-time"}, "verified_by": {"type": "string"}, "verification_method": {"type": "string"}}}, "source_system": {"type": "string"}, "capture_method": {"enum": ["MANUAL", "OCR_SCAN", "NFC_READ", "CHIP_READ", "API_IMPORT"], "type": "string"}, "schema_version": {"type": "string", "const": "nid.1.0"}}, "description": "Metadatos del registro"}}}