On chain tracing follows money on a public ledger: cluster addresses that belong together, follow hops from the theft, and identify where funds meet the regulated world. This sub-skill belongs to blockchain-forensics, which owns the investigation methodology, and it covers the tracing workflow itself: evidence preservation, forward and backward tracing, clustering tests, mixer and bridge hops, and the summary that holds up for investigators. It is for authorized investigations only, and it does not replace licensed chain analysis tools or legal advice.
Quick Workflow
- Define the case: the theft or fraud, the seed addresses, the time window, and the legal basis, and record them before pulling any data.
- Preserve evidence: transaction hashes, block numbers, data source, and retrieval date for everything, with hashes of the exported data files.
- Trace forward from the seed hop by hop, recording amount, asset, timestamp, and the next address at each step.
- Cluster addresses using co-spend and change heuristics, and test each cluster against a known false positive before trusting it.
- Trace backward where useful: where did the attacker's funding come from, and does that funding link to a known service or a prior incident.
- Identify attribution points: exchanges, mixers, bridges, and known services, and mark each one as confirmed, probable, or unknown, never as certain without evidence.
- Handle mixer and bridge hops explicitly: record what entered, what exited, and what cannot be linked, rather than drawing a line across a gap.
- Build the fund flow diagram and address list from the tracing records, not from memory, and prepare the chain of custody summary.
1. Evidence preservation and forward tracing
# Preserve the seed transactions with source and date in the filename
mkdir -p /evidence/case01
cast tx 0x0000000000000000000000000000000000000000000000000000000000000000 \
--rpc-url "$RPC_URL" --json > /evidence/case01/seed-tx.json
sha256sum /evidence/case01/seed-tx.json > /evidence/case01/hashes.txt
jq '.blockNumber, .from, .to, .value' /evidence/case01/seed-tx.json
# List outgoing transfers from a seed address for the first hop
# Fill the address and the block range from the case record
cast logs --from-block 21000000 --to-block 21010000 \
--rpc-url "$RPC_URL" 2>/dev/null | head -40
# Record every hop in a table: from, to, amount, asset, tx hash, block
2. Address clustering test
#!/usr/bin/env python3
"""Address clustering by co-spend heuristic, with a false positive check."""
import json, collections
txs = [json.loads(l) for l in open("/tmp/chain/txs.jsonl")]
parent = {}
def find(a):
while parent.get(a, a) != a:
a = parent[a] = parent.get(parent[a], parent[a])
return a
def union(a, b):
ra, rb = find(a), find(b)
if ra != rb:
parent[ra] = rb
for tx in txs:
inputs = tx.get("inputs", [])
for other in inputs[1:]:
union(inputs[0], other)
clusters = collections.defaultdict(list)
for tx in txs:
for addr in tx.get("inputs", []):
if addr not in clusters[find(addr)]:
clusters[find(addr)].append(addr)
print("clusters found:", len(clusters))
print("largest cluster size:", max(len(v) for v in clusters.values()))
print("check before trusting: shared custody wallets and exchanges")
print("co-spend many unrelated users, so a cluster is a hypothesis, not proof")
3. Mixer, bridge, and attribution handling
# Bridge hop record: what entered one chain and what exited the other
# Compare amounts, timing, and the bridge contract on both sides,
# and mark the link as probable only if amount and timing both match
# 1. Source chain lock transaction hash and amount
# 2. Destination chain mint transaction hash and amount
# 3. Bridge contract addresses on both chains
# 4. Gap note if the amounts differ by more than fees and slippage
echo "bridge hop template recorded in the case notes"
#!/usr/bin/env python3
"""Attribution summary with confidence levels, never overstated."""
attributions = [
{"address": "0xSeedAddress", "label": "theft proceeds", "confidence": "confirmed"},
{"address": "0xExchangeDeposit", "label": "exchange deposit", "confidence": "probable"},
{"address": "0xMixerOutput", "label": "mixer output", "confidence": "unknown"},
]
for row in attributions:
print(f"{row['address']} - {row['label']} - {row['confidence']}")
print("rule: probable needs amount plus timing plus a known service pattern")
print("rule: confirmed needs a service record, an admission, or a matching")
print("on chain identifier, not just a similar amount")
Edge cases
- Change addresses look like new recipients; use change heuristics carefully, and check whether the change returns to the sender's cluster.
- Exchange deposit addresses are often one time use; attributing the deposit address to the exchange is sound, attributing it to a named person is not, without a service record.
- A mixer or privacy pool breaks the deterministic link; report the gap and the amounts on both sides instead of inventing a connection.
- Cross-chain hops through bridges need both chains traced; a flow that stops at the bridge is incomplete, not inconclusive.
- Dust amounts and test transactions create false hops; filter by value threshold and by whether the hop moves a meaningful share of the stolen funds.
- Timestamps across chains and across time zones must be converted to UTC before any timing correlation is claimed.
Key references
1---2name: blockchain-forensics-on-chain-tracing3description: Use when tracing funds on chain from a seed address through hops, mixers, bridges, and exchange attribution points for an authorized investigation. Use when building an evidence-backed fund flow, testing a clustering hypothesis against transaction data, or preparing a tracing summary for investigators or legal reviewers.4version: "1.0.0"5domain: blockchain6lifecycle: stable7last_verified: "2026-10-27"8parent: blockchain-forensics9requires: [blockchain-forensics]10extends: []11relates: [nft-fraud, wallet-security, bridge-attacks]12tools:13 - name: Python14 version: "3.12"15 - name: jq16 version: "1.7"17metadata:18 source: https://skillmd.com/skills/mizazhaider-ceh/blockchain-forensics-on-chain-tracing19---2021On chain tracing follows money on a public ledger: cluster addresses that belong together, follow hops from the theft, and identify where funds meet the regulated world. This sub-skill belongs to blockchain-forensics, which owns the investigation methodology, and it covers the tracing workflow itself: evidence preservation, forward and backward tracing, clustering tests, mixer and bridge hops, and the summary that holds up for investigators. It is for authorized investigations only, and it does not replace licensed chain analysis tools or legal advice.2223## Quick Workflow24251. Define the case: the theft or fraud, the seed addresses, the time window, and the legal basis, and record them before pulling any data.262. Preserve evidence: transaction hashes, block numbers, data source, and retrieval date for everything, with hashes of the exported data files.273. Trace forward from the seed hop by hop, recording amount, asset, timestamp, and the next address at each step.284. Cluster addresses using co-spend and change heuristics, and test each cluster against a known false positive before trusting it.295. Trace backward where useful: where did the attacker's funding come from, and does that funding link to a known service or a prior incident.306. Identify attribution points: exchanges, mixers, bridges, and known services, and mark each one as confirmed, probable, or unknown, never as certain without evidence.317. Handle mixer and bridge hops explicitly: record what entered, what exited, and what cannot be linked, rather than drawing a line across a gap.328. Build the fund flow diagram and address list from the tracing records, not from memory, and prepare the chain of custody summary.3334## 1. Evidence preservation and forward tracing3536```bash37# Preserve the seed transactions with source and date in the filename38mkdir -p /evidence/case0139cast tx 0x0000000000000000000000000000000000000000000000000000000000000000 \40 --rpc-url "$RPC_URL" --json > /evidence/case01/seed-tx.json41sha256sum /evidence/case01/seed-tx.json > /evidence/case01/hashes.txt42jq '.blockNumber, .from, .to, .value' /evidence/case01/seed-tx.json43```4445```bash46# List outgoing transfers from a seed address for the first hop47# Fill the address and the block range from the case record48cast logs --from-block 21000000 --to-block 21010000 \49 --rpc-url "$RPC_URL" 2>/dev/null | head -4050# Record every hop in a table: from, to, amount, asset, tx hash, block51```5253## 2. Address clustering test5455```python56#!/usr/bin/env python357"""Address clustering by co-spend heuristic, with a false positive check."""58import json, collections59txs = [json.loads(l) for l in open("/tmp/chain/txs.jsonl")]60parent = {}61def find(a):62 while parent.get(a, a) != a:63 a = parent[a] = parent.get(parent[a], parent[a])64 return a65def union(a, b):66 ra, rb = find(a), find(b)67 if ra != rb:68 parent[ra] = rb69for tx in txs:70 inputs = tx.get("inputs", [])71 for other in inputs[1:]:72 union(inputs[0], other)73clusters = collections.defaultdict(list)74for tx in txs:75 for addr in tx.get("inputs", []):76 if addr not in clusters[find(addr)]:77 clusters[find(addr)].append(addr)78print("clusters found:", len(clusters))79print("largest cluster size:", max(len(v) for v in clusters.values()))80print("check before trusting: shared custody wallets and exchanges")81print("co-spend many unrelated users, so a cluster is a hypothesis, not proof")82```8384## 3. Mixer, bridge, and attribution handling8586```bash87# Bridge hop record: what entered one chain and what exited the other88# Compare amounts, timing, and the bridge contract on both sides,89# and mark the link as probable only if amount and timing both match90# 1. Source chain lock transaction hash and amount91# 2. Destination chain mint transaction hash and amount92# 3. Bridge contract addresses on both chains93# 4. Gap note if the amounts differ by more than fees and slippage94echo "bridge hop template recorded in the case notes"95```9697```python98#!/usr/bin/env python399"""Attribution summary with confidence levels, never overstated."""100attributions = [101 {"address": "0xSeedAddress", "label": "theft proceeds", "confidence": "confirmed"},102 {"address": "0xExchangeDeposit", "label": "exchange deposit", "confidence": "probable"},103 {"address": "0xMixerOutput", "label": "mixer output", "confidence": "unknown"},104]105for row in attributions:106 print(f"{row['address']} - {row['label']} - {row['confidence']}")107print("rule: probable needs amount plus timing plus a known service pattern")108print("rule: confirmed needs a service record, an admission, or a matching")109print("on chain identifier, not just a similar amount")110```111112## Edge cases113114- Change addresses look like new recipients; use change heuristics carefully, and check whether the change returns to the sender's cluster.115- Exchange deposit addresses are often one time use; attributing the deposit address to the exchange is sound, attributing it to a named person is not, without a service record.116- A mixer or privacy pool breaks the deterministic link; report the gap and the amounts on both sides instead of inventing a connection.117- Cross-chain hops through bridges need both chains traced; a flow that stops at the bridge is incomplete, not inconclusive.118- Dust amounts and test transactions create false hops; filter by value threshold and by whether the hop moves a meaningful share of the stolen funds.119- Timestamps across chains and across time zones must be converted to UTC before any timing correlation is claimed.120121## Key references122123- Ethereum documentation, transactions and accounts: https://ethereum.org/en/developers/docs/transactions/124- Bitcoin developer documentation, transaction structure and change: https://developer.bitcoin.org/125- Chainalysis and TRM Labs public research on tracing methods, read from the vendor sites for methodology context126- Etherscan and equivalent block explorers for transaction verification, used as a data source with hashes recorded127- BIP32 hierarchical deterministic wallets, address derivation context: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki