← Specifications

OCI-WALLET-1 Documents and Addressing

Version 0.1.0 · 2026-11-30 · Draft Changes
StatusDraft.
Version0.1.0, 2026-11-30
Profile ofJWS compact serialization (RFC 7515) and JWT (RFC 7519) for the signed document. Otherwise none: an OCI protocol
Depends onOCI-0 Core, OCI-PAY-2 Payments Switch (the participant registry and the error body)
Used byOCI-WALLET-2 Document Exchange, OCI-WALLET-3 Wallets
Reference implementationocitrust-api (participants and document types), ociwallet-issuer-api (signing a document, the printable copy, status), ociwallet-api (verifying a document), ociwallet-exchange-api (reading a URI and a wallet address)

1. Purpose

OCI-Wallet lets a person keep documents that organisations issued to them: a driving licence, an identity card, a school certificate. Three kinds of organisation take part. An issuer signs documents. A wallet provider keeps a person’s documents for them. A document exchange carries calls between the two. The person chooses their wallet provider, sees what it holds and decides what happens to it.

OCI-WALLET-1 defines the things every one of those organisations must read the same way:

  1. Who takes part, as the trust registry lists them, and which exchange each one uses (its home exchange).
  2. Document types: a country’s list of the kinds of document, and who may issue each.
  3. The document URI, the permanent name of one document.
  4. The document itself: what it says, and the issuer’s signature on it.
  5. What anyone must check before believing a document.
  6. Document status: active, suspended or revoked.
  7. The printable copy.
  8. The wallet address, the name a person gives an issuer so it can send them a document.
  9. How a document is matched to the person it was issued to.

OCI-WALLET-1 defines no call between an issuer, an exchange and a wallet. Those are in OCI-WALLET-2. What a wallet provider does for its person is in OCI-WALLET-3. The only calls defined here are the trust registry’s: the list of participants and the list of document types (§3, §4).

The reference implementation runs one country, India (IN), with one exchange (NDX), one issuer (the Transport Department), the country’s identity as the issuer of its ID card, and one wallet provider (Satchel). This text uses them as its examples. Every person in it is made up.

2. Conventions and terms

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be read as described in RFC 2119 and RFC 8174, and only when they appear in capitals. Every normative clause has an ID such as WDOC-3.1.

TermMeaning
PersonSomeone a document is issued to, who keeps it in a wallet.
IssuerAn organisation that issues documents and signs them. A participant of kind doc_issuer.
Wallet providerAn organisation that keeps people’s documents for them. A participant of kind wallet. “The wallet” is one person’s documents at a provider.
Document exchangeAn organisation that carries document calls between issuers and wallet providers (OCI-WALLET-2). A participant of kind doc_exchange.
RequesterAn organisation that asks a person for documents, with their agreement. A participant of kind doc_requester. Listed in the registry; nothing else about it is in this version (§18).
Trust registryThe service that lists participants and document types (ocitrust).
Home exchangeThe one exchange an issuer, a wallet provider or a requester makes and takes its document calls at.
Document typeA kind of document in one country, named by five capital letters (DRVLC).
AccreditedAn issuer is accredited for a document type when the country’s list names it as one that may issue that type.
Document URIThe permanent name of one document: <issuer>-<TYPE>-<id>.
CertificateWhat a document says: who issued it, to whom, its number, its dates and its type-specific data.
DocumentThe certificate, signed by its issuer as one compact JWS.
Printable copyA PDF of the document for printing. It is not the document.
StatusWhat the issuer says about a document now: active, suspended or revoked.
Wallet addressA person’s name at their wallet provider: <handle>@<provider> (asha@satchel).
National ID numberA person’s number in their country’s identity system.
VerifierWhoever checks a document before believing it. In this version, a wallet provider.

3. Participants and the home exchange

OCI-Wallet uses the participant list of the trust registry service, the same list OCI-PAY-2 describes in its section on the participant registry. It adds four kinds of participant and one field, home. Like the payments rail, it reads that flat list and does not resolve OCI-1 entity statements (§18).

  • WDOC-3.1 The registry MUST accept four more values of kind: doc_exchange, doc_issuer, wallet and doc_requester. Each such participant’s record MUST carry id, kind, country, display_name, base_url, jwks_url and status, with the meanings OCI-PAY-2 gives them, and MAY carry home.
  • WDOC-3.2 An issuer’s id MUST be issuer:<name>, where <name> matches ^[a-z0-9][a-z0-9._]{0,62}$. The name has no hyphen, because it is the first part of every URI the issuer makes (§5). This binds whoever registers the issuer; the registry itself is not required to check it (§18).
  • WDOC-3.3 A wallet provider’s id MUST be wallet:<provider>, where <provider> matches ^[a-z0-9][a-z0-9._-]{0,62}$. The provider name is the second part of every wallet address it gives (§10). This binds whoever registers the provider; the registry itself is not required to check it (§18).
  • WDOC-3.4 home is the id of the participant’s home exchange, or null. Only a participant of kind doc_issuer, wallet or doc_requester MAY have a home. A doc_exchange and every participant outside this family MUST NOT. A home MUST name a participant that is in the registry.
  • WDOC-3.5 An issuer, a wallet provider or a requester has at most one home exchange. One with no home can make no document call and can be reached by none. How an exchange uses home to route a call is in OCI-WALLET-2 §7.
  • WDOC-3.6 A country MAY have several participants of kind doc_exchange. Nothing in this spec assumes one.
  • WDOC-3.7 An issuer’s country MUST be set by whoever registers it; an issuer with none can be accredited for no type (WDOC-4.5). It is an ISO 3166-1 alpha-2 code in upper case, and it names the country whose document types the issuer may be accredited for (§4).
  • WDOC-3.8 A reader MUST treat a participant whose status is not active as taking no part: its documents are not accepted (WDOC-7.2) and it is not offered to a person as an issuer.
  • WDOC-3.9 A reader MAY cache the participant list for up to 60 seconds. When a reader needs the list and cannot fetch it, the check it was making MUST fail. It MUST NOT pass. The reference answers 502 TRUST_REGISTRY_UNAVAILABLE and keeps no older copy to fall back on.
  • WDOC-3.10 The registry MUST let a reader ask for only the participants of one home exchange (home=<exchange id>), and MUST show each participant’s home in every answer.

