fix(sdk-core): persist passkey for onchain generateWallet#8989
Merged
rajangarg047 merged 1 commit intoJun 11, 2026
Conversation
Switch the onchain generateWallet user-keychain path to send `webauthnInfo` (single object, with enterpriseId threaded from params.enterprise) instead of the deprecated `webauthnDevices` array. The backend's atomic POST /key only consumes `webauthnInfo` and ignores `webauthnDevices` on input, so the passkey was never persisted for onchain hot wallets created via generateWallet. Update walletsWebauthn unit tests to assert webauthnInfo (with enterpriseId) instead of webauthnDevices. Ticket: WCN-870 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mukeshsp
approved these changes
Jun 11, 2026
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.
Summary
Fixes WCN-870. The onchain hot-wallet path of
wallets.generateWalletbuilt the deprecatedwebauthnDevicesarray on the user keychain. The backend's atomicPOST /api/v2/:coin/keyonly consumeswebauthnInfo(a single object, withenterpriseIdfor PRF-salt validation) and ignoreswebauthnDeviceson input — so the passkey was never persisted for onchain wallets created viagenerateWallet.This switches that path to send
webauthnInfo: { otpDeviceId, prfSalt, encryptedPrv, enterpriseId }(threadingparams.enterprise), matching thekeychains.addcontract the backend actually consumes. Same bug class fixed for the MPC/TSS utils in WCN-848.Exposure
coinKeychain.add({ webauthnInfo })+createMpcdirectly).generateWallet— fine, routes throughcreateMpc(WCN-848).generateWallet({ webauthnInfo })(mobile, Express, scripts, partners) — fixed here.Changes
modules/sdk-core/src/bitgo/wallet/wallets.ts— sendwebauthnInfo(withenterpriseId) instead ofwebauthnDevices.modules/sdk-core/test/unit/bitgo/wallet/walletsWebauthn.ts— assertwebauthnInfo+enterpriseId; negative tests assert neither field present.Verification
cd modules/sdk-core && yarn unit-test --grep "WebAuthn"— 7 passingyarn build(tsc) — clean🤖 Generated with Claude Code