Skip to content

fix(sdk-coin-sol): default recipient tokenName on token wallets - #10020

Open
Marzooqa wants to merge 1 commit into
masterfrom
marzooqanaeemakather/wci-2009-fix-sol-token-transfer-failures-in-the-mpcv2-flow
Open

Marzooqa wants to merge 1 commit into
masterfrom
marzooqanaeemakather/wci-2009-fix-sol-token-transfer-failures-in-the-mpcv2-flow

Conversation

@Marzooqa

@Marzooqa Marzooqa commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

SOL token transfers sent with explicit txParams recipients that carry no tokenName fail local verification with Tx outputs does not match with expected txParams recipients (WCI-2009).

Root cause. Sol.verifyTransaction compares each recipient to the parsed tx output. For a token transfer the output address is the recipient's associated token account (ATA), so the check only passes when it can derive that ATA from the recipient's owner address, which requires recipient.tokenName. A recipient of { address, amount } on a token wallet (e.g. tsol:usdcv2) has no tokenName, so the ATA branch is skipped and the check returns false.

Fix. On a token wallet getChain() is the token itself, so a recipient without tokenName is still a token transfer. Sol.verifyTransaction now defaults a missing tokenName to this.getChain() when the coin is a token. Native SOL wallets are unaffected. An explicitly supplied tokenName is never overridden, so a wrong token still fails verification.

This supersedes the earlier recipientUtils resolver approach on this branch, which only affected the EdDSA MPCv2 intent-rebuild path and did not cover this case.

Issue Number

WCI-2009

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Reproduced locally through bitgo-express on staging: POST /api/v2/tsol:usdcv2/wallet/<id>/sendcoins with {address, amount} failed with the error above before the change and succeeds after it.
  • New unit test in sdk-coin-sol/test/unit/sol.ts using a tsol:usdc token coin: a recipient without tokenName verifies, and a wrong amount is still rejected. It fails with the fix reverted.
  • Full sdk-coin-sol unit suite passes (876). eslint and prettier clean.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My commits follow Conventional Commits and I have properly described any BREAKING CHANGES
  • The ticket or github issue was included in the commit message as a reference
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

WCI-2009

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@Marzooqa
Marzooqa force-pushed the marzooqanaeemakather/wci-2009-fix-sol-token-transfer-failures-in-the-mpcv2-flow branch from c966f80 to 3fce1af Compare October 21, 2026 13:47
@Marzooqa Marzooqa changed the title fix(sdk-coin-sol): resolve SOL token recipient names in MPCv2 verify-before-sign fix(sdk-core): resolve intent token names for EdDSA MPCv2 signing Oct 21, 2026
@Marzooqa Marzooqa changed the title fix(sdk-core): resolve intent token names for EdDSA MPCv2 signing fix(sdk-coin-sol): default recipient tokenName on token wallets Oct 23, 2026
@Marzooqa
Marzooqa force-pushed the marzooqanaeemakather/wci-2009-fix-sol-token-transfer-failures-in-the-mpcv2-flow branch from ff246bc to 13e7807 Compare October 23, 2026 10:20
Token transfers sent with explicit txParams recipients that carry no
tokenName failed local verification with "Tx outputs does not match
with expected txParams recipients". On a token wallet getChain() is the
token itself, so a recipient without tokenName is still a token
transfer; default it so the ATA derivation check can match.

Ticket: WCI-2009

Co-Authored-By: Claude <noreply@anthropic.com>
@Marzooqa
Marzooqa force-pushed the marzooqanaeemakather/wci-2009-fix-sol-token-transfer-failures-in-the-mpcv2-flow branch from 13e7807 to e25cd94 Compare October 23, 2026 10:24
@Marzooqa
Marzooqa marked this pull request as ready for review October 23, 2026 12:14
@Marzooqa
Marzooqa requested a review from a team as a code owner October 23, 2026 12:14

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Marzooqa
Marzooqa requested a review from danielpeng1 October 23, 2026 14:57

This branch has not been deployed

No deployments
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