TraceRank: Reputation-Weighted Service Discovery
- TraceRank is a reputation-weighted ranking algorithm that models payment interactions as a directed weighted graph to prioritize high-quality service providers.
- It employs off-chain seed reputations alongside logarithmic flow normalization and exponential decay to mitigate the influence of low-reputation, Sybil actors.
- The iterative PageRank-style propagation method enhances precision and correlates well with human-evaluated reputations in large, real-world payment graphs.
TraceRank is a reputation-weighted ranking algorithm for service discovery in agent economies, introduced in the context of the x402 protocol. It constructs a Sybil-resistant ranking of on-chain HTTP service providers, using payment relationships as endorsements, and propagates initial reputation based on off-chain signals such as social verifications and registry attestations. The algorithm processes the network of cryptocurrency payments as a weighted, directed graph, seeding addresses with reputational mass, and iteratively propagating this mass along recent, high-value payment flows. By explicitly discounting the influence of low-seed, potentially Sybil actors and emphasizing the input of reputable entities, TraceRank surfaces services preferred by high-reputation users while suppressing those with merely high transaction volume (Shi et al., 31 Oct 2025).
1. Graph Model and Problem Definition
TraceRank models the payment universe as a directed, weighted multigraph , where indexes on-chain addresses (including both payers and service endpoints), and represents individual payment transactions. Each edge encodes a payment with attributes:
- : transaction value in USD (e.g., stablecoin such as USDC).
- : timestamp of the transaction.
Over a specified temporal window (typically the most recent 90 days), all transactions from to are aggregated into an endorsed flow . This consolidation reflects real-world usage patterns and mitigates spam or outlier events. The explicit payment graph provides an objective substrate for flows of trust and reputation.
2. Reputation Seeding and Initialization
Each address receives an initial "seed" reputation reflecting its trustworthiness, as derived from off-chain signals. These may include: trading performance metrics (e.g., low slippage, on-chain profit/loss), decentralized social signals (social following relationships, DAO memberships, protocol-linked verifications), and entries in labeled entity registries (attestations for identity, compliance, audit through ERC-8004, etc.).
Addresses lacking public or credible signals are assigned . The complete seed vector is computed prior to propagation and remains static throughout the iterative process.
3. Edge Weighting and Flow Normalization
For each pair , the aggregate endorsed flow is computed as:
where is the age in days and is a temporal-decay rate. This formula log-scales each payment to limit the effect of outliers and whale flows, and applies exponential decay to emphasize recent behavior.
For each service :
is the total inbound flow. The column-stochastic weight matrix is then defined by:
ensuring each column of sums to 1 (for ), as required for stability in the propagation stage.
4. Iterative Reputation Propagation
TraceRank employs a PageRank-style power iteration to propagate reputation:
where is the reputation vector at iteration , is the fixed seed vector, and is the damping factor (commonly ). The seed-reinjection term ensures that only externally sourced reputation mass enters the system, while transmits reputation along incoming flows.
At convergence, the scheme solves the fixed-point equation:
Uniqueness and convergence are guaranteed due to the spectral properties of (column-stochastic with spectral radius ) and .
Convergence is assessed when the norm falls below a tolerance (e.g., to ). For million-edge graphs, 20–50 iterations are typically sufficient.
5. Sybil Resistance and Attack Mitigation
TraceRank's design yields robust Sybil resistance properties. When a service receives payments from new wallets lacking seed reputation (), the incoming reputation mass from these sources remains negligible, regardless of their flow ; thus, their repeated use cannot meaningfully boost 's ranking.
A single high-seed payer, however, introduces significant mass, making it expensive for adversaries to simulate legitimate reputation. The logarithmic scaling of flows and the exponential decay further restrict attempts by adversaries to amplify their standing through either large or temporally clustered payments (e.g., typical wash trading). All reputable mass must originate from verifiable, off-chain seeded addresses, as the propagation mechanism is mass-conserving for . No combination of "circular" payment patterns between Sybil addresses creates misattributed mass.
6. Algorithmic Summary and Implementation Considerations
The algorithm proceeds as follows:
- Input: transaction list , seed vector , decay factor , damping , tolerance .
- Aggregate edges forming for each address pair and compute .
- Construct the sparse weight matrix .
- Initialize .
- Iterate: , updating until .
The dominant computational cost is in power iteration, each step requiring time for sparse multiplication and for the teleport term. Space requirements are , using compressed column (CSC/CSR) formats for and dense arrays for and . With efficient C++ or CUDA (cuSPARSE/OpenMP) implementations, TraceRank computes on graphs with millions of edges in seconds to tens of seconds per propagation cycle.
Practical deployment stores per-service TraceRank vectors in a PostgreSQL database alongside semantic embeddings, enabling joint queries via vector indexes (pgvector) and btree on the TraceRank field. Data ingestion pipelines may compute log-scaling and decay as part of ETL.
7. Empirical Evaluation and Performance
Deployment on the x402 payment graph (hundreds of thousands of addresses, millions of payments) confirms TraceRank's effectiveness. The algorithm inverts the ranking of spam services (those paid by many low-seed wallets) versus legitimate services favored by high-reputation payers. Compared to unseeded PageRank and raw transaction volume, TraceRank substantially increases precision@K (fraction of reliable services among the top ). At , the margin is reported as greater than . Spearman correlation with human-labeled service reputations is consistently higher for TraceRank.
Multiplicative fusion of TraceRank with semantic retrieval (e.g., cosine similarity between query and service embedding, scaled by TraceRank) yields high-quality, contextually relevant discovery results. Dynamic updating is facilitated by re-aggregation of recent edges, allowing adaptation to underlying payment trends without recomputing on the full historic graph (Shi et al., 31 Oct 2025).