← Specifications

OCI-WALLET-3 Wallets

Version 0.1.0 · 2026-11-30 · Draft Changes
StatusDraft.
Version0.1.0, 2026-11-30
Profile ofOpenID Connect Core 1.0 (authorization code flow), RFC 7636 (PKCE), RFC 9207 (iss response parameter) and OpenID Connect Discovery 1.0, for connecting the national identity (§5 to §7). The rest is an OCI protocol.
Depends onOCI-0 Core, OCI-1 Trust Registry, OCI-2 ID Auth, OCI-WALLET-1 Documents and Addressing, OCI-WALLET-2 Document Exchange
Used by(none yet)
Reference implementationociwallet-api (the wallet server every provider runs), ociwallet-app (its app), ociid-api (the country’s identity: the national_id scope and the ID card)

1. Purpose

A wallet is where a person keeps their documents: a driving licence, a school certificate, an ID card. A wallet provider is the organisation that runs wallets for people. OCI-WALLET-3 says what a wallet provider must do for its person, and what a country’s identity must do when a person connects it to their wallet.

It covers:

  1. Who the person is at the wallet, and the wallet address the provider gives them.
  2. Connecting the country’s identity (“connect your national identity”): an OpenID Connect sign-in at that identity with the scope national_id. The wallet learns the person’s national ID number from the identity itself, never from something typed. A person may also sign in to the wallet with that identity, and is then connected from the start (§5.2).
  3. The ID card: after a connect, the identity has the person’s ID card issued and sent to their wallet address.
  4. Finding a document at an issuer and keeping it.
  5. Checking a document before showing it as valid: the issuer’s signature, the issuer’s accreditation for the type, and what the issuer says about it today.
  6. Taking a document an issuer sends to the person’s address (a push).
  7. Files the person adds themselves (uploads), which nobody has verified.
  8. History, removing a document, and disconnecting the national identity.

OCI-WALLET-3 does not repeat what the other two specs of the family define. The document URI, the signed document, document types, document status, the wallet address format, the rule that matches a document to a person, and the participant kinds are in OCI-WALLET-1. Every signed call between a wallet, an exchange and an issuer, including the wire shape of find, fetch, status and push, is in OCI-WALLET-2. This spec says what a wallet does before it makes those calls and after it gets their answers.

A document is believed because its issuer signed it, never because a wallet says so. Most of this spec follows from that.

Not in this version, because none of it is built: sharing a document with a requester, connecting a wallet at an issuer, signing in to a wallet with the national identity, copies only the person can read, and sending a document again after it is re-issued. They are listed in §21.

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 WAL-3.1.

TermMeaning
PersonThe human whose wallet it is.
Wallet providerAn organisation that runs wallets for people. A participant of kind wallet in the trust registry (OCI-WALLET-1), for example wallet:satchel. “The wallet” in a clause means the provider’s server acting for one person.
Wallet appThe provider’s own app or website, which the person uses. It talks only to its provider’s server.
Provider’s identityThe identity service where the provider’s people sign in to the wallet. It is the provider’s own choice and is not the national identity.
National identityA country’s identity service: the one that knows each resident’s national ID number.
National ID numberThe number a country’s identity holds for a resident.
ConnectThe person signs in at the national identity from their wallet and agrees to share their national ID number with the wallet provider.
Wallet address<handle>@<provider>, for example asha@satchel. What a person gives an issuer so it can send documents to their wallet. The format is OCI-WALLET-1’s.
Home exchangeThe one document exchange a wallet makes and takes document calls at (OCI-WALLET-1, OCI-WALLET-2).
Issued documentA document its issuer signed (OCI-WALLET-1). The wallet keeps exactly what was signed.
Uploaded documentA file the person added themselves. Nobody signed it and nobody vouches for it.
Printable copyThe PDF an issuer may send with a document (OCI-WALLET-1).
StatusWhat the issuer says about a document now: active (it is valid), suspended or revoked (OCI-WALLET-1).
ID cardThe document a country’s identity has issued for each resident. In the reference country its type is IDCRD.

Every error a wallet server gives uses the body {"error": {"code": "<CODE>", "message": "<one sentence>"}}. The national identity’s OpenID Connect endpoints use the error forms of RFC 6749 (§6.6).

3. The person at the wallet

  • WAL-3.1 A wallet provider MUST know who is using a wallet before it does anything for them. The person signs in at the provider’s identity, and every call the wallet app makes for them MUST carry proof of that sign-in. In the reference implementation the proof is an access token of the provider’s identity: a JWS signed with ES256, with typ at+jwt, whose iss is the provider’s identity, whose client_id is the wallet app’s client and is listed in aud, with a sub, and with an exp that has not passed.
  • WAL-3.2 A call without a valid sign-in MUST be refused with 401 UNAUTHENTICATED and MUST do nothing. When the sign-in cannot be checked because the provider’s identity cannot be reached, the answer MUST be 502 IDENTITY_UNAVAILABLE, not a refusal of the sign-in, and no record of the person MUST be created.
  • WAL-3.3 A person at a wallet is the pair of the identity’s iss and its sub for them. A person who also signs in with the national identity (§5.2) is one person with two such pairs. The wallet MUST take the person’s name from the provider’s identity (its userinfo answer) the first time it sees them, and MUST keep it. The wallet MUST NOT take a person’s name from anything the person or the app sends.
  • WAL-3.4 Everything a wallet holds for a person (documents, files, history, the national ID number) MUST be reachable only by that person’s sign-in. A request for another person’s document MUST be answered exactly as if it did not exist: 404 DOCUMENT_NOT_FOUND.
  • WAL-3.5 The wallet MUST let the person see the name it holds for them, because that is the name issuers are asked for (§8). The reference wallet returns it in GET /v1/me and the app shows it on the page where the person searches an issuer.

4. The wallet address

  • WAL-4.1 A wallet provider MUST give every person a wallet address, in the format OCI-WALLET-1 defines. The part after @ MUST be the provider’s own name: its participant id without the wallet: prefix. wallet:satchel gives addresses ending @satchel.
  • WAL-4.2 The handle (the part before @) MUST be unique within the provider, and MUST NOT change once given. A document sent to an address always reaches the same person.
  • WAL-4.3 The provider chooses the handle. The reference wallet takes the part of the person’s email address before @, or their name with spaces as dots when there is no email, in lower case, keeps only a to z, 0 to 9, ., _ and -, removes leading punctuation, and cuts it to 30 characters. When that handle is taken it adds a number (asha, asha2, asha3). This recipe is not required; WAL-4.1 and WAL-4.2 are.
  • WAL-4.4 The wallet MUST show the person their address. It is not a secret: knowing an address lets an issuer send a document to it and nothing else.
  • WAL-4.5 A wallet MUST NOT use the national ID number, or any part of it, in a handle.

5. Connecting the national identity: the wallet’s side

