Skip to content

fix(wasm-dot): validate SS58 destination network prefixes - #407

Draft
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-1892-dot-ss58-prefix
Draft

ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-1892-dot-ss58-prefix

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Sep 25, 2026

Copy link
Copy Markdown

What

  • Bind decoded SS58 prefixes to a chain address policy before encoding payment, consolidation, staking payee, proxy, and fillNonce destinations.
  • Add an explicit generic-prefix policy and require a verified prefix for unmapped chains; expose structured wrong-network errors and carry policy through parser contexts.
  • Add Rust and TypeScript regression coverage for Polkadot, Kusama, generic-prefix, malformed-address, and canonical parse-back behavior.

Why

  • SS58 prefixes identify network address domains. Silently discarding a valid but mismatched prefix can make an approved recipient appear as a different chain-form address when parsed from the signable call, undermining approval-time address-domain binding.

Test plan

  • git diff --check origin/master...HEAD (passed; no whitespace errors).
  • cargo test --manifest-path packages/wasm-dot/Cargo.toml — blocked: cargo and rustc are unavailable in this workspace.
  • cargo fmt --manifest-path packages/wasm-dot/Cargo.toml -- --check — blocked: cargo is unavailable.
  • npm test --prefix packages/wasm-dot and npm run build:ts --prefix packages/wasm-dot — blocked: node/npm, package node_modules, and generated js/wasm/wasm_dot.js are absent.
  • npm run build:wasm --prefix packages/wasm-dot — blocked: wasm-pack, cargo, and rustc are unavailable.

Ticket: WCN-1892

Validate recipient, payee, proxy, and self-transfer address prefixes
before producing call data. Propagate an explicit generic-prefix policy
through material and parser contexts, and cover mismatch regressions.

Wallet approvals must not accept addresses labeled for another network
then silently sign their AccountId in the selected chain.

Ticket: WCN-1892
Session-Id: 4408559a-0119-4900-9471-eb853265da1b
Task-Id: 3702a6ad-95cc-435a-8085-81d167f61534
@linear-code

linear-code Bot commented Sep 25, 2026

Copy link
Copy Markdown

WCN-1892

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.

2 participants