Skip to content

feat(web-demo): Passkey-crypto web demo#8716

Open
derranW26 wants to merge 3 commits intomasterfrom
WCN-194/passkey-demo-toarraybuffer-fix
Open

feat(web-demo): Passkey-crypto web demo#8716
derranW26 wants to merge 3 commits intomasterfrom
WCN-194/passkey-demo-toarraybuffer-fix

Conversation

@derranW26
Copy link
Copy Markdown
Contributor

No description provided.

derranW26 added 3 commits May 7, 2026 13:46
- Register, attach, derive PRF key, send funds, remove passkey flows
- Right-column panels: registered passkeys + associated wallets with refresh
- Quick-action buttons to select passkey/wallet for attach/remove steps
- Config fields (env, enterpriseId, coin) persisted to localStorage
- Coin registered via coinFactory before SDK use
- Staging environment option added

TICKET: WCN-188
Replace access-token-based initialization with a proper login flow
using WebCryptoHmacStrategy + IndexedDbTokenStore for browser-compatible
HMAC auth. Rework the UI to map 1:1 to passkey-crypto SDK functions
with explicit inputs, split passkey selection buttons, colored activity
log, and wallet keychain fetching for webauthnDevices display.

TICKET: WCN-188
passkey-crypto stores PRF salts and credential IDs as canonical
base64url (no padding). atob requires the input length to be a multiple
of 4 — without the padding it silently drops the trailing partial group
and the PRF extension receives a salt that's missing its last byte. That
bad salt produces a different PRF output, the derived password no
longer matches what attachPasskeyToWallet stored, and decryption fails
with ccm tag mismatch.

Pad with '=' up to the next multiple of 4 before atob.

Refs: WCN-194

TICKET: WCN-194
@derranW26 derranW26 requested review from a team as code owners May 7, 2026 23:54
@derranW26 derranW26 requested a review from rajangarg047 May 7, 2026 23:54
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 7, 2026

WCN-194

@derranW26 derranW26 changed the title Wcn 194/passkey demo toarraybuffer fix Wcn 194/passkey demo May 8, 2026
@derranW26 derranW26 changed the title Wcn 194/passkey demo feat(web-demo): Passkey-crypto web demo May 8, 2026
"@bitgo/sdk-coin-xtz": "^2.10.7",
"@bitgo/sdk-coin-zec": "^2.8.7",
"@bitgo/sdk-core": "^36.44.0",
"@bitgo/passkey-crypto": "*",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be versioned?

// Fetch the wallet's user keychain to get webauthnDevices
const keychain = await wallet.getEncryptedUserKeychain();
const devices = keychain.webauthnDevices;
const devices = (keychain as any).webauthnDevices ?? (keychain as any).webAuthnDevices;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid any casts

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.

2 participants