Skip to content

fix(sdk-core): preserve tokenName and add SOL no-recipient intents - #9388

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-1110-fix-resolve-effective-tx-params-sol
Draft

fix(sdk-core): preserve tokenName and add SOL no-recipient intents#9388
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-1110-fix-resolve-effective-tx-params-sol

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • recipientUtils.tsresolveEffectiveTxParams: accepts a new optional chainName parameter and now maps tokenName from intent recipients. Prefers intentRecipient.tokenData?.tokenName (structured field), falls back to intentRecipient.amount.symbol when it differs from the native chain symbol and is non-empty — mirroring the logic already in txParamsFromIntent. Empty-string tokenName is treated as absent (same as txParamsFromIntent's && guard). symbolIsToken is now explicitly typed boolean using symbol.length > 0.
  • NO_RECIPIENT_TX_TYPES: three new SOL EdDSA intent types added: stakingDelegate, stakingDeactivate, closeAssociatedTokenAccount. stakingAuthorize is intentionally not added (high-risk authority reassignment — must be validated at the coin layer).
  • Tests: WCN-196 regression suite covering the tsol:usdc sendMany path that originally caused the revert; plus per-type tests for each new SOL allowlist entry, an explicit assertion that stakingAuthorize still throws, edge cases for empty-string tokenName, mixed native+token recipients, data field preservation, and legacy ECDSA callers with tokenData.

Why

resolveEffectiveTxParams dropped tokenName when building recipients from the persisted intent. SOL token sendMany (e.g. tsol:usdc) requires tokenName so verifyTransaction can derive the Associated Token Account address for comparison; without it every token transfer failed with "Tx outputs does not match". This was the exact root cause of the production incident in WCN-196 (PR #9117 reverted in commit 96658f105f).

The three new SOL entries cover intent types that WP issues with no on-chain recipient (staking delegation, deactivation, and ATA-close). Without them the fail-closed guard in resolveEffectiveTxParams would throw on every staking/ATA-close operation for SOL MPCv2 wallets once this function is wired into the EdDSA signing path (sibling ticket WCI-1111).

Existing ECDSA callers (ecdsaMPCv2.ts, ecdsa.ts) do not pass chainName, so their behavior is unchanged — tokenData?.tokenName is still propagated for ECDSA token transfers and the symbol-based fallback is gated on chainName being present.

Test plan

  • yarn run unit-test --scope @bitgo/sdk-core -- -- --grep "recipientUtils" — all new and existing recipientUtils tests pass
  • Existing ECDSA tests in ecdsaMPCv2.ts / ecdsa.ts unit suites pass (no signature change for them)

Ticket: WCI-1110

@linear-code

linear-code Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

WCI-1110

@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 13fb3a5 to ace42a1 Compare July 30, 2026 07:33
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from ace42a1 to 345d3d6 Compare July 30, 2026 07:33
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 4b79462 to 4b081db Compare July 30, 2026 07:51
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 4b081db to 290f30a Compare July 30, 2026 08:50
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 290f30a to 907a783 Compare July 30, 2026 08:50
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 907a783 to 34d4e18 Compare July 30, 2026 08:53
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 34d4e18 to af6b667 Compare July 30, 2026 08:53
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from af6b667 to 26550db Compare July 30, 2026 08:56
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 26550db to 2e44d7a Compare July 30, 2026 08:56
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 2e44d7a to fff9cd3 Compare July 30, 2026 08:56
@Marzooqa Marzooqa changed the title fix(sdk-core): preserve tokenName in resolveEffectiveTxParams; add SOL no-recipient intent types fix(sdk-core): preserve tokenName and add SOL no-recipient intents Jul 30, 2026
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 5829934 to cd7129d Compare July 30, 2026 09:02
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from cd7129d to 187be6c Compare July 30, 2026 09:02
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 187be6c to a814d7e Compare July 30, 2026 09:13
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from a814d7e to 50cc94e Compare July 30, 2026 09:13
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch 2 times, most recently from 1016ca9 to 95e9486 Compare July 30, 2026 09:35
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 95e9486 to 38918c9 Compare July 30, 2026 09:35
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 38918c9 to 6b7da7f Compare July 30, 2026 10:34
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 6b7da7f to 974c1b5 Compare July 30, 2026 10:34
What changed:
- resolveEffectiveTxParams now accepts an optional chainName parameter and
  preserves tokenName when mapping intent recipients from the persisted intent.
  Prefers intentRecipient.tokenData?.tokenName (structured field); falls back
  to amount.symbol when truthy and different from the native chain symbol —
  identical to the existing txParamsFromIntent logic in baseTSSUtils.ts.
- NO_RECIPIENT_TX_TYPES: added three SOL EdDSA no-recipient intent types:
  stakingDelegate, stakingDeactivate, closeAssociatedTokenAccount.
  stakingAuthorize is intentionally NOT listed (high-risk authority change;
  must be validated at the coin layer, not bypassed here).
- Tests: WCN-196 regression suite covering the tsol:usdc sendMany path that
  caused PR #9117 to be reverted; per-type tests for each new SOL allowlist
  entry; explicit assertion that stakingAuthorize still throws; edge cases for
  empty-string tokenName, mixed native+token recipients, data field preservation,
  and legacy ECDSA callers with tokenData.

Why:
resolveEffectiveTxParams dropped tokenName when building recipients from the
persisted intent. SOL token sendMany (e.g. tsol:usdc) requires tokenName so
verifyTransaction can derive the Associated Token Account address for
comparison; without it every token transfer fails with 'Tx outputs does not
match'. This was the root cause of the production incident in WCN-196 that
caused PR #9117 to be reverted (commit 96658f1).

The three new SOL entries cover intent types WP issues with no on-chain
recipient (staking delegation, deactivation, and ATA-close). Without them the
fail-closed guard would throw on every staking/ATA-close operation for SOL
MPCv2 wallets once resolveEffectiveTxParams is wired into the EdDSA signing
path (sibling ticket WCI-1111).

Existing ECDSA callers (ecdsaMPCv2.ts, ecdsa.ts) do not pass chainName so
their behavior is unchanged.

References: WCI-1110, WCI-1100, WCN-196
Session-Id: 94a72c0d-fce8-4672-a6a4-26df25a64dfc
Task-Id: 76f4312b-c52c-4478-94f6-457913e8c0b7
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 974c1b5 to 7568d18 Compare July 30, 2026 10:38
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 7568d18 to c686500 Compare July 30, 2026 10:38
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from c686500 to 6bcaa0c Compare July 30, 2026 10: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