Skip to content

feat(sdk-core): reshare wallets to recovering spenders - #10100

Draft
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-3894-reshare-wallet-recovery
Draft

ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-3894-reshare-wallet-recovery

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Oct 29, 2026

Copy link
Copy Markdown

Description

Add optional admin and recovery-status filters to reshareWalletWithSpenders, expose the method and result types on IWallets, and return per-user successes and failures while continuing through the recipients. Setup and decryption failures still reject. Existing default recipient selection is unchanged, but recipient failures are now returned instead of thrown.

After a custody lightning userAuth key reset, other wallet members need the new key to regain spending access; an existing share must not prevent other members from being reshared. Coordinate publication in the same beta as the sibling abstract-lightning change.

Issue Number

WCN-3894

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected): recipient failures are returned, not thrown.
  • This change requires a documentation update

How Has This Been Tested?

  • yarn lerna run build --scope bitgo --scope @bitgo/express --include-dependencies --concurrency 2 in the Nix shell.
  • Wallets reshare unit tests: 9 passed with a local mock-only test password.
  • ESLint and Prettier checks on changed TypeScript files.
  • Exercised the built SDK against a mock wallet: recovery-only selection included an admin and continued after a blocked share.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My code compiles correctly for both Node and Browser environments (browser bundle not run)
  • I have commented my code, particularly in hard-to-understand areas (existing invariant comments retained)
  • My commits follow Conventional Commits and I have properly described any BREAKING CHANGES
  • The ticket or github issue was included in the commit message as a reference
  • I have made corresponding changes to the documentation and on any new/updated functions and/or methods
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (targeted reshare tests passed; full suite not run)

@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

WCN-3894

@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-3894-reshare-wallet-recovery branch from 3302561 to 27a11c7 Compare October 29, 2026 17:34
Add admin and recovery filters and report per-recipient outcomes.
This lets custody lightning wallet members regain spending access
after their userAuth key is reset without one blocked share stopping
the remaining recipients.

BREAKING CHANGE: recipient share failures are returned rather than
thrown; callers must inspect the failed results.

Ticket: WCN-3894
Session-Id: 3e80d32f-b610-4dde-bcdf-73d89ebe4147
Task-Id: ce5e1cc0-4061-4fb5-a492-2234993dadd8
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-3894-reshare-wallet-recovery branch from 27a11c7 to fc6965b Compare October 29, 2026 17:35
(user) =>
user.permissions.includes('spend') &&
(opts?.includeAdmins || !user.permissions.includes('admin')) &&
(!opts?.onlyNeedsRecovery || user.needsRecovery === true) &&

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I require an explicit true so members without recovery metadata are not accidentally reshared during a reset. The admin and recovery filters remain independent.

await wallet.shareWallet(shareOptions);
result.shared.push(user.user);
} catch (e) {
result.failed.push({ userId: user.user, error: e instanceof Error ? e.message : String(e) });

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I keep wallet-wide setup failures outside this catch so an incorrect password still rejects the operation; individual recipient failures allow subsequent shares to proceed.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

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