MetaMask / MetaMask/metamask-mobile

Help protect dapps against wrong-network confusion

Open
#2,334 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-transactions team-wallet-api-platform-deprecated type-enhancement type-security
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

Mobile version of #10577

As non-mainnet uses increase, we will more often see dapps accidentally suggesting transactions on the wrong network.

We should provide safety mechanisms to help prevent this scenario.

Simple proposed solution

  • Add optional chain_id parameter to all key-related methods.
  • If this parameter is missing from a transaction, warn the user to verify the network (Nudge dapps to always include this parameter)
  • If this parameter is different than the current selected network, return an informative response/error to the dapp, for suggesting network switching.
  • Coordinate the change between products.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with mobile issue #10577 and trace the key-related methods and selected-network transaction flow in this repository. Define how an optional chain_id should be handled when absent or mismatched, how the dapp receives a warning or error, and how the change should be coordinated across products.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
blockchain, mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.