Skip to content

feat(awm): add EdDSA MPCv2 key generation handler, types and route - #282

Draft
Marzooqa wants to merge 1 commit into
masterfrom
wci-892-awm-handler-types-route-for-eddsa-mpcv2-key-gen
Draft

Marzooqa wants to merge 1 commit into
masterfrom
wci-892-awm-handler-types-route-for-eddsa-mpcv2-key-gen

Conversation

@Marzooqa

@Marzooqa Marzooqa commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Add a single AWM handler (src/advancedWalletManager/handlers/eddsaMPCV2WalletGeneration.ts) with a shareType switch matching the ecdsaEddsaSignTransaction pattern
  • Add one route POST /api/{coin}/eddsampcv2/keygen/{shareType} (v1.eddsampcv2.keygen) with per-share request/response codecs in advancedWalletManagerApiSpec.ts
  • Add handler tests

Handler behavior

  • initialize: generates an ed25519 GPG keypair and a data key; returns the GPG public key, the data-key-encrypted GPG private key and the encrypted data key
  • round1 / round2 / finalize: decrypt the data key and delegate to EddsaMPCv2Utils.createOfflineKeyGenRound{1,2}Share / createOfflineKeyGenFinalizeShare, passing partyId derived from source on every round (required by the SDK's validateAdata session binding)
  • finalize also stores the key share via the key provider postKey and returns { commonKeychain, source }
  • Per-share required-field validation rejects with 400

Why

  • WCI-892 of the EdDSA MPCv2 external-signer key generation plan (WCI-888): AWM handlers are thin wrappers that only do key-provider encrypt/decrypt and delegate to the SDK methods

Dependencies

  • Stacked on the beta bump PR (bump-versions-2026-10-12) because the SDK offline key generation methods only exist in @bitgo-beta/sdk-core ≥ 8.2.1-beta.2107. This PR's diff against the bump branch is exactly the three new-code files. Retarget to master once the bump merges.

Test plan

  • initialize returns a GPG public key, the data-key-encrypted GPG private key and the encrypted data key
  • round1 delegates to createOfflineKeyGenRound1Share with the source-derived partyId (USER and BACKUP both covered)
  • round2 delegates to createOfflineKeyGenRound2Share with the round-1 session and both round-1 messages
  • finalize delegates to createOfflineKeyGenFinalizeShare and stores the key share via postKey with { coin, source, pub, prv, type: 'tss' }
  • Rejects unsupported share types and missing required fields with 400
  • Full AWM test suite against the bumped SDK: 446 passing, 0 failing
  • ESLint clean on changed files

Ticket: WCI-892

@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown

WCI-892

Add a single AWM handler (eddsaMPCV2WalletGeneration.ts) with a
shareType switch matching the ecdsaEddsaSignTransaction pattern, one
route (POST /api/{coin}/eddsampcv2/keygen/{shareType}) with per-share
request/response codecs in advancedWalletManagerApiSpec.ts, and
handler tests.

- initialize: generates an ed25519 GPG keypair and data key, returns
  the GPG public key, the data-key-encrypted GPG private key and the
  encrypted data key
- round1/round2/finalize: decrypt the data key and delegate to
  EddsaMPCv2Utils.createOfflineKeyGenRound{1,2}Share and
  createOfflineKeyGenFinalizeShare, passing partyId derived from
  source on every round (required by the SDK's validateAdata session
  binding)
- finalize also stores the key share via the key provider postKey and
  returns { commonKeychain, source }
- per-share required-field validation rejects with 400

Ticket: WCI-892
@Marzooqa
Marzooqa force-pushed the wci-892-awm-handler-types-route-for-eddsa-mpcv2-key-gen branch from 1c97394 to 19a6f46 Compare October 14, 2026 08:32
@Marzooqa Marzooqa mentioned this pull request Oct 14, 2026
@Marzooqa
Marzooqa changed the base branch from master to bump-versions-2026-10-12 October 14, 2026 08:33
Base automatically changed from bump-versions-2026-10-12 to master October 14, 2026 14:05

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