Skip to content

feat(mbe): use customSigning fns for MPC eddsa#66

Merged
pranavjain97 merged 1 commit intomasterfrom
WP-5246-custom-signing-fns-sendmany
Jul 11, 2025
Merged

feat(mbe): use customSigning fns for MPC eddsa#66
pranavjain97 merged 1 commit intomasterfrom
WP-5246-custom-signing-fns-sendmany

Conversation

@pranavjain97
Copy link
Copy Markdown
Contributor

Ticket: WP-5246

@pranavjain97 pranavjain97 requested a review from Copilot July 10, 2025 21:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements custom signing functions for MPC EdDSA algorithms to enable proper integration with the enclaved express client. The main change is extending the existing ECDSA MPCv2 custom signing pattern to support EdDSA algorithms.

  • Refactors sendMany handling to use custom signing functions for both ECDSA and EdDSA MPC algorithms
  • Creates new EdDSA custom signing functions that maintain state between signing rounds
  • Updates test coverage to reflect the new unified MPC signing approach

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/api/master/handlers/handleSendMany.ts Refactors MPC signing logic to support both ECDSA and EdDSA with custom signing functions
src/api/master/handlers/eddsa.ts Adds custom EdDSA signing function factory and updates existing handler to use them
src/api/master/clients/enclavedExpressClient.ts Exports SignMpcCommitmentResponse interface for external use
src/__tests__/api/master/signAndSendTxRequest.test.ts Adds comprehensive test coverage for both ECDSA and EdDSA signing workflows
src/__tests__/api/master/sendMany.test.ts Updates EdDSA test to reflect new unified MPC approach
src/__tests__/api/master/eddsa.test.ts Re-enables EdDSA tests and removes obsolete mocking

Comment thread src/api/master/handlers/handleSendMany.ts Outdated
Comment thread src/api/master/handlers/handleSendMany.ts Outdated
customGShareGenerator: CustomGShareGeneratingFunction;
} {
// Create state to maintain data between rounds
let commitmentResponse: SignMpcCommitmentResponse;
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

The commitmentResponse variable is declared but not initialized, which could lead to runtime errors if customRShareGenerator or customGShareGenerator are called before customCommitmentGenerator. Consider initializing with undefined or adding explicit undefined checks.

Suggested change
let commitmentResponse: SignMpcCommitmentResponse;
let commitmentResponse: SignMpcCommitmentResponse | undefined = undefined;

Copilot uses AI. Check for mistakes.
@pranavjain97 pranavjain97 force-pushed the WP-5246-custom-signing-fns-sendmany branch 2 times, most recently from 017bf3f to 8ae179e Compare July 10, 2025 21:50
@pranavjain97 pranavjain97 force-pushed the WP-5246-custom-signing-fns-sendmany branch from 8ae179e to b56e3da Compare July 10, 2025 21:53
@pranavjain97 pranavjain97 enabled auto-merge July 10, 2025 22:00
createEddsaCustomSigningFunctions(enclavedExpressClient, source, commonKeychain);

return {
...(req.decoded as SendManyOptions),
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.

curious why you need to do this? Ideally your parameters should be a subset of SendManyOptions

@pranavjain97 pranavjain97 merged commit 4dfab42 into master Jul 11, 2025
3 checks passed
@pranavjain97 pranavjain97 deleted the WP-5246-custom-signing-fns-sendmany branch July 11, 2025 19:59
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