MetaMask / MetaMask/metamask-extension
Soft-lock NFTs
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### Background
Drainers have been using signatures and `approveAll` transactions to trick users into malicious transactions. That, plus blind signing, made their business very profitable. We've been making efforts to mitigate these intents by raising contextual warnings and exploring opportunities to simulate transactions.
This initiative aims to reduce unwanted interactions with NFTs.
This initiative should be prioritized to reduce FLI.
### Acceptance Criteria
- Users are able to lock assets to prevent unwanted transaction interactions.
- Users are able to unlock assets to be able to transact.
- This interaction is not frictional.
- v1 - Only ERC-721 assets
- Vx - Increase asset's scope.
### Short Term
We propose to allow users to lock assets offline. It requires a local list of saved assets we will ping during a transaction request and reject if found. Users will be prompted to unlock their assets if they want to execute the transaction before the confirmation screen shows up. If they want to move forward, they will need to unlock the NFT first and then initiate the transaction again.
### User flow
1. User locks their fav NFT on the NFT detail page.
2. User receives a transaction request that affects the given NFT.
3. User is prompted with a warning message: " $origin wants to execute a transaction with a locked asset." The User can see which locked assets are being requested to transact.
4. a. User dismisses the message.
4. b. User goes to the NFT list and unlocks the NFT.
5. User initiates the transaction flow again.
### Usable security considerations
We are not considering warning users in the confirmation screen at this time. Mistakes in the confirmation screen are widespread and dangerous (one click to proceed).
We will introduce a pattern where we alert users _before_ exposing them to the confirmation page if a local setting is begin targeted.
### UI
**Mobile**

**Extension**

[WIP] https://www.figma.com/file/ClgQwhhN1BcAdYHuadeg8r/Lock-NFT?node-id=0%3A1&t=e4QFU5Qthx1wV9Er-1
### Metrics
TBD
### Long Term / Other ideas
- Allow users to hold multiple vaults in their MetaMask instance
- Allow users to lock accounts
- Allow users to lock multiple assets as one
- Do it on-chain via a delegated trust to let others manage specific assets
Contributor guide
Research direction
Start with the NFT detail page, NFT list, and transaction-request flow described in the issue, then compare the mobile and extension UI references. Done means users can lock and unlock ERC-721 assets, receive a warning before confirmation when a locked asset is targeted, and retry after unlocking; the issue provides no file or test entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100