Prototype: wallet sign-in by challenge words — QR/deep link → signed /challenge/response → doorkeeper verify → OIDC completes #1301

Closed
opened 2026-09-07 19:42:33 +00:00 by ben · 2 comments
Owner

Parent

Map: The community wallet: matou-app holds and presents IDIP credentials, and the Coa and IDSS setups are paired (#1293)

Question

Prove the wallet sign-in end to end before designing its screens (charting ruling 3): the bridge's sign-in page mints challenge words through the doorkeeper's agent and shows a QR / deep link carrying the doorkeeper's OOBI + the words + a session id; the wallet (a matou-app build pointed at a lab gateway) resolves the OOBI, sends one signed /challenge/response exn; the sidecar polls challenges_verify, marks it, and the bridge completes the OIDC auth request against the roster as ADR 0212 does today; the page polls to completion. Spike on a clan-lab gateway (or the IDIP drive's local-guest world) with a throwaway sidecar. Questions the spike answers: round-trip time (the #732 bar was ~7 s for browser sign-in), whether a foreign-agent exn arrives without a prior OOBI from the doorkeeper side, deep link vs QR on desktop, what the wallet must persist to make the second sign-in one tap. Links the spike as spikes/<n>-wallet-signin; torn down after Ben drives it.

Reworded by ADR 0235 (2026-09-10, #1298)

The challenge is the bridge’s (ADR 0212 §1), carried to the wallet by QR/deep link; the wallet signs it and presents its Membership credential to the Doorkeeper over IPEX; the Doorkeeper verifies (issuer, schema, holder = challenge signer, not revoked from the witnessed KEL seals) and answers the bridge over loopback; OIDC completes. No /challenge/response exn round, no roster lookup.

Reworded by ADR 0236 (2026-09-11, #1300)

There is no Doorkeeper agent to stand up and no sidecar. The spike: the bridge's sign-in page mints its challenge (ADR 0212 §1, signed bytes now idss-idp:<door url>:<aid>:<nonce>) and shows a QR / deep link carrying the challenge id + nonce + the door's address + the schema wanted; the wallet (a matou-app build pointed at a lab gateway, reading signin{url} from the descriptor) signs it and posts {aid, challengeID, response, presentation} where presentation is the bare credential CESR stream (credentials().get(said, includeCESR=true)); the bridge verifies in Go (SAIDs recomputed, iss/no-rev seals from the witness's GET /query, schema from the trust list, holder == signer) and completes OIDC. Questions the spike answers: round-trip time; the size of the Go verifier and whether keripy golden vectors cover it; the witness fetch latency at sign-in; deep link vs QR on desktop; what the wallet persists for one-tap repeat (the known door). Throwaway; no roster lookup.

## Parent Map: [The community wallet: matou-app holds and presents IDIP credentials, and the Coa and IDSS setups are paired](https://git.matou.nz/Matou/idss/issues/1293) (#1293) ## Question **Prove the wallet sign-in end to end** before designing its screens (charting ruling 3): the bridge's sign-in page mints challenge words through the doorkeeper's agent and shows a QR / deep link carrying the doorkeeper's OOBI + the words + a session id; the wallet (a `matou-app` build pointed at a lab gateway) resolves the OOBI, sends one signed `/challenge/response` exn; the sidecar polls `challenges_verify`, marks it, and the bridge completes the OIDC auth request against the roster as ADR 0212 does today; the page polls to completion. Spike on a `clan-lab` gateway (or the IDIP drive's local-guest world) with a throwaway sidecar. Questions the spike answers: round-trip time (the #732 bar was ~7 s for browser sign-in), whether a foreign-agent exn arrives without a prior OOBI from the doorkeeper side, deep link vs QR on desktop, what the wallet must persist to make the second sign-in one tap. Links the spike as `spikes/<n>-wallet-signin`; torn down after Ben drives it. ## Reworded by ADR 0235 (2026-09-10, #1298) The challenge is the **bridge’s** (ADR 0212 §1), carried to the wallet by QR/deep link; the wallet signs it **and presents its Membership credential to the Doorkeeper over IPEX**; the Doorkeeper verifies (issuer, schema, holder = challenge signer, not revoked from the witnessed KEL seals) and answers the bridge over loopback; OIDC completes. No `/challenge/response` exn round, no roster lookup. ## Reworded by ADR 0236 (2026-09-11, #1300) **There is no Doorkeeper agent to stand up and no sidecar.** The spike: the bridge's sign-in page mints its challenge (ADR 0212 §1, signed bytes now `idss-idp:<door url>:<aid>:<nonce>`) and shows a QR / deep link carrying the challenge id + nonce + the door's address + the schema wanted; the wallet (a `matou-app` build pointed at a lab gateway, reading `signin{url}` from the descriptor) signs it and posts `{aid, challengeID, response, presentation}` where `presentation` is the **bare credential CESR stream** (`credentials().get(said, includeCESR=true)`); the bridge **verifies in Go** (SAIDs recomputed, `iss`/no-`rev` seals from the witness's `GET /query`, schema from the trust list, holder == signer) and completes OIDC. Questions the spike answers: round-trip time; the size of the Go verifier and whether keripy golden vectors cover it; the witness fetch latency at sign-in; deep link vs QR on desktop; what the wallet persists for one-tap repeat (the known door). Throwaway; no roster lookup.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: apply no-triage. This is a /wayfinder-pipeline ticket (a child of map #1293), not work for the triage state machine. It moves through the wayfinder fan-out (grill-ux-with-docs → wireframe → to-spec) one ticket per session under /wayfinder; the triage state roles (ready-for-agent / needs-design / etc.) do not apply until this feature reaches to-tickets. no-triage tells triage automation to skip it so it is not repeatedly re-surfaced as untriaged.

Why a two-way door: a single additive label, reverted by removing it. It widens no security posture, destroys no data, spends nothing, and touches no credential or member-facing trust surface.

What proves it: the established precedent — the existing wayfinder map #262 carries exactly this pairing (no-triage + wayfinder:map). These tickets are owned by the wayfinder pipeline in docs/agents/issue-tracker.md (Wayfinding operations), not by triage.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** apply `no-triage`. This is a `/wayfinder`-pipeline ticket (a child of map #1293), not work for the triage state machine. It moves through the wayfinder fan-out (`grill-ux-with-docs` → `wireframe` → `to-spec`) one ticket per session under `/wayfinder`; the triage state roles (`ready-for-agent` / `needs-design` / etc.) do not apply until this feature reaches `to-tickets`. `no-triage` tells triage automation to skip it so it is not repeatedly re-surfaced as untriaged. **Why a two-way door:** a single additive label, reverted by removing it. It widens no security posture, destroys no data, spends nothing, and touches no credential or member-facing trust surface. **What proves it:** the established precedent — the existing wayfinder map #262 carries exactly this pairing (`no-triage` + `wayfinder:map`). These tickets are owned by the wayfinder pipeline in docs/agents/issue-tracker.md (Wayfinding operations), not by triage.
ben self-assigned this 2026-09-12 03:10:51 +00:00
Author
Owner

Resolved — the path runs end to end, and the door verifies in 142 ms

Built as spikes/1301-wallet-signin (throwaway), landed on main as 48902554. Read spikes/1301-wallet-signin/NOTES.md for the numbers; README.md for how to run it.

What was proven

ADR 0236's path, against a live isolated KERIA + witness + schema stack (proto1301), with a real Membership ACDC issued to a real wallet:

  1. the bridge's page mints a challenge and shows a QR / deep link carrying the door's own address;
  2. the wallet signs idss-idp:<door url>:<aid>:<nonce>, exports its credential as a bare CESR stream (no IPEX) and POSTs {aid, challengeID, response, presentation};
  3. the door verifies it in Go — SAIDs recomputed from the received bytes, the issuer's witnessed KEL fetched by the door itself, the iss seal walked, the schema checked against a trust list, the holder checked against the signer;
  4. green three ways: a signature bound to https://evil.example/signin posted to the real door is refused (403); after credentials().revoke the same presentation is refused in 163 ms while the wallet's own copy still reads iss; and a browser drive walks door → first-contact prompt → Approve → Signed in (spikes/1301-wallet-signin/shots/).

No Doorkeeper identity, no signify, no sidecar, no IPEX, no agent, no saved copy. ADR 0236 holds exactly as ruled.

The questions this ticket asked

question answer
round-trip time (the #732 bar was ~7 s) the door costs 142 ms warm (two witness fetches ~120 ms, cryptography ~13 ms). The whole sign-in cost 19.7 s by hand — and every second of it is the wallet's.
the size of the Go verifier ~450 lines (592 with comments) over internal/keriauth, plus one new dependency: a Blake3 implementation.
whether keripy golden vectors cover it yes, and they are free: wallet/setup.mjs dumps the bytes KERIA emitted into door/testdata/, and the Go tests recompute keripy's own SAIDs over them. No keripy, no container, no network in the test. A single flipped attribute byte breaks the credential's SAID (tested).
witness fetch latency 48–93 ms each on loopback, 353–505 ms cold. Two fetches per sign-in (the signer's key state, the issuer's KEL), both cacheable exactly as keriauth's key-state cache already is.
deep link vs QR on desktop the QR carries ~150 chars comfortably at 320 px. matou:// could not be exercised — nothing registers the scheme here. Registering it is a matou-app packaging item (x-scheme-handler/matou), and it is the only thing standing between "Open my community app" and a working same-device tap. The spike substitutes a loopback http://127.0.0.1:8302/approve?… link, which is also an honest real-world fallback.
what the wallet persists for one-tap repeat only the known doors list ({url: {name, firstMet, lastUsed}}). The credential and the identity are already held, so a repeat sign-in saves the first-contact prompt, not the crypto — it is one tap, never zero.
a foreign-agent exn without a prior OOBI moot: ADR 0236 removed the exn.

The finding that bends #1302

The round trip is the wallet's, not the door's. Measured: new SignifyClient 5.6 s, connect 5.9 s, manager.get 3.1–4.6 s, and keeper.sign 1.6–2.0 s per signature — because SaltyIdentifierManager.sign calls creator.create(...) on every call (signify-ts/dist/keri/core/keeping.js:159), re-stretching the salt with Argon2 each time. Credential export is 146 ms and the POST 200 ms.

So the ~7 s bar is missed by signify-ts's key derivation, not by anything ADR 0236 introduced. Caching the derived signer in an unlocked matou-app is one code path, and until it exists no sign-in copy should promise speed. #1302 should design to this number.

Two substrate facts, now ADR 0236 amendments

  • GET /query?typ=kel&pre= is a keripy 1.2.x route. keri-witness-demo:1.1.0 404s it and serves the same KEL at GET /oobi/<aid> — the door internal/keriauth already reads. IDSS's own witness is pinned to 1.2.13, but a foreign community's witness (ADR 0238's adopted Coa identity) may be any generation, so the verifier tries /query first and falls back to /oobi.
  • No TEL fetch is needed at all. The seal walk over the issuer's KEL decides issued and revoked on its own — the anchors are plain ixn events carrying {i: <credential>, s: "0"|"1", d: <TEL event SAID>}.

Also worth carrying into the build

  • The presentation can be 693 bytes, not 5792. credentials().get(said, includeCESR=true) ships the issuer's KEL, the holder's KEL, the registry inception and every attachment; the door reads two messages — the ACDC and its iss — and ignores the rest on purpose, because authority comes from the log it fetches itself. wallet.mjs --minimal posts just those two and gets the same verdict. A matou-app obligation; the door must accept both, and does.
  • Open, for the build ticket: the trust row carries a witness base URL here — a real row should probably carry the issuer's OOBI and let the verifier discover the witness endpoints from the KEL, so a witness rotation (ADR 0238 §10) is not a config edit. Witness receipts are not checked (the witness's copy is trusted wholesale over TLS, as keriauth.HTTPKeyStateResolver already does) — removing that trust is its own decision. Multi-key / multisig signers are refused.

Driving it yourself

cd spikes/1301-wallet-signin
./bring-up.sh && node wallet/setup.mjs   # ~2 min the first time
./drive.sh                               # then open http://127.0.0.1:8301/signin

run.sh is the headless proof and revokes the credential as its last step; re-run wallet/setup.mjs (~90 s) for a fresh world before driving by hand. ./tear-down.sh removes the stack.

Throwaway: delete the directory once the real verifier lands in idss-idp. #1302 is unblocked.

## Resolved — the path runs end to end, and the door verifies in 142 ms Built as `spikes/1301-wallet-signin` (throwaway), landed on `main` as **`48902554`**. Read `spikes/1301-wallet-signin/NOTES.md` for the numbers; `README.md` for how to run it. ### What was proven ADR 0236's path, against a live isolated KERIA + witness + schema stack (`proto1301`), with a real Membership ACDC issued to a real wallet: 1. the bridge's page mints a challenge and shows a **QR / deep link carrying the door's own address**; 2. the wallet signs `idss-idp:<door url>:<aid>:<nonce>`, exports its credential as a **bare CESR stream** (no IPEX) and POSTs `{aid, challengeID, response, presentation}`; 3. the door **verifies it in Go** — SAIDs recomputed from the received bytes, the **issuer's witnessed KEL fetched by the door itself**, the `iss` seal walked, the schema checked against a trust list, the holder checked against the signer; 4. green three ways: a signature bound to `https://evil.example/signin` posted to the real door is **refused (403)**; after `credentials().revoke` the **same** presentation is refused in 163 ms while the wallet's own copy still reads `iss`; and a browser drive walks door → first-contact prompt → Approve → *Signed in* (`spikes/1301-wallet-signin/shots/`). **No Doorkeeper identity, no signify, no sidecar, no IPEX, no agent, no saved copy.** ADR 0236 holds exactly as ruled. ### The questions this ticket asked | question | answer | |---|---| | **round-trip time** (the #732 bar was ~7 s) | the *door* costs **142 ms** warm (two witness fetches ~120 ms, cryptography ~13 ms). The whole sign-in cost **19.7 s** by hand — and every second of it is the wallet's. | | **the size of the Go verifier** | **~450 lines** (592 with comments) over `internal/keriauth`, plus **one** new dependency: a Blake3 implementation. | | **whether keripy golden vectors cover it** | yes, and they are free: `wallet/setup.mjs` dumps the bytes KERIA emitted into `door/testdata/`, and the Go tests recompute keripy's own SAIDs over them. **No keripy, no container, no network in the test.** A single flipped attribute byte breaks the credential's SAID (tested). | | **witness fetch latency** | 48–93 ms each on loopback, 353–505 ms cold. Two fetches per sign-in (the signer's key state, the issuer's KEL), both cacheable exactly as `keriauth`'s key-state cache already is. | | **deep link vs QR on desktop** | the QR carries ~150 chars comfortably at 320 px. **`matou://` could not be exercised — nothing registers the scheme here.** Registering it is a matou-app *packaging* item (`x-scheme-handler/matou`), and it is the only thing standing between "Open my community app" and a working same-device tap. The spike substitutes a loopback `http://127.0.0.1:8302/approve?…` link, which is also an honest real-world fallback. | | **what the wallet persists for one-tap repeat** | only the **known doors** list (`{url: {name, firstMet, lastUsed}}`). The credential and the identity are already held, so a repeat sign-in saves the *first-contact prompt*, not the crypto — it is one tap, never zero. | | **a foreign-agent exn without a prior OOBI** | moot: ADR 0236 removed the exn. | ### The finding that bends #1302 **The round trip is the wallet's, not the door's.** Measured: `new SignifyClient` **5.6 s**, `connect` 5.9 s, `manager.get` 3.1–4.6 s, and `keeper.sign` **1.6–2.0 s per signature** — because `SaltyIdentifierManager.sign` calls `creator.create(...)` on *every* call (`signify-ts/dist/keri/core/keeping.js:159`), re-stretching the salt with Argon2 each time. Credential export is 146 ms and the POST 200 ms. So the ~7 s bar is missed by signify-ts's key derivation, not by anything ADR 0236 introduced. **Caching the derived signer in an unlocked matou-app is one code path**, and until it exists no sign-in copy should promise speed. #1302 should design to this number. ### Two substrate facts, now ADR 0236 amendments - **`GET /query?typ=kel&pre=` is a keripy 1.2.x route.** `keri-witness-demo:1.1.0` 404s it and serves the same KEL at `GET /oobi/<aid>` — the door `internal/keriauth` already reads. IDSS's own witness is pinned to 1.2.13, but a **foreign** community's witness (ADR 0238's adopted Coa identity) may be any generation, so the verifier **tries `/query` first and falls back to `/oobi`**. - **No TEL fetch is needed at all.** The seal walk over the issuer's KEL decides issued *and* revoked on its own — the anchors are plain `ixn` events carrying `{i: <credential>, s: "0"|"1", d: <TEL event SAID>}`. ### Also worth carrying into the build - **The presentation can be 693 bytes, not 5792.** `credentials().get(said, includeCESR=true)` ships the issuer's KEL, the holder's KEL, the registry inception and every attachment; the door reads two messages — the ACDC and its `iss` — and ignores the rest on purpose, because authority comes from the log it fetches itself. `wallet.mjs --minimal` posts just those two and gets the same verdict. A matou-app obligation; the door must accept both, and does. - **Open, for the build ticket:** the trust row carries a witness base URL here — a real row should probably carry the issuer's **OOBI** and let the verifier discover the witness endpoints from the KEL, so a witness rotation (ADR 0238 §10) is not a config edit. Witness **receipts are not checked** (the witness's copy is trusted wholesale over TLS, as `keriauth.HTTPKeyStateResolver` already does) — removing that trust is its own decision. Multi-key / multisig signers are refused. ### Driving it yourself ```sh cd spikes/1301-wallet-signin ./bring-up.sh && node wallet/setup.mjs # ~2 min the first time ./drive.sh # then open http://127.0.0.1:8301/signin ``` `run.sh` is the headless proof and **revokes** the credential as its last step; re-run `wallet/setup.mjs` (~90 s) for a fresh world before driving by hand. `./tear-down.sh` removes the stack. Throwaway: delete the directory once the real verifier lands in `idss-idp`. **#1302 is unblocked.**
ben closed this issue 2026-09-12 03:53:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1301
No description provided.