Skip to content

fix(sdk-coin-tia,sdk-coin-zeta): accept tx-level memo in verifyTransaction - #10238

Draft
hitansh-madan wants to merge 2 commits into
masterfrom
hitanshmadan/coins-2752-tiazeta-verifytransaction-rejects
Draft

hitansh-madan wants to merge 2 commits into
masterfrom
hitanshmadan/coins-2752-tiazeta-verifytransaction-rejects

Conversation

@hitansh-madan

Copy link
Copy Markdown
Contributor

Problem

TIA withdrawals from the web UIs (bitgo-ui, bitgo-retail) fail client-side with Tx outputs does not match with expected txParams recipients whenever a memo is entered. Approving a memo-bearing TIA withdrawal from pending approvals fails the same way. ZETA has the identical override and the same failure.

Reported in prod: wallet 6706ba1fef768ea6b4b61416fad307d9 sent recipients: [{address: <bare celestia1…>}] plus memo: "0". Wallet-platform built the tx with memo 0, and the SDK rejected it before signing.

Root cause

Tia.verifyTransaction and Zeta.verifyTransaction (from #9944 / CSHLD-1780) compare {address, amount, memo} against explainTransaction().outputs, but take the recipient memo only from the ?memoId= address suffix:

  • The web UIs send a bare address plus a tx-level txParams.memo (isAddressMemoRequired is false for cosmos coins).
  • Pending-approval re-signs rebuild txParams from the intent; resolveEffectiveTxParams restores intent.memo into txParams.memo.

In both cases the tx output has a memo, the expected recipient has none, and _.isEqual fails. The API shape (addr?memoId=X) passes, which is why #9944 looked correct from the API side.

Fix

Port the sdk-coin-atom verifier (#10113, COINS-2285) to sdk-coin-tia/src/tia.ts and sdk-coin-zeta/src/zeta.ts:

  • Expected memo comes from the ?memoId= suffix, recipient.memo, or txParams.memo.value.
  • All declared sources must agree; conflicting declarations are rejected.
  • Empty strings count as absent (memo: '' from cleared UI fields).
  • A declared memo must match the tx memo exactly. When no memo is declared, the tx must not carry one, so an unapproved memo is still rejected.

No change to wallet-platform: it already builds the memo from intent.memo (or the suffix when there's no intent memo), rejects conflicts, and never injects a default memo. No UI code change; the UIs need an SDK bump after release.

Behaviour

Case Before After
Bare address + txParams.memo matching the tx (web UI) fail pass
Bare address + txParams.memo not matching the tx fail fail
addr?memoId=X (API) pass pass
Suffix and txParams.memo conflict fail fail
No memo, or memo: '', tx without memo pass pass
No memo declared, tx carries one fail fail
Pending-approval re-sign with intent.memo fail pass

Tests

New cases in sdk-coin-tia/test/unit/tia.ts and sdk-coin-zeta/test/unit/zeta.ts:

  • tx-level memo matching the tx → passes
  • tx-level memo not matching → rejected
  • suffix and tx-level memo conflicting → rejected
  • empty tx-level memo, tx without memo → passes
  • re-sign from a persisted intent through resolveEffectiveTxParams → passes

Existing cases unchanged, including "recipient has no memoId but the tx has one" (now the undeclared-memo case).

Verification

Check Result
mocha 'test/unit/**/*.ts' in sdk-coin-tia 85 passing
mocha 'test/unit/**/*.ts' in sdk-coin-zeta 85 passing
tsc --build modules/sdk-coin-tia modules/sdk-coin-zeta clean
eslint --quiet + prettier --check on changed files clean
Before/after matrix on real fixture txs for ttia, tzeta, tatom (throwaway script, not committed) matches the table above; tatom already passed on master

Out of scope

Ticket: COINS-2752

The web UIs send TIA recipients as a bare address plus a tx-level
txParams.memo, and pending-approval re-signs restore intent.memo into
txParams.memo via resolveEffectiveTxParams. The verifyTransaction
override only read the memo from the address ?memoId= suffix, so any
memo-bearing UI withdrawal or approval failed with 'Tx outputs does not
match with expected txParams recipients'.

Take the expected memo from the ?memoId= suffix, recipient.memo or
txParams.memo.value. All declared sources must agree, and empty strings
count as absent. A declared memo must match the transaction memo; when
none is declared the transaction must not carry one. Ports the
sdk-coin-atom fix (COINS-2285).

Ticket: COINS-2752
ZETA carries the same suffix-only verifyTransaction override as TIA, so
web UI withdrawals (bare address plus tx-level txParams.memo) and
pending-approval re-signs of memo-bearing transfers failed with 'Tx
outputs does not match with expected txParams recipients'.

Take the expected memo from the ?memoId= suffix, recipient.memo or
txParams.memo.value. All declared sources must agree, and empty strings
count as absent. A declared memo must match the transaction memo; when
none is declared the transaction must not carry one. Ports the
sdk-coin-atom fix (COINS-2285).

Ticket: COINS-2752
@linear-code

linear-code Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

COINS-2752

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

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