Skip to content

feat(sdk-lib-mpc): add EdDSA DSG MPS class#8599

Open
vibhavgo wants to merge 1 commit intomasterfrom
feat/eddsa-dsg-class
Open

feat(sdk-lib-mpc): add EdDSA DSG MPS class#8599
vibhavgo wants to merge 1 commit intomasterfrom
feat/eddsa-dsg-class

Conversation

@vibhavgo
Copy link
Copy Markdown
Contributor

Summary

This PR introduces the DSG (Distributed Sign Generation) class for EdDSA MPCv2 in sdk-lib-mpc, wrapping the @bitgo/wasm-mps WASM bindings for the 2-of-3 threshold Multi-Party Schnorr signing protocol. The class follows the same design pattern as the existing DKG class — explicit round-state management with session export/restore — so state can be persisted to a database between HTTP round-trips.

Ticket: WCI-164

Changes

  • dsg.ts — New DSG class with 4-round state machine (Init → WaitMsg1 → WaitMsg2 → WaitMsg3 → Complete), wrapping ed25519_dsg_round{0..3}_process. getSession() / restoreSession() serialise state to/from JSON for DB persistence.
  • types.ts — Adds DsgState enum mirroring DkgState.
  • index.ts — Exports DSG under the EddsaMPSDsg namespace.
  • test/unit/tss/eddsa/dsg.ts — Tests covering: full 2-of-3 signing across all
    party-pair combos, session restore continuity, message serialization, derivation-path
    differentiation, and error-handling guards.
  • test/unit/tss/eddsa/util.ts — Adds runEdDsaDSG test helper.

Test Plan

  • yarn unit-test --scope @bitgo/sdk-lib-mpc — all tests pass
  • All three 2-of-3 party pairs produce identical signatures verifying under DKG pubkey
  • Session export/restore produces same signature as an uninterrupted session

CLOSES TICKET: WCI-164

@vibhavgo vibhavgo marked this pull request as ready for review April 22, 2026 09:28
@vibhavgo vibhavgo requested review from a team as code owners April 22, 2026 09:28
Introduces the DSG (Distributed Sign Generation) class for EdDSA
MPCv2 using the @bitgo/wasm-mps WASM bindings. The class mirrors the
existing DKG pattern with explicit state management and session
export/restore support for server-side persistence across rounds.

- Add `DSG` class with 4-round signing protocol state machine
  (Init → WaitMsg1 → WaitMsg2 → WaitMsg3 → Complete)
- Add `DsgState` enum to types.ts
- Export `EddsaMPSDsg` namespace from index.ts
- Add `runEdDsaDSG` test helper to util.ts
- Add unit tests covering full 2-of-3 signing, session restore,
  message serialization, error handling, and derivation paths

Ticket: WCI-164
@vibhavgo vibhavgo force-pushed the feat/eddsa-dsg-class branch from ae4f5eb to e058c93 Compare April 22, 2026 11:40
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