Connecting is optional for the person and for the provider. A provider that offers it is registered at the national identity as a client that is a wallet provider (WAL-6.3).

  • WAL-5.1 A wallet provider MAY offer to connect a country’s national identity. A wallet that does not offer it MUST say so (available: false in the reference GET /v1/me) and MUST refuse an attempt to start or finish a connect with 404 NOT_OFFERED.
  • WAL-5.2 To start a connect, the wallet MUST send the signed-in person’s browser to the national identity’s authorization endpoint with an OpenID Connect authorization code request (§6.2) that has: response_type code; scope openid national_id; the provider’s client_id at that identity; a redirect_uri registered for it; a PKCE code_challenge with code_challenge_method S256; a fresh state; a fresh nonce; and wallet_address set to the person’s own wallet address.
  • WAL-5.3 The wallet’s server MUST create the PKCE verifier, the state and the nonce, and MUST keep them itself, tied to the signed-in person. They MUST NOT be given to the wallet app, apart from the state and the challenge that travel in the address the browser is sent to.
  • WAL-5.4 A started connect MUST be finished by the same signed-in person, with the same state, within 10 minutes, and only once. Starting a new connect MUST discard the person’s earlier unfinished one. Anything else MUST be refused with 400 CONNECT_EXPIRED.
  • WAL-5.5 To finish, the wallet’s server MUST redeem the code itself at the identity’s token endpoint (§6.4) with the kept code_verifier and the same redirect_uri. The national ID number is not in that answer: the wallet’s server MUST fetch it afterwards from the identity’s userinfo endpoint (§6.5), with the access token the answer carries. It MUST NOT pass through the wallet app or the person’s browser.
  • WAL-5.6 Before believing the answer, the wallet MUST check the ID token: its signature, with ES256, against the keys the identity publishes; iss equals the identity it started the connect at; aud holds the provider’s client_id; nonce equals the one it kept; sub is present; exp is present and has not passed. When the signature does not verify against the keys it holds, the wallet SHOULD fetch the identity’s keys once more before refusing. The wallet MUST then ask the identity’s userinfo endpoint (§6.5) with the answer’s access token, and MUST accept the userinfo answer only when its sub equals the ID token’s sub. It MUST take the national ID number from the userinfo answer only, never from the ID token. An answer that fails any check MUST connect nothing: 400 CONNECT_REFUSED.
  • WAL-5.7 When the identity refuses the code, gives no access token, or refuses the userinfo request, the wallet MUST answer 400 CONNECT_REFUSED. When the identity cannot be reached or answers with a server error, at the token endpoint or at userinfo, the wallet MUST answer 502 IDENTITY_UNAVAILABLE. When the userinfo answer carries no national_id, the wallet MUST answer 409 NO_NATIONAL_ID. In each case the person stays not connected.
  • WAL-5.8 From a good answer the wallet MUST keep the national ID number, which identity gave it, and when. It MUST record “connected” in the person’s history (§13), once: connecting again with the same number is not a new event.
  • WAL-5.9 One national ID number MUST be connected to at most one person at a provider. A connect that would give a second person the same number MUST be refused with 409 NATIONAL_ID_IN_USE and MUST change nothing.
  • WAL-5.10 The wallet’s server MUST NOT hand the whole national ID number to the wallet app. It MAY give the last four characters of the number (spaces not counted), so the person can recognise it, and whether and when the person connected. The reference wallet returns {"available", "name", "connected", "number_ending", "connected_at"}.
  • WAL-5.11 A wallet MUST NOT accept a national ID number from any source other than a connect, or a sign-in with the national identity (§5.2): not typed by the person, not sent by the app, not read from a document.
  • WAL-5.12 Once a person has connected, the wallet MUST send their national ID number with their name when it asks an issuer for their documents (WAL-8.2), and MUST use it to decide whose a document is (WAL-9.3, WAL-11.5).

5.1 Disconnecting

  • WAL-5.13 A person MUST be able to disconnect their national identity at any time, unless it is how they sign in (WAL-5.22). On disconnect the wallet MUST delete the national ID number, which identity gave it and when, and MUST record “disconnected” in the person’s history.
  • WAL-5.14 Disconnecting MUST NOT remove any document. The documents in the wallet are the person’s, including the ID card.
  • WAL-5.15 After a disconnect the wallet MUST ask issuers by name only (WAL-8.2). Disconnecting when not connected MUST succeed and change nothing.

5.2 Signing in with the national identity

A wallet may offer the country’s identity as a second way to sign in, beside the provider’s own. The person presses one button, and arrives in a wallet that is already connected.

  • WAL-5.16 A wallet provider that offers a connect MAY also let a person sign in with the national identity. The sign-in is the authorization code request of WAL-5.2, with the same client_id, the scope openid national_id and PKCE, and with no wallet_address: the person may not have a wallet yet. The identity treats it as any request for the scope (§6).
  • WAL-5.17 The wallet’s server MUST accept an access token of the national identity as proof of sign-in (WAL-3.1) only when it verifies as that identity’s (ES256, typ at+jwt, its iss, an exp, a sub) and its client_id is the provider’s own client at that identity and is listed in aud. A token of any other issuer, or for any other client, MUST be refused with 401 UNAUTHENTICATED.
  • WAL-5.18 The first time a sub of the national identity signs in, the wallet MUST require the token’s scope to hold national_id, MUST ask the identity’s userinfo endpoint with it (§6.5), and MUST accept the answer only when its sub equals the token’s. A token without the scope, or an answer for another sub, MUST be refused with 401 UNAUTHENTICATED. An answer with no national_id MUST be refused with 409 NO_NATIONAL_ID. When the identity cannot be reached the answer MUST be 502 IDENTITY_UNAVAILABLE. In each case no person is created and nothing is kept.
  • WAL-5.19 One national ID number is one person at a provider (WAL-5.9). When a person at the provider already holds the number the identity answered, because they connected it earlier from an account at the provider’s own identity, the sign-in MUST be theirs: the same wallet, the same documents, the same address. The wallet MUST NOT create a second person for the number.
  • WAL-5.20 Otherwise the wallet MUST create the person as connected: with the name the national identity gave (WAL-3.3), the national ID number, which identity gave it and when, and a wallet address (§4). It MUST record “connected” in their history.
  • WAL-5.21 The wallet MUST remember which sub of the national identity a person is, on a sign-in with it and on a connect (WAL-5.8). A later sign-in with that sub MUST NOT need the national_id scope and MUST NOT ask userinfo again: tokens renewed from the sign-in do not carry the scope (WAL-6.17).
  • WAL-5.22 A person the wallet created from a sign-in with the national identity has no other way in. The wallet MUST refuse their disconnect with 409 SIGNS_IN_WITH_IT and MUST tell them so in what it says about their connection (signs_in in the reference GET /v1/me). A person who has an account at the provider’s own identity can still disconnect (WAL-5.13); the wallet then forgets their sub at the national identity with the number.
  • WAL-5.23 A sign-in carries no wallet address, so the identity sends no card (WAL-7.10). After the first sign-in with the national identity (WAL-5.19, WAL-5.20) the wallet SHOULD collect the person’s ID card itself, by an ordinary find and keep (§8, §9) at each issuer the country accredits for the ID card type, searching by the number and the date of birth the identity answered. It MUST NOT delay or fail the sign-in for it, and MUST NOT keep a second copy of a card the person already holds.

6. Connecting the national identity: the identity’s side

This section is a profile of OpenID Connect for one purpose: a wallet provider learning a resident’s national ID number with the resident’s agreement. The identity’s ordinary sign-in rules (its authentication of the resident, client registration, assurance levels, token lifetimes) are its own and OCI-2’s. Only what the national_id scope adds is specified here.

6.1 Who offers it, and discovery

  • WAL-6.1 Only a country’s national identity gives the national_id scope. Any other identity MUST treat national_id as it treats any scope it does not know: the sign-in goes ahead as if the scope were absent, the granted scope does not include it, no wallet_address is recorded, and no national ID claim is returned.
  • WAL-6.2 A national identity that gives the scope MUST list national_id in scopes_supported of its OpenID Connect discovery document (/.well-known/openid-configuration). An identity that does not give it MUST NOT list it.

6.2 The authorization request

GET /authorize Ask to connect a national identity · served by an identity

An OpenID Connect authorization code request with the scope national_id. The parameters travel in the query string of the address the person's browser is sent to. The answer is a redirect (302) back to redirect_uri, with the answer's parameters in its query string: a code when the person chose to connect, or an error. Called by the person's browser, sent by their wallet provider's server. Defined in WAL-5.2, WAL-6.3, WAL-6.4, WAL-6.5, WAL-6.6, WAL-6.7, WAL-6.8, WAL-6.9, WAL-6.10, WAL-6.11, WAL-6.12.

RequestTypeRequiredMeaningClause
client_idstringyesThe wallet provider's client at this identity. It must be registered as a wallet provider.WAL-6.3
redirect_uristringyesWhere the person is sent back to. It must be registered for the client.WAL-6.6
response_type"code"yesAlways code.WAL-6.4
scopestringyesSpace-separated scopes. To connect: openid national_id.WAL-5.2
code_challengestringyesThe PKCE challenge: the base64url SHA-256 of the verifier the wallet's server keeps.WAL-6.4
code_challenge_method"S256"yesAlways S256.WAL-6.4
statestringyesA fresh value the wallet's server keeps for the signed-in person. It comes back unchanged.WAL-5.3
noncestringyesA fresh value the wallet's server keeps. It comes back inside the ID token. (at most 64 characters; at least 1)WAL-6.4
wallet_addressstringThe person's wallet address at this provider (asha@satchel). The ID card is sent here. Its provider part must be the provider name registered for the client. (pattern ^[a-z0-9][a-z0-9._-]{0,62}@[a-z0-9][a-z0-9._-]{0,62}$)WAL-6.5
ResponseTypeRequiredMeaningClause
codestringThe authorization code. It works once, for a short time, and only with the PKCE verifier.WAL-6.12
statestringyesThe state of the request, unchanged.WAL-6.7
issstringyesThe identity's issuer identifier (RFC 9207).WAL-6.7
error"invalid_scope" | "invalid_request" | "unsupported_response_type" | "access_denied" | "unmet_authentication_requirements"Why no code was issued.WAL-6.19
error_descriptionstringOne sentence. It never carries anything from the resident's record.WAL-6.19

Errors

  • WAL-6.3 The identity MUST accept national_id only from a client it has registered as a wallet provider. The registration MUST record the provider’s name as it appears in a wallet address (satchel for wallet:satchel). A request with the scope from any other client MUST be answered by redirecting back with the error invalid_scope.
  • WAL-6.4 The request MUST be an authorization code request with PKCE: response_type code, scope including openid, code_challenge with code_challenge_method S256, state, and a nonce of 1 to 64 characters. A request without them MUST be answered by redirecting back with unsupported_response_type, invalid_scope or invalid_request, as RFC 6749 and OpenID Connect Core define.
  • WAL-6.5 wallet_address is OPTIONAL. When present it MUST be a wallet address (OCI-WALLET-1) whose provider part equals the provider name registered for the client (WAL-6.3). Anything else MUST be answered by redirecting back with invalid_request. A wallet provider can name only an address of its own.
  • WAL-6.6 When the client_id is unknown or the redirect_uri is not registered for it, the identity MUST NOT redirect. It shows the person an error page.
  • WAL-6.7 Every redirect back, with a code or with an error, MUST carry the identity’s iss (RFC 9207) and the request’s state.

6.3 What the person is asked

  • WAL-6.8 When the resident who signs in has no national ID number, the identity MUST redirect back with access_denied and MUST share nothing.
  • WAL-6.9 After the resident has signed in and before anything is shared, the identity MUST show them a consent page that names the wallet provider and shows, as the values themselves, their name, their national ID number, and their date of birth when the identity holds one. It MUST say what the number will be used for (issuers use it to find the documents that are theirs).
  • WAL-6.10 When the request carries a wallet_address, the consent page MUST show that address and say that the resident’s ID card will be sent to it.
  • WAL-6.11 The consent page MUST offer two answers of equal standing: to connect, and to cancel. On cancel the identity MUST redirect back with access_denied, MUST issue no code, MUST record no wallet address, and MUST send no ID card.
  • WAL-6.12 On connect the identity issues an authorization code bound to the client, the redirect_uri, the code_challenge, the nonce, the scope openid national_id and the wallet_address (if any). The code MUST work once and only for a short time (60 seconds in the reference implementation).

6.4 The token request and the ID token

POST /token Redeem the code and learn the national ID number · served by an identity

The authorization code grant. The parameters travel in the body as application/x-www-form-urlencoded. The answer is JSON. For a code issued for openid national_id, the access token has that scope and the wallet fetches the resident's national ID number from userinfo with it; the ID token never carries the number. Redeeming such a code that carries a wallet address also has the resident's ID card sent to that address. Called by a wallet provider's server. Defined in WAL-5.5, WAL-5.6, WAL-6.13, WAL-6.14, WAL-6.16, WAL-6.17, WAL-7.1, WAL-7.8.

RequestTypeRequiredMeaningClause
grant_type"authorization_code"yesAlways authorization_code for a connect.WAL-6.13
codestringyesThe code from the redirect back.WAL-6.13
redirect_uristringyesThe same redirect_uri as in the authorization request.WAL-6.13
code_verifierstringyesThe PKCE verifier the wallet's server kept.WAL-6.13
client_idstringyesThe wallet provider's client at this identity.WAL-6.13
ResponseTypeRequiredMeaningClause
access_tokenstringyesThe access token. For a connect its scope is openid national_id, and the wallet presents it at the userinfo endpoint to fetch the national ID number.WAL-6.14
token_type"Bearer"yesAlways Bearer.
expires_inintegeryesSeconds the access token lasts.
scopestringyesThe scope granted: openid national_id when the code was issued for it and the resident has a national ID number, else without national_id.WAL-6.14
id_tokenstringyesThe ID token: a JWS signed by the identity with ES256. Its claims are described by $defs.id_token_claims.WAL-6.16
refresh_tokenstringyesA refresh token. Tokens issued from it never carry the national ID claims.WAL-6.17

Errors

  • WAL-6.13 The wallet’s server redeems the code with grant_type authorization_code, code, redirect_uri, code_verifier and its client_id, sent as application/x-www-form-urlencoded. The identity MUST check that the code is live and unused, that it was issued to this client for this redirect_uri, and that the code_verifier matches the code_challenge. A failure is invalid_grant.

  • WAL-6.14 When the code was issued for openid national_id and the resident has a national ID number, the answer’s scope MUST be openid national_id, and so MUST the scope of its access token. Otherwise the answer’s scope MUST NOT include national_id. The ID token MUST NOT carry any claim of WAL-6.15, whatever the scope: a national ID number is never part of a sign-in (OCI-2 §9, AUTH-9.8). The wallet fetches those claims from userinfo (WAL-6.18).

  • WAL-6.15 The claims the national_id scope adds to the userinfo answer, and only there:

    ClaimValuePresent
    national_idThe resident’s national ID number, as the identity holds itAlways
    birthdateThe resident’s date of birth, YYYY-MM-DDWhen the identity holds one
    genderThe resident’s gender, as the identity holds itWhen the identity holds one
  • WAL-6.16 The ID token MUST be signed by the identity with ES256, and MUST carry iss, sub, aud (the client’s client_id), exp and the request’s nonce, so the wallet can run the checks of WAL-5.6. sub MUST NOT be, or contain, the national ID number.

  • WAL-6.17 The national ID claims belong to the connect, not to the session. Tokens the identity issues later from the refresh token of this sign-in MUST have the scope openid, so userinfo no longer answers the claims of WAL-6.15 for them.

6.5 Userinfo

GET /userinfo Read the national ID claims with the access token · served by an identity

The OpenID Connect userinfo endpoint. It takes no parameters: the access token travels in the Authorization header as a Bearer token. When that token has the scope national_id, the answer carries the national ID claims beside the identity's ordinary ones. This is the only place the national ID number is given: the wallet's server calls it after redeeming the code, and accepts the answer only when its sub is the ID token's. Called by a wallet provider's server. Defined in WAL-5.5, WAL-5.6, WAL-6.15, WAL-6.18.

Request: no body.

ResponseTypeRequiredMeaningClause
substringyesThe identity's identifier for the resident at this client.
namestringyesThe resident's name.
phone_numberstringThe resident's phone number, when the identity holds one.
emailstringThe resident's email address, when the identity holds one.
national_idstringThe resident's national ID number, as the identity holds it. Only for an access token with the scope national_id.WAL-6.18
birthdatestringThe resident's date of birth, YYYY-MM-DD. Present when the identity holds one. Only for an access token with the scope national_id.WAL-6.18
genderstringThe resident's gender, as the identity holds it. Present when the identity holds one. Only for an access token with the scope national_id.WAL-6.18

Errors

  • WAL-6.18 When the access token presented at the userinfo endpoint has the scope national_id, and the resident has a national ID number, the answer MUST carry the claims of WAL-6.15 beside the identity’s ordinary userinfo claims. For any other access token it MUST NOT.

6.6 Errors

  • WAL-6.19 Errors of the authorization endpoint travel as error, error_description, state and iss in the query of the redirect back (RFC 6749 §4.1.2.1). Errors of the token and userinfo endpoints are JSON, {"error": "<code>", "error_description": "<one sentence>"} (RFC 6749 §5.2, RFC 6750 §3). An error description MUST NOT include the resident’s national ID number or anything else about their record.

7. The ID card after a connect

  • WAL-7.1 When a code issued for openid national_id with a wallet_address is redeemed (WAL-6.13), the identity MUST record that the resident connected that address, with the client that asked, and MUST then have the resident’s ID card sent to that address.
  • WAL-7.2 When the connect carried no wallet_address, the wallet still learns the number, and the identity MUST NOT send the ID card anywhere.
  • WAL-7.3 The identity MUST NOT sign documents with its sign-in keys. The ID card is an ordinary issued document (OCI-WALLET-1): a document issuer run by the same organisation, registered as a participant of kind doc_issuer and accredited for the ID card type, issues it, signs it, keeps its status and answers find, fetch and status for it like any other document. In the reference country that issuer is issuer:ociid.in and the type is IDCRD.
  • WAL-7.4 The identity asks its issuer to issue the card once for each resident. When the card already exists, that is success, and the same card is sent again. Connecting a second wallet later MUST send the same card, not a new one.
  • WAL-7.5 The card’s id at the issuer, and so its URI, MUST be stable for the resident and MUST say nothing about them. It MUST NOT be, contain, or be derived from the national ID number. The reference identity derives it from its own random internal id for the resident.
  • WAL-7.6 The card MUST name one person in issued_to, with their name and national_id, and their date_of_birth and gender when the identity holds them. Its number is the national ID number.
  • WAL-7.7 The card MUST be sent as a push from that issuer to the wallet address, as OCI-WALLET-2 §11 requires: issuer to its home exchange, then to the wallet’s home exchange if it is another, then to the wallet. The identity MUST NOT deliver it to the wallet by any other path. The wallet treats it as any pushed document (§11).
  • WAL-7.8 Sending the card MUST NOT delay or fail the connect. The identity MUST answer the token request first and send the card afterwards. When the card cannot be issued or delivered, the connect stands and the token answer is unchanged. The identity records when a card was delivered, so a connect with no delivery time is one whose card has not arrived.
  • WAL-7.9 How the identity asks its own issuer is inside one organisation and is not specified. The reference identity calls its issuer connector’s administrative API with a shared token: POST /admin/v1/documents, then POST /admin/v1/documents/{uri}/push with {"to": "<wallet address>"}.
  • WAL-7.10 When the scope national_id is granted on a request that carried no wallet_address (a sign-in, WAL-5.16), the identity MUST still have the resident’s ID card issued, once, as WAL-7.3 to WAL-7.6 require, so that the wallet can find it (WAL-5.23). It MUST NOT push it anywhere. WAL-7.8 applies: the token answer comes first and does not depend on it.

8. Finding a document

  • WAL-8.1 A wallet SHOULD show the person what can be found: the document types of the wallet’s country from the trust registry (OCI-WALLET-1), each with its search fields and with those of its accredited issuers that are registered, of kind doc_issuer and active. A type with no such issuer SHOULD NOT be offered.
  • WAL-8.2 When a wallet asks an issuer for a person’s documents (find) or for one document (fetch), it MUST say who it has signed in, in the person object of OCI-WALLET-1 §11 (WDOC-11.1), sent as OCI-WALLET-2 §8 and §9 define: name, the name of WAL-3.3; and national_id, the number of WAL-5.8, when and only when the person has connected. Nothing else about the person is sent, apart from the answers the person themselves gives to the type’s search fields.
  • WAL-8.3 The person MUST NOT be able to say who they are. A request from the wallet app that carries a person, a name or a national ID number of its own MUST be refused (422 VALIDATION_ERROR in the reference wallet).
  • WAL-8.4 A wallet that holds no name for a person MUST NOT ask any issuer for them. It MUST answer 409 NAME_NEEDED and send nothing.
  • WAL-8.5 Before a search is sent, the wallet MUST tell the person which issuer will be asked and for whom: the name that will be sent. See also the open question in §21 on showing that the national ID number is sent.
  • WAL-8.6 The wallet makes find, fetch and status calls only at its home exchange, signed, as OCI-WALLET-2 requires. It MUST NOT call an issuer directly.
  • WAL-8.7 From a find answer the wallet MUST drop every entry whose URI does not parse (OCI-WALLET-1), or whose URI names a different issuer or a different type from the ones asked for. An issuer answers only for itself.
  • WAL-8.8 A find answer is a list of what the issuer says exists. It is not yet verified, and the wallet MUST NOT present a found document as kept or as checked. The wallet SHOULD mark which found documents are already in the person’s wallet.
  • WAL-8.9 A refusal from the issuer or from an exchange, with status 403, 404, 410, 422 or 502 and an error body, MUST reach the person with the same status, code and message. Any other failure of the call, and an exchange that cannot be reached, is 502 EXCHANGE_UNAVAILABLE.
  • WAL-8.10 For a person who has connected their national identity, a wallet MAY ask an issuer with no search fields (OCI-WALLET-2 WEX-8.10), so that the person need not know a document’s number. It MUST tell the person that the issuer is asked by their national ID number. For a person who has not connected, the wallet MUST NOT send an empty search: 409 NOT_CONNECTED.
  • WAL-8.11 A wallet MAY ask every issuer of every document type of its country at once in this way (the reference POST /v1/find-all). It MUST show what each issuer found, with the issuer’s name, and which of those the person already holds, and it MUST keep nothing the person has not chosen to keep (§9). An issuer that refuses or does not answer MUST NOT fail the rest: the wallet says which issuers did not answer.

9. Keeping a document

  • WAL-9.1 To keep a document the wallet MUST fetch it by its URI through its home exchange (WAL-8.2, WAL-8.6) and MUST accept the answer only when it is for the URI asked for, carries the signed document, and carries the status active or suspended. Any other answer MUST be refused with 502 DOCUMENT_NOT_GENUINE.
  • WAL-9.2 The wallet MUST verify the signed document as OCI-WALLET-1 §7 requires (see WAL-10.1) before keeping it. A document that does not verify MUST NOT be kept: 502 DOCUMENT_NOT_GENUINE.
  • WAL-9.3 The issuer answers only for the person asked for. The wallet MUST still read what it was given and apply the matching rule of OCI-WALLET-1 §11 itself: when the wallet knows the person’s national ID number and the document records one for anyone in issued_to, the numbers must match; otherwise a name in issued_to must match the person’s name. A verified document that names somebody else MUST NOT be kept: 403 NOT_YOUR_DOCUMENT.
  • WAL-9.4 The wallet MUST keep the signed document exactly as it arrived, byte for byte. Everything it later shows about the document’s content MUST be read from what was signed.
  • WAL-9.5 When the answer carries a printable copy that decodes, the wallet keeps it with the document. A printable copy that cannot be decoded MUST be dropped, and MUST NOT stop a verified document from being kept.
  • WAL-9.6 A wallet MUST hold at most one record for a URI for a person. Keeping a document already in the wallet refreshes that record (the signed document, the status, the printable copy, including removing a copy the issuer no longer sends) and MUST NOT make a second one. The reference wallet answers 201 for a new document and 200 for a refresh.
  • WAL-9.7 Keeping a new document MUST be recorded in the person’s history as “added”, with the issuer’s name. A refresh is not a new history entry.
  • WAL-9.8 A failed keep MUST leave nothing behind: no document, no file, no history entry.

10. Checking a document before showing it as valid

10.1 What is checked

  • WAL-10.1 A wallet MUST NOT show an issued document as valid unless all three of these hold at the time it is shown:
    1. The signature. The document verifies as OCI-WALLET-1 §7 requires: it is signed by the issuer its URI names, with a key that issuer publishes, and what it says matches its URI.
    2. The accreditation. That issuer is, now, a registered and active document issuer, accredited in the trust registry for the document’s type (OCI-WALLET-1).
    3. The status. The issuer’s latest answer about the document is active (WAL-10.5 to WAL-10.9).
  • WAL-10.2 The wallet MUST run checks 1 and 2 when it keeps a document (WAL-9.2), when it takes a pushed one (WAL-11.3), and again every time the person opens the document. A check made earlier does not carry forward: an issuer that has lost its accreditation since the document was kept makes the document not genuine now.
  • WAL-10.3 When the person opens a document, the wallet MUST tell them the result of the check as one of three outcomes, and MUST NOT merge them:
    • Genuine: checks 1 and 2 passed. A document whose signature and accreditation pass but whose own end date has passed is genuine and expired, and MUST be shown as expired.
    • Not genuine: check 1 or 2 failed. The wallet MUST say why.
    • Could not be checked: the issuer’s keys or the trust registry could not be reached. The wallet MUST NOT show this as genuine or as not genuine.
  • WAL-10.4 A wallet MUST NOT ask the person, or anyone else, to believe a document on the wallet’s word. Anyone given the signed document can run the same checks.

10.2 Status

  • WAL-10.5 The status kept with a document is only what the issuer last said. Every time the person opens an issued document, the wallet MUST ask the issuer for its status now, through its home exchange (OCI-WALLET-2 §10), and MUST show the answer.
  • WAL-10.6 When the wallet lists a person’s documents, it MUST ask again for every issued document whose status it last heard more than 60 seconds ago. It MAY skip the question for a status heard more recently. It MAY limit how many documents it asks about in one listing (the reference asks about at most 20); a document it did not ask about keeps the status last heard.
  • WAL-10.7 revoked is final. Once an issuer has said a document is revoked, the wallet MUST show it as revoked and need not ask again. A status answer of 410 means revoked.
  • WAL-10.8 When the issuer cannot be asked, the wallet MUST keep and show the status it last heard, and MUST tell the person that the issuer did not answer just now (status_asked: false in the reference wallet). It MUST NOT invent a status.
  • WAL-10.9 A status answer that is not for the URI asked, or that carries a status other than active, suspended or revoked, MUST be treated as no answer (WAL-10.8).
  • WAL-10.10 Every change of status the wallet learns MUST be recorded in the person’s history once, with the old and the new status, however many screens asked at the same moment.
  • WAL-10.11 A suspended or revoked document stays in the wallet until the person removes it. What the issuer signed has not changed; what is said about it has.

11. Taking a pushed document

An issuer may send a document to a person’s wallet address without the person asking: the ID card after a connect (§7) is the first case. The call arrives at the wallet from its home exchange. Its wire shape (to, uri, document, pdf), its signature and who may send it are OCI-WALLET-2’s. This section says what the wallet does with it.

  • WAL-11.1 A wallet MUST take a push only from its home exchange, verified as OCI-WALLET-2 §4 requires. A push from anyone else, including an issuer directly or another exchange, MUST be refused as OCI-WALLET-2 §3 requires (403 FORBIDDEN_PARTICIPANT; 401 for a missing or bad signature).
  • WAL-11.2 The wallet MUST find the person from the address alone: the provider part MUST be its own name (WAL-4.1) and the handle MUST be one it has given. Otherwise it MUST refuse with 404 NO_SUCH_ADDRESS, and MUST give the same answer for an address at another provider and for a handle nobody has.
  • WAL-11.3 The wallet MUST verify a pushed document exactly as it verifies one it fetched (WAL-10.1, checks 1 and 2), against the uri the push names. A document that does not verify MUST be refused with 422 DOCUMENT_NOT_GENUINE and MUST NOT be kept. The status is 422, not the 502 of WAL-9.2, because here the fault is in what the sender sent.
  • WAL-11.4 A pushed document whose own end date has passed MUST be refused with 410 DOCUMENT_EXPIRED. When the issuer’s keys or the trust registry cannot be reached, the wallet MUST refuse with 502 (ISSUER_UNAVAILABLE, TRUST_REGISTRY_UNAVAILABLE) and keep nothing, so the sender can try again.
  • WAL-11.5 When the person at the address has connected their national identity and the document records a national ID number for anyone in issued_to, the wallet MUST refuse a document whose numbers do not include the person’s: 403 NOT_THEIR_DOCUMENT. A document that records no number, or a person who has not connected, is not refused on this ground (see §21).
  • WAL-11.6 A printable copy in a push is kept only when it decodes, is a PDF by its content, and is no larger than the wallet’s file limit (WAL-12.3). Otherwise the copy MUST be dropped and the document still taken.
  • WAL-11.7 A push carries no status. The wallet MUST NOT show a pushed document as valid on the push alone: it MUST treat the status as not yet heard and ask the issuer (WAL-10.5, WAL-10.6) the next time the person lists or opens their documents.
  • WAL-11.8 A taken document is kept as an issued document under WAL-9.4 and WAL-9.6, marked as received (the reference wallet’s received: true), so the person can tell a document that was sent to them from one they looked for. A new one MUST be recorded in history as “received”, with the issuer’s name. The same document pushed again MUST NOT make a second record or a second history entry.
  • WAL-11.9 On success the wallet answers with the uri, the address (to) and its own participant id (wallet), as OCI-WALLET-2 §11 defines. It MUST NOT answer success before the document is kept.
  • WAL-11.10 A refusal MUST NOT tell the sender anything about the person beyond what the codes above say. In particular it MUST NOT say whether the person has connected a national identity, except as WAL-11.5 implies.

12. Uploads

  • WAL-12.1 A wallet MAY let a person add a file of their own. Such a document is an uploaded document: it has no URI, no issuer and no status, and nobody is told about it.
  • WAL-12.2 A wallet MUST mark every uploaded document as not verified, everywhere it is shown, in the list and when opened. It MUST NOT show an upload with any sign it uses for a genuine issued document. The reference wallet reports source: "uploaded", check.genuine: null and “You added this file yourself. Nobody has verified it.”
  • WAL-12.3 The wallet MUST decide what a file is by its content, not by its name or declared type. The reference wallet accepts a PDF, a JPEG or a PNG of at most 10 MB, and refuses others with 415 UNSUPPORTED_FILE, a larger one with 413 FILE_TOO_LARGE, and an empty file or an empty name with 422 VALIDATION_ERROR. The set of kinds and the limit are the provider’s choice.
  • WAL-12.4 An upload MUST be recorded in the person’s history as “uploaded”.
  • WAL-12.5 A wallet MUST NOT turn an upload into an issued document, and MUST NOT attach an issuer’s name or a status to it, whatever the file says.

13. History and removing

  • WAL-13.1 A wallet MUST keep, for each person, a history of what happened in their wallet, and MUST let the person read it. The events are: added (a document they looked for was kept), received (an issuer sent one), uploaded, removed, status (an issuer changed a document’s status), connected and disconnected (the national identity).
  • WAL-13.2 Each event MUST carry when it happened, what it was about by name, and a detail where there is one (the issuer’s name, or the old and new status). A history entry MUST NOT carry the national ID number.
  • WAL-13.3 History is the person’s alone (WAL-3.4). The reference wallet shows the 200 most recent events, newest first, and says for each whether the document is still in the wallet.
  • WAL-13.4 A person MUST be able to remove any document from their wallet, issued or uploaded. Removing MUST delete the wallet’s record of it, the signed document and its file, and MUST be recorded in history as “removed”. The history entries about the document stay.
  • WAL-13.5 Removing a document changes nothing at the issuer and tells nobody. The document remains issued; the person can find and keep it again.
  • WAL-13.6 When the wallet serves a document’s file to the person, it MUST serve it only to them, with the type the wallet decided from the content, and MUST tell the browser not to store it (Cache-Control: private, no-store).

14. Errors

Errors a wallet server gives. The first group answers the wallet app; the second answers a push and travels back through the exchange to the issuer.

StatusCodeWhenClause
401UNAUTHENTICATEDNo valid sign-inWAL-3.2
502IDENTITY_UNAVAILABLEThe provider’s identity, or the national identity, could not be reachedWAL-3.2, WAL-5.7
404DOCUMENT_NOT_FOUNDNo such document in this person’s walletWAL-3.4
404FILE_NOT_FOUNDThe document has no fileWAL-9.5
404NOT_OFFEREDThis wallet does not connect to a national identityWAL-5.1
400CONNECT_EXPIREDThe connect was not started by this person, took too long, or was already finishedWAL-5.4
400CONNECT_REFUSEDThe identity refused the code, or its answer did not verifyWAL-5.6, WAL-5.7
409NO_NATIONAL_IDThe identity’s answer carried no national ID numberWAL-5.7
409NATIONAL_ID_IN_USEThe number is connected to another person at this providerWAL-5.9
409SIGNS_IN_WITH_ITA disconnect by a person who signs in with the national identityWAL-5.22
409NOT_CONNECTEDA search with no fields by a person who has not connected their national identityWAL-8.10
409NAME_NEEDEDThe wallet holds no name for the person, so no issuer can be askedWAL-8.4
422VALIDATION_ERRORThe request is not of the call’s shapeWAL-8.3, WAL-12.3
502EXCHANGE_UNAVAILABLEThe home exchange could not be reached or did not answer usefullyWAL-8.9
502DOCUMENT_NOT_GENUINEA fetched document did not verify, or the answer was not for the document asked forWAL-9.1, WAL-9.2
403NOT_YOUR_DOCUMENTA fetched, verified document names somebody elseWAL-9.3
413FILE_TOO_LARGEAn upload over the limitWAL-12.3
415UNSUPPORTED_FILEAn upload that is not an accepted kind of fileWAL-12.3
404NO_SUCH_ADDRESSPush: nobody at this provider has that addressWAL-11.2
422DOCUMENT_NOT_GENUINEPush: the document did not verifyWAL-11.3
410DOCUMENT_EXPIREDPush: the document’s own end date has passedWAL-11.4
502ISSUER_UNAVAILABLE, TRUST_REGISTRY_UNAVAILABLEThe issuer’s keys or the registry could not be reachedWAL-11.4
403NOT_THEIR_DOCUMENTPush: the document records another person’s national ID numberWAL-11.5

