Skip to content

feat(sdk-core): add externalSigner createOfflineRound3Share handler#8853

Merged
vibhavgo merged 1 commit into
masterfrom
WCI-478
May 26, 2026
Merged

feat(sdk-core): add externalSigner createOfflineRound3Share handler#8853
vibhavgo merged 1 commit into
masterfrom
WCI-478

Conversation

@vibhavgo
Copy link
Copy Markdown
Contributor

Add the EdDSA MPCv2 offline round-3 handler for external signer flows. It restores the encrypted round-2 DSG session and emits the final user signature share without persisting further signing state.

  • Restore DSG state from the encrypted round-2 session payload.
  • Verify BitGo round-2 output from txRequest signature shares before advancing DSG.
  • Generate the final EdDSA MPCv2 round-3 signature share for BitGo.
  • Cover happy path, v2 envelopes, adata tampering, missing BitGo share, and transaction guard cases in unit tests.

Ticket: WCI-478

@vibhavgo vibhavgo requested review from a team as code owners May 26, 2026 06:08
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 26, 2026

WCI-478

@vibhavgo vibhavgo requested a review from Marzooqa May 26, 2026 06:09
Marzooqa
Marzooqa previously approved these changes May 26, 2026
Copy link
Copy Markdown
Contributor

@Marzooqa Marzooqa left a comment

Choose a reason for hiding this comment

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

Implementation is correct — session restore, userMsgPayload carry-over, type-aware reverse scan for BitGo's round-2 share (necessary since both round-1 and round-2 BitGo shares are present by this point), and no session re-encryption on the final round all look good. Test coverage mirrors round 2 exactly. One minor nit carried over from #8834: the assert(Array.isArray(transactions) && transactions.length === 1, ...) after getSignableHexAndDerivationPath is dead code — safe to remove in a follow-up.

Base automatically changed from WCI-477 to master May 26, 2026 09:22
@vibhavgo vibhavgo dismissed Marzooqa’s stale review May 26, 2026 09:22

The base branch was changed.

@vibhavgo
Copy link
Copy Markdown
Contributor Author

One minor nit carried over from #8834: the assert(Array.isArray(transactions) && transactions.length === 1, ...) after getSignableHexAndDerivationPath is dead code — safe to remove in a follow-up.

From TypeScript narrowing perspective, the local assert is still useful, because TS does not understand that a previous helper call proved txRequest.transactions is defined.
src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts:635:29 - error TS18048: 'transactions' is possibly 'undefined'.

635 const signatureShares = transactions[0].signatureShares;

@vibhavgo vibhavgo requested a review from Marzooqa May 26, 2026 09:24
Add the EdDSA MPCv2 offline round-3 handler for external signer flows.
It restores the encrypted round-2 DSG session and emits the final user
signature share without persisting further signing state.

- Restore DSG state from the encrypted round-2 session payload.
- Verify BitGo round-2 output from txRequest signature shares before advancing DSG.
- Generate the final EdDSA MPCv2 round-3 signature share for BitGo.
- Cover happy path, v2 envelopes, adata tampering, missing BitGo share,
  and transaction guard cases in unit tests.

Ticket: WCI-478
@vibhavgo vibhavgo merged commit 31e1d5f into master May 26, 2026
22 checks passed
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.

2 participants