← Book map

Chapter 09 · Tabs

Ask for named fields

A query rather than a signature request: a list of VDXF keys, an optional signer, and a full/partial data mode.

User data — ask for named fields A user data request carries a request id, an optional signer, and requested keys, asking an identity to return specific VDXF-keyed data. requestID signer requestedKeys[] FULL_DATA = 1 PARTIAL_DATA = 2 searchDataKey recipient auth (optional) Flags: 1 requestID · 2 signer · 4 requested keys.

FIGURE 9.1 · UserDataRequestDetails as wired by the form.

The request is a query

Where the data packet asks for a signature on data the requester already has, user data asks the identity to return data it holds. The distinction is the flags and the payload: here the payload is a list of VDXF keys, not a blob.

Requested keys and search

const details = new UserDataRequestDetails({
  requestID, signer, requestedKeys, searchDataKey, …
});
// the constructor's setFlags() derives 1/2/4 from the fields present

buildSearchDataKey(keyAddress, keyValue) produces the Array<{[key: string]: string}> form the details object expects, so a request can target a specific key/value pair rather than a whole namespace. The form exposes a single key, but the primitive takes an array.

Full or partial

ModeMeaning
FULL_DATA (1)Return complete objects for the requested keys
PARTIAL_DATA (2)Return only the named fields

The route builds the details and wraps it with an optional recipient auth detail, exactly like the data packet. Response handling is the caller's problem: the request asks, the wallet answers to the configured response URI.

Reading the code

src/routes/requests/userData.ts
  parseRequestedKeys / buildSearchDataKey
  buildRecipientAuthDetails / buildUserDataRequest
  generateUserDataQr
__tests__/userData.test.js        # concrete expected output