| Status | Draft. |
| Version | 0.1.0, 2026-11-30 |
| Profile of | OpenID 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 on | OCI-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 implementation | ociwallet-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:
- Who the person is at the wallet, and the wallet address the provider gives them.
- 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). - The ID card: after a connect, the identity has the person’s ID card issued and sent to their wallet address.
- Finding a document at an issuer and keeping it.
- 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.
- Taking a document an issuer sends to the person’s address (a push).
- Files the person adds themselves (uploads), which nobody has verified.
- 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.
| Term | Meaning |
|---|---|
| Person | The human whose wallet it is. |
| Wallet provider | An 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 app | The provider’s own app or website, which the person uses. It talks only to its provider’s server. |
| Provider’s identity | The 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 identity | A country’s identity service: the one that knows each resident’s national ID number. |
| National ID number | The number a country’s identity holds for a resident. |
| Connect | The 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 exchange | The one document exchange a wallet makes and takes document calls at (OCI-WALLET-1, OCI-WALLET-2). |
| Issued document | A document its issuer signed (OCI-WALLET-1). The wallet keeps exactly what was signed. |
| Uploaded document | A file the person added themselves. Nobody signed it and nobody vouches for it. |
| Printable copy | The PDF an issuer may send with a document (OCI-WALLET-1). |
| Status | What the issuer says about a document now: active (it is valid), suspended or revoked (OCI-WALLET-1). |
| ID card | The 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
typat+jwt, whoseissis the provider’s identity, whoseclient_idis the wallet app’s client and is listed inaud, with asub, and with anexpthat has not passed. - WAL-3.2 A call without a valid sign-in MUST be refused with
401 UNAUTHENTICATEDand MUST do nothing. When the sign-in cannot be checked because the provider’s identity cannot be reached, the answer MUST be502 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
issand itssubfor 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 (itsuserinfoanswer) 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/meand 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 thewallet:prefix.wallet:satchelgives 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 onlyatoz,0to9,.,_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: falsein the referenceGET /v1/me) and MUST refuse an attempt to start or finish a connect with404 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_typecode;scopeopenid national_id; the provider’sclient_idat that identity; aredirect_uriregistered for it; a PKCEcode_challengewithcode_challenge_methodS256; a freshstate; a freshnonce; andwallet_addressset to the person’s own wallet address. - WAL-5.3 The wallet’s server MUST create the PKCE verifier, the
stateand thenonce, and MUST keep them itself, tied to the signed-in person. They MUST NOT be given to the wallet app, apart from thestateand 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 with400 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_verifierand the sameredirect_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;
issequals the identity it started the connect at;audholds the provider’sclient_id;nonceequals the one it kept;subis present;expis 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 itssubequals the ID token’ssub. 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 answer502 IDENTITY_UNAVAILABLE. When the userinfo answer carries nonational_id, the wallet MUST answer409 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_USEand 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 scopeopenid national_idand PKCE, and with nowallet_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,
typat+jwt, itsiss, anexp, asub) and itsclient_idis the provider’s own client at that identity and is listed inaud. A token of any other issuer, or for any other client, MUST be refused with401 UNAUTHENTICATED. - WAL-5.18 The first time a
subof the national identity signs in, the wallet MUST require the token’s scope to holdnational_id, MUST ask the identity’s userinfo endpoint with it (§6.5), and MUST accept the answer only when itssubequals the token’s. A token without the scope, or an answer for anothersub, MUST be refused with401 UNAUTHENTICATED. An answer with nonational_idMUST be refused with409 NO_NATIONAL_ID. When the identity cannot be reached the answer MUST be502 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
subof the national identity a person is, on a sign-in with it and on a connect (WAL-5.8). A later sign-in with thatsubMUST NOT need thenational_idscope 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_ITand MUST tell them so in what it says about their connection (signs_inin the referenceGET /v1/me). A person who has an account at the provider’s own identity can still disconnect (WAL-5.13); the wallet then forgets theirsubat 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_idscope. Any other identity MUST treatnational_idas 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, nowallet_addressis recorded, and no national ID claim is returned. - WAL-6.2 A national identity that gives the scope MUST list
national_idinscopes_supportedof 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.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
client_id | string | yes | The wallet provider's client at this identity. It must be registered as a wallet provider. | WAL-6.3 |
redirect_uri | string | yes | Where the person is sent back to. It must be registered for the client. | WAL-6.6 |
response_type | "code" | yes | Always code. | WAL-6.4 |
scope | string | yes | Space-separated scopes. To connect: openid national_id. | WAL-5.2 |
code_challenge | string | yes | The PKCE challenge: the base64url SHA-256 of the verifier the wallet's server keeps. | WAL-6.4 |
code_challenge_method | "S256" | yes | Always S256. | WAL-6.4 |
state | string | yes | A fresh value the wallet's server keeps for the signed-in person. It comes back unchanged. | WAL-5.3 |
nonce | string | yes | A 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_address | string | The 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 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
code | string | The authorization code. It works once, for a short time, and only with the PKCE verifier. | WAL-6.12 | |
state | string | yes | The state of the request, unchanged. | WAL-6.7 |
iss | string | yes | The 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_description | string | One sentence. It never carries anything from the resident's record. | WAL-6.19 |
Errors
- WAL-6.3 The identity MUST accept
national_idonly 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 (satchelforwallet:satchel). A request with the scope from any other client MUST be answered by redirecting back with the errorinvalid_scope. - WAL-6.4 The request MUST be an authorization code request with PKCE:
response_typecode,scopeincludingopenid,code_challengewithcode_challenge_methodS256,state, and anonceof 1 to 64 characters. A request without them MUST be answered by redirecting back withunsupported_response_type,invalid_scopeorinvalid_request, as RFC 6749 and OpenID Connect Core define. - WAL-6.5
wallet_addressis 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 withinvalid_request. A wallet provider can name only an address of its own. - WAL-6.6 When the
client_idis unknown or theredirect_uriis 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’sstate.
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_deniedand 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, thecode_challenge, thenonce, the scopeopenid national_idand thewallet_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.
| Request | Type | Required | Meaning | Clause |
|---|---|---|---|---|
grant_type | "authorization_code" | yes | Always authorization_code for a connect. | WAL-6.13 |
code | string | yes | The code from the redirect back. | WAL-6.13 |
redirect_uri | string | yes | The same redirect_uri as in the authorization request. | WAL-6.13 |
code_verifier | string | yes | The PKCE verifier the wallet's server kept. | WAL-6.13 |
client_id | string | yes | The wallet provider's client at this identity. | WAL-6.13 |
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
access_token | string | yes | The 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" | yes | Always Bearer. | |
expires_in | integer | yes | Seconds the access token lasts. | |
scope | string | yes | The 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_token | string | yes | The ID token: a JWS signed by the identity with ES256. Its claims are described by $defs.id_token_claims. | WAL-6.16 |
refresh_token | string | yes | A 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_typeauthorization_code,code,redirect_uri,code_verifierand itsclient_id, sent asapplication/x-www-form-urlencoded. The identity MUST check that the code is live and unused, that it was issued to this client for thisredirect_uri, and that thecode_verifiermatches thecode_challenge. A failure isinvalid_grant. -
WAL-6.14 When the code was issued for
openid national_idand the resident has a national ID number, the answer’sscopeMUST beopenid national_id, and so MUST the scope of its access token. Otherwise the answer’sscopeMUST NOT includenational_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_idscope adds to the userinfo answer, and only there:Claim Value Present national_idThe resident’s national ID number, as the identity holds it Always birthdateThe resident’s date of birth, YYYY-MM-DDWhen the identity holds one genderThe resident’s gender, as the identity holds it When 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’sclient_id),expand the request’snonce, so the wallet can run the checks of WAL-5.6.subMUST 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.
| Response | Type | Required | Meaning | Clause |
|---|---|---|---|---|
sub | string | yes | The identity's identifier for the resident at this client. | |
name | string | yes | The resident's name. | |
phone_number | string | The resident's phone number, when the identity holds one. | ||
email | string | The resident's email address, when the identity holds one. | ||
national_id | string | The resident's national ID number, as the identity holds it. Only for an access token with the scope national_id. | WAL-6.18 | |
birthdate | string | The 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 | |
gender | string | The 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
401 invalid_token(WAL-6.19)
- 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,stateandissin 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_idwith awallet_addressis 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_issuerand 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 isissuer:ociid.inand the type isIDCRD. - 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 theirnameandnational_id, and theirdate_of_birthandgenderwhen the identity holds them. Itsnumberis 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, thenPOST /admin/v1/documents/{uri}/pushwith{"to": "<wallet address>"}. - WAL-7.10 When the scope
national_idis granted on a request that carried nowallet_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_issuerand 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
personobject of OCI-WALLET-1 §11 (WDOC-11.1), sent as OCI-WALLET-2 §8 and §9 define:name, the name of WAL-3.3; andnational_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_ERRORin 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_NEEDEDand 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
activeorsuspended. Any other answer MUST be refused with502 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 inissued_tomust 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
201for a new document and200for 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:
- 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.
- 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).
- 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
revokedis 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 of410means 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: falsein 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,suspendedorrevoked, 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;401for 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
urithe push names. A document that does not verify MUST be refused with422 DOCUMENT_NOT_GENUINEand 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 with502(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: nulland “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 with413 FILE_TOO_LARGE, and an empty file or an empty name with422 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),connectedanddisconnected(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.
| Status | Code | When | Clause |
|---|---|---|---|
| 401 | UNAUTHENTICATED | No valid sign-in | WAL-3.2 |
| 502 | IDENTITY_UNAVAILABLE | The provider’s identity, or the national identity, could not be reached | WAL-3.2, WAL-5.7 |
| 404 | DOCUMENT_NOT_FOUND | No such document in this person’s wallet | WAL-3.4 |
| 404 | FILE_NOT_FOUND | The document has no file | WAL-9.5 |
| 404 | NOT_OFFERED | This wallet does not connect to a national identity | WAL-5.1 |
| 400 | CONNECT_EXPIRED | The connect was not started by this person, took too long, or was already finished | WAL-5.4 |
| 400 | CONNECT_REFUSED | The identity refused the code, or its answer did not verify | WAL-5.6, WAL-5.7 |
| 409 | NO_NATIONAL_ID | The identity’s answer carried no national ID number | WAL-5.7 |
| 409 | NATIONAL_ID_IN_USE | The number is connected to another person at this provider | WAL-5.9 |
| 409 | SIGNS_IN_WITH_IT | A disconnect by a person who signs in with the national identity | WAL-5.22 |
| 409 | NOT_CONNECTED | A search with no fields by a person who has not connected their national identity | WAL-8.10 |
| 409 | NAME_NEEDED | The wallet holds no name for the person, so no issuer can be asked | WAL-8.4 |
| 422 | VALIDATION_ERROR | The request is not of the call’s shape | WAL-8.3, WAL-12.3 |
| 502 | EXCHANGE_UNAVAILABLE | The home exchange could not be reached or did not answer usefully | WAL-8.9 |
| 502 | DOCUMENT_NOT_GENUINE | A fetched document did not verify, or the answer was not for the document asked for | WAL-9.1, WAL-9.2 |
| 403 | NOT_YOUR_DOCUMENT | A fetched, verified document names somebody else | WAL-9.3 |
| 413 | FILE_TOO_LARGE | An upload over the limit | WAL-12.3 |
| 415 | UNSUPPORTED_FILE | An upload that is not an accepted kind of file | WAL-12.3 |
| 404 | NO_SUCH_ADDRESS | Push: nobody at this provider has that address | WAL-11.2 |
| 422 | DOCUMENT_NOT_GENUINE | Push: the document did not verify | WAL-11.3 |
| 410 | DOCUMENT_EXPIRED | Push: the document’s own end date has passed | WAL-11.4 |
| 502 | ISSUER_UNAVAILABLE, TRUST_REGISTRY_UNAVAILABLE | The issuer’s keys or the registry could not be reached | WAL-11.4 |
| 403 | NOT_THEIR_DOCUMENT | Push: the document records another person’s national ID number | WAL-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:
| Call | What it does | Clauses it carries out |
|---|---|---|
GET /v1/me | Who is signed in, their wallet address, and the state of the national identity connection | WAL-3.5, WAL-4.4, WAL-5.10 |
POST /v1/national-identity/start | Begin a connect; answers the address to send the browser to | WAL-5.2 to WAL-5.4 |
POST /v1/national-identity/finish | The person came back with state and code; finish the connect | WAL-5.4 to WAL-5.9 |
DELETE /v1/national-identity | Disconnect | WAL-5.13 to WAL-5.15 |
GET /v1/doc-types | What can be found, and at which issuers | WAL-8.1 |
POST /v1/find | Look for the person’s documents at an issuer (issuer, doc_type, search) | WAL-8.2 to WAL-8.9 |
GET /v1/documents | The person’s documents | WAL-10.6 |
POST /v1/documents | Keep an issued document by its uri | §9 |
POST /v1/uploads | Add 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}/file | The printable copy, or the upload | WAL-13.6 |
DELETE /v1/documents/{id} | Remove a document | WAL-13.4 |
GET /v1/history | What has happened in the wallet | WAL-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
noncestop a code or a token meant for another connect from being used. - A connect belongs to who started it. WAL-5.4 ties the
stateto 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_idscope and say that a scope defined by another OCI spec may add claims to userinfo. OCI-2 also requires pushed authorization requests, DPoP andprivate_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).
| Clauses | Checked by |
|---|---|
| WAL-3.1 to 3.3 | test_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.4 | test_people.py: test_one_persons_wallet_is_invisible_to_another |
| WAL-4.1, 4.2 | test_national.py: test_everyone_gets_an_address_and_no_two_people_the_same |
| WAL-5.1 | test_national.py: test_a_wallet_that_offers_no_national_identity |
| WAL-5.2, 5.3 | test_national.py: test_connecting_sends_the_person_to_the_identity_with_their_address |
| WAL-5.4 | test_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.10 | test_national.py: test_the_wallet_learns_the_number_from_the_identity_itself, test_an_answer_that_does_not_check_out_connects_nothing |
| WAL-5.9 | test_national.py: test_one_national_identity_is_one_person_here |
| WAL-5.12, 8.2 | test_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.15 | test_national.py: test_disconnecting_forgets_the_number_and_keeps_the_documents |
| WAL-6.1, 6.2 | test_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.5 | test_national_identity.py: test_only_a_wallet_provider_may_ask_and_only_for_its_own_address |
| WAL-6.8 | test_national_identity.py: test_a_resident_without_a_number_cannot_connect |
| WAL-6.9, 6.10 | test_national_identity.py: test_the_resident_is_told_what_is_shared_and_where_the_card_goes |
| WAL-6.11 | test_national_identity.py: test_saying_no_shares_nothing |
| WAL-6.14, 6.15, 6.18 | test_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.17 | test_national_identity.py: test_a_refreshed_session_does_not_carry_the_number |
| WAL-7.1, 7.2 | test_national_identity.py: test_connecting_sends_the_card, test_a_wallet_learns_the_national_id_when_the_resident_connects |
| WAL-7.3 to 7.6 | test_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.8 | test_national_identity.py: test_a_card_that_cannot_be_delivered_does_not_fail_the_connection |
| WAL-8.1 | test_people.py: test_the_catalogue_is_the_countrys_types_with_their_active_issuers |
| WAL-8.3, 8.4 | test_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.9 | test_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.5 | test_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.8 | test_people.py: test_a_document_that_does_not_check_out_is_not_kept |
| WAL-9.4, 9.6, 9.7 | test_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.3 | test_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.9 | test_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.10 | test_people.py: test_a_change_seen_by_two_reads_at_once_is_recorded_once |
| WAL-11.1 | test_national.py: test_only_the_home_exchange_may_push |
| WAL-11.2 | test_national.py: test_an_address_nobody_has |
| WAL-11.3, 11.6 | test_national.py: test_a_pushed_document_is_checked_like_any_other |
| WAL-11.5 | test_national.py: test_a_connected_person_is_not_sent_someone_elses_document |
| WAL-11.7 to 11.9 | test_national.py: test_a_pushed_document_lands_in_the_persons_wallet, test_a_document_the_person_found_is_not_marked_received |
| WAL-12.x | test_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.4 | test_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.6 | Not 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.
- 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. - 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.
- 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. - Copies only the person can read. The provider can read everything it stores. Not built.
- 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.
- 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?
- 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
activeand marks it as never asked, so the next list or open asks. If the issuer cannot be reached then, the list showsactive. Should there be a status meaning “not yet heard”? - A push over a revoked record. A push of a document the wallet already holds as revoked sets the kept status back to
activeuntil the issuer is asked again. Probably accidental. - 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?
- 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_jwtwith the wallet’s registry key), and the rest of OCI-2 (pushed authorization requests, DPoP)? - 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? - Discovery.
scopes_supportedlistsnational_id, butclaims_supporteddoes not listnational_id,birthdateorgender. The reference wallet does not read the discovery document at all: it is configured with the identity’s address and uses/authorize,/tokenand/jwks.jsonunder it. Should a wallet be required to use discovery, and the identity to list the claims? - The
issof the redirect. The identity sendsissback (WAL-6.7). The reference wallet does not check it when the person returns; it checksissinside the ID token. - Gender is shared but not shown. The consent page shows name, number and date of birth. Userinfo also carries
genderwhen 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”. - 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.
- Claims the wallet does not use. The wallet keeps only
national_id.birthdateandgenderare sent and discarded. Should the scope return only the number? - 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. - 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?
- 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?
- 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.
- 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?
- 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.
- 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.
- 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?
- 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? - 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.
- 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?
- 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
| Version | Date | What changed |
|---|---|---|
| 0.1.0 | 2026-11-30 | First version, extracted from the reference implementation. |