Skip to content

Comments

fix(mcp): enforce strict wallet network matching in CDP strategy#34

Open
Lutra23 wants to merge 1 commit intomicrochipgnu:mainfrom
Lutra23:fix/strict-network-matching
Open

fix(mcp): enforce strict wallet network matching in CDP strategy#34
Lutra23 wants to merge 1 commit intomicrochipgnu:mainfrom
Lutra23:fix/strict-network-matching

Conversation

@Lutra23
Copy link

@Lutra23 Lutra23 commented Feb 22, 2026

Summary

CDPSigningStrategy currently treats mainnet/testnet as compatible by “family” (e.g. base and base-sepolia) and also falls back to any active wallet when no compatible wallet is found. This blurs network domain separation for payment signing.

This PR enforces strict matching:

  • A wallet is only considered compatible when walletNetwork === targetNetwork.
  • If there is no matching wallet for the requested network, we return a clear error instead of attempting to sign with a wallet from a different network.

Repro (before)

  1. Have only a base-sepolia CDP wallet active.
  2. Trigger a payment requirement for base.
  3. Strategy considers the wallet compatible (family match) and/or falls back to active wallets, leading to cross-network signing attempts.

Impact

  • Prevents accidental cross-network wallet usage (mainnet vs testnet).
  • Makes failure modes explicit and actionable (create/activate a wallet on the requested network).

Behavior change (expected)

This is a tightening change: flows that previously “worked by accident” via family/fallback may now return an error if no wallet exists on the target network.

@vercel
Copy link

vercel bot commented Feb 22, 2026

@Lutra23 is attempting to deploy a commit to the Inventions Hub Team on Vercel.

A member of the Team first needs to authorize it.

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