The reference names an exchange exchange:<name> (exchange:ndx) and a requester requester:<name>. No rule in this version reads those two prefixes.

GET /v1/participants List the participants · served by the trust registry

Every participant of the trust registry, ordered by id. The optional query parameters country, kind, status and home each narrow the list; home gives the participants of one exchange. No authentication. Called by Anyone. Every exchange, issuer and wallet provider reads it. Defined in WDOC-3.1, WDOC-3.4, WDOC-3.9, WDOC-3.10.

Request: no body.

ResponseTypeRequiredMeaningClause

Errors

The answer is a JSON array, ordered by id. The optional query parameters country, kind, status and home each narrow it. One participant:

{ "id": "issuer:transport", "kind": "doc_issuer", "country": "IN", "display_name": "Transport Department",
  "address_suffix": null, "base_url": "https://issuer.transport.example", "jwks_url": "https://issuer.transport.example/.well-known/jwks.json",
  "status": "active", "acts_for": null, "home": "exchange:ndx" }

4. Document types

A document type is a kind of document in one country. The country keeps the list, in the trust registry, so every exchange, issuer and wallet provider of that country reads the same one.

A document type has:

FieldMeaning
countryThe country whose type this is. Two capital letters.
typeThe type’s code: five capital letters (DRVLC).
nameWhat people call it (“Driving Licence”). 1 to 120 characters.
descriptionOne or two sentences. At most 500 characters. May be empty.
data_schemaA JSON Schema (2020-12) for the type-specific part of a document of this type (§6).
search_fieldsWhat a person gives to find their document of this type at an issuer. 1 to 10 entries.
issuersThe ids of the issuers accredited for this type. At most 200.

A search field has:

FieldMeaning
nameThe field’s name. Matches ^[a-z][a-z0-9_]{0,39}$.
labelWhat the person is asked for (“Licence number”). 1 to 80 characters.
whereWhat the person’s answer is compared with: document, person or data.
requiredWhether the person must give it. True when absent.
  • WDOC-4.1 A document type is identified by its country and its type together. type MUST be five capital letters (^[A-Z]{5}$). The same code in two countries is two separate types.
  • WDOC-4.2 No two search fields of one type may have the same name. A type MUST have at least one search field.
  • WDOC-4.3 where says what a search field is compared with. document: the document’s own number, issued_on or expires_on, whichever the field’s name is. person: the field of that name in any person the document is issued to (§6). data: the member of that name in the document’s type-specific data.
  • WDOC-4.4 A person’s answer and the document’s value are compared as text, ignoring letter case and treating any run of spaces as one space, with spaces at either end dropped. A date is compared as YYYY-MM-DD.
  • WDOC-4.14 A search may give no field at all when the wallet says who is asking by their national ID number (person.national_id, §11). An issuer MUST then answer the documents of the type that record that number for a person they are issued to, compared as WDOC-11.4 compares numbers, whatever the type’s required search fields are. It MUST NOT fall back to the person’s name for such a search: a document that records no number is not found this way. A search with no field and no person.national_id MUST be refused (422 SEARCH_FIELD_MISSING). A search that gives any field is as WDOC-4.2 to WDOC-4.4 say, with every required field.
  • WDOC-4.5 The registry MUST accept an id in issuers only when it is a participant of kind doc_issuer whose country is the type’s country. Any other id MUST be refused with 422 INVALID_ISSUER, and the type MUST be left as it was.
  • WDOC-4.6 Writing a type replaces all of it, its list of issuers included. An issuer left out of the new list is no longer accredited.
  • WDOC-4.7 Only the country’s registrar may write a type. Reading needs no authentication. The reference takes an admin bearer token on the write: without a valid one the answer is 401 UNAUTHORIZED, and 503 ADMIN_DISABLED when the registry has no token configured.
  • WDOC-4.8 An issuer is accredited for a type when, and only when, the type exists in the issuer’s own registry country and its issuers list holds the issuer’s id. A reader MUST decide accreditation this way, from the registry, and never from anything a document or a caller says.
  • WDOC-4.9 An issuer MUST issue only documents of a type it is accredited for at the moment of issue, and the type-specific data of each MUST be valid against the type’s data_schema (JSON Schema 2020-12).
  • WDOC-4.10 A reader MAY cache a country’s list of types for up to 60 seconds. When a reader needs the list and cannot fetch it, the check it was making MUST fail, as in WDOC-3.9.
  • WDOC-4.11 The registry upper-cases a country code it is given in a path or a query. A request that does not fit the shapes above MUST be refused with 422 INVALID_REQUEST.

4.1 Reading the list

GET /v1/doc-types List document types · served by the trust registry

The document types the registry holds, ordered by country and type. The optional query parameters country (two letters) and issuer (a participant id: only the types it is accredited for) narrow the list. No authentication. Called by Anyone. Every exchange, issuer and wallet provider reads it. Defined in WDOC-4.1, WDOC-4.8, WDOC-4.10, WDOC-4.11.

Request: no body.

ResponseTypeRequiredMeaningClause

Errors

The answer is a JSON array of document types, ordered by country and then type. Two optional query parameters narrow it: country (two letters) and issuer (a participant id: only the types that issuer is accredited for). A country with no types gets an empty array.

4.2 Reading one type

GET /v1/doc-types/{country}/{doc_type} Read one document type · served by the trust registry

One country's document type: its name, data schema, search fields and accredited issuers. No authentication. Called by Anyone. Defined in WDOC-4.1, WDOC-4.11, WDOC-4.12.

Request: no body.

