Unstake From a Compromised Wallet: Rescue Locked Tokens
By Merunas Grincalaitis, founder of MEV DAO and a developer who builds MEV, sniping and trading bots on Ethereum. Last updated: October 2026.
TL;DR: To unstake from a compromised wallet without handing your tokens to the attacker's sweeper bot, you must never send gas ETH directly to the hacked address and never initiate a standalone cooldown if the withdrawal automatically lands in the compromised EOA. Instead, use a private Flashbots bundle (eth_sendBundle) or EIP-7702 atomic batch that funds gas, triggers the claim/withdrawal, and sweeps the unlocked ERC-20 or ETH to a safe wallet in the exact same block.
When an attacker drains an Ethereum wallet, they steal liquid ETH and transferable ERC-20 tokens immediately, but they often leave behind staked positions, restaked EigenLayer shares, DeFi lending collateral, and time-locked vesting contracts. Victims then ask how to unstake from a compromised wallet before the cooldown expires and the attacker's sweeper bot steals the unlocked tokens.
I build and run rescue bundles for compromised Ethereum wallets. Below is the exact playbook for executing a rescue staked eth hacked wallet operation or saving vesting tokens compromised wallet positions across Lido, EigenLayer, Aave, and custom staking contracts.
Why staked and locked tokens survive the initial drain (and why they are still in danger)
Sweeper bots are automated scripts that watch your compromised address 24/7. Whenever liquid ETH lands in the wallet, the sweeper immediately signs a high-priority transfer to steal it. However, sweepers are lazy about non-liquid positions for two reasons:
- Unstaking cooldowns: Many protocols require a 7-to-14-day unbonding queue (such as EigenLayer withdrawals, Lido withdrawal queues, or protocol staking locks).
- Gas requirements: Because the compromised wallet has 0 ETH left, the attacker waits for you to panic, send 0.01 ETH for gas, and click "Unstake"—at which point their bot steals both your gas ETH and the unstaked tokens.
As we explain in Wallet Drained? What to Do in the First Hour (Ethereum Checklist), your #1 rule is never send plain ETH to a compromised wallet and never broadcast an unstake transaction to the public mempool.
The 4 staking & vesting architectures on Ethereum (and how each is rescued)
Before writing a single line of rescue code, inspect the staking or vesting contract on Etherscan to see how withdrawals work. Every unstake from compromised wallet case falls into one of four patterns:
| Staking / Lock Pattern | How Withdrawals Work | Examples | Rescue Strategy |
|---|---|---|---|
| 1. Transferable Receipt Token | Staking gave you a liquid ERC-20 (stETH, wstETH, rETH, aUSDC) |
Lido, Rocket Pool, Aave V3 | No unstake needed! Bundle gas + transfer() of the receipt token directly to your clean wallet. |
2. Instant Atomic Unstake (withdraw(amount)) |
Calling unstake() or exit() immediately returns the underlying ERC-20 in the same transaction |
Synthetix-style StakingRewards, MasterChef, Uniswap LP |
1-stage Flashbots bundle: [sponsor_gas, unstake(), token.transfer(safeWallet)] in the same block. |
3. Two-Step Queue (requestWithdraw → claim) |
Step 1 starts a timer; Step 2 (days later) releases tokens to msg.sender |
EigenLayer, Ethena sUSDe, custom lockups |
2-stage Flashbots operation: Bundle Step 1 privately; monitor unlock block; win block-0 of unlock with Step 2 + transfer. |
4. Recipient-Override Withdraw (withdraw(amount, receiver)) |
The withdrawal function accepts a address to or recipient parameter |
ERC-4626 vaults (redeem(shares, receiver, owner)), Sablier/Lockup |
Best-case scenario: Bundle [sponsor_gas, redeem(shares, safeWallet, hackedWallet)] so tokens never touch the hacked wallet! |
Pattern 1 & 4: Check for liquid receipt tokens or receiver parameters first!
Roughly 40% of people who message me asking how to unstake from a compromised wallet don't actually need to unstake from the hacked address at all:
- If you hold a liquid receipt token (
stETH,wstETH,rETH,cbETH,sDAI,weETH, or AaveaTokens): Unless the token's transfer function is paused, the receipt token itself is a standard ERC-20. You can rescue the receipt token directly to your clean hardware wallet using a standard Flashbots bundle, and unstake at your leisure from the safe wallet. - If the vault follows ERC-4626 (
withdraw(assets, receiver, owner)orredeem(shares, receiver, owner)): Standard ERC-4626 vaults let the compromisedownerspecify a differentreceiveraddress. When your Flashbots bundle callsvault.redeem(allShares, cleanWalletAddress, compromisedAddress), the vault burns the shares in the hacked wallet and sends the underlying tokens straight tocleanWalletAddress. Even if a sweeper bot is watching the hacked wallet, the underlying tokens never land there.
Pattern 2: Atomic unstake + sweep in a single Flashbots bundle
When the contract has no cooldown and sends tokens only to msg.sender (for example, stakingContract.exit() or vesting.claim()), you must execute three transactions back-to-back inside a single Flashbots bundle (eth_sendBundle):
Tx 1 (from Clean Sponsor Wallet): Send exact gas ETH (e.g. 0.0025 ETH) -> Compromised Wallet
Tx 2 (from Compromised Wallet): Call stakingContract.unstake(fullBalance)
Tx 3 (from Compromised Wallet): Call token.transfer(cleanWallet, unlockedAmount)
Because Flashbots, Titan Builder, and Beaverbuild include bundles atomically in the exact order specified without exposing any of the transactions to the public mempool, the attacker's sweeper bot never sees Tx 1 in the pending pool. By the time the block is mined, Tx 1 has funded the gas, Tx 2 has unstaked the tokens, Tx 3 has moved 100% of the tokens to your safe wallet, and the compromised wallet is back near 0 ETH.
For a full code walkthrough of building and simulating this bundle, read How to Rescue Tokens From a Compromised Wallet With a Sweeper Bot (Flashbots Guide) and inspect our open-source compromised-wallet-sweeper-rescue GitHub repository.
Pattern 3: Two-step unbonding queues and vesting cliffs (the contested race)
The hardest rescue staked eth hacked wallet or vesting tokens compromised wallet scenario is a two-step cooldown where:
- You must call
startUnstake()now, which starts a 7-day timer (unlockTimestamp). - Once
block.timestamp >= unlockTimestamp, anyone (including the attacker, who also has your leaked private key) can signcompleteWithdrawal()and transfer the tokens out.
Here is how we win two-step cooldown rescues at MEV DAO's Sweeper Bot Rescue Service:
- Stealth unbonding initiation: If the attacker hasn't noticed your staked position yet, we submit the
requestWithdrawal()bundle privately via Flashbots right before a quiet weekend window, burning 100% of leftover gas dust so no ETH sits idle. - Pre-signed EIP-7702 atomic rescue: Since the Pectra upgrade, EIP-7702 allows the compromised EOA to delegate code execution to an atomic rescue contract (
sweep7702pattern) so thatcompleteWithdrawal(),transfer(), andblock.coinbasebuilder bribe happen inside a single transaction paid for by the sponsor wallet. - Target-block saturation: Starting 3 blocks before the exact
unlockTimestampslot, our rescue engine fires multi-builder bundles (Flashbots,Titan,Beaverbuild,Rsync) with a competitive builder bribe so that on the very first Ethereum slot whereblock.timestamp >= unlockTimestamp, our bundle lands at the top of the block before the attacker's script reacts.
If the attacker has already attached a malicious EIP-7702 delegation to your address, we must overwrite that delegation inside the same rescue bundle—see How to Check and Remove a Malicious EIP-7702 Delegation and How to Claim an Airdrop From a Compromised Wallet (Before the Sweeper Does).
Frequently asked questions
Can I unstake from a compromised wallet using MetaMask and Flashbots Protect RPC?
No. While Flashbots Protect RPC hides individual transactions from the public mempool, clicking "Send ETH" from one wallet and then manually clicking "Unstake" in MetaMask sends them in separate blocks. As soon as your gas funding transaction lands in Block N, the attacker's sweeper bot steals the ETH in Block N+1 before you can click Unstake. You must submit all steps as an atomic multi-transaction bundle (eth_sendBundle) or EIP-7702 batch.
What if my staked tokens have a 7-day or 14-day unbonding period?
Never start the unbonding period until your rescue bundle script is tested and ready to fire on the exact unlock block. Once requestWithdrawal() is on-chain, sophisticated attackers monitoring your address can see the exact timestamp when your tokens will become claimable and will race you on that block.
How do I rescue vesting tokens that unlock monthly in a hacked wallet?
First check if the vesting contract (such as Sablier, LlamaPay, or Hedgey) represents your stream as a transferable NFT or supports a claimTo(address recipient) function. If it does, a single Flashbots bundle transfers the stream NFT or redirects the claim directly to your safe wallet. Otherwise, you must run a block-targeted rescue bundle at each cliff unlock.
Can native 32 ETH solo validator stakes be rescued if the withdrawal address is compromised?
If your validator's 0x01 execution withdrawal credentials point to a compromised EOA, consensus-layer beacon chain skimming deposits ETH automatically into that address without an EVM transaction. Because consensus withdrawals cannot be bundled with an EVM transfer before they land, rescuing swept validator payouts requires specialized EIP-7702 delegation on the compromised address so incoming calls or sponsored sweeps outbid the attacker.
How much does a professional staked token rescue cost?
You can run our open-source Flashbots rescue scripts yourself for free (paying only the Ethereum gas and builder tip), use the MEV DAO Token Rescue Bot included in our subscription (with a 3-day free trial), or message us on Telegram for complex contested cooldown rescues with zero upfront fees.
Related guides
- Rescue Tokens From a Compromised Wallet: Sweeper Bot Rescue Service
- How to Rescue Tokens From a Compromised Wallet With a Sweeper Bot (Flashbots Guide)
- How to Claim an Airdrop From a Compromised Wallet (Before the Sweeper Does)
- How to Check and Remove a Malicious EIP-7702 Delegation
- Wallet Drained? What to Do in the First Hour (Ethereum Checklist)
Need to rescue staked ETH, restaked positions, or vesting tokens from a compromised wallet before a sweeper grabs them? Use the MEV DAO Token Rescue Bot with a 3-day free trial at mevdao.org/subscribe, or message me directly on Telegram (@merunas) with your public wallet address so we can inspect the staking contract before you trigger any cooldown.