Caloogy Article
中文

Address Poisoning: Fake Addresses with Matching Prefixes and Suffixes

Date
Sep 4, 2025
Series
Onchain
Reading
4 min
Topics
Address poisoningEthereumEip 55Checksum

The one-sentence version

Ethereum addresses consist of 40 hexadecimal characters, and the human eye typically only notices the first and last few digits. Attackers mass-generate fake addresses that have the same prefix and suffix as your frequently used addresses, then send you a "transaction" with a zero or negligible amount to make it appear in your transaction history. The next time you copy an address from your history, you will end up copying the attacker's address. This attack does not need to steal anything; it simply exploits human habits. Defense relies on: not copying addresses from history, using an address book, comparing more characters, and wallets proactively flagging similar addresses.

This article has three layers:

  1. Layer 1: The Intuition: How the attack is performed
  2. Layer 2: Real-World Use: Real loss cases and responses from wallets and exchanges
  3. Layer 3: Principles and engineering key points: The cost of generating similar addresses, what EIP-55 checksums can and cannot do, and detection rules

Layer 1: The Intuition

1.1 Attack Steps

Attacker 0x7a3f...91c2 (Fake)Your Friend 0x7a3f...91c2YouAttacker 0x7a3f...91c2 (Fake)Your Friend 0x7a3f...91c2YouMonitors this transfer,generates an address with the same prefix and suffixAn extra entry appears in history,the recipient shows as 0x7a3f...91c2Normal transfer of 1000 USDC0 amount transfer / fake token transferNext time, copies "friend's address" from history to transfer 5000 USDC

To make wallet interfaces look better, addresses are often abbreviated to 0x7a3f...91c2. The real address and the fake address look exactly the same once abbreviated.

1.2 Why it works

Layer 2: Real-World Use

Caloogy Wallet also employs address poisoning detection.

Layer 3: Principles and Engineering

3.1 How difficult is it to generate a similar address?

An Ethereum address is derived from the hash of a public key and can be viewed as 40 random hexadecimal characters. To make a fake address and a real address match in both the first aa digits and the last bb digits, on average, one would need to try

16a+b=24(a+b)16^{a + b} = 2^{4(a+b)}

private keys.

Matching digits (Prefix + Suffix) Average attempts Difficulty
4 + 4 168≈4.3×10916^8 \approx 4.3 \times 10^9 A single GPU in seconds to minutes
6 + 6 1612≈2.8×101416^{12} \approx 2.8 \times 10^{14} GPU clusters, feasible
10 + 10 1620≈1.2×102416^{20} \approx 1.2 \times 10^{24} Practically infeasible

Note that this is a second preimage style search (finding a similar address given a specific target address), not a birthday attack, so you cannot take the square root (see "The Birthday Paradox and Hash Collisions"). The conclusion is: Checking only 4 digits at the start and end is far from enough; the more digits you verify, the safer it is.

3.2 EIP-55 Checksum: Prevents typos, but not poisoning

The casing of Ethereum addresses is not arbitrary. EIP-55 stipulates: Take the Keccak-256 hash of the lowercase address; if the iith hexadecimal digit of the hash is ≥8\ge 8, then the iith letter of the address is written in uppercase.

Test address in EIP-55 standard

Correct format: 0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed

If the last digit is miscopied, ...BeAed becomes ...beaee, then the correct casing for the corresponding address becomes 0x5Aaeb6053f3e94c9B9a09F33669435e7EF1BeAee, where almost every letter's case changes.

If the wallet detects that the casing pattern you entered does not match the correct one, it will throw an error. (Verified with Python.)

Similar to the "casting out nines" method or checksums used in ID cards and bank cards, EIP-55 can catch random transcription errors. However, a poisoning address is itself a legitimate address with its own correct checksum, so EIP-55 cannot prevent poisoning at all.

3.3 Detection Rules

Rule Description
Compare prefix/suffix similarity with historical transaction recipients If the first and last several digits match but the overall address is different, mark it as suspicious
Whether the counterparty has sent you 0-amount or fake token transfers A typical prelude to poisoning
Whether this is the first time transferring to this address The first transfer itself should require an extra layer of confirmation
Whether the token is on a whitelist Poisoning is often accompanied by fake tokens (e.g., named "USDT" but with a different contract address)

3.4 Interface Design

Summary

Layer Key points
Attack Generate addresses with matching prefixes and suffixes to blend 0-amount transfers into your history
Cost Matching 8 digits at the start and end requires only a few billion attempts, which is very cheap
Checksum EIP-55 prevents typos but does not prevent poisoning (the poisoned address itself is valid)
Defense Do not copy from history; use address books; full display; similarity detection; out-of-band verification