ResponseTypeRequiredMeaningClause
countrystringyesThe country whose type this is, in capital letters. (pattern ^[A-Z]{2}$)WDOC-4.1
typestringyesThe type's code: five capital letters, such as DRVLC. (pattern ^[A-Z]{5}$)WDOC-4.1
namestringyesWhat people call the type, such as Driving Licence. (at most 120 characters; at least 1)
descriptionstringyesOne or two sentences about the type. May be empty. (at most 500 characters)
data_schemaobjectyesA JSON Schema (2020-12) for the type-specific data of a document of this type.WDOC-4.9
search_fieldsarray of objectyesWhat a person gives to find their document of this type at an issuer. No two share a name.WDOC-4.2
search_fields[].namestringyesThe field's name. (pattern ^[a-z][a-z0-9_]{0,39}$)WDOC-4.2
search_fields[].labelstringyesWhat the person is asked for, such as Licence number. (at most 80 characters; at least 1)
search_fields[].where"document" | "person" | "data"yesWhat the person's answer is compared with: the document's own number or dates, a person it is issued to, or its type-specific data.WDOC-4.3
search_fields[].requiredbooleanWhether the person must give it. True when absent.
issuersarray of stringyesThe participant ids of the issuers accredited for this type. Each is a document issuer of the type's country.WDOC-4.8

Errors

  • WDOC-4.12 The answer is the one type, in the shape of §4. When the country has no such type the answer is 404 DOC_TYPE_NOT_FOUND.

4.3 Writing a type

PUT /v1/doc-types/{country}/{doc_type} Register or replace a document type · served by the trust registry

Creates the type or replaces all of it, its list of accredited issuers included, and answers with the type as it now stands. Called by the country's registrar. Defined in WDOC-4.2, WDOC-4.5, WDOC-4.6, WDOC-4.7, WDOC-4.11, WDOC-4.13.

RequestTypeRequiredMeaningClause
namestringyesWhat people call the type, such as Driving Licence. (at most 120 characters; at least 1)
descriptionstringOne or two sentences about the type. May be empty. (at most 500 characters)
data_schemaobjectA JSON Schema (2020-12) for the type-specific data of a document of this type.WDOC-4.9
search_fieldsarray of objectyesWhat a person gives to find their document of this type at an issuer. No two share a name.WDOC-4.2
search_fields[].namestringyesThe field's name. (pattern ^[a-z][a-z0-9_]{0,39}$)WDOC-4.2
search_fields[].labelstringyesWhat the person is asked for, such as Licence number. (at most 80 characters; at least 1)
search_fields[].where"document" | "person" | "data"yesWhat the person's answer is compared with: the document's own number or dates, a person it is issued to, or its type-specific data.WDOC-4.3
search_fields[].requiredbooleanWhether the person must give it. True when absent.
issuersarray of stringThe participant ids of the issuers accredited for this type. Each is a document issuer of the type's country.WDOC-4.5
ResponseTypeRequiredMeaningClause
countrystringyesThe country whose type this is, in capital letters. (pattern ^[A-Z]{2}$)WDOC-4.1
typestringyesThe type's code: five capital letters, such as DRVLC. (pattern ^[A-Z]{5}$)WDOC-4.1
namestringyesWhat people call the type, such as Driving Licence. (at most 120 characters; at least 1)
descriptionstringyesOne or two sentences about the type. May be empty. (at most 500 characters)
data_schemaobjectyesA JSON Schema (2020-12) for the type-specific data of a document of this type.WDOC-4.9
search_fieldsarray of objectyesWhat a person gives to find their document of this type at an issuer. No two share a name.WDOC-4.2
search_fields[].namestringyesThe field's name. (pattern ^[a-z][a-z0-9_]{0,39}$)WDOC-4.2
search_fields[].labelstringyesWhat the person is asked for, such as Licence number. (at most 80 characters; at least 1)
search_fields[].where"document" | "person" | "data"yesWhat the person's answer is compared with: the document's own number or dates, a person it is issued to, or its type-specific data.WDOC-4.3
search_fields[].requiredbooleanWhether the person must give it. True when absent.
issuersarray of stringyesThe participant ids of the issuers accredited for this type. Each is a document issuer of the type's country.WDOC-4.8

Errors

Request (the registrar of India registers the driving licence):

{
  "name": "Driving Licence",
  "description": "A licence to drive, issued by a transport department.",
  "data_schema": {
    "type": "object", "required": ["vehicle_classes"], "additionalProperties": false,
    "properties": {
      "vehicle_classes": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
      "blood_group": { "type": "string", "enum": ["A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-"] }
    }
  },
  "search_fields": [
    { "name": "number", "label": "Licence number", "where": "document", "required": true },
    { "name": "date_of_birth", "label": "Date of birth", "where": "person", "required": true }
  ],
  "issuers": ["issuer:transport"]
}

Response (200): the same object with "country": "IN" and "type": "DRVLC" added.

  • WDOC-4.13 The write creates the type or replaces it (WDOC-4.6), and answers with the type as it now stands. issuers is returned in id order, each id once.

5. The document URI

Every document has one URI:

