Skip to content

feat: implement EdDSA MPS DKG key gen orchestration#8523

Merged
Marzooqa merged 1 commit intomasterfrom
WCI-5
Apr 17, 2026
Merged

feat: implement EdDSA MPS DKG key gen orchestration#8523
Marzooqa merged 1 commit intomasterfrom
WCI-5

Conversation

@Marzooqa
Copy link
Copy Markdown
Contributor

@Marzooqa Marzooqa commented Apr 16, 2026

Summary

Implements EddsaMPCv2Utils in sdk-core — the SDK orchestrator for EdDSA DKG using the MPS protocol.

Changes

sdk-lib-mpc — PGP comms layer

  • New commsLayer.ts with detachSignMpsMessage and verifyMpsMessage, exported as MPSComms.
  • Adds MPSSignedMessage type to types.ts.

sdk-core — Key generation

  • New EddsaMPCv2Utils with a 2-round createKeychains flow: generates Ed25519/X25519 GPG keys for user and backup, runs EddsaMPSDkg.DKG for each party, PGP-signs and exchanges messages over POST /mpc/generatekey (MPS-R1, MPS-R2), verifies BitGo's signed responses, cross-checks the derived commonPublicKey, then persists all three keychains.
  • New MPSKeyGenSenderForEnterprise sender with type: MPCv2, keyCurve: EdDSA.

bitgo — Unit tests

  • 3 tests: full DKG round-trip, per-participant keychain creation, and rejection on invalid BitGo PGP signature.

TICKET: WCI-5

@linear
Copy link
Copy Markdown

linear bot commented Apr 16, 2026

@Marzooqa Marzooqa marked this pull request as ready for review April 16, 2026 10:55
@Marzooqa Marzooqa requested review from a team as code owners April 16, 2026 10:55
Base automatically changed from WCI-175 to master April 16, 2026 14:48
Copy link
Copy Markdown
Contributor

@zahin-mohammad zahin-mohammad left a comment

Choose a reason for hiding this comment

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

Reviewed the EdDSA MPS implementation against the ECDSA DKLS conventions. Behavior looks correct; leaving inline notes on drifts we should close before merging. Retrofit is expected to come later — not flagged.

Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts Outdated
Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts Outdated
Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts Outdated
Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts Outdated
Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts Outdated
Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2KeyGenSender.ts Outdated
Comment thread modules/sdk-core/src/bitgo/utils/tss/eddsa/index.ts Outdated
Copy link
Copy Markdown
Contributor

@zahin-mohammad zahin-mohammad left a comment

Choose a reason for hiding this comment

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

Test coverage notes — the happy path and one failure branch are covered, but several explicit invariants in the production code are untested. Inline suggestions below.

Comment thread modules/bitgo/test/v2/unit/internal/tssUtils/eddsaMPCv2/createKeychains.ts Outdated
@Marzooqa Marzooqa force-pushed the WCI-5 branch 2 times, most recently from c8889ca to 9ff9752 Compare April 17, 2026 16:36
TICKET: WCI-5

fix(sdk-core): address PR review comments on EdDSA MPCv2 key gen

- Re-export EddsaMPCv2KeyGenSendFn, KeyGenSenderForEnterprise, and MPCv2
  types from eddsa index to match ECDSA export pattern
- Add reducedEncryptedPrv round-trip assertions to createParticipantKeychain
  tests to catch regressions in btoa browser-safe encoding path
- Seed bitgoMPCv2PublicGpgKey in fallback test to fix fire-and-forget
  constructor race with beforeEach nock setup

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

TICKET: WCI-5
Copy link
Copy Markdown
Contributor

@zahin-mohammad zahin-mohammad left a comment

Choose a reason for hiding this comment

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

All review feedback addressed apart from the feature-flag fallback test, which can ship as a follow-up.

@Marzooqa Marzooqa merged commit 9026945 into master Apr 17, 2026
36 of 37 checks passed
@Marzooqa Marzooqa deleted the WCI-5 branch April 17, 2026 17:42
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