Wallet Units

A wallet unit is one activated wallet instance. Wallet2 creates and reuses a unit on its own. Call these endpoints when another wallet backend should talk to the provider directly.

The API base is /v2/{target}/wallet-provider-api. {target} is the provider, for example waltid.tenant1.wallet-provider1.

Activate

POST /units creates an operational unit and returns the first WIA, KA, or both.

CURL

Example Request

curl -X 'POST' \
  'https://{orgID}.enterprise-sandbox.waltid.dev/v2/{target}/wallet-provider-api/units' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer {yourToken}' \
  -H 'Content-Type: application/json' \
  -d '{
  "instance_jwk": { "kty": "EC", "crv": "P-256", "x": "...", "y": "..." },
  "attested_keys": [{ "kty": "EC", "crv": "P-256", "x": "...", "y": "..." }],
  "composition": "wia_ka",
  "client_id": "waltid.tenant1.wallet1"
}'

Body Parameters

  • instance_jwk: JWK — Required when the requested composition includes a WIA. Public key only.
  • attested_keys: Array of JWKs — Required when the composition includes a KA.
  • composition: String — Optional. Defaults to the service composition. This is what the unit can mint later.
  • mint: String — Optional. Tokens to sign on this call. Defaults to composition. Use wia to store key material now and sign the key attestation later, once an issuer nonce exists.
  • sign_tokens: Boolean — Optional, default true. Set false to store the unit and its keys without signing a token. Do not send mint in that case; the service rejects the combination.
  • client_id: String — Optional. Becomes the WIA sub. Wallet2 sends the wallet target. When omitted, the service generates an id.
  • wallet_version: String — Optional. Omit it when wia.allowedVersions is empty. Wallet2 and the mobile client omit it. A value is accepted only when it is on that allow-list.

Response

unit_id, state (operational or revoked), and the minted wia and ka strings. Configured status lists are returned as client_status and key_storage_status.


Mint again

POST /units/{unitId}/wua signs a fresh token for an operational unit without rotating keys.

{
  "need": "wia",
  "nonce": "issuer-nonce",
  "credential_issuer": "https://issuer.example"
}
  • need: wia, ka, or wia_ka. Must be inside the unit's composition.
  • nonce and credential_issuer: optional. A KA stores nonce when present. A WIA stores credential_issuer as aud when present.
  • attested_keys: optional. When set, the signed KA lists only these keys, and each one must already be stored on the unit. When omitted, the KA lists every stored key.

Each call allocates a new index for each minted token whose status list is configured. type_shared key-storage status reuses its fixed index.


Refresh keys

POST /units/{unitId}/refresh replaces the instance key, the attested keys, or both, then mints again. It does not extend the status-list horizon.

{
  "rotate": "ka",
  "attested_keys": [{ "kty": "EC", "crv": "P-256", "x": "...", "y": "..." }],
  "nonce": "issuer-nonce"
}

rotate is wia, ka, or wia_ka. Send instance_jwk when rotating a WIA and attested_keys when rotating a KA. The unit stores attested_keys. Optional sign_attested_keys limits the signed KA to those stored keys; when omitted, the KA lists every stored key.


Read and revoke

MethodPathPurpose
GET/units?offset=0&limit=50List units. limit is 1–200.
GET/units/{unitId}State, composition, and status indices whose tokens have not expired.
POST/units/{unitId}/revokeMark the unit revoked and set revocable status indices to invalid.

Revoke body: { "reason": "loss" }. Other reasons are theft, vulnerability, wallet_initiated, and pid_provider_request.

A revoked unit rejects /wua and /refresh with 409. A mint that loses its unit write five times returns 503. Repeating revoke retries only the status updates that failed earlier (pending_status_revocations) whose tokens have not expired. A status backend failure returns 502 while the unit stays revoked, and those indices stay pending for the next revoke.

Next steps

Last updated on November 26, 2026