Skip to content

test(express): add EdDSA MPCv2 external-signer DSG round-trip test#8942

Merged
vibhavgo merged 1 commit into
masterfrom
WCI-634
Jun 5, 2026
Merged

test(express): add EdDSA MPCv2 external-signer DSG round-trip test#8942
vibhavgo merged 1 commit into
masterfrom
WCI-634

Conversation

@vibhavgo

@vibhavgo vibhavgo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a full 3-round DSG round-trip test for the EdDSA MPCv2 external-signer path to modules/express/test/unit/clientRoutes/externalSign.ts
  • Fills the last gap in the external-signer test matrix — legacy EdDSA v1 (commitment/R/G), ECDSA MPCv2, and EdDSA MPCv2 are now all covered
  • Introduces signBitgoEddsaMPCv2Round1/2/3 BitGo-side DSG simulator helpers, the EdDSA analog of the existing signBitgoMPCv2Round1/2/3 (ECDSA)

Approach

The test drives handleV2GenerateShareTSS through all three rounds with real WASM sessions (MPSUtil.generateEdDsaDKGKeyShares + EddsaMPSDsg.DSG). The GPG comms layer (MPSComms.detachSignMpsMessage / verifyMpsMessage) is stubbed so the test exercises only the WASM DSG protocol without requiring openpgp or @noble/curves as direct express dependencies — consistent with how the legacy EdDSA v1 test uses only SDK-level abstractions (MPC.keyShare, MPC.verify) and the ECDSA MPCv2 test uses DklsComms which wraps GPG internally.

Final signature is verified cryptographically via Node.js built-in crypto.verify (Ed25519) against the BIP-32-derived public key (deriveUnhardenedMps), matching the assertion patterns of the other round-trip tests.

Test plan

BITGOJS_TEST_PASSWORD=x yarn mocha --timeout 180000 --grep "External signer"
# 11 passing

Closes WCI-634

@vibhavgo vibhavgo requested review from a team as code owners June 4, 2026 10:21
@vibhavgo vibhavgo requested review from mrdanish26 and ranga-r2 June 4, 2026 10:21
@linear-code

linear-code Bot commented Jun 4, 2026

Copy link
Copy Markdown

WCI-634

@vibhavgo vibhavgo requested a review from Marzooqa June 4, 2026 10:21
Ticket: WCI-634

Adds a full 3-round DSG round-trip test for the EdDSA MPCv2 external-signer
path to externalSign.ts, filling the last gap in the external-signer test
matrix (legacy EdDSA v1, ECDSA MPCv2, and EdDSA MPCv2 are now all covered).

- Generates real DKG key shares via MPSUtil.generateEdDsaDKGKeyShares()
- Drives handleV2GenerateShareTSS for Round1→2→3 with real WASM sessions
- Adds signBitgoEddsaMPCv2Round1/2/3 helpers (BitGo-side DSG simulator)
  using EddsaMPSDsg.DSG + MPSComms stubs, mirroring signBitgoMPCv2Round1/2/3
- GPG layer is stubbed (MPSComms.detachSignMpsMessage/verifyMpsMessage) so
  the test exercises only the WASM DSG protocol without requiring openpgp or
  @noble/curves as direct express dependencies — consistent with how the
  legacy EdDSA v1 test uses only SDK-level abstractions
- Final assertion verifies the Ed25519 signature cryptographically via
  Node.js built-in crypto.verify against the BIP-32-derived public key
  (deriveUnhardenedMps), consistent with MPC.verify in the legacy EdDSA v1
  test and DklsUtils.verifyAndConvertDklsSignature in the ECDSA MPCv2 test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vibhavgo vibhavgo merged commit 7fb1a84 into master Jun 5, 2026
22 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.

2 participants