MetaMask / MetaMask/metamask-mobile
Help protect dapps against wrong-network confusion
Open
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_idparameter 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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