Skip to content

feat: add async counterparts for public encrypt/decrypt methods#8876

Open
bdesoky wants to merge 1 commit into
masterfrom
WCN-284
Open

feat: add async counterparts for public encrypt/decrypt methods#8876
bdesoky wants to merge 1 commit into
masterfrom
WCN-284

Conversation

@bdesoky
Copy link
Copy Markdown
Contributor

@bdesoky bdesoky commented May 27, 2026

Ticket: WCN-284

This pull request introduces async versions of several cryptographic and wallet management methods in the BitGo SDK, aiming to modernize the codebase and improve compatibility with v2 encryption. It also updates and expands the test suites to cover these new async methods, ensuring both backward compatibility and robust error handling. The most significant changes are grouped below:

Async Cryptographic Methods and API Enhancements

  • Added decryptKeysAsync, an async method for decrypting multiple wallet keys with v2 encryption support, and updated related documentation and error handling.
  • Added handleTokenIssuanceAsync, an async method for securely handling authentication responses and token issuance, and refactored internal usage to prefer the async version. [1] [2] [3]
  • Added splitSecretAsync and reconstituteSecretAsync for Shamir Secret Sharing, providing async support for splitting and reconstructing secrets, with improved input validation and error messages. [1] [2]
  • Updated keychain addition and encryption flows to use encryptAsync for private key encryption, ensuring consistency with async cryptography.
  • Marked several legacy sync methods for deprecation in favor of their async counterparts, preparing for a future transition to v2 encryption by default. [1] [2] [3]

Test Suite Updates and Coverage

  • Refactored BitGo prototype method tests to use async versions (splitSecretAsync, reconstituteSecretAsync, verifyShardsAsync) and added comprehensive new tests for all async Shamir Secret Sharing flows, including error cases and success scenarios. [1] [2]
  • Added new tests for handleTokenIssuanceAsync and updated authentication response handling tests to use async methods.
  • Introduced async test coverage for wallet methods such as encryptPrvForUserAsync and downloadKeycardAsync, including error handling for Node.js environments and correct output validation. [1] [2]

These changes modernize the SDK's cryptographic workflows, improve test coverage, and lay the groundwork for a full migration to async and v2 encryption methods.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 27, 2026

WCN-284

@bdesoky bdesoky force-pushed the WCN-284 branch 2 times, most recently from c863c6e to 7b61eb3 Compare May 27, 2026 20:59
@bdesoky bdesoky changed the title feat: migrate remaining v1 encrypt callsites to async feat: add async counterparts for public encrypt/decrypt methods May 27, 2026
@bdesoky bdesoky marked this pull request as ready for review May 27, 2026 21:05
@bdesoky bdesoky requested review from a team as code owners May 27, 2026 21:05
@bdesoky bdesoky requested review from danielpeng1 and ranga-r2 May 27, 2026 21:05
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