Building a Wallet Attribution Pipeline with Public APIs
How to build a wallet attribution pipeline using public on-chain data APIs — address discovery, entity resolution, and behavioral profiling without proprietary tools.
Wallet attribution is the process of linking blockchain addresses to real-world entities -- exchanges, institutions, protocols, known individuals -- and building behavioral profiles from on-chain activity. It is the foundation of compliance, analytics, portfolio tracking, and risk assessment in crypto. The good news is that you do not need proprietary tools to build a functional attribution pipeline. Public APIs and open datasets provide enough signal to resolve a large fraction of active addresses.
This article walks through building a wallet attribution pipeline from scratch using publicly available APIs and datasets. Every tool, API, and dataset mentioned here is publicly documented and accessible.
Pipeline Overview
A wallet attribution pipeline has four stages:
- Address Discovery. Identify addresses of interest -- either from transaction monitoring, user-provided addresses, or systematic scanning.
- Data Enrichment. Fetch transaction history, token balances, contract interactions, and metadata for each address.
- Entity Resolution. Link addresses to known entities using labels, heuristics, and clustering.
- Behavioral Profiling. Classify addresses by behavior pattern -- exchange hot wallet, DeFi power user, long-term holder, MEV searcher, etc.
Each stage uses different public APIs. Let us walk through them.
Stage 1: Address Discovery
Before you can attribute an address, you need to know it exists. There are several public sources for address discovery.
Etherscan API
The Etherscan API (etherscan.io/api) is the most widely used public blockchain data API. It covers 60+ EVM chains and provides REST endpoints for account data, contract data, token data, and logs.
For address discovery, the relevant endpoints are:
txlist-- Get a list of transactions for an address. Useful for finding counterparties: if you are monitoring a known entity's address, everyfromandtofield in its transaction list is a newly discovered address.tokennfttx-- Get ERC-721 and ERC-1155 token transfers for an address.tokentx-- Get ERC-20 token transfers for an address.getlogs-- Get event logs filtered by topic and address. Useful for discovering addresses that interact with specific protocols.fundedby-- Get the address that funded a given address. This is critical for entity resolution -- if an address was funded by a known exchange withdrawal, that is a strong signal.
API keys are free with registration. Rate limits are 5 calls/second and 100,000 calls/day on the free tier.
The Graph
The Graph (thegraph.com) is a decentralized indexing protocol that lets you query subgraphs -- indexed datasets of on-chain events -- using GraphQL. Many DeFi protocols publish public subgraphs that expose structured data about their users.
For address discovery, subgraphs are useful because they pre-index protocol-specific data. For example:
- Uniswap V3 subgraph exposes all pools, positions, and swaps. Querying for swaps on a specific pool gives you a list of addresses active in that market.
- Aave subgraph exposes all lenders and borrowers. Querying for deposits gives you addresses with lending activity.
- Compound subgraph similarly exposes users of the lending protocol.
The Graph's hosted service and the decentralized network both provide free query tiers. You query using GraphQL:
{
swaps(orderBy: timestamp, orderDirection: desc, first: 100) {
sender
recipient
pool {
id
}
amountUSD
timestamp
}
}
This returns the 100 most recent swaps on a protocol, giving you sender and recipient addresses to feed into your enrichment stage.
Covalent
Covalent (covalenthq.com) provides a unified API across multiple chains. Their block_heights endpoint and historical data access are useful for systematic address discovery across block ranges. Covalent's API returns decoded event logs and transaction data in a structured format, which can be more convenient than raw Etherscan responses for bulk processing.
Stage 2: Data Enrichment
Once you have a set of addresses, you need to enrich them with transaction history, balances, and metadata.
Etherscan API -- Account Endpoints
Etherscan's account endpoints provide the core enrichment data:
balance-- Get the native token (ETH) balance for a single address.balancemulti-- Get balances for up to 20 addresses in a single call.txlist-- Normal transactions (external). Includesfrom,to,value,gas,gasPrice,timeStamp,isError,input(calldata).txlistinternal-- Internal transactions (value transfers triggered by smart contracts). Only available on Ethereum Mainnet, Polygon Mainnet, and Base Mainnet.tokentx-- ERC-20 token transfers. IncludescontractAddress,value,tokenName,tokenSymbol,tokenDecimal.tokennfttx-- ERC-721 and ERC-1155 transfers.
The input field in txlist responses is the raw calldata of the transaction. You can decode this to determine which function was called on which contract, which tells you what the address was doing -- swapping on Uniswap, depositing on Aave, interacting with a specific staking contract, etc.
Alchemy API
Alchemy (alchemy.com) provides enhanced APIs that go beyond raw blockchain data:
alchemy_getTokenBalances-- Returns ERC-20 token balances for a given address. This is faster than querying each token contract individually.alchemy_getTokenMetadata-- Returns metadata (name, symbol, decimals, logo) for a given token contract address.alchemy_getAssetTransfers-- Returns historical transfers for any address across Ethereum and supported L2s (Base, Polygon, Arbitrum, Optimism). Supports filtering by category (external,internal,erc20,erc721,erc1155), block range, and contract addresses. This is more flexible than Etherscan's per-type endpoints because it unifies all transfer types in a single query.- Portfolio API -- Multi-chain token balances, NFT holdings, and transaction history for a set of addresses. The
Token Balances By Walletendpoint fans out across requested networks and merges results, handling partial failures gracefully.
The alchemy_getAssetTransfers endpoint is particularly useful for enrichment because it returns a unified transfer history across asset types. A single call can return all ERC-20, ERC-721, and internal transfers for an address in a block range, paginated.
Etherscan Metadata API
Etherscan provides a metadata layer of names, labels, and reputation for addresses. The relevant endpoints:
getaddresstag-- Get the name tag for a specific address. This is the human-readable label shown on Etherscan (e.g., "Coinbase: Hot Wallet", "Binance 14", "Vitalik Buterin").- Name tags -- Crowdsourced labels across seven EVM chains, approximately 50,000 tags.
These labels are the starting point for entity resolution. If Etherscan has already tagged an address, your pipeline can use that tag directly.
Stage 3: Entity Resolution
Entity resolution is the process of grouping multiple addresses under a single real-world entity and assigning a label. This is where the pipeline moves from data collection to intelligence.
Public Label Datasets
Several public datasets provide pre-labeled addresses that you can use as a reference layer:
- Etherscan labels. Available via the Etherscan API and as a crowdsourced GitHub dataset (
brianleect/etherscan-labels) with approximately 52,773 tags across seven EVM chains. - dawsbot/eth-labels. A curated Ethereum mainnet labels dataset with approximately 17,495 entries organized by category.
- DeFiLlama protocols. Approximately 3,332 protocol contract addresses, useful for identifying which protocols an address interacts with.
- OFAC SDN. Approximately 788 sanctioned wallet addresses across 18 chains, published as Enhanced XML by the US Treasury.
- Forta labelled-datasets. Approximately 7,480 known malicious contracts and phishing addresses.
- ScamSniffer blacklist. Approximately 2,530 reported scam addresses.
- ethereum-lists. Token contract addresses with metadata, useful for identifying tokens by address.
The key insight from public entity resolution research is that every public dataset is a partial, opinionated view. OFAC publishes sanctioned wallets. Etherscan crowdsources tags. DeFiLlama catalogs protocol addresses. None of them are complete, and none of them talk to each other. A robust pipeline reconciles multiple sources.
Entity Resolution Methods
With labeled reference data in hand, you can apply several entity resolution methods:
Direct label lookup. The simplest method. For each address, check if it appears in any labeled dataset. If it does, assign the label. This catches exchange hot wallets, known protocol contracts, and sanctioned addresses. Coverage is limited to addresses that have already been labeled by someone.
Funding trace heuristics. If address A was funded by a transaction from address B, and address B is labeled "Binance: Withdrawal Wallet", then address A is likely a user who withdrew from Binance. The Etherscan fundedby endpoint provides this directly. This heuristic is not perfect -- the user may have withdrawn to a fresh address and then transferred to another wallet -- but it provides a strong prior.
Co-spending clustering. If two addresses are used as inputs in the same transaction (common in UTXO chains like Bitcoin) or if one address consistently sends to another in a pattern suggesting they are controlled by the same entity, they can be clustered. On EVM chains, co-spending is less direct but can be inferred from patterns like a wallet that always sends gas to another wallet before it transacts.
Temporal clustering. If two addresses transact within seconds of each other in a pattern that suggests automated coordination (e.g., MEV bot transactions, or a deployer contract creating multiple contracts in sequence), they may be controlled by the same entity.
Protocol interaction fingerprinting. If two addresses interact with the same set of protocols in the same order with similar transaction patterns, they may be the same entity using multiple wallets. This is weaker than direct labeling but useful for clustering.
Multi-Source Reconciliation
When you have multiple labels for the same address from different sources, you need a reconciliation strategy:
- Priority hierarchy. Assign trust levels to sources. Government sanctions lists (OFAC) have the highest priority for risk screening. Exchange-confirmed labels are high trust for entity attribution. Crowdsourced labels are medium trust. Heuristic-derived labels are low trust.
- Conflict detection. If two sources disagree on the label for an address, flag it for manual review. Do not silently pick one.
- Cluster merging. If source A says address X belongs to "Coinbase" and source B says address Y belongs to "Coinbase", and your heuristic clustering says X and Y are co-controlled, merge them into a single Coinbase cluster with both addresses.
Research on public entity resolution pipelines has shown that running this reconciliation across all available public sources can surface 30,000+ multi-source clusters from 13 million input rows -- meaning addresses that are independently confirmed by multiple datasets, which are high-confidence attributions.
Stage 4: Behavioral Profiling
Once you have enriched data and entity labels, you can classify addresses by behavior. This is useful for identifying unknown addresses that do not match any known entity label.
Classification Dimensions
Activity frequency. How many transactions per day/week/month? High-frequency addresses are likely bots, MEV searchers, or exchange hot wallets. Low-frequency addresses are likely individual users or cold storage.
Asset diversity. How many different tokens does the address hold? A broad portfolio suggests an active DeFi user or a fund. A single-token holding suggests a specific-purpose wallet.
Protocol interaction pattern. Which protocols does the address interact with? An address that only interacts with Uniswap is a trader. An address that interacts with Aave, Compound, and Uniswap is a DeFi power user. An address that interacts with lending protocols and holds stablecoins is likely a lender.
Transaction value distribution. Are transactions consistently large (institutional), consistently small (retail), or variable? Exchange hot wallets typically have high variance in transaction size because they process user withdrawals of varying amounts.
Gas price behavior. Does the address consistently pay above-market gas prices (suggesting urgency or MEV)? Does it always use the exact same gas price (suggesting an automated system)?
Time-of-day pattern. When does the address transact? If activity is concentrated in specific hours, it may indicate a human in a specific timezone. If activity is uniformly distributed, it is likely automated.
Building the Profile
To build a behavioral profile, you need the enriched transaction data from Stage 2. For each address, compute:
metrics = {
tx_count_30d: count of transactions in last 30 days,
unique_protocols: count of distinct contract addresses interacted with,
unique_tokens: count of distinct token contracts held,
median_tx_value: median value of transactions,
gas_price_p95: 95th percentile gas price paid,
active_hours: set of hours (UTC) with transaction activity,
counterparties: set of addresses transacted with
}
These metrics can be computed from the Etherscan txlist and tokentx responses, or from Alchemy's alchemy_getAssetTransfers responses. The computation is straightforward data processing -- no specialized tooling required.
Classification Heuristics
With metrics in hand, apply classification rules:
- Exchange hot wallet. High tx_count, high counterparties, high value variance, labeled counterparties (many users withdrawing). Often already labeled by Etherscan.
- MEV searcher. High tx_count, high gas_price_p95, interacts with mempool or DEX contracts, transacts in blocks with sandwich attacks or arbitrage patterns.
- DeFi power user. Medium tx_count, high unique_protocols, medium unique_tokens, interacts with lending and DEX protocols.
- Long-term holder. Low tx_count, low unique_protocols, holds tokens for long periods without transferring.
- Fund or institution. Large median_tx_value, broad asset diversity, periodic rebalancing patterns, may interact with staking or yield protocols.
These are heuristics, not certainties. The goal is to narrow down the classification space so that manual review (if needed) is focused on the most ambiguous cases.
Pipeline Architecture
A practical pipeline architecture using these public APIs:
Ingestion layer. A job scheduler (cron, Airflow, or a simple loop) that periodically polls Etherscan and Alchemy APIs for new transactions on monitored addresses. Rate limit awareness is critical -- Etherscan allows 5 calls/second on the free tier. Use a queue with rate limiting.
Storage layer. Store enriched data in a database. PostgreSQL with JSONB columns for flexible transaction metadata is a common choice. For larger scale, a time-series database for transaction events and a graph database for entity relationships.
Label layer. Maintain a local copy of public label datasets, updated periodically. Join incoming addresses against this label database for direct lookup.
Clustering layer. Run entity resolution heuristics on the enriched data. This can be batch-processed nightly for new addresses.
API layer. Expose the attribution results via a simple REST API for downstream consumers -- compliance dashboards, analytics tools, or go-to-market strategies for token projects that need wallet intelligence.
Rate Limits and Cost Considerations
All APIs mentioned have free tiers with rate limits:
- Etherscan. 5 calls/second, 100,000 calls/day on the free tier. Paid tiers available for higher limits.
- Alchemy. Free tier includes 300 million compute units per month. Different endpoints consume different amounts (e.g.,
alchemy_getAssetTransferscosts 120 compute units per call). - The Graph. Free queries on the decentralized network with rate limits. Paid plans for higher throughput.
- Covalent. Free tier with rate limits. Paid plans for higher throughput.
For a pipeline monitoring a few thousand addresses with daily enrichment, the free tiers are sufficient. At scale (hundreds of thousands of addresses), you will need paid API tiers or self-hosted indexing using your own RPC nodes.
Limitations of Public-Data-Only Pipelines
A pipeline built entirely on public data has limitations you should be aware of:
Label coverage is incomplete. Public label datasets cover a small fraction of all active addresses. Most addresses will remain unlabeled. Your pipeline can classify them behaviorally but cannot assign entity-level attribution without additional signal.
Heuristics produce false positives. Funding trace heuristics can be wrong -- a user may withdraw from Binance to a fresh address and then send to a friend, making the friend look like a "Binance user." Temporal clustering can group unrelated addresses that happen to transact at similar times.
Privacy-preserving behaviors defeat clustering. Users who employ fresh addresses for each transaction, use mixers, or route through bridges will not be easily clustered. This is by design -- these behaviors exist to prevent attribution.
Sanctions screening is necessary but not sufficient. Checking against OFAC lists catches sanctioned addresses but does not identify addresses that are one or two hops away from sanctioned entities, which is why a full KYT and transaction monitoring stack is needed for production compliance. For deeper risk screening, you need graph traversal across the transaction network, which is computationally expensive at scale.
Summary
Building a wallet attribution pipeline with public APIs is feasible and practical. The core components are:
- Etherscan API for transaction history, token transfers, and address labels.
- Alchemy API for multi-chain asset transfers and token balances.
- The Graph for protocol-specific structured data.
- Public label datasets (Etherscan labels, DeFiLlama, OFAC, Forta) for entity reference.
- Heuristic clustering (funding traces, temporal patterns, protocol fingerprinting) for unknown addresses.
- Behavioral profiling for classification of unattributed addresses.
The pipeline will not achieve 100% attribution -- no pipeline does, even with proprietary data. But it will resolve a meaningful fraction of addresses to known entities and classify the rest by behavior pattern. For compliance, analytics, and portfolio tracking use cases, that is often sufficient. All tools and datasets mentioned in this article are publicly available and documented.
Frequently Asked Questions
What is wallet attribution?
Wallet attribution is the process of linking blockchain addresses to real-world entities such as exchanges, institutions, or individuals, and grouping related addresses into clusters. It combines on-chain transaction analysis with off-chain data sources to assign labels and identities to otherwise pseudonymous addresses. Attribution is used for compliance, risk assessment, market intelligence, and forensic investigation. The output is typically a mapping from address to entity label with an associated confidence score.
What public APIs are available for on-chain analysis?
Several public APIs provide on-chain data for attribution, including blockchain explorers with REST endpoints, node RPCs for raw chain data, and specialized analytics platforms with labeled address databases. Etherscan and equivalent block explorers offer transaction and contract data via free-tier APIs. Graph indexing protocols provide structured queries over indexed subgraph data. Public label databases maintained by research communities and some analytics providers publish exchange and known-entity address sets that can be used as attribution seeds.
How do you cluster wallets?
Wallet clustering groups addresses that are likely controlled by the same entity by analyzing on-chain behavioral patterns. The most common heuristic is the common-input-ownership heuristic, where addresses that appear as inputs in the same transaction are assumed to share an owner. Other heuristics include temporal correlation, shared funding sources, and interaction with the same set of contracts. Clustering is an iterative process where seed addresses are expanded by applying heuristics and the resulting clusters are validated against known labels.
What is entity resolution in blockchain?
Entity resolution in blockchain is the process of determining whether two on-chain identities or clusters refer to the same real-world entity. It involves merging clusters that exhibit identical behavioral signatures, resolving conflicts where a single address is used by multiple entities such as a shared exchange hot wallet, and assigning canonical entity labels. Entity resolution draws on both on-chain evidence and off-chain signals such as KYC records, public statements, and known deposit addresses. The goal is a consistent, non-redundant mapping from addresses to entities.
How accurate is wallet attribution?
Wallet attribution accuracy varies widely depending on the entity type, the quality of seed data, and the heuristics applied. Attribution of large exchanges and known institutions is typically high-confidence because their deposit and withdrawal patterns are well-documented and publicly labeled. Attribution of individual users is much less reliable because individuals can create unlimited addresses and mix funds through privacy tools. Heuristic clustering can produce false positives when unrelated addresses are grouped together, so production systems assign confidence scores rather than binary labels.
Put it to work
The research above powers the product — try it or compare it: