Repository navigation
feat(web): passkey vault on Platform (vaultEntry) on a vendored platform-auth core - #605
Merged
Merged
Conversation
…ey vault Adds `vaultEntry`, a passkey-sealed key bundle per (owner, WebAuthn credential), behind a new UPDATE-2 flag `passkey_vault` in build.py. It is defined in forge-community and moved to forge-meta by META_TYPES, so it exists in the four-contract (mainnet) set only: in the three-contract forge-community it would take the contract to 18,385 B (ceiling 17,832) with 1,989 B of room. Schema: credentialId (byteArray 16-255, immutable), recipientKey (bytes 32, immutable), version 1-255, authKeyId (u32, refersTo the owner's authentication key), enc (bytes 32), sealed (byteArray 32-256); mutable and deletable; unique index byCredential [$ownerId, credentialId]. forge-meta grows 6,870 -> 7,684 B (create transition 7,790 B, 12,690 B of room). contract-validate accepts it as an update of the forge-meta registered on sakura. Clients' layout maps (forge-core, forge-web, seed scripts) learn the type; it has no three-contract home. Nothing is broadcast. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Vendored with platform-auth tools/vendor.mjs from feat/passkey-vault (dbd9a4f). VENDORED.json keeps app-connect at its own commit. Adds @noble/ciphers for the module's HPKE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forge's vault profile (one 240-byte slot format, six keys) checked against the core's forge.json vectors; the relying-party policy (forge.dashhq.org and localhost only, never on shared origins or IPFS subdomain gateways, only where forge-meta exists); and the VaultPort over proved vaultEntry reads and Forge's idempotent write helpers. vaultEntry joins DOC and the web cost tables (estimates from Yappr's sakura figures until measured). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forge's slot rules on top of the vendored PasskeyVault: slot 0 is a budgeted, expiring, group-bound HIGH key; then up to four live wallet grants (never held-only, unbounded or foreign ones); then, only when the user opts in, the identity's usable encryption key. Opening checks every slot against the identity read with proofs: a failing slot 0 refuses the sign-in, other failures are dropped, and copies are returned before the core wipes the bundle. Core errors map to Forge copy with stable codes. Device records (pv-own trust markers, pv-pending enrolments as public ids only) live in IndexedDB beside the browser vault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntroller AuthController gains signInWithPasskey (one discoverable prompt, the chain-checked keys kept in the browser vault under the same passkey with its PRF input as the salt), addPlatformPasskey (opt-in encryption key, pending enrolments kept for Check again), listPlatformPasskeys, removePlatformPasskey (signals only this device's credentials) and resealPlatformPasskeys (no prompt only for entries still sealed to this device's recorded recipient key; one prompt otherwise). Key changes in this tab re-seal in the background; revokeStored and disableIdentityKey can first delete the passkeys naming the keys; forget clears the device's passkey records. The auth context exposes them for the UI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for the passkey vault controller: - the browser adapter maps WebAuthn rejections to coded PasskeyErrors in the vault's words, so a closed confirm stays pending instead of being dropped, and codes reach the UI; - a pending passkey is dropped only when it can never hold the key and Platform proves no entry of it exists; Discard deletes a landed entry before signalling, and a second add waits for the first; - background re-seals: per-entry failures, no stripping of an opted-in encryption key, no marker after sign-out; forget and remove wait for them; a lagging node is read again; keyChanged never throws; - the sign-in marker's recipient key is derived from the PRF output and written once the key is stored; wipe gaps closed; clearer copy for a key on a foreign group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Simplifier pass: one session guard, writable/read-only port helpers, an error-mapping helper, one ownMarkerFor rule for 'this device's entry', shared key-shape predicates, and module-private internals. Remaining budgets are keyed by number whatever the SDK's map keys are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entry ciphertexts are public on chain forever, so a leaked passkey must never yield a key with no spending limit or no expiry. Extra keys (slots 1+) now need a budget AND an expiry, both when sealing and when opening an entry: a v1 wallet's unlimited per-contract grant stays on the device that holds it. The controller reports how many were left out so the UI can say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-restored key either way Passkey controls stay hidden until the forge-meta Platform serves declares vaultEntry (a proved contract fetch, not the bundled snapshot), so the feature is inert until the pending sakura forge-meta update. A read that fails also hides them and is retried next time. A session restored from a passkey is stored with origin 'passkey': a passkey does not say whether a wallet or the master key made the key, so renewal offers both 'Renew in your wallet' and 'Renew with identity file' (low-funds banner, top-up sheet, Settings), and the wallet renewal request accepts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ke options
- Sign-in sheet: 'Sign in with a passkey' (after the wallet tile), with progress,
the 'only unlocks the browser that made it' message and 'Unlock instead'.
- Devices & keys: a passkeys section that lists, adds (encryption key off by
default, with the lock-out warning), updates ('Needs update'), removes,
finishes ('Check again') and discards passkeys, and says that keys without a
spending limit stay on the device. A resumed tab unlocks first.
- A one-time offer under the header after an interactive sign-in: at most twice
per identity, never after 'Not now', never where a passkey could not hold the key.
- Revoke and disable dialogs offer to remove the passkeys that hold the key.
- Importing an encryption key in Settings re-seals this device's passkeys.
- Hidden whenever platformPasskeyProblem is not null.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, limits - e2e/passkey-vault.spec.ts: Chromium with a CDP virtual authenticator (PRF) on http://localhost. Hermetic cases (no passkey sign-in on an IP address, nor where forge-meta reads as having no vault) run anywhere; the browser-only passkey message self-skips until forge-meta has vaultEntry; the full add, forget, passkey sign-in, re-seal and remove flow needs E2E_WRITE=1. - lib/auth/passkey-vault.live.test.ts (FORGE_LIVE=1): a fake authenticator against real sakura, printing each step's fee; ends before spending while forge-meta has no vaultEntry. - docs/security/passkey-vault.md: the threat model, the extras policy (only budgeted, expiring keys), 'passkeys move a session, they don't recover an account', and the pending sakura forge-meta update. Costs, economics, limits, the identity guide and the changelog updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Revoke and disable: removing the passkeys first is best effort. A delete that fails (this browser's key spent, Platform slow) no longer stops the key from being disabled; the page says which passkeys to remove. - A new encryption key is no longer added silently to an entry that held the old one: the entry shows 'Needs update' and the user chooses again. - Renewing a passkey-restored key in a wallet keeps the old key held-only (the wallet does not disable another browser's grant), so no passkey seals it again, and the copy no longer says it was disabled. - The one-time offer is skipped for a spent or expired key; the passkeys panel is keyed by identity; the remove dialog and the extras shape check are tighter. - e2e w1: unlock a resumed tab before the renewal, and check the re-seal in the same page instead of after a reload. - Docs: the expiry claim matches what is enforced, a top-up reaches every passkey that holds the key, and the best-effort removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Brings in master (testnet registration, Platform SDK rc.8, zod 4) via #604. Testnet registered forge-meta without vaultEntry, so passkey_vault joins testnet's 'since' in NETWORK_REGISTRATIONS (build.py --check reproduces the registered bytes again), and the vault deployment notes now say testnet needs the same forge-meta update as sakura. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The costs guide no longer names sakura, and the passkey-vault security page, whose deployment status names each network's pending forge-meta update, joins the developer pages L10 allows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PastaPastaPasta
changed the base branch from
feat/app-connect-login
to
master
October 26, 2026 17:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #604 (App Connect v2). Review and merge #604 first.
Summary
Adds a passkey vault stored on Platform to forge-web. A synced passkey can move a Forge session to a new device. The session key is sealed with HPKE to a key derived from the passkey's WebAuthn PRF output, and stored as a
vaultEntrydocument in forge-meta.vaultEntrydocument type, added through apasskey_vaultUPDATE-2 flag inbuild.py. It exists only in the four-contract (mainnet) set, where it lands in forge-meta. In the three-contract set it would push forge-community past its size ceiling.credentialId: 16–255 B, immutable.recipientKey: 32 B, immutable.version: u8.authKeyId:refersToan authentication key of the owner.enc: 32 B.sealed: 32–256 B.byCredential [$ownerId, credentialId]index.contract-validate --expect-updateaccepts the new forge-meta as an update of the one sakura registered.lib/vendor/platform-auth/passkey-vault/is vendored from feat: passkey vault core (HPKE + WebAuthn PRF) with Yappr/govhub/Forge profiles platform-auth#6 atdbd9a4fwithtools/vendor.mjs. A Forge test runs the Forge profile against the upstreamforge.jsonvectors, which an independent Python generator cross-checks.lib/auth/passkey-vault/).forge.dashhq.organdlocalhostonly. Hidden on shared origins and IPFS gateways.vaultEntry. This is checked with a proved contract fetch, and a failed read also hides them. Until the sakura update below, the feature does nothing.docs/security/passkey-vault.mdcovers the threat model: planted entries, stale entries, metadata, shared devices, and the fact that sealed bytes stay public on chain forever. It also says plainly that passkeys move a session; they do not recover an account.Needs approval before it works on sakura and testnet
Nothing has been broadcast. Testnet registered the four-contract set on 2026-10-26 (#606) without
vaultEntry, sopasskey_vaultis listed in testnet'ssinceinbuild.py, andvalidate-registered.shaccepts the new forge-meta as an update of what testnet registered (the other three contracts are byte-identical). Each network needs one forge-meta update, signed by its deployer. Even the dry run needs the deployer identity file, because it signs the transition:Then run each without
--dry-run, runsnapshot-contracts.mjsfor the network, and commit the record and snapshot. After that, the rehearsal must show that a group-bound limited key can writevaultEntry. Mainnet isn't registered yet, so therevaultEntrysimply becomes part of the registration set.Test plan
pnpm typecheck && pnpm lint && pnpm lint:copy && pnpm test(after merging master): 9722 passed, 39 skippedpnpm buildbuild.py --check,validate-registered.sh(forge-meta as an update of testnet's registration),vectors.py --check,registered_test.py,wherecheck.py,variants.py,negative.sh,cargo test -p forge-core --lib, and the deploy-v2 self-testspasskey-vaulth1 (no tile on 127.0.0.1) and h2 (tile hidden when Platform lacksvaultEntry) passpasskey-vaultw1 (add → forget → passkey sign-in → renew with re-seal → remove): needsE2E_WRITE=1, a reachable sakura, andvaultEntrydeployedFORGE_LIVE=1 … vitest run lib/auth/passkey-vault.live.test.ts: prints real fees. The figures in the docs are estimates until this runs🤖 Generated with Claude Code