Sub topic 12
Look-alike addresses and address poisoning
This chapter covers a way to lose funds that has nothing to do with choosing the wrong network. The address you send to is valid and on the right network, but it belongs to an attacker. The chapter assumes you have read the earlier chapters on address formats, EVM shared address space, and irreversible transactions. You should be comfortable reading hexadecimal strings and have used a wallet's transaction history.
What a look-alike address is
A look-alike address is a valid address that shares the characters people usually check with a genuine address. Most wallets and block explorers shorten addresses for display, for example 0x5290…9EE7. Many people verify only the first and last few characters. An attacker who produces an address with the same ends can pass that check.
A look-alike address is a fully valid address. Format checks and checksum validation do not reject it, because it is a real public-key hash with a correct checksum. As the earlier chapters explained, validation tells you an address is well formed. It does not tell you the address is the one you meant.
How address poisoning works
Address poisoning plants a look-alike address in your own transaction history so that you copy it by mistake later. The attack has four steps:
- The attacker watches the blockchain for wallets that send transfers, particularly large ones.
- For a target's frequent counterparty, the attacker generates a vanity address. A vanity address is one found by brute force so that part of it matches a chosen pattern. Here the pattern is the first and last characters of the genuine counterparty.
- The attacker makes your history contain the look-alike. They send you a zero-value or dust transfer from the look-alike address. Often they instead trigger a fake token transfer that appears to come from you to the look-alike. Both show up in your wallet's activity list.
- Later you want to pay the real counterparty again. You open your history, find a recent entry whose ends look right, and copy it. The funds go to the attacker.
The attack depends on a habit: copying an address from history rather than from the original source. The attacker does not need your keys or any access to your wallet. Everything they do is public and permitted on the chain.
Why it is cheap to build
Each hexadecimal character has 16 possible values, so matching n specific characters takes about 16^n random attempts on average. A modern GPU tests very large numbers of candidate keys per second, so matching a few characters at each end is affordable.
| Characters matched (start + end) | Average attempts | Practical difficulty |
|---|---|---|
| 2 + 2 | 65,536 | Trivial on any computer |
| 4 + 4 | about 4.3 billion | Feasible on a single GPU |
| 6 + 6 | about 2.8 × 10^14 | Needs substantial GPU resources, but within reach of a funded attacker targeting large balances |
| Full 40 characters | about 1.5 × 10^48 | Infeasible |
Matching all characters is infeasible, which is why the defense is to compare the entire address. Matching a visible subset is cheap, which is why truncated display is the weakness.
Why EVM shared addresses make it worse
An EVM address is valid on every EVM network. A look-alike generated once works on Ethereum, BNB Smart Chain, Polygon, Arbitrum, Base and the others. Attackers often poison on networks with low fees, because a dust transfer costs them very little there. A victim who rarely checks activity on a cheap chain may still copy from it.
The earlier warning also applies. If you copy a poisoned address and pay on the correct network, the funds still go to the attacker, and no network mismatch occurs. The attacker owns the same address on every EVM network, so they can collect from any of them.
The attack is not limited to EVM chains. Bitcoin, Solana, Tron and other networks all have addresses that can be brute-forced to match visible characters. The cost and the matching rules differ by format. Base58 addresses have a larger alphabet per character, so each matched character is harder to produce than a hex character.
Detecting look-alikes in code
You can screen incoming transfers against addresses you trust. The script below compares a candidate address with your known addresses. It flags any candidate that is not identical but shares the first and last characters. It ignores case, because case in an EVM address only carries the checksum.
import re
EVM_ADDRESS = re.compile(r"0x[0-9a-fA-F]{40}")
def is_evm_address(value: str) -> bool:
return EVM_ADDRESS.fullmatch(value) is not None
def is_lookalike(known: str, candidate: str, head: int = 4, tail: int = 4) -> bool:
"""True if candidate differs from known but shares its first and last characters."""
if not (is_evm_address(known) and is_evm_address(candidate)):
raise ValueError("both values must be 0x-prefixed 40-character hex addresses")
k = known[2:].lower()
c = candidate[2:].lower()
if k == c:
return False
return k[:head] == c[:head] and k[-tail:] == c[-tail:]
def screen(known_addresses: list[str], incoming: list[str]) -> list[tuple[str, str]]:
"""Return (known, suspicious) pairs for incoming addresses that look like a known one."""
flagged = []
for candidate in incoming:
for known in known_addresses:
if is_lookalike(known, candidate):
flagged.append((known, candidate))
return flagged
genuine = "0x52908400098527886E0F7030069857D2E4169EE7"
poisoned = "0x5290" + "ab" * 16 + "9EE7"
print(screen([genuine], [poisoned, genuine]))Running it prints one pair: the genuine address and the poisoned one. The genuine address is not flagged against itself, because the script returns False for an exact match.
This is a screening aid and not a security guarantee. An attacker who matches more characters than your head and tail values will still be caught by a looser setting, but a strict comparison of the full string is always the authoritative test. Use the script to warn about suspicious history entries, and never to approve an address.
Related look-alike tricks
Address poisoning is one of several ways an address can be swapped. Recognize the others so the same habits cover them.
- Clipboard hijacking. Malware on your device watches the clipboard. When it sees something shaped like an address, it replaces the contents with the attacker's address. Your paste then differs from what you copied. Only comparing the pasted address with the source catches it.
- Fake token transfers. Some poisoning transfers use a counterfeit token contract that emits a transfer event naming your address. Wallets that display events without verifying the token show it as a normal entry. A token you never held, with a name copied from a real one, is a warning sign.
- Look-alike names. Human-readable names such as ENS domains can contain characters that resemble others, such as a Cyrillic letter that looks like a Latin one. A name that appears to match a contact may resolve to a different address.
- Look-alike websites and support accounts. A cloned exchange page can show a deposit address that belongs to the attacker. A person claiming to be support can send you an address in a message. The deposit address you trust is the one displayed inside your own logged-in account.
Defenses
The defenses combine tooling and habit.
- Compare the whole address. Check the full string, not only the ends. For a long address, compare it in sections: the beginning, the middle and the end.
- Do not copy from history. Transaction history is untrusted input, because anyone can place an entry there. Take the address from the original source, such as the recipient's own message or the exchange's deposit page.
- Use an address book you built yourself. Save a verified address once, with a label, and send only to saved entries. Add an entry only after a full comparison.
- Send a small test first. For a large transfer to a new or rarely used address, send a small amount and confirm the recipient received it. Then send the rest. The test costs a second fee but exposes a wrong address cheaply. Pair it with the network checks from the earlier chapters.
- Hide or flag unknown transfers. Use wallet or explorer settings that hide zero-value transfers and unverified tokens. A dust entry from an unknown address is more likely an attack than a gift.
- Use hardware wallet confirmation. A hardware wallet shows the destination on its own screen. Check the full address there, since the computer's screen may be compromised.
- Keep your device clean. Clipboard hijackers arrive through malware and malicious extensions. Update software and install only extensions you need.
What happens after the mistake
Sending to a poisoned address is the same as any confirmed transfer to a wrong address that someone else controls. The transaction is final, and no central authority can reverse it. The recovery chapter covered the limits of recovery. Here the situation is worse than a plain wrong-network send, because the recipient is an adversary who is watching and will move the funds immediately, often through mixers or swaps to other assets.
What you can do is limited:
- Record the transaction hash, the destination address and the time.
- Report the address to the explorer's labeling service and to any exchange the funds reach. Fast action occasionally lets an exchange freeze a deposit.
- Report the case to local law enforcement and to a crypto-crime reporting service, as these records support later investigations.
- Treat recovery offers from strangers as scams. People who promise to retrieve stolen funds for an upfront fee are a second attack on the same victims.
Prevention is the only dependable control.
Adding this to your pre-send checklist
Two checks cover this chapter's risks, and they extend the checklist from the previous chapters:
- Did I take this address from the original source, and did I compare every character, not only the ends?
- Is this address already saved and verified in my own address book, or have I sent a small test?
Exercise
You paid a supplier last week. Today you open your wallet history to pay them again. You notice a zero-value incoming transfer from an address that starts and ends with the same characters as the supplier's address, and the supplier's genuine address is no longer visible on the first page. You copy the top entry and send. Name the attack, explain why a checksum did not stop it, and give two things you should have done differently.
Show answer
This is address poisoning. The attacker brute-forced a vanity address matching the first and last characters of the supplier's address and sent a zero-value transfer so it appeared in your history. A checksum only detects typing errors in an address, and the attacker's address has its own valid checksum, so the wallet accepted it. You should have taken the address from the supplier's original message or a verified address book entry instead of from history, and compared the entire address rather than the ends. A small test transfer first, or confirming the full address on a hardware wallet screen, would also have caught it.
Exercise
An attacker wants to match 5 hexadecimal characters at the start and 5 at the end of a target address. Roughly how many random addresses must they generate on average, and why is matching all 40 characters impractical?
Show answer
Matching 10 specific hexadecimal characters takes about 16^10, or roughly 1.1 × 10^12, attempts on average. Each additional matched character multiplies the work by 16, so matching all 40 characters needs about 16^40, around 1.5 × 10^48 attempts, which is far beyond any available computing power. That is why comparing the full address is an effective defense.