Skip to content

feat(directory): verify a directory field with a credential your agent holds (window.vtaWallet.directory.presentCredential) - #375

Merged
stormer78 merged 1 commit into
mainfrom
feat/directory-present-credential
Oct 22, 2026
Merged

stormer78 merged 1 commit into
mainfrom
feat/directory-present-credential

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Adds window.vtaWallet.directory.presentCredential({hostDid, member?, fields}) → {verified, revision}. After the page gates, the wallet reads the community's field schema, finds valid vault credentials of the field's type from an accepted issuer, and lets the member pick one. It has the VTA present it (vault/credentials/present/0.1, audience = the community DID, nonce = the card/present document id), asking again on wouldOverDisclose, then signs and posts vtc/directory/card/present as the member. The generic page task path refuses vault/credentials/present. Bumps @openvtc/trust-tasks to ^0.27.2.

Depends on OpenVTC/verifiable-trust-infrastructure#2265 (VTA side); consumed by OpenVTC/verifiable-trust-infrastructure#2266 (portal button).

Not covered: the offscreen success path has no fake to test against; unit tests cover the gates, selection, refusals and the over-disclosure prompt.

…t holds (window.vtaWallet.directory.presentCredential)

A member fills their card's credential-sourced fields — a verified employer, a professional registration — from a credential their own agent holds. The portal asks with one new call, window.vtaWallet.directory.presentCredential({ hostDid, member?, fields }), naming the fields and nothing else: never the claims, never the credential.

Gates: the call is well formed (1 to 16 distinct field keys); the page is the community's portal by its DID document; the member is one of the wallet's identities there. Then the wallet reads the community's field schema as the member (vtc/directory/fields/list): every named field must be active, credential-sourced and a claim field, and all of one credential type. It finds the member's credentials that answer them (vault/credentials/query, valid, active, from an issuer every field accepts) and asks the person, in the wallet's own window, which one to present — showing the community, the fields and every claim it discloses. A closed window, or an answer naming a credential the prompt did not offer, presents nothing.

The agent then presents the chosen credential (vault/credentials/present/0.1, trustoverip/dtgwg-trust-tasks-tf#871): audience the community's DID, nonce the id of the vtc/directory/card/present document that will carry it, so the community's binding check holds. A credential that cannot hide claims the fields do not read is refused by the agent with wouldOverDisclose — matched on the code, never the message — and the wallet asks again, naming those claims, before presenting with them; declined, nothing more is presented. The card/present document is signed as the member and sent; the page gets back the verified values now on the card.

A page may no longer drive vault/credentials/present through the generic task path (page-task-policy): it is a disclosure under the subject's signature to a verifier the caller names, which a generic prompt cannot show.

core: credVaultPresent (vault/credentials.ts); vtc/directory-present.ts (credentialAskFor, claimNameOf, buildCardPresent, verifiedValuesOf). @openvtc/trust-tasks 0.27.2; task-surface.json synced, family count 230 → 231.

Depends on the VTA serving vault/credentials/present/0.1 (OpenVTC/verifiable-trust-infrastructure, branch feat/vault-credentials-present, not yet merged); against a VTA without it the call fails at the agent with unsupportedType.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit bf92427 into main Oct 22, 2026
4 checks passed
@stormer78
stormer78 deleted the feat/directory-present-credential branch October 22, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant