DEV Community

Kevin
Kevin

Posted on

Revoke Approvals or Move to a New Wallet If a Key Leaked

Revoke a bad approval when your key is safe; move funds to a new wallet when your recovery phrase or private key may be exposed.

The difference is who can act on your wallet. An approval lets a particular spender contract use particular tokens. A private key lets its holder sign transactions for the address, including transfers and new approvals. Revoking removes a contract’s permission; it cannot remove an attacker’s ability to sign with a stolen key.

Start by identifying what you signed and which address was affected. Use revokecash to inspect that address’s active approvals and approval history, then revoke an unfamiliar spender on every affected chain. The Etherscan Token Approval Checker offers another way to inspect approvals on Ethereum. Neither tool can tell you whether someone has copied your recovery phrase.

How Do You Tell an Approval Problem From a Key Problem?

The deciding evidence is whether the suspicious event gave a contract spending permission or exposed the wallet’s signing key. Treat a phrase entered on a website, shared with someone, or stored in a cloud account as exposed. The same applies to a private key. Create a wallet with a fresh recovery phrase and move the remaining assets there. Revoking approvals on the old address cannot secure a key someone else holds.

What you signed. An ERC-20 token allowance is permission for a named spender to use up to a set amount of one token. An ERC-721 operator approval lets an operator manage NFTs from a collection; an approval for one NFT has a narrower scope. If you signed a phishing approval and kept your key private, revoke the affected permission promptly. Once the revocation confirms, that approval can no longer be used for future spending. It cannot reverse a transfer that already happened.

Which assets moved. A malicious approval points to a spender and the tokens it was allowed to use. Key exposure puts every asset controlled by the address at risk, including the chain’s native coin, which needs no token approval to move. Repeated unauthorized transactions, especially across chains, are reason to treat the key as exposed. One stolen token is not proof either way: a scam may have obtained an approval or tricked you into signing a direct transfer.

The visible transaction helps resolve that confusion. Look for an approval granting a spender access, then compare it with the outgoing transfer. A direct transfer you signed moves the asset immediately; revoking an unrelated allowance will not undo it. An attacker using a copied key can sign a transfer from your address or grant a fresh allowance after you revoke the old one. When you cannot establish that the key stayed private, move the remaining funds.

Cost and effort. Revoking usually requires a transaction and network gas for each approval you remove. Moving requires a fresh wallet, transfers for the assets you hold, and enough gas on each affected chain. The cost varies with the chains, assets, and current network fees. These costs matter when you have only an approval problem; they do not change the choice when a key may be exposed.

Who Should Revoke, and Who Should Move?

Revoke approvals when you can identify the suspicious permission and have no reason to think your phrase or key was exposed. Review ERC-20 allowances and ERC-721 operator approvals, including other permissions granted during the same session. Remove the unwanted ones and confirm the transactions. You can continue using the address once those permissions are gone, provided you have ruled out other malicious signatures.

Say you approved an unfamiliar contract to spend a token, noticed the request immediately, and revoked it before the contract used the allowance. The token remains at the same address. Before revocation, that spender could take the approved amount; afterward, it cannot use that allowance. Your wallet key and any other active approvals stay as they were. This is a case where a quick revocation can close the identified risk without moving the wallet.

Move funds when your recovery phrase or private key may have left your control. Generate a new phrase in a trusted wallet on a device you trust, record it securely, and transfer the remaining assets to its new address. Verify the destination address and network before sending. Review each chain you used, including tokens and NFTs, because protecting one chain’s balance does not move assets held elsewhere.

Migration has a second step that is easy to miss: the old approvals remain attached to the old address. As an illustrative case, suppose you move a token from Address A to fresh Address B. The suspicious allowance on A stays active even though A’s token balance is now zero. If an exchange withdrawal, saved payment address, or later transfer sends that token back to A, the approved spender can use it again. After moving assets, revoke the old approvals where you can, update saved withdrawal addresses, and stop using A. If a sweeper is taking gas as soon as it arrives, do not send more funds to A just to attempt revocations.

A leaked key makes the old address unsafe even after its allowances are removed. The attacker can sign a new approval or transfer any asset that returns. Leaving old allowances active gives an attacker another ready route to spend eligible tokens. Keep the new phrase separate from the old one; importing the exposed phrase into a different wallet app creates the same addresses and leaves the attacker’s access in place.

Related Questions

How do I know if my seed phrase is compromised?

Your seed phrase is compromised if you entered it on a site, shared it, or kept it somewhere an attacker may have accessed, such as a breached cloud account. Unauthorized transfers without a matching approval are another warning sign. You may not be able to prove who copied the phrase, so move funds when exposure is plausible.

What to do after signing a malicious transaction

After signing a malicious transaction, identify whether it was an approval or a direct transfer. Inspect the transaction and approval history, revoke any unwanted permissions, and move remaining assets if the phrase or key may also be exposed. A completed direct transfer cannot be undone by revoking.

Can a wallet drainer take my NFTs after I revoke?

A wallet drainer cannot use an ERC-721 operator approval after that approval has been successfully revoked. Review other NFT approvals and signatures you gave during the incident. If the drainer has your private key, it can still transfer NFTs or approve an operator again; move them to a wallet with a new phrase.

Top comments (0)