Skip to content

feat(me): add EdDSA MPCv2 key generation callback factory - #286

Draft
Marzooqa wants to merge 1 commit into
wci-893-me-eddsa-mpcv2-keygen-clientfrom
wci-895-me-eddsa-mpcv2-keygen-callbacks
Draft

Marzooqa wants to merge 1 commit into
wci-893-me-eddsa-mpcv2-keygen-clientfrom
wci-895-me-eddsa-mpcv2-keygen-callbacks

Conversation

@Marzooqa

Copy link
Copy Markdown
Contributor

What

  • Add createEddsaMPCv2KeyGenCallbacks(awmUserClient, awmBackupClient) to src/masterBitgoExpress/handlers/walletGenerationCallbacks.ts, returning the SDK's EddsaMPCv2KeyGenCallbacks four-callback contract:
    • initializeCallback — both AWMs generate GPG pairs; returns pubs + packed state
    • round1Callback — both AWMs run DKG round 1; returns signed msg1s + updated state
    • round2Callback — both AWMs run DKG round 2; returns signed msg2s + updated state
    • finalizeCallback — both AWMs finalize; asserts commonKeychain match; returns { commonKeychain }

Design notes

  • Finalize bridge: the SDK's finalizeCallback params do not include userSignedMsg2/backupSignedMsg2, but the user's finalize needs the backup's signed msg2 (and vice versa) — they are carried in the factory closure (same pattern as the ECDSA factory's inter-party messages)
  • State packing: per-party keygen state (encrypted data key, encrypted GPG prv, round-1/round-2 sessions, GPG pub keys) is threaded through the SDK's ExternalSignerMpcState as a JSON blob in encryptedData
  • Four-callback contract (not the incompatible three-callback variant on the stale WCI-895-pt1/pt2 branches, which collapsed SDK round 1 into initialize and SDK round 2 into round1)

Why

  • WCI-895 of the WCI-888 plan: the SDK orchestrator (EddsaMPCv2Utils.createKeychainsWithExternalSigner) drives the callbacks; this factory wires them to the AWM via the WCI-893 client method

Dependencies

  • Stacked on the WCI-893 PR (the client method this factory calls)

Test plan

  • tsc --noEmit clean; ESLint clean
  • Exercised end-to-end by WCI-918 routing tests and the WCI-896 E2E (follow-up)

Ticket: WCI-895

Add createEddsaMPCv2KeyGenCallbacks to walletGenerationCallbacks.ts,
implementing the SDK's EddsaMPCv2KeyGenCallbacks four-callback contract
(initialize, round1, round2, finalize). Each callback drives both the
user and backup AWM through the single shareType-parameterized keygen
route via the WCI-893 client method.

The counterparty round-2 signed messages — which finalize needs but the
SDK does not pass into finalizeCallback — are carried in the factory
closure (the finalize bridge). The per-party keygen state (encrypted
data key, encrypted GPG private key, round-1/round-2 sessions, GPG
pub keys) is threaded through the SDK's ExternalSignerMpcState as a
packed JSON blob.

Ticket: WCI-895
@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

WCI-895

This branch has not been deployed

No deployments
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