Skip to content

feat(sdk-core): add getEddsaMPCv2RecoveryKeyShares helper#8918

Draft
vibhavgo wants to merge 1 commit into
masterfrom
WCI-396/sdk-core
Draft

feat(sdk-core): add getEddsaMPCv2RecoveryKeyShares helper#8918
vibhavgo wants to merge 1 commit into
masterfrom
WCI-396/sdk-core

Conversation

@vibhavgo
Copy link
Copy Markdown
Contributor

@vibhavgo vibhavgo commented Jun 2, 2026

Summary

Adds and exports getEddsaMPCv2RecoveryKeyShares — a standalone helper that decrypts both EdDSA MPCv2 reduced keycards in parallel, validates that pub and rootChainCode match independently, and returns typed Buffer key shares with the derived commonKeyChain.

Ticket: WCI-396

Changes

  • Parallel decryption of user and backup keycards via Promise.all
  • Separate validation of pub and rootChainCode with distinct error messages
  • Try-catch around getDecodedReducedKeyShare to surface a descriptive error for missing/malformed keycard fields
  • Clear unsupported error for v2 (Argon2id) envelopes detected via isV2Envelope
  • 7 unit tests: v1 happy path, v2 rejection, missing keyShare/pub/rootChainCode, mismatched pub, mismatched rootChainCode

Test Plan

  • yarn run unit-test --scope @bitgo/sdk-core -- -- --grep "getEddsaMPCv2RecoveryKeyShares" — all 7 tests pass

CLOSES TICKET: WCI-396

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 2, 2026

WCI-396

Decrypt both keycards in parallel, validate pub and rootChainCode
separately with distinct errors, and surface a clear message when
keycard material is missing or a v2 Argon2id envelope is detected.
Adds 7 unit tests covering happy path, field validation, and
pub/rootChainCode mismatch cases.

Ticket: WCI-396
@vibhavgo vibhavgo force-pushed the WCI-396/sdk-core branch from 6c41269 to 2451c14 Compare June 2, 2026 12: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