Skip to content

fix(sdk-core): skip ECDH keychain lookup in bulkAcceptShare when unneeded (WCN-3735) - #10024

Open
zahin-mohammad wants to merge 2 commits into
masterfrom
zahinmohammad/wcn-3735-bulk-accept-share-skip-ecdh
Open

zahin-mohammad wants to merge 2 commits into
masterfrom
zahinmohammad/wcn-3735-bulk-accept-share-skip-ecdh

Conversation

@zahin-mohammad

Copy link
Copy Markdown
Contributor

Ticket: WCN-3735 (follow-up to support ticket CUS-2174)

Problem

Wallets.bulkAcceptShare always 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 an Error object instead of throwing. bulkAcceptShare read .encryptedXprv off it, got undefined, and surfaced encryptedXprv was not found on sharing keychain in the Accept Keys modal.

Changes

  • sdk-core: bulkAcceptShare fetches and decrypts the ECDH keychain only when at least one selected share has a keychain (same idea as hasSharesRequiringDecryption in bulkUpdateWalletShare), and asserts the decrypted key exists before deriving the shared secret.
  • sdk-api: getECDHKeychain now throws ecdh keychain not found for user instead of returning the Error. All in-repo callers read encryptedXprv off the result, so none relied on the returned value.

Tests

  • UMKR-only batch succeeds and never calls getECDHKeychain (fails without the fix).
  • Mixed batch with a keychain share still rejects with encryptedXprv was not found on sharing keychain.
  • getECDHKeychain rejects when the user has no ecdhKeychain (fails without the fix).
  • Ran walletsEncryptionVersion.ts (13 passing) and modules/sdk-api/test/unit/bitgoAPI.ts (75 passing); tsc --noEmit on sdk-core clean. The larger modules/bitgo wallets suite was not run.

Not covered

  • Why this user has no ECDH keychain (terms accepted 2026-10-20) is a separate data question; other Go Account invitees may be affected.
  • bitgo-retail needs an @bitgo-beta/sdk-core bump after release before users see the fix.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

WCN-3735

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

zahin-mohammad and others added 2 commits October 21, 2026 15:41
…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
zahin-mohammad force-pushed the zahinmohammad/wcn-3735-bulk-accept-share-skip-ecdh branch from a917aff to 918423e Compare October 21, 2026 19:43
@zahin-mohammad
zahin-mohammad marked this pull request as ready for review October 21, 2026 19:44
@zahin-mohammad
zahin-mohammad requested review from a team as code owners October 21, 2026 19:44
@zahin-mohammad

Copy link
Copy Markdown
Contributor Author

@claude

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

This branch has not been deployed

No deployments
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