Codes of an issuer or an exchange that a wallet passes on unchanged (WAL-8.9), and the codes for a push that fails the signature or caller check (WAL-11.1), are OCI-WALLET-2’s.

15. The provider’s own API (informative)

The calls between a wallet app and its provider’s server are one provider’s own. They are not part of the protocol, and another provider may shape them differently, as long as the clauses above hold. The reference wallet server (ociwallet-api) serves these, each with the person’s sign-in as a bearer token:

CallWhat it doesClauses it carries out
GET /v1/meWho is signed in, their wallet address, and the state of the national identity connectionWAL-3.5, WAL-4.4, WAL-5.10
POST /v1/national-identity/startBegin a connect; answers the address to send the browser toWAL-5.2 to WAL-5.4
POST /v1/national-identity/finishThe person came back with state and code; finish the connectWAL-5.4 to WAL-5.9
DELETE /v1/national-identityDisconnectWAL-5.13 to WAL-5.15
GET /v1/doc-typesWhat can be found, and at which issuersWAL-8.1
POST /v1/findLook for the person’s documents at an issuer (issuer, doc_type, search)WAL-8.2 to WAL-8.9
GET /v1/documentsThe person’s documentsWAL-10.6
POST /v1/documentsKeep an issued document by its uri§9
POST /v1/uploadsAdd a file of the person’s own (the body is the file)§12
GET /v1/documents/{id}One document, checked again now§10
GET /v1/documents/{id}/fileThe printable copy, or the uploadWAL-13.6
DELETE /v1/documents/{id}Remove a documentWAL-13.4
GET /v1/historyWhat has happened in the walletWAL-13.1 to WAL-13.3

The wallet server also serves POST /exchange/v1/hello and POST /exchange/v1/push to its home exchange. Those are protocol calls, defined in OCI-WALLET-2.

16. Worked example

Asha Rao keeps her documents at Satchel, a wallet provider (wallet:satchel). Her wallet address is asha@satchel. Satchel’s home exchange is NDX (exchange:ndx). The country’s identity is at https://id.in.example; Satchel is registered there as the client wallet:satchel, a wallet provider named satchel. All values are synthetic.

1. Asha presses “Connect” in her wallet. Satchel’s server makes a verifier, a state and a nonce, keeps them for Asha, and sends her browser to:

https://id.in.example/authorize?client_id=wallet%3Asatchel
  &redirect_uri=https%3A%2F%2Fsatchel.example%2Fconnect%2Fnational
  &response_type=code&scope=openid+national_id
  &code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256
  &state=Qm3x0cV7yT1dK9rLw2uJ8aZp5sN4hB6e&nonce=n-0S6_WzA2Mj
  &wallet_address=asha%40satchel

2. Asha signs in at the identity and is asked. The page reads “Connect your OCI-ID to Satchel?”, shows her name, her number 9999 0000 0001 and her date of birth, and says “Your ID card will be sent to your wallet, asha@satchel.” She chooses Connect. The identity sends her browser back:

https://satchel.example/connect/national?code=3q8b…&state=Qm3x0cV7yT1dK9rLw2uJ8aZp5sN4hB6e&iss=https%3A%2F%2Fid.in.example

3. Satchel’s server redeems the code.

POST /token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&code=3q8b…&redirect_uri=https%3A%2F%2Fsatchel.example%2Fconnect%2Fnational
&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk&client_id=wallet%3Asatchel
{ "access_token": "eyJ…", "token_type": "Bearer", "expires_in": 900, "scope": "openid national_id",
  "id_token": "eyJ…", "refresh_token": "…" }

The ID token’s claims:

{ "iss": "https://id.in.example", "sub": "k7Qw…pairwise", "aud": "wallet:satchel", "iat": 1796032800, "exp": 1796033700,
  "acr": "substantial", "amr": ["otp"], "auth_time": 1796032790, "nonce": "n-0S6_WzA2Mj",
  "name": "Asha Rao", "email": "asha@oci.example" }

It says who signed in and nothing about her number. Satchel checks the signature, iss, aud, nonce and exp, then asks for the number with the access token:

GET /userinfo
Authorization: Bearer eyJ…
{ "sub": "k7Qw…pairwise", "name": "Asha Rao", "email": "asha@oci.example",
  "national_id": "9999 0000 0001", "birthdate": "1990-04-12", "gender": "F" }

The sub is the ID token’s, so Satchel keeps the number, and tells its app only:

{ "available": true, "name": "OCI-ID", "connected": true, "number_ending": "0001", "connected_at": "2026-11-30T10:00:01Z" }

4. The identity sends the ID card. Having answered the token request, it asks its own issuer (issuer:ociid.in) to issue Asha’s card, once, and to push it to asha@satchel. The card’s URI is ociid.in-IDCRD-3F2A9C1B7D4E4A10: nothing in it comes from her number. The push travels issuer to NDX to Satchel as OCI-WALLET-2 defines. Satchel finds Asha from the address, verifies the card (signed by issuer:ociid.in, which is accredited for IDCRD), sees that the number it records is hers, keeps it, and answers:

{ "uri": "ociid.in-IDCRD-3F2A9C1B7D4E4A10", "to": "asha@satchel", "wallet": "wallet:satchel" }

Her history now reads “connected, OCI-ID” and “received, OCI-ID Card, from OCI-ID”. The next time she lists her documents, Satchel asks the issuer for the card’s status and shows it as valid when the answer is active.

5. Asha looks for her driving licence. She picks Driving Licence at the Transport Department and gives the licence number and her date of birth. The page says the Transport Department will be asked for documents issued to Asha Rao. Satchel calls its home exchange (the call is OCI-WALLET-2’s) with:

{ "issuer": "issuer:transport", "doc_type": "DRVLC",
  "search": { "number": "KA01 2023 0001", "date_of_birth": "1990-04-12" },
  "person": { "name": "Asha Rao", "national_id": "9999 0000 0001" } }

She keeps transport-DRVLC-KA0120230001. Satchel fetches it, verifies it, sees it is issued to her, and stores what was signed. When she opens it, the reference wallet reports:

{ "source": "issued", "name": "Driving Licence", "uri": "transport-DRVLC-KA0120230001", "issuer_name": "Transport Department",
  "status": "active", "received": false, "expired": false,
  "check": { "genuine": true, "status_asked": true, "detail": "Signed by Transport Department, which is accredited to issue it." } }

6. Later she disconnects. Satchel forgets her number. The card and the licence stay. Her next search sends "person": {"name": "Asha Rao"}.

