Skip to content

feat: use decryptAsync/encryptAsync for remaining WRW flows#8909

Merged
bdesoky merged 1 commit into
masterfrom
WCN-172-rest
Jun 2, 2026
Merged

feat: use decryptAsync/encryptAsync for remaining WRW flows#8909
bdesoky merged 1 commit into
masterfrom
WCN-172-rest

Conversation

@bdesoky
Copy link
Copy Markdown
Contributor

@bdesoky bdesoky commented Jun 1, 2026

Ticket: WCN-172

This pull request refactors key recovery and encryption/decryption logic across multiple coin modules and the BitGo SDK to consistently use asynchronous methods, improving reliability and compatibility with async workflows. The main changes involve replacing synchronous key derivation and encryption/decryption functions with their asynchronous counterparts, and updating method signatures and calls accordingly.

Key changes include:

Asynchronous Encryption/Decryption

  • Replaced all calls to synchronous decrypt and encrypt methods with their asynchronous equivalents (decryptAsync and encryptAsync) throughout the SDK, including wallet recovery, transaction signing, and key sharing operations in wallet.ts and ecdsaMPCv2.ts. This ensures that encryption and decryption operations do not block the event loop and are compatible with async/await patterns. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Asynchronous Key Derivation

  • Updated all usages of getBip32Keys to use the asynchronous getBip32KeysAsync function in UTXO, EOS, STX, TRX, and XRP coin modules, as well as related imports, to ensure proper handling of asynchronous key derivation. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

ECDSA MPCv2 Recovery Key Changes

  • Modified all calls to ECDSAUtils.getMpcV2RecoveryKeyShares to include the bitgo instance as an additional argument, ensuring that recovery key shares are generated with the correct context and access to required BitGo methods. [1] [2] [3] [4] [5] [6] [7] [8]

These updates standardize async key management and cryptographic operations across the codebase, reducing the risk of blocking behavior and improving maintainability.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 1, 2026

WCN-172

@bdesoky bdesoky marked this pull request as ready for review June 1, 2026 19:42
@bdesoky bdesoky requested review from a team as code owners June 1, 2026 19:42
@bdesoky bdesoky requested review from Marzooqa and danielpeng1 June 1, 2026 19:42
vinhkhangtieu
vinhkhangtieu previously approved these changes Jun 1, 2026
Copy link
Copy Markdown

@vinhkhangtieu vinhkhangtieu left a comment

Choose a reason for hiding this comment

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

use async for decrypt and encrypt

@bdesoky bdesoky force-pushed the WCN-172-rest branch 2 times, most recently from 4e665ed to 6da369e Compare June 1, 2026 19:54
Copy link
Copy Markdown
Contributor

@pranavjain97 pranavjain97 left a comment

Choose a reason for hiding this comment

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

lgtm

Comment thread modules/abstract-utxo/src/recovery/backupKeyRecovery.ts
@bdesoky bdesoky merged commit 9694608 into master Jun 2, 2026
24 checks passed
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.

6 participants