fix(sdk-lib-mpc): authenticate signatureR in DKLS DSG round 4 messages#8470
Open
mrdanish26 wants to merge 2 commits intomasterfrom
Open
fix(sdk-lib-mpc): authenticate signatureR in DKLS DSG round 4 messages#8470mrdanish26 wants to merge 2 commits intomasterfrom
mrdanish26 wants to merge 2 commits intomasterfrom
Conversation
Comment on lines
+1048
to
+1050
| const parsedSignatureShare = JSON.parse(userShare.share) as MPCv2SignatureShareRound3Input & { | ||
| data: { msg4: { signatureRSignature?: string } }; | ||
| }; |
Contributor
There was a problem hiding this comment.
why not update the type instead of casting it?
Contributor
Author
There was a problem hiding this comment.
I have added signatureRSignature on the shared round‑3 msg4 type in @bitgo/public-types: https://github.com/BitGo/public-types/pull/339 . Will remove the cast once that is merged
Contributor
09a86ef to
f135d5e
Compare
Annotate PostSendMany, PostSendCoins, PostWalletSignTx, and PostWalletTxSignTSS as HttpRoute<'post'> so declaration emit stays within TS limits. WAL-376
f135d5e to
905a4ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DKLS DSG round 4 — authenticate
signatureRsignatureRbytes with the party GPG key inencryptAndAuthOutgoingMessages()— previously a hardcoded empty signature left the ECDSA nonce commitment R unauthenticated (F-04, severity: HIGH).signatureRindecryptAndVerifyIncomingMessages()before returning it to callers.signatureRandsignatureRSignatureon round-3 / round-4 plumbing so the server can authenticate R beforecombinePartialSignatures()(aligned with@bitgo/public-types).Types & SDK wiring
@bitgo/public-types(e.g. 5.92.0) somsg4includessignatureRSignatureand the flow is typed end-to-end (reduces need for ad-hoc casts in tests).sdk-core: requiresignatureR.message/signatureR.signaturewhere applicable; setsignatureR+signatureRSignatureonmsg4forMPCv2SignatureShareRound3Input.expresstests (externalSign): passsignatureRauth when bothsignatureRandsignatureRSignatureare present; soft downgrade when not.Express build (TS7056)
httpRouteexports asHttpRoute<'post'>(PostSendMany,PostSendCoins,PostWalletSignTx,PostWalletTxSignTSS) so.d.tsdeclaration emit stays under TypeScript’s serialization limit; updatetypedRoutes/api/index.tsnotes accordingly.Test plan
sdk-lib-mpcunit tests (sign/verify round-trip, tampered R, wrong key, no-signatureR/ soft-downgrade cases as applicable)sdk-core/bitgotests for MPCv2 / external-sign paths@bitgo/expressbuilds (tsc; TS7056 resolved for the routes above)Ticket: WAL-376