Sub topic 6
Labeling entities and judging label quality
This chapter assumes you have read the previous chapter on address clustering. It also assumes you can read basic Python and know what an address and a transaction are. Clustering tells you that several addresses probably share a controller. Labeling tells you who that controller is. Every exchange flow number later in this tutorial depends on labels, so the quality of a label limits the quality of the result.
What a label is
A label is a claim that an address, or a cluster of addresses, belongs to a named entity of a certain type. A useful label has more than a name. It carries at least these fields:
- The address or cluster it applies to.
- The entity name, such as "ExchangeA".
- A category, such as exchange, custodian, smart contract, bridge, miner, or individual.
- A source, meaning where the claim came from.
- The evidence behind it.
- A date of last verification.
A bare mapping like {"addr_ex1": "ExchangeA"} hides all but the first two. That is fine for a demo and risky in a pipeline, because you cannot tell a verified label from a guess.
A label is a claim about the past and present, not a fact written on the chain. The chain contains no entity names. Every label is inferred or reported by someone.
Where labels come from
Labels come from a handful of source types. They differ widely in reliability.
| Source | How it works | Typical strength | Typical weakness |
|---|---|---|---|
| Self-reported | The entity publishes its addresses, for example in a proof-of-reserves report or documentation | High, if the entity is honest and the page is current | Often covers only some wallets, and may be stale |
| Interaction-based | You deposit to a service, withdraw from it, and record the addresses you see | High for the addresses you touched | Covers few addresses, and the service may rotate them |
| Propagation by clustering | A known address is extended to its cluster using heuristics such as common input ownership | Finds many addresses cheaply | Inherits every clustering error, and errors spread |
| Behavioral inference | A model flags addresses that behave like an exchange hot wallet, such as many small deposits swept to one place | Scales to the whole chain | Produces false positives, and gives a category more reliably than a name |
| Community or crowd-sourced | Explorer tags, forum posts, and user submissions | Wide coverage, fast reaction | Unverified, and open to spam and deliberate mislabeling |
| Vendor datasets | A commercial analytics provider sells curated labels | Maintained and often documented | Methods are opaque, and vendors disagree with each other |
The strongest labels combine two independent sources. For example, an address that the exchange lists itself and that you also observed during a test withdrawal is far safer than either claim alone.
How labels spread, and how errors spread with them
Most labeled addresses in a dataset were never directly verified. They were reached by propagation. You start with a small set of seed addresses, then extend the label along clusters. Suppose address A is a verified ExchangeA hot wallet. If the clustering step links A to B because they were inputs in the same transaction, B becomes "ExchangeA" too. Then every address linked to B follows.
One bad link can therefore attach a whole cluster to the wrong entity. This happens when a CoinJoin-style transaction joins unrelated users, or when a service co-spends inputs for several customers. A label that came from three propagation steps is much weaker than one that came from direct evidence, even though both appear as the same string in the final table. Keeping the propagation path, or at least the source type, lets you discount distant labels.
Labeling entities versus labeling roles
Two questions are easy to confuse:
- Which entity controls this address?
- What role does this address play?
The role matters as much as the entity. An exchange has hot wallets, cold wallets, and deposit addresses, which the next chapter covers. A flow computation treats them differently. Custodians, market makers, bridges, staking contracts, and decentralized exchange contracts also hold large balances. If you label all of these simply as "exchange", you will count a token moving into a staking contract as an exchange deposit.
Keep a category field separate from the entity name. Then you can decide per analysis which categories to include. A concentration measure usually excludes contracts and exchanges, while an exchange flow measure includes only exchange categories.
Judging label quality
You cannot fully verify a third-party label, but you can score it and test it. Practical checks:
- Source. Is the label self-reported, observed, propagated, or crowd-sourced? Prefer direct evidence.
- Age. Exchanges migrate wallets. A label last verified two years ago may describe an address that is now dormant or reassigned. Older labels deserve less weight.
- Behavioral consistency. An address labeled as a hot wallet should show many counterparties and frequent small transfers. An address with a single transfer per year labeled as a hot wallet is suspect.
- Cross-source agreement. If two independent datasets name different entities for one address, treat it as a conflict and do not silently pick one.
- Self-consistency with known totals. If a labeled set of addresses for an entity holds far more or far less than the entity's published reserves, something is missing or wrong. This idea returns in the proof-of-reserves chapter.
- Spot checks. Sample a few labels, trace their transactions by hand in an explorer, and see whether the story holds.
A useful discipline is to measure label precision on a sample. If you check 50 labels and 4 are wrong, the precision is 92 percent. Report that number alongside your results.
A small label resolver
The code below stores labels with source and verification date, weights each by source reliability and age, and resolves conflicts for an address. The weights are illustrative. Tune them from your own spot checks.
from dataclasses import dataclass
from datetime import date
SOURCE_WEIGHT = {
"self_reported": 1.0,
"observed": 0.9,
"vendor": 0.7,
"heuristic": 0.4,
"crowd": 0.2,
}
@dataclass(frozen=True)
class Label:
address: str
entity: str
category: str
source: str
last_verified: str # ISO date, e.g. "2026-11-01"
def label_score(label, today):
"""Source weight, halved for every 365 days since last verification."""
age_days = (today - date.fromisoformat(label.last_verified)).days
return SOURCE_WEIGHT[label.source] * 0.5 ** (age_days / 365)
def resolve(labels, today):
"""Pick the best-supported entity for one address.
Returns (entity, confidence, conflict). Confidence is the winner's
share of the total score. conflict is True if entities disagree."""
totals = {}
for lab in labels:
totals[lab.entity] = totals.get(lab.entity, 0.0) + label_score(lab, today)
total = sum(totals.values())
if total == 0:
return None, 0.0, False
best = max(totals, key=totals.get)
return best, totals[best] / total, len(totals) > 1
today = date(2026, 11, 27)
labels = [
Label("addr1", "ExchangeA", "exchange", "self_reported", "2026-11-01"),
Label("addr1", "ExchangeB", "exchange", "heuristic", "2025-11-27"),
]
entity, confidence, conflict = resolve(labels, today)
print(entity, round(confidence, 2), conflict)The output is ExchangeA 0.83 True. The recent self-reported label scores about 0.95 and the year-old heuristic label scores 0.2, so ExchangeA wins with about 83 percent of the total score. The conflict flag stays True, which tells you the address deserves a manual look instead of being trusted blindly.
Common errors in labeling
- Treating all addresses of a cluster as equally certain. Cluster members vary in how well they are supported. Keep the evidence per address.
- Ignoring label age. Exchanges move funds to new wallets. Old labels create false netflow when the exchange rotates addresses and the new ones are unlabeled.
- Merging entities. Some brands share a custodian, and some exchanges have separate legal entities. Check whether two names are one controller or two.
- Labeling contracts as owners. A token contract, a bridge, or a multi-signature wallet holds funds for many people. It is not a single holder.
- Mixing labels from different dates. Joining a 2024 label set to 2026 transfers produces gaps. Record the validity period of each label.
- Circular confirmation. A vendor label may itself come from a crowd tag you also use. Two matching sources are not independent if one copied the other.
Coverage versus precision
Every labeling system trades coverage against precision. A strict set of verified labels is accurate but leaves most real exchange activity unlabeled. A liberal set that includes heuristics and crowd tags covers more, but adds false positives.
The two errors affect flow numbers differently. A missing label (false negative) makes flows to or from an unlabeled exchange wallet look like ordinary transfers, so measured inflow and outflow are both too low. A wrong label (false positive) adds transfers that are not exchange flows at all. Because these errors are not symmetric across inflow and outflow, they can bias netflow in one direction as well as add noise.
For exchange flow work, a reasonable default is to require at least one strong source for each included address and to report how many addresses are included per exchange. For exploratory whale hunting, a looser set is acceptable if you review alerts manually.
Exercise
An analytics dataset labels address X as "ExchangeA hot wallet". The label comes from a clustering step three links away from a verified seed, was last verified 18 months ago, and a second dataset labels X as "ExchangeB". Name three checks you would run before using X in an exchange flow computation, and say what result would make you drop the label.
Show answer
Check 1, source and path: look at the cluster path from the seed and whether any link relies on a heuristic that CoinJoin-style transactions can break. Drop the label if a link joins unrelated users. Check 2, behavior: in an explorer, see whether X shows hot-wallet behavior such as many counterparties and regular sweeps. Drop it if X has little activity or acts like a single user. Check 3, conflict and independence: find out whether the ExchangeB label is independent evidence or copied from the first dataset, and whether the two names are one controller. If you cannot find strong direct evidence for either name, exclude X and record it as unresolved. The age of 18 months also lowers its weight, so recent activity consistent with the label would be needed to keep it.
Exercise
Using the resolve function above, an address has one "observed" label for ExchangeA verified on 2026-11-20 and one "crowd" label for ExchangeC verified on 2026-11-20. Both entities appear once. Which entity wins, and is conflict True or False?
Show answer
ExchangeA wins, because the observed source weight (0.9) is higher than the crowd weight (0.2) and both labels have nearly the same age, so the decay factor is nearly equal. The conflict flag is True because two different entities were proposed. Confidence is about 0.82, since 0.9 divided by 1.1 is roughly 0.82.