<issuer>-<TYPE>-<id>          transport-DRVLC-KA0120230001
PartWhat it is
<issuer>The issuer’s name: its participant id without the issuer: prefix (WDOC-3.2).
<TYPE>The document type’s code, five capital letters (WDOC-4.1).
<id>The issuer’s own id for the document: 1 to 20 letters and digits.
  • WDOC-5.1 A URI MUST match ^[a-z0-9][a-z0-9._]{0,62}-[A-Z]{5}-[A-Za-z0-9]{1,20}$. Anything else is not a URI and MUST be refused wherever a URI is expected.
  • WDOC-5.2 A reader gets three things from a URI, and from nothing else: the issuer’s participant id (issuer: followed by the first part), the document type, and the issuer’s id for the document. The parts are divided at the two hyphens, which is why neither an issuer’s name nor an <id> may hold one.
  • WDOC-5.3 A URI is compared as an exact string. It is case-sensitive.
  • WDOC-5.4 Only the issuer named in a URI may make it. An issuer MUST give each document a different <id> within one type, and MUST NOT issue a second document under a URI it has used.
  • WDOC-5.5 When the issuer’s own records give no id for a document, the issuer makes a random one. The reference makes 12 characters from capital letters and digits.
  • WDOC-5.6 A URI is permanent. It does not change when the document is suspended or revoked, and it says nothing about where the document is kept.
  • WDOC-5.7 A URI is not a secret. Knowing one MUST NOT be enough to read the document behind it (§11).
  • WDOC-5.8 An <id> SHOULD NOT hold a national ID number, because the URI is written wherever the document is named. The reference identity makes its ID card’s <id> from its own random id for the resident, never from the resident’s number.
  • WDOC-5.9 A URI does not name a country. The document type in it is looked up in the country of the issuer’s registry entry (WDOC-4.8).

6. The signed document

A document is its certificate, signed whole by the issuer. A person shares a document whole or not at all: this version has no way to show one field without the rest.

6.1 The certificate

{
  "type": "DRVLC",
  "name": "Driving Licence",
  "number": "KA01 2023 0001",
  "issued_on": "2023-01-10",
  "valid_from": "2023-01-10",
  "expires_on": "2043-01-09",
  "issued_at": "Bengaluru",
  "issued_by": { "id": "issuer:transport", "name": "Transport Department", "country": "IN" },
  "issued_to": [
    { "name": "Asha Rao", "date_of_birth": "1990-04-12", "gender": "F", "national_id": "9999 0000 0001",
      "address": { "line1": "14 Lake Road", "locality": "Bengaluru", "region": "Karnataka", "postal_code": "560001", "country": "IN" } }
  ],
  "data": { "vehicle_classes": ["LMV", "MCWG"], "blood_group": "O+" }
}
MemberRequiredMeaning
typeyesThe document type’s code.
nameyesThe type’s name, as the registry gave it when the document was issued.
numberyesThe number printed on the document (a licence number). 1 to 60 characters.
issued_onyesThe date of issue, YYYY-MM-DD.
valid_fromnoThe first day it is good, YYYY-MM-DD.
expires_onnoThe last day it is good, YYYY-MM-DD. Absent when the document does not expire.
issued_atnoThe place of issue. At most 80 characters.
issued_byyes{id, name, country}: the issuer’s participant id, its display name and its country, from its registry entry.
issued_toyesThe people the document is issued to: 1 to 10 of them.
datayesThe type-specific part. An object, valid against the type’s data_schema. May be empty.

One person in issued_to:

MemberRequiredMeaning
nameyesThe person’s name. 1 to 120 characters.
date_of_birthnoYYYY-MM-DD.
gendernoM male, F female, T transgender.
parent_or_spouse_namenoAt most 120 characters.
national_idnoThe person’s national ID number, when the issuer records it. At most 40 characters.
addressno{line1, line2, locality, region, postal_code, country}. Only line1 is required. country is two capital letters.
phonenoAt most 20 characters.
emailnoAt most 254 characters.
  • WDOC-6.1 A certificate MUST carry type, name, number, issued_on, issued_by, issued_to and data, as above. A member that has no value is left out. It is not written as null.
  • WDOC-6.2 type MUST equal the type in the document’s URI. issued_by.id MUST equal the issuer in the URI.
  • WDOC-6.3 issued_to MUST name at least one person and at most ten. A person carries only the members listed above. Anything a type needs beyond them belongs in data.
  • WDOC-6.4 expires_on, when present, MUST NOT be earlier than issued_on.
  • WDOC-6.5 A certificate MUST NOT carry the document’s status. A copy cannot learn that it was suspended or revoked, so status is asked of the issuer (§8).

6.2 The signature

  • WDOC-6.6 A document is a JWT in JWS compact serialization (three parts divided by dots), signed by its issuer. Its protected header MUST be exactly alg, typ and kid.
  • WDOC-6.7 alg MUST be ES256 (ECDSA on P-256 with SHA-256). typ MUST be oci-doc+jwt. kid MUST name the signing key in the issuer’s JWK Set.
  • WDOC-6.8 The claims MUST be iss (the issuer’s participant id), iat (when it was signed, in seconds), uri (the document’s URI) and certificate (§6.1). iss MUST equal the issuer in uri.
  • WDOC-6.9 When the certificate has an expires_on, the document MUST also carry exp: the end of that day, so the document is good through its last day. A document with no expires_on carries no exp.
  • WDOC-6.10 An issuer MUST sign documents with a P-256 key that it uses for nothing else. It MUST NOT sign a document with the key that signs its calls (the OCI-Signature key of OCI-WALLET-2 §4, an Ed25519 key).
  • WDOC-6.11 An issuer MUST publish its document key in the JWK Set at its registry jwks_url, beside its call-signing key, as an EC key with "alg": "ES256" and "use": "sig". The reference serves the set at /.well-known/jwks.json, without authentication.
  • WDOC-6.12 Once signed, a document is never changed. Whoever holds it, an exchange, a wallet provider or the person, MUST keep and pass on the exact signed text.

A document’s header and claims, decoded:

{ "alg": "ES256", "typ": "oci-doc+jwt", "kid": "pQ4nT0mHn1cX3yqk0l2m7uVd9sA5bJ8wRzE6fC1gYtI" }
{ "iss": "issuer:transport", "iat": 1796040000, "uri": "transport-DRVLC-KA0120230001",
  "exp": 2304441000, "certificate": { "type": "DRVLC", "…": "as in §6.1" } }

7. Verifying a document

