| Wallet type | Surface | Use when |
|---|---|---|
| SHHH (default since v14.5.0) | createShhhPasskey, signShhhMessage, …ShhhCredential | New integrations, any SHHH wallet |
| Legacy CHIPI v29 | createWalletPasskey, getWalletEncryptKey, …Credential | Existing CHIPI v29 wallets you haven’t migrated yet |
usePasskeySetup, usePasskeyAuth, usePasskeyStatus) wrap the legacy surface today. SHHH equivalents ship in a follow-on release; until then, call createShhhPasskey / signShhhMessage directly inside your own effects.
SHHH passkey (modern path)
createShhhPasskey
Registers a new P-256 platform passkey. No PRF extension, no PIN derivation. The private key stays inside the platform authenticator.rpId = window.location.hostname, rpName = "Chipi Wallet". Persists { credentialId, publicKey, userId, rpId, transports } to localStorage under the key chipi_wallet_shhh_passkey_credential. Throws on NotAllowedError (user cancelled) or InvalidStateError (passkey already exists for this account on this device).
signShhhMessage
Runsnavigator.credentials.get() with messageHash encoded as the 32-byte big-endian WebAuthn challenge. Returns the raw assertion bytes ready to feed into buildWebAuthnEnvelopeFromAssertion from @chipi-stack/backend.
hasShhhPasskey
Synchronous check for a stored SHHH credential. Use it to branch between “Sign up” and “Sign in” UI without prompting.getStoredShhhCredential
Reads the persisted credential metadata.removeStoredShhhCredential
Clears the stored credential id from localStorage. Use at logout, account reset, or when the user opts to re-register. The platform authenticator’s stored credential is NOT deleted — only your app’s reference to it.Extraction utilities
Exported for tests and for advanced callers who want to verify a passkey’s pubkey against a separately-stored copy.extractP256PubkeyFromRegistration is the dispatch helper — it tries the SPKI fast path first (Chrome, Safari, modern Edge), then falls back to decoding the CBOR attestationObject for older browsers. You only need these utilities if you’re writing your own registration-response handler.
Legacy PRF passkey [#legacy-prf-passkey]
The PRF passkey path encrypts a STARK private key with a key derived from the WebAuthn PRF extension. It backs CHIPI v29 wallets — both legacy on-chain accounts and the dual-key (passkey primary + PIN backup) flow. New SHHH integrations don’t need this surface; existing CHIPI v29 integrations still do.createWalletPasskey
Registers a passkey with the PRF extension enabled, derives an encryption key from the PRF output, and stores the credential metadata.{ credentialId, createdAt, userId, transports, prfSupported } to localStorage under chipi_wallet_passkey_credential. Separate storage key from the SHHH path — both surfaces coexist on the same device.
getWalletEncryptKey
Authenticates with an existing PRF passkey and returns the sameencryptKey derived at registration time. Use it before every wallet operation that needs the STARK key (transfer, session-key registration, encryption rotation).
Status checks
Credential management
React hooks (legacy passkey path)
The hooks today wrap the legacy PRF surface —usePasskeySetup calls createWalletPasskey, usePasskeyAuth calls getWalletEncryptKey. Import from the /hooks subpath so Next.js bundles get the right "use client" directives.
usePasskeySetup
usePasskeyAuth
usePasskeyStatus
TypeScript types
Related
- Quickstart — end-to-end SHHH passkey flow
- When passkeys fail — recovery, PIN fallback, browser switching
