Repository navigation
feat: add eddsa mpcv2 custom signers in master express - #279
Conversation
f89f76a to
8ec3045
Compare
8ec3045 to
c84ded3
Compare
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
c84ded3 to
3911af8
Compare
|
@claude review, focusing on gaps in types, casting, and other cleanups |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Marzooqa
left a comment
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
🟡 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.
Summary
Add
createEddsaMPCv2CustomSigners()tosrc/masterBitgoExpress/handlers/eddsa.ts, mirroringcreateEcdsaMPCv2CustomSignersinecdsa.ts:signMPCv2Round1/2/3()client methods withcurveType: 'eddsa'Round 1 must be completed before Round 2,Round 2 must be completed before Round 3Depends on the
curveTypeclient params from WCI-924 (base branch).Testing
New
src/__tests__/api/master/eddsaMpcv2Signing.test.ts(5 tests):curveType: 'eddsa'curveType: 'eddsa'curveType: 'eddsa'Regression: master suites (eddsaMpcv2Signing + ecdsa + eddsa) — 455 passing, 0 failing.
Ticket: WCI-925
Linear: https://linear.app/bitgo/issue/WCI-925