Sub topic 2
Addresses are not people: entities and clustering
This chapter assumes you know what a blockchain, a wallet, and a transaction are. It also assumes you can read short Python functions and understand averages and distributions. Everything later in this tutorial counts addresses, so you need to know what an address does and does not represent.
What an address is
An address is an identifier derived from a public key (or, for contracts, from the deployment). Anyone can create one for free, offline, in any quantity. Nothing on the chain records who controls it.
That gives three facts that shape every metric in this tutorial:
- One person or organization can control many addresses.
- One address can be controlled by many people, as with an exchange deposit wallet or a multisig.
- An address can be controlled by no person at all, as with a smart contract or a burn address.
When a metric says "1 million active addresses", it counts identifiers. It does not count people. The gap between the two is the subject of this chapter.
Why the ledger model matters here
The ledger model changes how many addresses one actor tends to use.
- Account-based chains such as Ethereum keep a balance per address. A user commonly reuses one address for a long time, so address count is a rough but usable proxy for actor count.
- UTXO chains such as Bitcoin keep unspent transaction outputs. Wallets typically generate a fresh address for each receipt and for each change output. One user can therefore touch dozens of addresses in a month.
Per-address metrics are therefore more misleading on UTXO chains unless you cluster first. On account-based chains, the larger distortions come from contracts, exchanges, and deliberate address splitting.
Common sources of many-to-one and one-to-many
| Pattern | Direction | Example | Effect on metrics |
|---|---|---|---|
| Change addresses | Many addresses, one actor | A Bitcoin wallet sends coins and returns change to a new address | Inflates active address counts |
| Exchange deposit addresses | Many addresses, one actor | An exchange assigns each customer a unique deposit address | Inflates counts. Hides the true size of exchange holdings |
| Hot and cold wallets | Many addresses, one actor | An exchange moves coins between its own wallets | Looks like real transfer volume |
| Splitting for privacy or evasion | Many addresses, one actor | A holder spreads a balance over 500 addresses | Understates concentration |
| Multisig and custody | One address, many actors | A treasury controlled by five signers | Understates the number of people involved |
| Smart contracts | One address, many users | A token swap pool holding user funds | A single "holder" may represent thousands of owners |
| Burn and null addresses | One address, no actor | `0x000...dead` | Appears as a large holder but is not circulating supply |
Entities
An entity is a set of addresses believed to be controlled by the same actor. An exchange, a miner pool, a fund, and a retail user are all possible entities. Analytics providers publish entity-level metrics because they are closer to the question people actually ask, such as "how many holders are there?" or "how much do exchanges hold?".
An entity is an inference. It is never observed directly. Treat every entity as a claim with some probability of being wrong.
How clustering works
Clustering groups addresses using heuristics. Each heuristic is a rule of thumb with known failure cases.
Common-input-ownership heuristic
On UTXO chains, a transaction that spends several inputs usually needs a signature for each one. The usual assumption is that one party holds all the keys, so all input addresses belong to the same entity.
Failure case: CoinJoin transactions deliberately combine inputs from many users. Applying the heuristic to a CoinJoin merges unrelated people into one false cluster. Good pipelines detect CoinJoin patterns and skip them.
Change-address heuristic
When a transaction has two outputs, one is payment and one is change returned to the sender. If you can identify the change output, you can link it to the inputs. Typical signals are a fresh address that has never appeared before, a round-number payment next to an odd remainder, or an address type that matches the inputs.
Failure case: wallets that behave unusually, or senders who pay an odd amount on purpose. Errors here are costly because they chain. One wrong link merges two clusters, and later transactions can merge more.
Deposit-address consolidation
Exchanges give each customer a deposit address and later sweep the funds to a central wallet. If many addresses all send their full balance to one address soon after receiving, they probably belong to the same service. This works on account-based chains too.
Failure case: a popular payment processor and a real exchange look alike, and so do a mixer and a service.
Labels from outside the chain
Some labels come from off-chain sources: published exchange wallet lists, proof-of-reserves disclosures, a known donation address, or a team's own announcement. These are usually more reliable than heuristics for the addresses they cover, but they are incomplete and go stale when a service rotates wallets.
A small clustering example
The code below implements the common-input-ownership heuristic with a union-find structure. It reads a list of transactions, each with its input addresses, and merges every set of inputs into one cluster.
class UnionFind:
def __init__(self):
self.parent = {}
def find(self, x):
self.parent.setdefault(x, x)
while self.parent[x] != x:
self.parent[x] = self.parent[self.parent[x]]
x = self.parent[x]
return x
def union(self, a, b):
ra, rb = self.find(a), self.find(b)
if ra != rb:
self.parent[rb] = ra
def cluster_by_common_input(transactions, skip=lambda tx: False):
uf = UnionFind()
for tx in transactions:
inputs = tx["inputs"]
for addr in inputs:
uf.find(addr)
if skip(tx):
continue
for addr in inputs[1:]:
uf.union(inputs[0], addr)
clusters = {}
for addr in list(uf.parent):
clusters.setdefault(uf.find(addr), set()).add(addr)
return list(clusters.values())
def looks_like_coinjoin(tx):
return len(tx["inputs"]) >= 5 and len(set(tx["output_values"])) == 1
transactions = [
{"inputs": ["a1", "a2"], "output_values": [3, 1]},
{"inputs": ["a2", "a3"], "output_values": [4, 2]},
{"inputs": ["b1"], "output_values": [7]},
{"inputs": ["c1", "c2", "c3", "d1", "d2"], "output_values": [1, 1, 1, 1, 1]},
]
print("without filter:", cluster_by_common_input(transactions))
print("with filter: ", cluster_by_common_input(transactions, skip=looks_like_coinjoin))Running it gives two outcomes. Without the filter, c1, c2, c3, d1, and d2 merge into one cluster, although they may belong to five different people. With the filter, they stay separate. In both runs a1, a2, and a3 form one cluster, because the first two transactions share a2. The set ordering in the printed output may vary, but the grouping does not.
The looks_like_coinjoin rule here is deliberately crude: five or more inputs and identical output amounts. Real detectors use richer signals and still make mistakes.
Measuring how good a cluster is
Two errors matter, and they push metrics in opposite directions.
- False merge: two different actors are placed in one entity. This shrinks the entity count and can make one holder look larger than it is, which overstates concentration.
- False split: one actor remains in several entities. This inflates the entity count and hides large holders, which understates concentration.
Heuristic clustering tends to produce false merges when it is aggressive and false splits when it is conservative. You rarely get to tune this to zero. What you can do is state which direction your errors lean and test whether your conclusion survives when you vary the aggressiveness.
Special address types to handle explicitly
Before computing any metric, decide how to treat these groups and write the decision down.
- Exchange addresses. Keep them as labeled entities. Do not count their balance as ordinary holder balance when discussing concentration among investors, and do not count their internal moves as user activity.
- Smart contracts. A contract holding tokens is a pool, vault, or bridge. Treat it separately from externally owned accounts, and consider looking through it to the depositors when the question is about ownership.
- Burn and null addresses. Remove their balances from circulating supply.
- Protocol-owned and treasury addresses. These are real holders with a different incentive from retail holders. Label them as such.
- Dust and spam addresses. Attackers send tiny amounts to thousands of addresses to poison clustering or to inflate activity. Apply a minimum value threshold where the metric allows it.
Consequences for the metrics ahead
| Later metric | How address-versus-entity confusion distorts it |
|---|---|
| Active addresses | Counts identifiers, so wallet behavior and splitting move the number without changing the real user base |
| Transfer volume | Includes movements between addresses of the same entity, which are not economic transfers |
| Exchange flows | Depends entirely on how complete the exchange label set is |
| Holder distribution | Many small addresses may be one large holder |
| Concentration (top-N, Gini) | Sensitive to false merges and false splits, as above |
Keep this table in mind. The later chapters return to each row.
Practical guidance
- Say which unit you are counting in every chart and sentence: addresses, clusters, or labeled entities.
- Keep the raw address-level data. Cluster as a separate, repeatable step, so you can rerun it with different settings.
- Version your label set and note its date. A label list from last year misses wallets created since.
- Report a range when it matters. If aggressive and conservative clustering give top-10 shares of 31% and 24%, say so.
- Where the question is about people, say that entity counts are still an estimate of actors, not a census.
Exercise
A Bitcoin analyst counts 400,000 active addresses in a day and says the network has 400,000 daily users. Give two reasons the claim can be wrong, one that makes the true user count lower and one that makes it higher.
Show answer
Lower: wallets generate fresh change addresses and new receive addresses, and exchanges sweep deposit addresses, so one actor appears as many addresses. Higher: a single address can represent many users, such as an exchange hot wallet, a custodial service, or a multisig, so one active address can stand for many people. The figure counts identifiers, not people.
Exercise
Your clustering run merges two exchange wallets with an unrelated group of 3,000 small holders because of one CoinJoin transaction. Does this make top-N concentration look higher or lower, and why? What step would have prevented it?
Show answer
Higher. The false merge creates one very large entity, so the largest balances account for a bigger share of supply than they truly do. Detecting CoinJoin-style transactions and excluding them from the common-input rule, plus checking for implausibly large clusters, would have prevented it.
Exercise
Modify cluster_by_common_input so that it also returns the size of the largest cluster, and explain how that number helps you spot a bad merge.
Show answer
Compute max(len(c) for c in clusters) after building the list, for example largest = max(len(c) for c in result), and return it alongside the clusters. A sudden jump in the largest cluster size, or a cluster far bigger than any known service, suggests a false merge such as an unfiltered CoinJoin.