Sub topic 9
Address poisoning and copy-paste mistakes
This chapter assumes you know what a wallet address is, you have sent crypto from an exchange or wallet app, and you understand from the earlier chapter on irreversible transactions that a confirmed transfer cannot be recalled. It covers a scam that needs no fake website, no stolen seed phrase, and no conversation with the victim. The attacker only needs the victim to copy the wrong address.
What address poisoning is
Address poisoning is a scam that plants a lookalike address in your transaction history, hoping you will copy it later by mistake. The attacker does not break into anything. They rely on a habit: many people send funds to a recipient by opening their history, finding an earlier transfer to that person, and copying the address from there.
Wallet addresses are long strings that people cannot memorize. Wallets and block explorers often shorten them on screen, for example 0xAbCd…9876. Users learn to recognize an address by its first and last few characters. The attacker exploits that shortcut.
The attack works on any chain where anyone can send you a transaction, which includes Ethereum, BNB Chain, Tron, and Bitcoin. It is most common on account-based chains with cheap fees, because the attacker pays a small cost for each attempt.
How the attack works
The attacker watches the blockchain for transfers between real wallets. Public ledgers make this easy. Once they see you send funds to a recipient, they do the following.
- Generate a vanity address. The attacker uses software to search for a new address whose first and last characters match the recipient's address. A match of four to six characters at each end is feasible with modest computing power. The middle of the address will be different.
- Send a poisoning transaction. The attacker makes your wallet show a transaction involving the fake address. There are three common forms:
- A zero-value transfer. Some token contracts allow anyone to trigger a transfer of zero tokens "from" your address to the recipient. The fake address appears as if you had interacted with it.
- A dust transfer. The attacker sends you a tiny amount, such as a fraction of a cent, from the fake address.
- A fake token transfer. The attacker deploys a worthless token with a familiar name and makes it look like you sent it to the fake address.
- Wait. The poisoned entry now sits in your history, next to the real one.
- Collect. Later you want to pay the same recipient again. You open your history, see an address starting and ending with the right characters, copy it, and send. The funds go to the attacker.
Why it works
Three weaknesses combine.
- Truncated display. Wallets and explorers hide the middle of the address. If you never see the middle, you cannot notice that it differs.
- Pattern matching by humans. People verify the first and last characters because that feels like a check. It is a weak check, because an attacker can choose those characters.
- History as a source of truth. A transaction history feels like a record of your own actions. Poisoning entries are not your actions, but the wallet displays them in the same list.
The attacker's cost is low and the payoff is large. Losses of hundreds of thousands of dollars from a single mistaken transfer have been reported, which is why the scam persists even though most attempts fail.
Seeing the weakness in code
The following function shows why a partial match proves nothing. Two different addresses can match at both ends, so the only reliable comparison is of the full string.
def looks_alike(a: str, b: str, n: int = 4) -> bool:
"""True if two different addresses share the same first and last n characters."""
return a != b and a[:n] == b[:n] and a[-n:] == b[-n:]
known = "0xAbCd1234567890aaaaaaaaaaaaaaaaaaaaaa9876"
incoming = "0xAbCd1234567890bbbbbbbbbbbbbbbbbbbbbb9876"
print(looks_alike(known, incoming)) # True: same ends, different addressYou can turn this into a defensive check. If a wallet's history contains a second address that looks like one in your address book, the function flags it. A tool built on this idea can warn you before you send.
def find_lookalikes(address_book: dict[str, str], history: list[str], n: int = 4) -> list[tuple[str, str]]:
"""Return (name, address) pairs where a history address resembles a saved one."""
hits = []
for name, saved in address_book.items():
for seen in history:
if seen != saved and seen[:n] == saved[:n] and seen[-n:] == saved[-n:]:
hits.append((name, seen))
return hits
book = {"landlord": "0xAbCd1234567890aaaaaaaaaaaaaaaaaaaaaa9876"}
history = [
"0xAbCd1234567890aaaaaaaaaaaaaaaaaaaaaa9876",
"0xAbCd1234567890bbbbbbbbbbbbbbbbbbbbbb9876",
]
print(find_lookalikes(book, history))The output lists the second address under the name landlord. That entry is the suspicious one.
Related copy-paste tricks
Address poisoning is one of a family of attacks on the step between "I know who I want to pay" and "the address I actually sent to."
Clipboard hijacking
Clipboard hijacking is malware on your computer or phone that watches the clipboard. When it sees something shaped like a crypto address, it silently replaces it with the attacker's address. You copy a correct address, paste, and the pasted text is different. Malware like this often arrives through pirated software, fake installers, or malicious browser extensions. Clipboard hijackers frequently choose a replacement with matching first and last characters, so a quick glance at the ends will not catch it.
Look-alike addresses in chats and invoices
An attacker who has compromised an email account, or who is impersonating a business, can send an invoice with a changed payment address. The message looks normal. Only the address is different. This is common in business payments and in over-the-counter trades.
Wrong-network sends
Not every copy-paste loss involves an attacker. Sending a token on the wrong network, or pasting an address from one chain into a wallet on another, can also lose funds. The mechanism is different, but the defenses overlap: verify the whole address and the network before you confirm.
| Attack | Where the bad address comes from | What you see | Main defense |
|---|---|---|---|
| Address poisoning | A fake entry in your transaction history | Two similar addresses in the list | Never copy from history; use a verified address book |
| Clipboard hijacking | Malware that rewrites your clipboard | Pasted text differs from what you copied | Compare the full pasted address; keep devices clean |
| Altered invoice | A forged or tampered message | A normal-looking payment request | Confirm the address by a second channel |
| Wrong network | Your own mistake | A valid address on the wrong chain | Check the network field; send a small test first |
Defending against copy-paste attacks
No single habit covers all of these attacks, but a small set of them closes most of the gap.
- Do not copy addresses from transaction history. This one rule defeats address poisoning. History is not a trusted source, because anyone can insert entries into it.
- Use an address book or whitelist. Save a recipient's address once, after verifying it carefully, and send to the saved entry afterward. Many exchanges offer withdrawal allowlists, and some add a waiting period before a new address becomes usable.
- Compare the full address, not the ends. Check at least the first six, the last six, and several characters from the middle. A better method is to compare it in chunks against the source you trust.
- Send a small test transaction. For a large transfer to a new address, send a minimal amount first and confirm that the recipient received it. The extra fee is small compared with the risk.
- Confirm the address through a second channel. If someone sends you an address by email or chat, check it by a phone call or another independent route you already trust.
- Treat unexpected tiny deposits as a warning. A zero-value or dust transaction you did not request is a possible poisoning attempt. Do not interact with it, and do not use that address.
- Use ENS or similar names carefully. Name services such as ENS let you pay
name.ethinstead of a raw hex string. They help, but you must still make sure you typed the right name, because lookalike names exist. - Keep your devices clean. Install software only from official sources, review browser extensions, and run updates. This reduces the chance of a clipboard hijacker.
- Check the address on a hardware wallet screen. A hardware wallet shows the destination on its own display. If it differs from what your computer showed, stop.
What to do after a mistaken send
If you realize you have sent funds to a poisoned address, act at once, even though recovery is unlikely.
- Do not assume you can undo it. The transfer is final. The attacker controls the destination and typically moves funds within minutes.
- Record the details. Save the transaction hash, both addresses, the amount, the time, and screenshots of the poisoning entry in your history.
- Contact the exchange, if one was involved. If the destination address belongs to an exchange account, the exchange may be able to freeze it. Report quickly.
- Report to the authorities and relevant bodies. Later chapters on incident response cover reporting in detail.
- Be wary of recovery offers. People who contact you promising to retrieve the funds are usually running a second scam. That pattern is covered in the chapter on recovery scams.
Summary
Address poisoning needs no deception beyond a lookalike entry in your history. It works because people verify only the ends of an address and treat history as a safe source. The fixes are simple habits: do not copy from history, use a verified address book, compare the full address, and test large transfers with a small send first.
Exercise
You paid a contractor 0.5 ETH last week. Today you need to pay them again, so you open your wallet history and see two entries to addresses that both begin with 0x7F3a and end with c21B. One of them is a 0 ETH transfer you do not remember. Which entry should you use, and what should you do instead of copying either one?
Show answer
Use neither. The 0 ETH entry is likely an address poisoning attempt, and you cannot tell from the shortened view which entry is real. Do not copy from history. Get the contractor's address from a trusted source, such as an address book entry you saved earlier or a confirmation by a second channel like a phone call. Compare the whole address, check it on your hardware wallet screen if you have one, and send a small test amount first.
Exercise
The function looks_alike compares only the first and last 4 characters. Explain why an attacker would still succeed against a person who checks the first 6 and last 6 characters, and what check actually closes the gap.
Show answer
Matching more characters at each end only makes the attack more costly for the attacker, because generating a longer vanity match takes more computing work. It does not make it impossible, and matches of six or more characters at each end are reachable with enough resources. The check that closes the gap is comparing the entire address, or avoiding the comparison by sending only to a verified address book entry or a withdrawal allowlist.