feat(mbe): use custom signing fns for mpcv2 signing/sendmany#61
feat(mbe): use custom signing fns for mpcv2 signing/sendmany#61pranavjain97 merged 10 commits intomasterfrom
Conversation
d7a913a to
4ab0f79
Compare
fd13360 to
cf25a92
Compare
Ticket: WP-5232
cf25a92 to
f4288f9
Compare
| } else { | ||
| // For non-ECDSA algorithms, return the original parameters | ||
| return req.decoded as SendManyOptions; | ||
| } |
There was a problem hiding this comment.
The function name createEcdsaMPCv2SendParams doesn't match the comment. makes it seem the function is specifc for mpcv2 but you handle other wallet types as well.
There was a problem hiding this comment.
not sure what you mean; it only returns custom fns for mpcv2 + the given send params
| // if (params.commonKeychain && signingKeychain.commonKeychain !== params.commonKeychain) { | ||
| // throw new Error( | ||
| // `Common keychain provided does not match the keychain on wallet for ${params.source}`, | ||
| // ); | ||
| // } |
There was a problem hiding this comment.
remove comments.
| if (wallet.multisigType() === 'tss') { | ||
| if (signingKeychain.source === 'backup') { | ||
| throw new Error('Backup MPC signing not supported for sendMany'); | ||
| } |
There was a problem hiding this comment.
it's not supported for utxos either from what I recall.
There was a problem hiding this comment.
sure - but not part of mpc branch
There was a problem hiding this comment.
Pull Request Overview
This PR replaces legacy MPC signing flows with custom ECDSA MPCv2 signing functions, renames GPG key parameters for consistency, and consolidates EDDSA and ECDSA handlers to work directly on TxRequest objects.
- Rename
bitgoGpgPubKeytobitgoPublicGpgKeyin API spec and handlers. - Introduce
createEcdsaMPCv2CustomSignersand wire it intosendManyand transaction endpoints. - Refactor EDDSA and ECDSA MPCv2 signing code to accept full
TxRequestobjects and remove outdated methods.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/enclavedBitgoExpress/routers/enclavedApiSpec.ts | Rename GPG key field and restrict shareType to known literals |
| src/api/master/handlers/transactionRequests.ts | Add unified signAndSendTxRequests for EDDSA and ECDSA MPC flows |
| src/api/master/handlers/handleSendMany.ts | Implement ECDSA MPCv2 custom signers and remove old code paths |
| src/api/master/handlers/generateWallet.ts | Update ECDSA key generation import to new ecdsaMPCv2 module |
| src/api/master/handlers/eddsa.ts | Refactor EDDSA signing to accept TxRequest and rename key param |
| src/api/master/handlers/ecdsaMPCv2.ts | Create custom ECDSA MPCv2 signer generators and refactor sender |
| src/api/master/clients/enclavedExpressClient.ts | Update MPCv2 methods to include source/pub and rename param |
| src/api/enclaved/handlers/signMpcTransaction.ts | Update unified handler to use renamed fields and typed shareType |
| src/tests/api/master/sendMany.test.ts | Adjust tests for new sendMany flow and rename parameter stubs |
| src/tests/api/master/eddsa.test.ts | Skip EDDSA tests until new custom flow is in place |
| src/tests/api/master/ecdsa.test.ts | Switch to new signAndSendEcdsaMPCv2FromTxRequest entry point |
| src/tests/api/enclaved/signMpcTransaction.test.ts | Update tests for renamed GPG key field and share-type handling |
Comments suppressed due to low confidence (3)
src/api/master/handlers/handleSendMany.ts:8
- Imported
PrebuildTransactionResultbut the code usesPrebuildTransactionOptions. Replace or add the correct import forPrebuildTransactionOptionsfrom@bitgo/sdk-coreto ensure the type is available.
PrebuildTransactionResult,
src/api/master/handlers/handleSendMany.ts:5
- [nitpick] The
KeyIndicesimport is not used in this file and can be removed to improve readability and avoid dead code.
KeyIndices,
src/api/master/handlers/ecdsaMPCv2.ts:7
- [nitpick] The
SupplementGenerateWalletOptionsimport is not referenced elsewhere in this module and should be removed to reduce unused dependencies.
SupplementGenerateWalletOptions,
Ticket: WP-5232