A document is believed because of its issuer, never because of who holds it or who passed it on. A verifier is given a document and the URI it is said to be. It checks all of the following, and the document is genuine only if every one holds.

  • WDOC-7.1 The URI MUST be well formed (WDOC-5.1).
  • WDOC-7.2 The issuer named in the URI MUST be in the registry, of kind doc_issuer, with status active.
  • WDOC-7.3 That issuer MUST be accredited, now, for the type named in the URI (WDOC-4.8). A valid signature by an issuer that is not accredited for the type does not make a document genuine.
  • WDOC-7.4 The signature MUST verify with ES256 against an EC key in the JWK Set at the issuer’s registry jwks_url. The verifier MUST take keys only from there, never from the document or from whoever supplied it. Every other algorithm, none included, MUST be refused.
  • WDOC-7.5 The header’s typ MUST be oci-doc+jwt.
  • WDOC-7.6 The claim iss MUST equal the issuer in the URI, and the claim uri MUST equal the URI the verifier was given. A genuine document offered under another document’s URI is refused.
  • WDOC-7.7 certificate MUST be an object whose type equals the type in the URI and whose issued_by.id equals the issuer in the URI.
  • WDOC-7.8 A document that fails any of WDOC-7.1 to 7.7 is not genuine. A verifier MUST NOT show it to a person as verified, and MUST NOT keep it as an issued document.
  • WDOC-7.9 A document that passes WDOC-7.1 to 7.7 and whose exp is in the past is expired. It is genuine and no longer good, and a verifier MUST say so. A document with no exp does not expire. An exp that is not a number is treated as past.
  • WDOC-7.10 A verifier MAY cache an issuer’s JWK Set for up to 300 seconds. When no cached key verifies a document, it SHOULD fetch the set once more and try again, so that a new key is picked up. It SHOULD NOT refetch more often than once in 30 seconds for one issuer.
  • WDOC-7.11 When the issuer’s keys or the registry cannot be fetched, the verifier MUST NOT treat the document as genuine, and SHOULD say that it could not be checked, which is different from saying it is not genuine.
  • WDOC-7.12 Being genuine says the document was issued. It does not say the document is still good. Before a verifier shows a document as valid it MUST also ask the issuer for the document’s status (§8).
  • WDOC-7.13 A verifier that has kept a document MUST run these checks again whenever it shows the document as verified, because an issuer’s standing and accreditation can change after the document was kept.

The reference wallet reports “not genuine” as DOCUMENT_NOT_GENUINE, “expired” as 410 DOCUMENT_EXPIRED, and keys that cannot be fetched as 502 ISSUER_UNAVAILABLE. What a wallet tells its person is in OCI-WALLET-3 §9 and §10.

8. Document status

The issuer of a document is the only one who knows whether it is still good. It answers with one of three values.

StatusMeaning
activeThe document is good.
suspendedThe issuer has put the document on hold. It may become active again.
revokedThe issuer has withdrawn the document for good.
  • WDOC-8.1 A document’s status MUST be one of active, suspended and revoked. A newly issued document is active.
  • WDOC-8.2 Only the document’s issuer sets its status. The issuer MAY move a document between active and suspended in either direction, and MAY revoke it from either.
  • WDOC-8.3 revoked is final. An issuer MUST NOT move a revoked document to any other status. To replace it, the issuer issues a new document, with a new URI.
  • WDOC-8.4 Status is asked of the issuer, by URI, through the exchange (OCI-WALLET-2 §10). It is never read from the document or from a copy.
  • WDOC-8.5 An answer about status names no person and needs none: it says nothing about anyone.
  • WDOC-8.6 An issuer MUST NOT give out a revoked document: it is not found and not fetched. A suspended document is still found and fetched, and the answer says it is suspended. The calls and their answers are in OCI-WALLET-2 §8 and §9.
  • WDOC-8.7 A verifier MUST NOT show a document as valid unless the issuer’s latest answer for it is active. A status that arrived with a document from anyone but the issuer’s own answer is only assumed, and MUST be asked before the document is shown as valid.
  • WDOC-8.8 Once a verifier has heard revoked for a document it need not ask again. When the issuer cannot be reached, the verifier keeps the last status it heard and SHOULD say the status was not checked just now.

9. The printable copy

An issuer makes a PDF of each document for the person to print or show on paper.

  • WDOC-9.1 An issuer MUST make the printable copy when it issues the document, and MUST NOT have a document on record without one.
  • WDOC-9.2 The copy is a PDF. It MUST show the issuer’s name, the type’s name, the document’s number, each person it is issued to, its dates, its type-specific data, and the document’s URI. It MUST say that it is a printed copy and that the code, or the issuer, confirms whether it is genuine and current.
  • WDOC-9.3 The copy MUST carry a QR code that holds a signed token tying the paper to the document. The token is a JWT in JWS compact serialization, signed with the issuer’s document key (WDOC-6.10), with header alg ES256, typ oci-doc-qr+jwt and kid, and exactly these claims: iss (the issuer’s participant id), uri (the document’s URI), num (the certificate’s number), nam (the name of the first person in issued_to) and iso (the certificate’s issued_on).
  • WDOC-9.4 The printable copy is not the document and proves nothing by itself. A verifier MUST NOT treat a PDF as verified. Only the signed document (§6) is checked (§7).
  • WDOC-9.5 The copy travels beside the document as base64 text. A copy that is missing or cannot be read MUST NOT make a genuine document be refused: the document is kept without it.

How someone holding only the paper checks the QR code is not defined in this version (§18).

10. The wallet address

A person has an address at their wallet provider. They give it to an issuer, and the issuer can then send their documents to it.