17. Security considerations

  • The number comes only from the identity. A typed national ID number would let anyone ask an issuer for somebody else’s documents. WAL-5.5, WAL-5.6 and WAL-5.11 make the identity’s own answer, fetched by the wallet’s server with the access token of a checked sign-in, the only source. PKCE (WAL-5.2) and the kept nonce stop a code or a token meant for another connect from being used.
  • A connect belongs to who started it. WAL-5.4 ties the state to the signed-in person, once, for 10 minutes. Without it, an attacker could finish their own connect in a victim’s session and attach the attacker’s number to the victim’s wallet, or the reverse.
  • Only wallet providers may ask. WAL-6.3 keeps the national ID number away from every ordinary client of the identity. WAL-6.5 keeps a provider from having a resident’s ID card sent to an address it does not run.
  • The wallet is not a trusted party for documents. It stores what the issuer signed and checks it every time (WAL-10.2). A provider that is compromised or dishonest cannot make a forged document verify for anyone who checks it themselves (WAL-10.4).
  • Accreditation is checked now, not once. A valid signature from an issuer that is not accredited for the type proves nothing (WAL-10.1). An issuer that loses accreditation makes its kept documents show as not genuine at the next open.
  • A push is not believed more than a fetch. WAL-11.3 applies the same verification. WAL-11.7 stops a pushed document from being shown as valid before its issuer has been asked. WAL-11.1 limits who can deliver one.
  • Unreachable is not a verdict. WAL-10.3 and WAL-10.8 keep “could not be checked” apart from both “genuine” and “not genuine”, so an outage neither blesses a forged document nor condemns a good one.
  • Uploads cannot borrow trust. WAL-12.2 and WAL-12.5 keep a scanned or edited file from ever looking like an issued document.
  • Open risk: the wallet client is public. In the reference implementation the wallet redeems the code with PKCE and no client secret or key. See §21.

18. Privacy considerations

  • The person decides. Connecting is optional, the identity shows the values before sharing them (WAL-6.9), cancelling shares nothing (WAL-6.11), and disconnecting deletes the number at the wallet (WAL-5.13).
  • The app never holds the number. The wallet’s server shows four characters (WAL-5.10). A stolen phone or a compromised app session does not give the number away.
  • What issuers are told. An issuer learns the person’s name, their national ID number once they have connected, and the answers they typed to the type’s search fields (WAL-8.2). The person is told who is asked and for whom (WAL-8.5).
  • Addresses and URIs say nothing. A handle never contains the number (WAL-4.5). The ID card’s URI is not derived from it (WAL-7.5). Both appear in logs and messages that the number must stay out of.
  • Removing is private. Removing a document, and adding an upload, tell nobody (WAL-12.1, WAL-13.5).
  • Refusals do not describe people. A push to an unknown address gets one answer whether the provider or the handle is wrong (WAL-11.2), and the identity’s error descriptions carry nothing from a resident’s record (WAL-6.19).
  • What the wallet provider itself can read. In this version a provider can read every document and file it keeps. Copies only the person can read are not built (§21).
  • What the identity remembers. It records which wallet addresses a resident has connected and when their card was delivered (WAL-7.1, WAL-7.8). It is not told when the person disconnects at the wallet (§21).

19. Changes this spec needs in other OCI specs

  • OCI-2 ID Auth. OCI-2 says the ID token carries no claim beyond the sign-in claims and that nothing in a sign-in may be a national ID number (AUTH-9.8). This spec keeps to that: the ID token of a connect carries no national claim (WAL-6.14), and the number is fetched from userinfo afterwards, for one kind of client, a registered wallet provider, with the resident’s consent. OCI-2 needs to name the national_id scope and say that a scope defined by another OCI spec may add claims to userinfo. OCI-2 also requires pushed authorization requests, DPoP and private_key_jwt; the reference national identity serves the plain code flow with PKCE (§21).
  • OCI-1 Trust Registry. The identity needs to know that a client is a wallet provider and what its provider name is. Today that is the identity’s own client registration. It could instead follow from the registry: the client is the participant of kind wallet (OCI-WALLET-1) with the same id.
  • OCI-WALLET-1. This spec relies on its verification rules returning three distinguishable results (verified, not genuine, could not be checked) and treating a passed end date separately. It relies on the matching rule covering how a national ID number is compared (the reference compares with spaces removed and case ignored). The country’s type list needs the ID card type.
  • OCI-WALLET-2. The push section should list the wallet’s refusals of §11 (NO_SUCH_ADDRESS, DOCUMENT_NOT_GENUINE, DOCUMENT_EXPIRED, NOT_THEIR_DOCUMENT) as answers an exchange passes back to the issuer unchanged.

20. Conformance

A wallet provider conforms to OCI-WALLET-3 0.1 when its server passes the reference wallet’s tests for §3 to §5 and §8 to §13 (ociwallet-api/tests/). A national identity conforms when it passes the reference identity’s tests for §6 and §7 (ociid-api/tests/test_national_identity.py).

ClausesChecked by
WAL-3.1 to 3.3test_people.py: test_a_signed_in_person_is_who_their_identity_says, test_a_call_without_a_good_sign_in_is_refused, test_an_identity_that_cannot_be_reached_is_not_a_bad_sign_in
WAL-3.4test_people.py: test_one_persons_wallet_is_invisible_to_another
WAL-4.1, 4.2test_national.py: test_everyone_gets_an_address_and_no_two_people_the_same
WAL-5.1test_national.py: test_a_wallet_that_offers_no_national_identity
WAL-5.2, 5.3test_national.py: test_connecting_sends_the_person_to_the_identity_with_their_address
WAL-5.4test_national.py: test_the_wallet_learns_the_number_from_the_identity_itself, test_a_connection_belongs_to_the_person_who_started_it
WAL-5.5 to 5.8, 5.10test_national.py: test_the_wallet_learns_the_number_from_the_identity_itself, test_an_answer_that_does_not_check_out_connects_nothing
WAL-5.9test_national.py: test_one_national_identity_is_one_person_here
WAL-5.12, 8.2test_national.py: test_once_connected_issuers_are_asked_by_the_number; test_people.py: test_find_asks_for_the_signed_in_person_by_the_identitys_name_never_a_typed_one
WAL-5.13 to 5.15test_national.py: test_disconnecting_forgets_the_number_and_keeps_the_documents
WAL-6.1, 6.2test_national_identity.py: test_an_identity_that_is_not_national_ignores_the_scope, test_a_wallet_learns_the_national_id_when_the_resident_connects
WAL-6.3, 6.5test_national_identity.py: test_only_a_wallet_provider_may_ask_and_only_for_its_own_address
WAL-6.8test_national_identity.py: test_a_resident_without_a_number_cannot_connect
WAL-6.9, 6.10test_national_identity.py: test_the_resident_is_told_what_is_shared_and_where_the_card_goes
WAL-6.11test_national_identity.py: test_saying_no_shares_nothing
WAL-6.14, 6.15, 6.18test_national_identity.py: test_a_wallet_learns_the_national_id_when_the_resident_connects, test_without_the_scope_the_wallet_learns_nothing_more
WAL-6.17test_national_identity.py: test_a_refreshed_session_does_not_carry_the_number
WAL-7.1, 7.2test_national_identity.py: test_connecting_sends_the_card, test_a_wallet_learns_the_national_id_when_the_resident_connects
WAL-7.3 to 7.6test_national_identity.py: test_the_card_is_issued_once_and_pushed_to_the_address, test_no_card_is_sent_when_no_issuer_is_set
WAL-7.8test_national_identity.py: test_a_card_that_cannot_be_delivered_does_not_fail_the_connection
WAL-8.1test_people.py: test_the_catalogue_is_the_countrys_types_with_their_active_issuers
WAL-8.3, 8.4test_people.py: test_find_asks_for_the_signed_in_person_by_the_identitys_name_never_a_typed_one, test_someone_whose_identity_gives_no_name_cannot_ask_issuers
WAL-8.6 to 8.9test_documents.py: test_find_asks_the_home_exchange_and_keeps_only_what_was_asked_for, test_a_refusal_from_the_issuer_or_the_exchange_reaches_the_person_as_given, test_an_exchange_that_fails_is_unavailable
WAL-9.1, 9.2, 9.5test_documents.py: test_fetch_returns_a_verified_document_and_its_printable_copy, test_fetch_refuses_an_answer_that_does_not_check_out
WAL-9.3, 9.8test_people.py: test_a_document_that_does_not_check_out_is_not_kept
WAL-9.4, 9.6, 9.7test_people.py: test_keeping_a_document_fetches_checks_and_stores_it, test_keeping_it_again_refreshes_it_and_does_not_duplicate
WAL-10.1 to 10.3test_people.py: test_opening_a_document_checks_it_again_and_asks_the_issuer_how_it_stands, test_a_document_whose_issuer_lost_its_accreditation_is_shown_as_not_genuine, test_an_expired_document_is_genuine_and_expired; test_documents.py: the documents.verify tests
WAL-10.5 to 10.9test_people.py: test_the_list_asks_again_only_about_what_it_has_not_heard_of_lately, test_an_issuer_that_cannot_be_reached_leaves_what_was_last_heard; test_documents.py: test_status_is_asked_of_the_issuer_not_read_from_the_copy
WAL-10.10test_people.py: test_a_change_seen_by_two_reads_at_once_is_recorded_once
WAL-11.1test_national.py: test_only_the_home_exchange_may_push
WAL-11.2test_national.py: test_an_address_nobody_has
WAL-11.3, 11.6test_national.py: test_a_pushed_document_is_checked_like_any_other
WAL-11.5test_national.py: test_a_connected_person_is_not_sent_someone_elses_document
WAL-11.7 to 11.9test_national.py: test_a_pushed_document_lands_in_the_persons_wallet, test_a_document_the_person_found_is_not_marked_received
WAL-12.xtest_people.py: test_an_upload_is_kept_as_the_persons_own_unverified_file, test_an_upload_must_be_a_real_pdf_or_image_of_a_sane_size
WAL-13.1, 13.4test_people.py: test_removing_a_document_removes_its_file_and_is_remembered and the history assertions of the tests above
WAL-3.5, 4.3 to 4.5, 5.11, 6.4, 6.6, 6.7, 6.12, 6.13, 6.16, 6.19, 7.7, 7.9, 8.5, 10.4, 10.11, 11.4, 11.10, 13.2, 13.3, 13.5, 13.6Not checked by a named test of the national_id profile or the wallet in 0.1. WAL-6.4, 6.6, 6.7, 6.12 and 6.13 are the identity’s ordinary sign-in rules and are checked by its general tests (ociid-api/tests/test_oidc.py).

The tests do not yet cite WAL clause IDs. They should.

21. Open questions

Each of these is something the reference implementation does not do, does by accident, or does in a way the operator has not confirmed. None is a requirement in 0.1.

  1. Sharing with a requester. A person showing a document from their wallet to a bank or an employer, with consent (an OCI-CONSENT-1 profile, and the participant kind doc_requester). Not built. It would be OCI-WALLET-4.
  2. Connecting a wallet at an issuer. Giving an issuer a wallet address and confirming it with a second factor, or scanning the issuer’s code, so that issuer pushes the person’s documents. Not built. Until then the only push is the ID card.
  3. The app’s server holds a token that can read the number. After a sign-in with the national identity (§5.2) the wallet app’s server holds, for the life of that access token, a token whose scope lets it ask userinfo for the national ID number. WAL-5.10 keeps the number from the app; this token is a way around it for whoever runs the app’s server, which in the reference is the provider itself. Renewed tokens do not have the scope (WAL-6.17). A stricter design would have the wallet’s server run the sign-in and give the app a session of its own. And: disconnecting, then signing in with the national identity, makes a second wallet. A person with an account at the provider who disconnects is no longer known by their number or their sub (WAL-5.22). If they later sign in with the national identity, WAL-5.20 creates a new person, and their first account can then no longer connect that number (WAL-5.9). The wallet should either remember that the two are one person after a disconnect, or tell the person before they sign in.
  4. Copies only the person can read. The provider can read everything it stores. Not built.
  5. Sending again after re-issue. When an issuer re-issues or corrects a document, nothing sends the new one to wallets that hold the old. Not built.
  6. A pushed document is not matched by name. WAL-11.5 refuses only when both the person and the document have a national ID number and they differ. A document with no number, or a person who has not connected, is taken on the address alone, without the name check a fetch gets (WAL-9.3). Should a push apply the full matching rule of OCI-WALLET-1, or is knowing the address enough?
  7. A pushed document before its issuer has been asked. Plan 012 says the wallet “asks the issuer for its status before showing it as valid”. The reference wallet stores a pushed document with the status active and marks it as never asked, so the next list or open asks. If the issuer cannot be reached then, the list shows active. Should there be a status meaning “not yet heard”?
  8. A push over a revoked record. A push of a document the wallet already holds as revoked sets the kept status back to active until the issuer is asked again. Probably accidental.
  9. How often the list asks, and for how many. The 60 seconds of WAL-10.6 is the reference’s value. The reference also asks for at most 20 documents in one listing; the rest keep the status last heard without saying so. Is 60 seconds the rule or a default, and what should a long list do?
  10. The wallet client is public. The reference wallet redeems the code with PKCE only. The national ID number is the most sensitive value in this family. Should the identity require a confidential client (private_key_jwt with the wallet’s registry key), and the rest of OCI-2 (pushed authorization requests, DPoP)?
  11. The client id. In the demo wiring the client id at the identity is the wallet’s registry id (wallet:satchel), and plan 012 says so. The identity does not check this: the provider name is a separate field of its client registration. Should the identity derive it from the trust registry?
  12. Discovery. scopes_supported lists national_id, but claims_supported does not list national_id, birthdate or gender. The reference wallet does not read the discovery document at all: it is configured with the identity’s address and uses /authorize, /token and /jwks.json under it. Should a wallet be required to use discovery, and the identity to list the claims?
  13. The iss of the redirect. The identity sends iss back (WAL-6.7). The reference wallet does not check it when the person returns; it checks iss inside the ID token.
  14. Gender is shared but not shown. The consent page shows name, number and date of birth. Userinfo also carries gender when the identity holds one. Either the page should show it or the claim should not be sent. WAL-6.9 lists only what the reference shows; it should become “every value the provider will receive”.
  15. Consent wording without a date of birth. The page’s sentence says the provider will see “your date of birth” even when the identity holds none and none is sent.
  16. Claims the wallet does not use. The wallet keeps only national_id. birthdate and gender are sent and discarded. Should the scope return only the number?
  17. The userinfo answer is not signed. The number reaches the wallet’s server over TLS from the identity it started the connect at, tied to the sign-in by sub (WAL-5.6). It is not a signed statement the wallet could show anyone later. A signed userinfo answer (OpenID Connect Core §5.3.2, as a JWT) would be; the reference does not make one.
  18. Disconnect does not reach the identity. The identity keeps its record that the resident connected the address, and nothing stops a later push of the card to it. Should disconnecting tell the identity, and should the identity offer the resident a list of connected wallets?
  19. The ID card after a disconnect. The card stays in the wallet (WAL-5.14) and still records the number, which the provider can read from it. Is that what “forget the number” should mean?
  20. A card that was not delivered. The identity records that delivery failed but nothing retries, and the person is not told. The card is sent again only if the person connects again.
  21. The person’s name never changes at the wallet. The wallet keeps the name it was first given (WAL-3.3). A person who changes their name at the provider’s identity is still asked for under the old one. The name from the national identity’s ID token is not used, even after a connect; should it replace the provider’s?
  22. Telling the person that the number is sent. The reference app says an issuer “will be asked for documents issued to Asha Rao”. It does not say that, once connected, her national ID number is sent too. WAL-8.5 requires only the name for that reason.
  23. How well a provider must know its people. A document is matched to a name the provider’s identity vouches for. Nothing sets a minimum assurance level for that identity. Before a connect, two people with the same name who know each other’s details cannot be told apart.
  24. One number, one person. WAL-5.9 is per provider. Nothing stops the same number being connected at several providers, which is intended, or a person holding two accounts at one provider, which WAL-5.9 forbids. Is that the wanted rule?
  25. The handle recipe. Handles come from email addresses, so an address can reveal part of an email address. The reference recipe can also produce a handle that ends in a dot (mohan.das.k.). Should the format in OCI-WALLET-1 forbid that, and should a person choose their handle?
  26. Printable copies. A fetched printable copy is kept if it decodes; a pushed one must also be a PDF by content and within the size limit (WAL-11.6). The difference looks accidental. Nothing ties a printable copy to the signed document, so a copy can say something the signed document does not.
  27. Expired on push. WAL-11.4 refuses a pushed document whose end date has passed, while a kept document that later expires stays and is shown as expired. Should an expired document be refused on push, or taken and shown as expired?
  28. The national ID number at rest. The reference wallet stores the number as plain text in its database. Should the spec require it to be encrypted, or kept only as a keyed hash plus the last four characters?

Changes

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