A private key sweeper script is an automated program that holds the private keys of one or more crypto addresses and transfers out any coins or tokens the moment they appear. In almost all reported cases it is a theft tool: once a key has leaked, a sweeper (often called a sweeper bot) camps on the address, so that the owner cannot rescue remaining assets and any new deposit, even a small amount sent to pay network fees, is taken within seconds.
The term is informal security and crypto-community language rather than a defined legal category. "Sweeping" also has an innocent meaning: wallet software such as Electrum lets a user import a private key, for example from an old paper wallet, and sweep its balance into a new wallet the user controls. This page covers both but focuses on the malicious use, which is one form of automated crypto theft.
Private key sweeper script in plain terms
Imagine a burglar who has copied the key to your letterbox and then sits beside it day and night. The moment a letter with money falls in, he opens the box and takes it before you can reach the door. You can still see the letterbox and you still have your own key, but you can never get there first.
A sweeper script is that burglar, made of software. It never sleeps, it reacts in a fraction of a second, and it can watch thousands of letterboxes at once.
How sweeper scripts work
A typical sweeper follows a simple loop:
- Collect keys. The operator gathers leaked keys or seed phrases from phishing sites, malware, fake wallet apps, public code repositories, cloud backups and data breaches.
- Watch the addresses. The script monitors blocks and pending transactions for incoming transfers to any of those addresses.
- Front-run the owner. When funds arrive, it signs an outgoing transaction with a higher gas fee or transaction fee so that validators include it ahead of anything the real owner sends.
- Move the proceeds. Stolen funds are passed through further addresses, bridges or a crypto mixer to make tracing harder.
On account-based chains such as the Ethereum blockchain, sweepers are especially damaging because moving any token requires the native coin to pay gas. A victim with valuable tokens but no ETH must first send in a little ETH, which the bot takes immediately, leaving the tokens stranded. After Ethereum's Pectra upgrade in May 2025 introduced EIP-7702, which lets an ordinary account delegate its behaviour to smart contract code, attackers began setting compromised accounts to delegate to sweeper contracts. Research by market maker Wintermute published in mid-2025 found that the large majority of early EIP-7702 delegations pointed to copies of the same sweeper code.
Honeypot bait and other scams
Sweepers are also used as bait. In a common scam, someone "accidentally" posts a seed phrase in a chat or comment, and the wallet it opens shows a tempting balance of stablecoins. Anyone who imports it finds the tokens cannot be moved without paying gas, sends in ETH or another coin to cover the fee, and watches a sweeper take it. The scheme is described under honeypot wallet address and belongs to a wider group of cryptocurrency scams that exploit greed and curiosity, alongside tactics such as wallet address poisoning.
Rescue attempts and defences
Once a key is compromised, the only lasting fix is to move everything to a new wallet with fresh keys; the old address should be treated as permanently lost. Rescuing assets already trapped there is hard. On Ethereum, white-hat responders sometimes use private transaction bundles, submitted through services such as Flashbots, that fund gas and transfer the tokens in a single atomic package so the sweeper never sees a window. This works only if done carefully and before the attacker drains the assets directly.
Prevention is far more effective:
- Never share a seed phrase. No legitimate support agent, airdrop or recovery service needs it; requests for it are a hallmark of social engineering.
- Keep keys offline. A hardware device or cold wallet keeps keys away from malware and screenshots.
- Split control. A multi-sig wallet means one leaked key is not enough to move funds.
- Check code and backups. Developers should keep keys out of repositories and configuration files; many leaks start with an exposed environment file.
Legal status and tracing
Using a sweeper to take funds from someone else's wallet is theft and, depending on the country, computer-misuse or fraud under criminal law; knowing the key does not confer ownership. Investigators and exchanges use blockchain analytics to follow the stolen funds, and centralized platforms or stablecoin issuers can sometimes freeze them when they reach an account the platform controls. Victims are usually advised to report the theft to police and to the exchanges involved, but recovery is rare once funds have been laundered. The persistence of sweepers is one reason non-custodial wallet users are told that key security is entirely their own responsibility.