A trust scoring system for Ethereum addresses based on on-chain activity. ChainRank analyzes blockchain events from DeFi protocols to calculate reputation scores using the EigenTrust algorithm.
ChainRank fetches events from major DeFi protocols (Aave, Compound, Uniswap, Lido, etc.) and calculates trust scores based on user interactions. The system supports multiple chains (Ethereum, Base) and incorporates identity verification through ENS and Farcaster.
- Multi-protocol support: Lending (Aave, Compound, Morpho, Spark), DEXs (Uniswap, Aerodrome, 1inch, CoW), Liquid Staking (Lido, Rocket Pool, EtherFi), and more
- Multi-chain: Ethereum and Base
- Identity integration: ENS names and Farcaster verification multipliers
- Configurable weights: Customize trust weights per event type
- EigenTrust algorithm: Calculate global trust scores from local trust relationships
-
Clone the repository and navigate to the project directory
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile with your RPC endpoints:RPC_ETHEREUM=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY RPC_BASE=https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY
Generate initial seed scores for trusted contracts:
python generate_seeds.py --config config.toml
python generate_seeds.py --config config.toml --chain ethereumDownload events from configured protocols:
python fetch_events.py --config config.toml
python fetch_events.py --config config.toml --year 2025 --month 1Compute trust scores from the fetched events:
python calculate_trust.py --config config.toml
python calculate_trust.py --config config.toml --input raw/ethereum_aave_20240101_120000.csvResolve ENS names for scored addresses:
python fetch_ens_names.py --config config.tomlMap addresses to ENS/Farcaster identities:
python map_identities.py --scores scores/ethereum.csv --output scores/ethereum_mapped.csvThe config.toml file contains:
- time_periods: Define the time range for event fetching
- seed_contracts: Trusted protocol contracts by chain
- allowlisted_events: Event signatures to track per protocol
- trust_weights: Scoring weights for different event types
- output: Output folder and file format settings
- indexer: Rate limiting and batch processing settings
Events are weighted based on their trust implications:
| Category | Positive Weight | Negative Weight |
|---|---|---|
| Supply/Deposit | +1.0 | - |
| Repay | +1.0 | - |
| Liquidator | +0.5 | - |
| Borrow | - | -0.5 |
| Withdraw | - | -0.5 |
| Liquidated | - | -1.0 |
trust = max(0, Σ log(amount) * event_weight)
Verification multipliers:
- ENS verified: 2x
- Farcaster verified: configurable
- World ID verified: configurable
chainrank/
├── config.toml # Main configuration
├── config.defi.toml # DeFi-specific configuration
├── requirements.txt # Python dependencies
├── generate_seeds.py # Generate seed scores
├── fetch_events.py # Fetch on-chain events
├── calculate_trust.py # Calculate trust scores
├── fetch_ens_names.py # Resolve ENS names
├── map_identities.py # Map addresses to identities
├── find_seed_candidates.py # Find potential seed addresses
├── raw/ # Raw event data
├── seed/ # Seed score files
├── scores/ # Calculated trust scores
├── trust/ # Trust edge data
└── output/ # Final output files
- Aave V3
- Compound V2/V3
- Morpho Blue
- Spark
- Fluid
- Uniswap V3
- Aerodrome
- 1inch
- 0x
- Paraswap
- CoW Protocol
- Lido (stETH, wstETH)
- Rocket Pool
- EtherFi
- Frax ETH
- EigenLayer
- Renzo
- Kelp
- Puffer
- Origin (OETH)
- Yearn Finance
MIT