<handle>@<provider>          asha@satchel
  • WDOC-10.1 A wallet address MUST match ^[a-z0-9][a-z0-9._-]{0,62}@[a-z0-9][a-z0-9._-]{0,62}$ and MUST NOT be longer than 127 characters. It is written in lower case. An address with a capital letter or a space is not an address.
  • WDOC-10.2 The part after the @ is the provider. It maps to exactly one registry participant: wallet: followed by the provider (asha@satchel is at wallet:satchel). That participant MUST be of kind wallet with status active, or the address reaches nobody.
  • WDOC-10.3 Nothing else is needed to find the provider. A reader MUST NOT use the registry’s address_suffix field for a wallet address: that field belongs to payment addresses (OCI-PAY-1).
  • WDOC-10.4 The part before the @ is the handle. Only the provider knows whose it is. A wallet provider MUST give one handle to one person only, and answers for an address only when the provider part is its own name and the handle is one it gave.
  • WDOC-10.5 A wallet address is compared as an exact string.
  • WDOC-10.6 A wallet address names where a person’s documents may be sent. It is not proof of who the person is, and it gives no access to anything in the wallet.

How a provider chooses a handle and shows the address to its person is in OCI-WALLET-3 §4. How an exchange carries a document to an address is in OCI-WALLET-2 §11.

11. Whose a document is

A document is found, fetched and kept only by the person it was issued to. Two sides apply the same rule: the issuer, before it answers a wallet, and the wallet provider, before it keeps what it was given.

The wallet provider says who it is asking for: the person it has signed in, as a person object.

{ "name": "Asha Rao", "national_id": "9999 0000 0001" }
  • WDOC-11.1 person.name is REQUIRED: 1 to 120 characters. It MUST be the name the wallet provider’s own sign-in holds for the person. person.national_id is OPTIONAL: 1 to 40 characters. A wallet provider MUST send it only when the person has connected their national identity to the wallet (OCI-WALLET-3 §5), and then it MUST be the number the country’s identity gave. Neither is ever something the person typed into the wallet.
  • WDOC-11.2 When the wallet gives a national_id and the document records a national_id for at least one person in issued_to, the number decides: the document is the person’s when, and only when, one of the recorded numbers equals the one given. The name is then not compared.
  • WDOC-11.3 In every other case the name decides: the document is the person’s when the given name equals the name of a person in issued_to.
  • WDOC-11.4 Two national ID numbers are equal when they are the same after all spaces are removed, ignoring letter case (9999 0000 0001 equals 999900000001).
  • WDOC-11.5 Two names are equal when they are the same after every run of spaces is made one space and spaces at either end are dropped, ignoring letter case ( asha RAO equals Asha Rao).
  • WDOC-11.6 An issuer MUST apply WDOC-11.2 to 11.5 before it answers a find or a fetch, on top of the type’s search fields (§4). For a document that is not the person’s it MUST answer as it would for a document that does not exist.
  • WDOC-11.7 A wallet provider MUST apply the same rule to a document it fetched before it keeps it, and MUST NOT keep one that is not the person’s.
  • WDOC-11.8 An issuer that knows a person’s national ID number SHOULD record it in the document, so that the number, which is one person’s, decides and not a name, which may be shared.

What a wallet provider does with a document an issuer sent to an address is in OCI-WALLET-3 §11.

12. Errors

Every error in this family uses the error body of OCI-PAY-2: {"error": {"code": "<CODE>", "message": "<one sentence>"}}, with the HTTP status carrying the class. The trust registry’s calls in this spec answer:

StatusCodeWhen
401UNAUTHORIZEDA write without a valid admin token (WDOC-4.7).
404DOC_TYPE_NOT_FOUNDThe country has no such type (WDOC-4.12).
422INVALID_REQUESTA path, a query or a body that does not fit (WDOC-4.11), two search fields with one name (WDOC-4.2).
422INVALID_ISSUERAn id in issuers that is not a document issuer of that country (WDOC-4.5).
503ADMIN_DISABLEDThe registry has no admin token configured (WDOC-4.7).

The errors of the calls between an issuer, an exchange and a wallet are in OCI-WALLET-2 §15.

13. Worked example

India’s registrar has registered DRVLC with issuer:transport as its one issuer (§4.3). The Transport Department’s home is exchange:ndx. Satchel is wallet:satchel, also at home at exchange:ndx. Asha Rao keeps her documents at Satchel, where her address is asha@satchel.

  1. Issue. The Transport Department issues Asha’s licence. Its own id for it is KA0120230001, so the URI is transport-DRVLC-KA0120230001 (§5). The data {"vehicle_classes": ["LMV", "MCWG"], "blood_group": "O+"} is valid against the type’s schema (WDOC-4.9). The issuer builds the certificate of §6.1, signs it with its P-256 key (§6.2), and makes the PDF with its QR code (§9). The status is active.

  2. The QR code on the PDF holds a token with header {"alg": "ES256", "typ": "oci-doc-qr+jwt", "kid": "…"} and claims:

    { "iss": "issuer:transport", "uri": "transport-DRVLC-KA0120230001", "num": "KA01 2023 0001", "nam": "Asha Rao", "iso": "2023-01-10" }
  3. Find. In her wallet, Asha picks the Transport Department and “Driving Licence”. The wallet shows the type’s search fields, and she gives her licence number and date of birth. Satchel asks through NDX, saying who she is: {"name": "Asha Rao", "national_id": "9999 0000 0001"}, because she has connected her national identity. The licence records the same number, so it is hers (WDOC-11.2), and both search fields match (WDOC-4.3, 4.4). She would get the same answer had she typed ka01 2023 0001.

  4. A namesake. Another Asha Rao, whose number is 9999 0000 0777, gives the same licence number and date of birth. The numbers differ, so the issuer finds nothing for her, though the name is the same (WDOC-11.2).

  5. Verify. Satchel fetches the document and checks it against transport-DRVLC-KA0120230001: issuer:transport is an active doc_issuer, it is accredited for DRVLC in IN, the signature verifies with the EC key in its JWK Set, typ is oci-doc+jwt, iss and uri match, the certificate’s type and issued_by.id match, and exp is in the future (§7). The document is genuine. The issuer’s status answer is active, so Satchel shows it to Asha as valid.

  6. Suspend. The Transport Department suspends the licence. The signed document does not change. The next time Asha opens it, Satchel asks for its status, hears suspended, and shows that (WDOC-8.7).

  7. Revoke. The department revokes it. From then on the licence is not found and not fetched, and its status stays revoked (WDOC-8.3, 8.6). Asha’s copy still verifies as genuine, and her wallet shows it as revoked.

  8. An impostor document. Someone gets a school board, issuer:cbse, to sign a “driving licence” under cbse-DRVLC-1. The signature is real. The board is not accredited for DRVLC, so the document is not genuine (WDOC-7.3).

