Skip to content

feat: migrate remaining sync decrypt/encrypt calls#8908

Draft
bdesoky wants to merge 1 commit into
masterfrom
WCN-284-non-breaking
Draft

feat: migrate remaining sync decrypt/encrypt calls#8908
bdesoky wants to merge 1 commit into
masterfrom
WCN-284-non-breaking

Conversation

@bdesoky
Copy link
Copy Markdown
Contributor

@bdesoky bdesoky commented Jun 1, 2026

Ticket: WCN-284

This pull request introduces significant improvements to the BitGo SDK's cryptographic operations by adding asynchronous versions of key decryption, encryption, and verification functions. These changes modernize the codebase, improve support for v2 encryption, and ensure that cryptographic operations do not block the event loop. The updates affect multiple modules, including UTXO, Cosmos, Lightning, and Express, and also update related tests.

Key improvements include:

Asynchronous Cryptographic Operations

  • Replaced synchronous decrypt, encrypt, and related keychain methods with their asynchronous counterparts (decryptAsync, encryptAsync) across Lightning, Cosmos, UTXO, and Express modules, ensuring non-blocking cryptographic operations throughout the codebase. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

Asynchronous Key Verification

  • Added verifyUserPublicKeyAsync to abstract-utxo and updated all relevant code paths to use the async version, while retaining the synchronous method for backward compatibility. This ensures compatibility with v2 encryption and improves security practices. [1] [2] [3] [4] [5] [6] [7]

Refactoring and Internal API Updates

  • Refactored internal helper functions to support async cryptographic operations, such as getBip32KeysAsync and verifyUserPublicKeyWithPrv, and updated their usages throughout the codebase. [1] [2] [3] [4] [5]

Express API and Test Updates

  • Updated Express API endpoints and test stubs to use the new async cryptographic methods, ensuring consistency and proper async handling in API routes and unit tests. [1] [2] [3] [4] [5] [6] [7]

Deprecation and Backward Compatibility

  • Marked synchronous verification methods as deprecated, guiding developers to use the new async methods for future development while maintaining backward compatibility for legacy code. [1] [2] [3]

These changes collectively modernize the SDK's cryptographic operations, improve compatibility with newer encryption standards, and lay the groundwork for future enhancements.

@bdesoky bdesoky requested review from a team as code owners June 1, 2026 16:59
@bdesoky bdesoky requested a review from margueriteblair June 1, 2026 16:59
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 1, 2026

WCN-284

@bdesoky bdesoky requested a review from lokesh-bitgo June 1, 2026 16:59
@bdesoky bdesoky marked this pull request as draft June 1, 2026 17:09
@bdesoky bdesoky force-pushed the WCN-284-non-breaking branch 2 times, most recently from 8ddd2ea to dc430f9 Compare June 1, 2026 18:14
@bdesoky bdesoky force-pushed the WCN-284-non-breaking branch from dc430f9 to 9e1eb22 Compare June 1, 2026 18:18
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.

1 participant