Skip to content

Emergency tool to recover NFTs from a compromised wallet

Notifications You must be signed in to change notification settings

vblackwhale/nft-recovery-tool

Repository files navigation

NFT Recovery Tool

Emergency tool to recover NFTs from a compromised wallet. Works on Polygon and can be adapted for other EVM chains.

Author: blackwhale.eth

This tool was developed to successfully recover NFTs from a compromised wallet that was being monitored by a sweeper bot. You can view the compromised wallet here: https://polygonscan.com/address/0x6f278db79a32ae52d57c4f10a737879c3a615c84

Strategy

The recovery process has three phases:

  1. Disperse: Fund multiple deterministic wallets derived from a secure wallet
  2. Approve: Spam approval transactions from compromised wallet using multiple RPCs (check success on Polygonscan)
  3. Extract: Transfer NFTs to secure wallet once approval is confirmed

Setup

  1. Install dependencies:
npm install
  1. Create .env:
MAIN_RPC_URL=your_rpc_url
SAVER_WALLET_PK=your_secure_wallet_pk
COMPROMISED_WALLET_PK=compromised_wallet_pk
  1. Add RPC endpoints to providers.ts. Get more from Chainlist

Usage

  1. Run disperse script to fund derived wallets:
npm run disperse
  1. Start approval spam:
npm run approve
  1. Check Polygonscan for successful approval

  2. Run transfer script:

npm run extract

Important Notes

  • Have sufficient MATIC in secure wallet for gas
  • Uses high gas price for speed
  • Check Polygonscan to confirm approval before extracting
  • Can be modified for other EVM chains by changing RPC endpoints

Security

  • Run on secure machine
  • Never share private keys
  • Verify all addresses before running

License

MIT

About

Emergency tool to recover NFTs from a compromised wallet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published