Skip to content

feat(persona): create a standalone persona DID on demand#134

Merged
stormer78 merged 1 commit into
mainfrom
feat/create-persona
Jun 17, 2026
Merged

feat(persona): create a standalone persona DID on demand#134
stormer78 merged 1 commit into
mainfrom
feat/create-persona

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Problem

Personas could only be minted as a side effect of joining a community (the "mint new identity" choice mid-join). There was no way to create a persona DID up front — which you need in order to receive a VIC (Verifiable Invitation Credential) bound to a pre-created persona DID (one that isn't your VTA DID), and then join cleanly on the join-as-subject path (no subject-linkage proof needed).

What this does

Adds a "create persona DID" action, reachable two ways (per request):

  • Top-level menu — a new "Create Persona DID" item (an action item, like Quit).
  • VTA panel — the n key, with n: new persona hints (including an empty-state hint when no personas exist yet).

Both open a centered overlay that:

  1. Prompts for a label (⏎ create / esc cancel),
  2. Runs the VTA mint, streaming progress (find server → create DID → save),
  3. Shows the new did:webvh and copies it to the clipboard (c: copy again, ⏎/esc close) — or shows the error.

The minted persona is a standalone orphan, listed in the VTA panel's Context Identities and reusable in any later join (JoinIdentityChoice::Reuse). Hand its DID to a VTC, receive a VIC bound to it, then join on the clean join-as-subject path.

Implementation

  • New state_handler/create_persona module owns the mint orchestration: pick a WebVH server → create_did_via_server → persist via the shared mint_persona_into (built from a scratch SetupState, so zero edits to that proven persist code). Runs inline-await, mirroring the join flow's mint sub-sequence minus the community/submit parts.
  • A page-level overlay (MainPageState::create_persona, like the community switcher) with phases Label → Working → Done/Failed. Editing keys are forwarded to a tui_input::Input via an action (the main page uses the cloned-props pattern). The mint runs in the loop on CreatePersonaSubmit; the clipboard copy reuses clipboard.rs.

Note on a revised design decision

While investigating I found the join flow's pre-mint create_persona_keys / create_update_keys results are actually discardedcreate_did_via_server requests signing_key_id: None / ka_key_id: None, so the WebVH server generates the keys. Rather than extract a "shared" helper that would either replicate that dead code or change the join hot path, I gave the standalone flow its own focused helper and left the join path untouched. Extracting a shared mint helper (and dropping the join's redundant key calls) is a sensible follow-up, tracked separately.

Limits

Same prerequisites as join: needs the always-on admin VTA session and a WebVH server advertised by the VTA (serverless mint still unsupported — surfaced as an error).

Tests

  • Key-handler tests: both entry points (VTA n, menu Enter) and every overlay phase (label edit/submit/cancel, done copy/close, working swallows input).
  • Reducer tests: overlay open / label edit / close; and that the mint + copy arms defer to the loop.
  • cargo build, full cargo test (0 failures), and cargo clippy --all-targets all clean (only a pre-existing mod.rs:138 warning, untouched).

Personas could only be minted as a side effect of joining a community
(the "mint new identity" choice mid-join). There was no way to create a
persona DID up front — which you need to receive a VIC bound to a
pre-created persona DID (one that isn't your VTA DID), then join cleanly
on the join-as-subject path.

Add a "create persona DID" action reachable two ways (per request):
a new top-level menu item and the VTA panel's 'n' key. Both open a
centered overlay that prompts for a label, runs the VTA mint, then shows
the new did:webvh and copies it to the clipboard ('c' to copy again).
The minted persona is a standalone orphan listed in the VTA panel,
reusable in any later join.

Mechanics mirror the join flow's mint sub-sequence (pick a WebVH server,
create_did_via_server, persist via the shared mint_persona_into) but
without the community/submit parts, run inline-await like the join. A new
create_persona module owns the orchestration; the join path is left
untouched (its redundant pre-mint key calls and friendly_name behaviour
are a separate cleanup).

Same prerequisites/limits as join: needs the admin VTA session + a WebVH
server (serverless mint still unsupported). Adds key-handler tests for
both entry points and every overlay phase, plus reducer tests for the
overlay open/edit/close arms.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78 stormer78 requested a review from a team as a code owner June 17, 2026 14:59
@stormer78 stormer78 merged commit 90a87c5 into main Jun 17, 2026
6 of 13 checks passed
@stormer78 stormer78 deleted the feat/create-persona branch June 17, 2026 15: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