Skip to content

Conversation

@zahin-mohammad
Copy link
Contributor

@zahin-mohammad zahin-mohammad commented Nov 14, 2025

Summary

Adds support for accepting wallet shares when userMultiKeyRotationRequired is true. When this flag is set, users must provide a password to generate a new keychain, and both the public key and encrypted private key are sent to accept the share.

Changes

  • acceptShare() and processAcceptShare(): Handle userMultiKeyRotationRequired by requiring userPassword, generating a new keychain, encrypting the private key, and sending both pub and encryptedPrv to accept the share
  • Type definitions: Added userMultiKeyRotationRequired?: boolean to WalletShare interface and pub?: string to UpdateShareOptions interfaces
  • Testing: Added comprehensive test coverage for error handling, successful acceptance, and bulk operations

Key Difference

Unlike keychainOverrideRequired, when userMultiKeyRotationRequired is true, the wallet is NOT reshared with spenders after acceptance. The user generates their own keychain rather than using a provided one.

Ticket: WP-6769

@zahin-mohammad zahin-mohammad force-pushed the WP-6769/update-wallet-accept-share branch from 236afa6 to f548584 Compare November 14, 2025 23:47
@zahin-mohammad zahin-mohammad marked this pull request as ready for review November 17, 2025 16:28
@zahin-mohammad zahin-mohammad requested review from a team as code owners November 17, 2025 16:28
… operations

Fixed processAcceptShare to correctly use newWalletPassphrase when provided
for both keychainOverrideRequired and userMultiKeyRotationRequired cases in
bulk wallet share operations. Updated validation to accept either
newWalletPassphrase or userLoginPassword for userMultiKeyRotationRequired
shares.

Added comprehensive tests to verify:
- Bulk accept share with userMultiKeyRotationRequired and newWalletPassphrase
- Bulk accept share with keychainOverrideRequired and newWalletPassphrase
- Error handling when neither password is provided
- Correct usage of newWalletPassphrase vs userLoginPassword

Fixed existing keychainOverrideRequired tests to use correct API endpoints
(ofc instead of tbtc) and made nock matchers more flexible to handle dynamic
signatures and payloads.

WP-6769

TICKET: WP-6769
@zahin-mohammad zahin-mohammad merged commit ff8c4ff into master Nov 17, 2025
15 checks passed
const keysForWalletShares = walletShares.flatMap((walletShare) => {
// Handle userMultiKeyRotationRequired case - these shares don't have keychains
if (walletShare.userMultiKeyRotationRequired) {
if (!params.userLoginPassword) {
Copy link
Contributor

Choose a reason for hiding this comment

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

here params.userLoginPassword is checked but at line 1065 newWalletPassphrase is used which can be params.newWalletPassphrase || params.userLoginPassword;

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.

5 participants