Repository navigation
fix(sdk-core): skip ECDH keychain lookup in bulkAcceptShare when unneeded (WCN-3735) - #10024
Open
zahin-mohammad wants to merge 2 commits into
Open
zahin-mohammad wants to merge 2 commits into
zahin-mohammad wants to merge 2 commits into
Conversation
Contributor
Contributor
|
|
…eded (Refs: WCN-3735) bulkAcceptShare always fetched and decrypted the user's ECDH sharing keychain, even for batches made only of userMultiKeyRotationRequired shares (Go Account / OFC). Those shares carry no keychain and generate a fresh keypair encrypted with the login password, so they never use the ECDH key. A user without an ECDH keychain could therefore not accept them and saw "encryptedXprv was not found on sharing keychain". Fetch the keychain only when at least one selected share has a keychain, as bulkUpdateWalletShare already does, and assert the decrypted key exists before deriving the shared secret, with a client-readable message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…WCN-3735) getECDHKeychain returned an Error object instead of throwing it when the user's settings had no ecdhKeychain. Callers read encryptedXprv off the result, so they reported "encryptedXprv was not found on sharing keychain" instead of the real cause. The error now tells the client the account is missing its sharing key and to contact support@bitgo.com so it can be set up. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zahin-mohammad
force-pushed
the
zahinmohammad/wcn-3735-bulk-accept-share-skip-ecdh
branch
from
October 21, 2026 19:43
a917aff to
918423e
Compare
zahin-mohammad
marked this pull request as ready for review
October 21, 2026 19:44
danielpeng1
approved these changes
Oct 21, 2026
Contributor
Author
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
This branch has not been deployed
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.
Ticket: WCN-3735 (follow-up to support ticket CUS-2174)
Problem
Wallets.bulkAcceptSharealways fetched and decrypted the user's ECDH sharing keychain, even when every selected share is a multi-key rotation share (userMultiKeyRotationRequired: true, e.g. Go Account / OFC). Those shares carry no keychain and generate a fresh keypair encrypted with the login password, so they never use the ECDH key.For a user whose settings have
ecdhKeychain: null(confirmed on prod for the CUS-2174 user),getECDHKeychain()returned anErrorobject instead of throwing.bulkAcceptShareread.encryptedXprvoff it, gotundefined, and surfacedencryptedXprv was not found on sharing keychainin the Accept Keys modal.Changes
sdk-core:bulkAcceptSharefetches and decrypts the ECDH keychain only when at least one selected share has a keychain (same idea ashasSharesRequiringDecryptioninbulkUpdateWalletShare), and asserts the decrypted key exists before deriving the shared secret.sdk-api:getECDHKeychainnow throwsecdh keychain not found for userinstead of returning theError. All in-repo callers readencryptedXprvoff the result, so none relied on the returned value.Tests
getECDHKeychain(fails without the fix).encryptedXprv was not found on sharing keychain.getECDHKeychainrejects when the user has noecdhKeychain(fails without the fix).walletsEncryptionVersion.ts(13 passing) andmodules/sdk-api/test/unit/bitgoAPI.ts(75 passing);tsc --noEmiton sdk-core clean. The largermodules/bitgowallets suite was not run.Not covered
@bitgo-beta/sdk-corebump after release before users see the fix.🤖 Generated with Claude Code