Skip to content

feat: add eddsa mpcv2 custom signers in master express - #279

Merged
vibhavgo merged 1 commit into
masterfrom
WCI-925-eddsa-mpcv2-custom-signers
Oct 19, 2026
Merged

vibhavgo merged 1 commit into
masterfrom
WCI-925-eddsa-mpcv2-custom-signers

Conversation

@vibhavgo

Copy link
Copy Markdown
Contributor

Summary

Add createEddsaMPCv2CustomSigners() to src/masterBitgoExpress/handlers/eddsa.ts, mirroring createEcdsaMPCv2CustomSigners in ecdsa.ts:

  • Stateful round-generator closures capture the round 1 and round 2 AWM responses
  • All three generators call the existing signMPCv2Round1/2/3() client methods with curveType: 'eddsa'
  • Rounds 2/3 forward the encrypted data key, session state, and user GPG prv key captured from the previous round
  • Explicit precondition errors for out-of-order round calls: Round 1 must be completed before Round 2, Round 2 must be completed before Round 3

Depends on the curveType client params from WCI-924 (base branch).

Testing

New src/__tests__/api/master/eddsaMpcv2Signing.test.ts (5 tests):

  • Round 1 generator calls AWM with curveType: 'eddsa'
  • Round 2 generator forwards round 1 encrypted state + curveType: 'eddsa'
  • Round 3 generator forwards round 1 + round 2 encrypted state + curveType: 'eddsa'
  • Round 2 before round 1 and round 3 before round 2 throw the exact error strings
    Regression: master suites (eddsaMpcv2Signing + ecdsa + eddsa) — 455 passing, 0 failing.

Ticket: WCI-925
Linear: https://linear.app/bitgo/issue/WCI-925

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

WCI-925

@vibhavgo
vibhavgo added this pull request to stack #280 October 13, 2026 11:13
@vibhavgo
vibhavgo marked this pull request as ready for review October 13, 2026 11:22
@vibhavgo
vibhavgo requested review from a team as code owners October 13, 2026 11:22
@vibhavgo
vibhavgo force-pushed the WCI-925-eddsa-mpcv2-custom-signers branch from f89f76a to 8ec3045 Compare October 14, 2026 10:19
@vibhavgo
vibhavgo force-pushed the WCI-925-eddsa-mpcv2-custom-signers branch from 8ec3045 to c84ded3 Compare October 15, 2026 18:21
Base automatically changed from WCI-923-add-curvetype-sign-request to master October 16, 2026 06:16
Add createEddsaMPCv2CustomSigners() to master express eddsa.ts, mirroring
the ECDSA MPCv2 custom signer pattern. Stateful round generator closures
call the existing signMPCv2Round1/2/3() client methods with curveType
'eddsa', capture round 1/2 responses, and forward the encrypted data key,
session state and user GPG prv key into the next round. Precondition
failures are explicit for out-of-order round calls.

Ticket: WCI-925
@vibhavgo
vibhavgo force-pushed the WCI-925-eddsa-mpcv2-custom-signers branch from c84ded3 to 3911af8 Compare October 16, 2026 06:16
@danielpeng1

Copy link
Copy Markdown
Contributor

@claude review, focusing on gaps in types, casting, and other cleanups

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@Marzooqa Marzooqa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving — reviewed against the ECDSA MPCv2 factory (createEcdsaMPCv2CustomSigners) and it mirrors it consistently. One non-blocking test-fixture note inline.

const mockRound1Response: SignMpcV2Round1Response = {
signatureShareRound1: { from: 'user', to: 'bitgo', share: 'mock-round1-share' },
userGpgPubKey: 'mock-user-gpg-pub-key',
encryptedRound1Session: 'mock-encrypted-round1-session',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium — Test fixtures can't prove captured-state forwarding. In eddsaMpcv2Signing.test.ts, the caller-supplied values are byte-identical to the captured-response values: encryptedRound1Session: 'mock-encrypted-round1-session' (fixture line 20 vs test input lines 100/134/172), encryptedUserGpgPrvKey (line 21 vs 99/133/139/171/185), encryptedRound2Session (line 26 vs 140/186). So assertions like line 112-113 pass even if the implementation forwarded the caller's param instead of the captured round-1 response — the PR's headline behavior isn't pinned. (encryptedDataKey is genuinely tested, since callers can't supply it.) Fix: use distinct strings, e.g. caller passes 'caller-round1-session' and assert the AWM param equals 'mock-encrypted-round1-session'.

Non-blocking — fine to address in a follow-up.

@vibhavgo
vibhavgo merged commit cb841cd into master Oct 19, 2026
24 checks passed
@vibhavgo
vibhavgo deleted the WCI-925-eddsa-mpcv2-custom-signers branch October 19, 2026 14:29
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.

3 participants