14. Security considerations

  • The registry is the root of trust. Who is an issuer, where its keys are, and what it may issue all come from the trust registry. Whoever can write to the registry can make any document genuine. The list is read over TLS and is not signed (§18).
  • A signature is not enough. WDOC-7.3 is what stops an accredited issuer of one type from issuing another. Accreditation is checked at the time of checking, so withdrawing it makes that issuer’s documents of that type fail from then on, the old ones included.
  • Substitution. The uri claim and the type and issued_by.id checks (WDOC-7.6, 7.7) stop a genuine document being passed off as a different one. The explicit typ (WDOC-7.5) stops another kind of token signed by the same key, the QR token included, being accepted as a document.
  • Key separation. A document key signs only documents and QR tokens. A stolen call-signing key cannot forge a document, and a verifier accepts only EC keys for documents (WDOC-6.10, 7.4).
  • Key rotation. A document is checked against the keys the issuer publishes today. If an issuer drops a key from its JWK Set, every document signed with it stops verifying. An issuer has to keep a retired document key published for as long as documents signed with it should be believed (§18).
  • A copy outlives a revocation. A signed document held anywhere stays verifiable after it is revoked. Only the status answer says it is no longer good, which is why WDOC-7.12 and 8.7 are requirements and not advice.
  • Matching on a name is weak. Where the wallet has no national ID number for the person, or the document records none, a shared name plus knowledge of the search fields is enough to obtain another person’s document (WDOC-11.3). Recording the number (WDOC-11.8) and connecting the national identity close this.
  • The wallet provider is believed about who it has signed in. An issuer cannot check the person it is given. It relies on the provider being an accredited participant, and on OCI-WALLET-2 §3, under which only a wallet’s home exchange may ask.
  • URIs can be guessed. An <id> taken from a running number makes URIs predictable. WDOC-5.7 and §11 are what protect the document, not the URI.
  • The printable copy. A PDF can be edited. Nothing in it is trusted (WDOC-9.4).

15. Privacy considerations

  • A document is all or nothing. The certificate carries everything the issuer wrote, the person’s date of birth, address and national ID number included, and it is shared whole. A person who shows a licence to prove their age also shows their address.
  • The national ID number travels. It sits in the certificate when the issuer records it, and in the person a wallet sends once the person has connected their national identity. OCI-WALLET-2 §12 covers the exchange. Wallet providers and issuers MUST NOT write it to logs in clear text (CORE-7.3).
  • The URI. A URI names the issuer and the type, so a list of URIs shows what kinds of document a person has. It SHOULD NOT also hold a number that identifies them (WDOC-5.8).
  • The wallet address names the person’s provider and a handle, and is given to every issuer that sends them a document. A handle made from an email address reveals part of it.
  • The QR code holds the person’s name and the document’s number in a form anyone with a camera can read. It is on paper the person chooses to hand over.
  • Finding a document sends the issuer the person’s name, their number when connected, and their answers to the search fields. The person sees the search fields before they answer. An issuer answers nothing about a document that is not theirs, and gives no sign that it exists (WDOC-11.6).
  • Synthetic data. Demonstrations and conformance tests use made-up people only (CORE-7.4).

16. Changes this spec needs in other OCI specs

  • OCI-PAY-2, the participant registry. The list of kinds (bank, switch, provider, idp) gains doc_exchange, doc_issuer, wallet and doc_requester, and the record gains home (WDOC-3.1, 3.4). The participant registry is now shared by two families and would sit better in a spec of its own, or in OCI-1.
  • OCI-1 Trust Registry. OCI-1 has a credential_issuer and a wallet_provider role as trust marks. This family does not use them: it reads kinds and accreditation from the flat participant list and the document type list. OCI-1 needs either a profile of those two lists or a mapping from them to trust marks. Document types and per-type accreditation have no counterpart in OCI-1 today.
  • OCI-0 Core, CORE-6.3. It requires iat and exp on every signed statement. A document that does not expire has no exp (WDOC-6.9), and the QR token has neither iat nor exp (WDOC-9.3). Core needs an exception, as it has for security event tokens, or these two need the claims.
  • OCI-0 Core, CORE-6.2. The reference allows no clock skew when it checks a document’s exp.
  • OCI-0 Core, CORE-9.1. This family uses the nested error body of OCI-PAY-2, not Core’s {error, error_description}.
  • OCI-4 Credentials. A document is not an OCI-4 credential. It has no owner key (cnf), no status list entry and no selective disclosure, and its typ is oci-doc+jwt. OCI-4 or this spec should say when each format is used.
  • Proposal OCI-10 Verifiable Documents. This spec replaces it. Its DOC clause ids are not reused.

17. Conformance

A conforming trust registry serves the three calls of §4 and the participant list of §3 as written. A conforming issuer makes URIs, certificates, signatures, printable copies and statuses as §5, §6, §8 and §9 say, and matches people as §11 says. A conforming verifier (a wallet provider) passes every check of §7 and §8 and matches people as §11 says. An exchange reads URIs and wallet addresses as §5 and §10 say.

