Skip to content

fix: reject overlong UTXO swap memos before signing#379

Merged
BitHighlander merged 1 commit into
developfrom
agent/validate-utxo-swap-memos
Jul 24, 2026
Merged

fix: reject overlong UTXO swap memos before signing#379
BitHighlander merged 1 commit into
developfrom
agent/validate-utxo-swap-memos

Conversation

@BitHighlander

Copy link
Copy Markdown
Collaborator

Summary

  • make swap memo validation source-aware: 80 bytes for UTXO OP_RETURN, 250 bytes elsewhere
  • skip overlong UTXO quotes during best-route selection instead of failing during device signing
  • enforce the same rule during preview and execution
  • replace the legacy signer wording with a clear route-refresh message in the swap UI
  • add BTC → USDT and UTF-8 byte-length regression coverage

Root cause

Vault enforced only THORChain's global 250-byte memo limit, while the current KeepKey UTXO signer supports a single 80-byte OP_RETURN. A full contract-qualified BTC → USDT memo therefore passed quote parsing and preview, then failed late during signing.

User impact

Unbuildable UTXO routes now fail or fall through before the confirmation screen. No quoted memo is rewritten client-side; Pioneer remains responsible for constructing the compact protocol memo.

Validation

  • bun test __tests__/swap-parsing.test.ts — 55 passed
  • bunx vite build — passed
  • git diff --check — passed

The repository-wide TypeScript check remains red on the existing baseline of unrelated errors; filtering its output to the touched files showed no new error at the changed lines.

@BitHighlander
BitHighlander marked this pull request as ready for review July 24, 2026 20:13
@BitHighlander
BitHighlander merged commit 010594a into develop Jul 24, 2026
2 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.

1 participant