Skip to content

fix(sdk-core): pass txParams on EdDSA MPCv2 re-sign and PA paths#9061

Open
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-765-fix-eddsa-mpcv2-txparams
Open

fix(sdk-core): pass txParams on EdDSA MPCv2 re-sign and PA paths#9061
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-765-fix-eddsa-mpcv2-txparams

Conversation

@bitgo-ai-agent-dev

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot commented Jun 18, 2026

Copy link
Copy Markdown

Summary

EdDSA MPCv2 TSOL signing fails on the pending-approval (PA) path with:

failed to sign transaction Error: Number of tx outputs does not match with number
of txParams recipients

Root cause: eddsaMPCv2.signRequestBase re-verifies the transaction against
txParams.recipients before DSG starts:


  await this.baseCoin.verifyTransaction({
    txPrebuild: { txHex: unsignedTx.serializedTxHex ?? txOrMessageToSign },
    txParams: params.txParams || { recipients: [] },  // ← falls back to []
    ...
  });

Solana's verifyTransaction does a strict length check:

if (filteredRecipients.length !== filteredOutputs.length) {
  throw new Error('Number of tx outputs does not match with number of txParams
recipients');
}

Why ECDSA MPCv2 is unaffected: ETH's verifyTssTransaction gates its strict
recipient checks on txParams.type. Without a type, those checks are skipped and {
recipients: [] } passes silently.

Why EdDSA MPCv1 is unaffected: MPCv1's signRequestBase does not call
verifyTransaction with txParams in normal flows.

Fix

Derive txParams from the persisted txRequest.intent inside recreateTxRequest,
guarded to EdDSA MPCv2 only — matching the pattern established by WCI-505:

Ticket: WCI-765

@linear-code

linear-code Bot commented Jun 18, 2026

Copy link
Copy Markdown

WCI-765

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the wci-765-fix-eddsa-mpcv2-txparams branch from 83641a6 to 5fe3aca Compare June 18, 2026 11:22
EdDSA MPCv2 verifyTransaction() compares txParams.recipients to parsed
tx outputs before MPC signing. On re-sign and pending-approval flows
txParams was never derived, causing a "Number of tx outputs does not
match number of txParams recipients" error.

Add txParamsFromIntent() which maps the persisted IntentRecipient
shape on txRequest.intent into the flat ITransactionRecipient shape
expected by verifyTransaction callers.

Wire it in two places:
- recreateTxRequest: derive txParams after fetching the fresh
  txRequest so PA approve → auto-sign completes correctly.
- signTransactionTss: when buildParams is absent (re-sign via
  signAndSendTxRequest), fetch the txRequest and derive txParams
  so UI re-sign completes correctly.

Existing buildParams / sendMany paths are unchanged; the new
derivation only runs when buildParams is not already present.

Ticket: WCI-765
Session-Id: 1c44b40e-24c1-49b1-b454-86318c9a44a2
Task-Id: bad80f2c-73b6-4826-a6ee-49cc4344544c
@Marzooqa Marzooqa force-pushed the wci-765-fix-eddsa-mpcv2-txparams branch from 5fe3aca to f2a4114 Compare June 18, 2026 13:08
@Marzooqa Marzooqa marked this pull request as ready for review June 18, 2026 14:38
@Marzooqa Marzooqa requested review from a team as code owners June 18, 2026 14:38
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.

1 participant