ClausesWhere the reference tests them
WDOC-3.1, 3.4, 3.6, 3.10ocitrust-api/tests/test_participants.py (document participants and their home exchange, home is only for issuers, wallets and requesters)
WDOC-4.1, 4.2, 4.5, 4.6, 4.7, 4.11 to 4.13ocitrust-api/tests/test_doc_types.py
WDOC-4.3, 4.4ociwallet-issuer-api/tests/test_documents.py (find matches every field given)
WDOC-4.8, 4.9ociwallet-issuer-api/tests/test_documents.py (only the types it is accredited for, the data must fit the type’s schema)
WDOC-5.1, 5.2, 5.4, 5.5ociwallet-issuer-api/tests/test_documents.py (a URI names issuer, type and id, a malformed URI, the same id is not issued twice, a random id)
WDOC-6.1 to 6.9ociwallet-issuer-api/tests/test_documents.py (an issued document is the certificate signed by the issuer, a malformed document is not issued)
WDOC-6.10ociwallet-api/tests/test_documents.py (signed by anyone but its issuer)
WDOC-7.1 to 7.10ociwallet-api/tests/test_documents.py (genuine, changed, wrong signer, must be the one asked for, accreditation, suspended issuer, expired, junk, a rotated key)
WDOC-8.1 to 8.3, 8.6ociwallet-issuer-api/tests/test_documents.py (suspend, restore and revoke)
WDOC-8.4ociwallet-api/tests/test_documents.py (status is asked of the issuer, not read from the copy)
WDOC-9.1 to 9.3ociwallet-issuer-api/tests/test_documents.py (the printable copy, the QR code, nothing on record without the copy)
WDOC-9.5ociwallet-api/tests/test_documents.py (a broken printable copy does not spoil a genuine document)
WDOC-10.1ociwallet-issuer-api/tests/test_documents.py (what cannot be pushed)
WDOC-10.2, 10.4ociwallet-exchange-api/tests/test_push.py, ociwallet-api/tests/test_national.py
WDOC-11.2 to 11.6ociwallet-issuer-api/tests/test_documents.py (matched on the number, matched on the name, only by the person it was issued to)
WDOC-11.7ociwallet-api/tests/test_people.py (NOT_YOUR_DOCUMENT)

The clauses not listed, among them WDOC-3.2, 3.3, 3.9, 5.8, 7.11 to 7.13, 8.7 and 8.8, have no test that covers them directly. There is no conformance suite for this family yet.

18. Open questions

  • The registry is not OCI-1. As for payments, this family reads a flat, unsigned list from ocitrust. Document types and accreditation are rows in the same service. Should they become signed statements under the country’s trust anchor?
  • Who may write document types. The reference uses one admin token for the whole registry. A country’s registrar should be able to write only its own country’s types. How the registrar is authenticated is not designed.
  • No way to remove a type. A type can be replaced, and its issuers emptied, but not deleted.
  • The registry does not check data_schema. A type can be registered with a schema that is not valid JSON Schema. The issuer finds out when it first issues.
  • Accreditation ignores status. The registry accredits an issuer whatever its status. Readers check status themselves (WDOC-7.2). Should the registry refuse to accredit a suspended issuer?
  • Ids are not checked by the registry. The issuer: and wallet: forms (WDOC-3.2, 3.3) are relied on by every reader, but the registry stores whatever id it is given, and it has no call to add a participant. Nor does it check that a home is a doc_exchange: an exchange checks that when it routes.
  • exchange: and requester: id forms. Used by convention only. Should they be required?
  • Document types across countries. A URI’s type is looked up in its issuer’s country, so a wallet in one country can verify a document from another if it can read that country’s list. Nothing tests this, and a wallet offers a person only its own country’s types. Whether one registry lists several countries, or recognition between registries is needed, is open.
  • Search fields with where: document. Only number, issued_on and expires_on can be compared. A document field with any other name never matches, and the registry accepts it. A data field whose value is a list (a licence’s vehicle classes) is compared as text and in practice never matches.
  • A search field’s type. Search fields have a label and no data type, so a wallet cannot tell a date from a number when it asks.
  • exp and time zones. The reference computes the end of the expires_on day in the issuer server’s local time. It should be a stated zone. A verifier allows no clock skew.
  • iat is not checked by a verifier. Should a document signed in the future be refused?
  • Retired document keys. Documents live for years. This version has no rule for how long a retired key stays published, and no way to tell a retired key from a compromised one. CORE-5.6 covers short-lived statements only.
  • Checking the QR code. The token is defined (WDOC-9.3), but nothing reads it: there is no call that takes a QR token and answers genuine and current. The token has no iat and no exp.
  • The PDF is not bound to the document. Nothing ties the PDF’s bytes to the signed document, so a carrier could swap it. A hash of the PDF in the claims would bind it.
  • A document with no expiry and no exp (see §16, CORE-6.3).
  • Name matching. Plan decisions asked for the national ID number to replace the name. The reference still falls back to the name when either side lacks a number (WDOC-11.3). Should an issuer be able to require the number for a type? An issuer’s own second factor was designed and is not built.
  • Several people on one document. When some people in issued_to have a number and others do not, a person without one cannot match by name once the wallet sends a number (WDOC-11.2). Is that intended?
  • Names in other scripts. Name comparison folds case and spaces only. Diacritics, name order and transliteration are not handled.
  • The wallet’s check on a pushed document. A wallet refuses a pushed document only when both sides have a number and they differ. It does not compare names. OCI-WALLET-3 §11 and its open questions cover it, and it bears on §11 here.
  • URI ids taken from a licence number. The reference issuer lets staff choose the <id>, and the example uses the licence number without spaces. Should an <id> be required to say nothing about the document or the person?
  • Wallet addresses and payment addresses look the same. asha@satchel and asha@sbi have one shape and separate namespaces (wallet:<provider> here, address_suffix in OCI-PAY-1). Should a wallet address be marked as one?
  • A photo is not in the person model.
  • Not in this version: sharing a document with a requester (the doc_requester kind is registered and unused; this would be OCI-WALLET-4, a profile of OCI-CONSENT-1), connecting a wallet address at an issuer with a second factor or a QR code, copies encrypted so only the person can read them, sending a document again after it is re-issued, and showing one field of a document without the rest.

Changes

VersionDateWhat changed
0.1.02026-11-30First version, extracted from the reference implementation.