Skip to content

feat(dkg): add EdDSA MPCv2 AWM client methods and ME callback factory#256

Draft
bitgo-ai-agent-dev[bot] wants to merge 2 commits into
WCI-895-eddsa-mpcv2-keygen-callback-factory-pt1from
WCI-895-eddsa-mpcv2-keygen-callback-factory-pt2
Draft

feat(dkg): add EdDSA MPCv2 AWM client methods and ME callback factory#256
bitgo-ai-agent-dev[bot] wants to merge 2 commits into
WCI-895-eddsa-mpcv2-keygen-callback-factory-pt1from
WCI-895-eddsa-mpcv2-keygen-callback-factory-pt2

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Add three methods to AdvancedWalletManagerClient (WCI-893):
    • eddsaMPCv2KeyGenInitialize — calls POST /api/{coin}/eddsampcv2/keygen/initialize
    • eddsaMPCv2KeyGenRound1 — calls POST /api/{coin}/eddsampcv2/keygen/round1
    • eddsaMPCv2KeyGenFinalize — calls POST /api/{coin}/eddsampcv2/keygen/finalize
  • Add createEddsaMPCv2KeyGenCallbacks factory in walletGenerationCallbacks.ts (WCI-895): wraps user + backup AWM clients into an EddsaMPCv2KeyGenCallbacks object
  • Add local EddsaMPCv2KeyGenCallbacks type definitions (mirrors WCI-894 shape; replaced by SDK import once published)
  • Add 3 unit tests covering parallel fan-out and result merging for each callback phase

Why

  • The AKM EdDSA MPCv2 key generation upgrade (WCI-888) uses the external-signer callback pattern: ME provides callbacks that delegate WASM/GPG/DKG to AWM, the SDK orchestrates via createKeychainsWithExternalSigner (WCI-916). This PR wires the ME side of that contract.
  • Each callback fans both AWM clients in parallel so user and backup key shares are generated concurrently, halving latency.

Test plan

  • npm run tsc -- --noEmit passes
  • npm test — all 403 tests pass (400 existing + 3 new)
  • npm run lint — no errors
  • Integration test coverage via WCI-896 (follow-up ticket)

Stack

This PR is part 2 of 2 in a stack. Review and merge in order:

  1. feat(dkg): add EdDSA MPCv2 keygen API spec entries and route stubs to AWM #255 — AWM API spec types + route stubs (base: master)
  2. feat(dkg): add EdDSA MPCv2 AWM client methods and ME callback factory #256 — AWM client methods + ME callback factory + tests (base: pt1) ← you are here

Ticket: WCI-895

@linear-code

linear-code Bot commented Jul 8, 2026

Copy link
Copy Markdown

WCI-895

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the WCI-895-eddsa-mpcv2-keygen-callback-factory-pt2 branch from 48a0e2e to d5bc087 Compare July 8, 2026 16:37
Add io-ts request/response types and three new route entries to
AdvancedWalletManagerApiSpec for the EdDSA MPCv2 DKG protocol:
  - POST /api/{coin}/eddsampcv2/keygen/initialize
  - POST /api/{coin}/eddsampcv2/keygen/round1
  - POST /api/{coin}/eddsampcv2/keygen/finalize

Each route is wired in createKeyGenRouter with a NotImplementedError
stub; the real handlers land in WCI-892. The type exports are needed
by the ME client added in the next PR (WCI-893).

Ticket: WCI-895
Session-Id: 4df43c40-1cea-4bcc-ae92-080304169427
Task-Id: 04666b37-650f-4c07-97b0-76a62e98f1ad
@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the WCI-895-eddsa-mpcv2-keygen-callback-factory-pt1 branch 2 times, most recently from 0b9c357 to c13f9e0 Compare July 8, 2026 16:44
Add three methods to AdvancedWalletManagerClient (WCI-893):
  - eddsaMPCv2KeyGenInitialize
  - eddsaMPCv2KeyGenRound1
  - eddsaMPCv2KeyGenFinalize

Each method calls the corresponding AWM endpoint added in the
previous PR, with mTLS agent support.

Add createEddsaMPCv2KeyGenCallbacks factory in
walletGenerationCallbacks.ts (WCI-895): wraps user and backup AWM
clients into an EddsaMPCv2KeyGenCallbacks object whose initialize,
round1, and finalize callbacks fan both clients out in parallel and
merge results for the SDK orchestrator (WCI-916). This replaces the
inline WASM/GPG/DKG key gen logic with AWM-delegated calls, enabling
hardware-backed key generation in the AKM pattern.

Local EddsaMPCv2KeyGenCallbacks type mirrors the WCI-894 shape; it
will be replaced by the SDK import once published.

Three unit tests verify parallel fan-out and result merging for each
callback phase using nock.

Ticket: WCI-895
Session-Id: 4df43c40-1cea-4bcc-ae92-080304169427
Task-Id: 04666b37-650f-4c07-97b0-76a62e98f1ad
@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the WCI-895-eddsa-mpcv2-keygen-callback-factory-pt2 branch 2 times, most recently from 5f093c1 to b758edc Compare July 8, 2026 16:45
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.

0 participants