> ## Documentation Index
> Fetch the complete documentation index at: https://docs.credprotocol.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ERC-8004 Validation

> How the Cred Protocol Validator computes composite trust assessments for agents and submits them to the ERC-8004 Reputation Registry

Cred Protocol runs an independent **ERC-8004 validator** at `https://validator.credprotocol.com`. Given an agent's wallet, it computes a 0–100 **composite trust score** from three on-chain signals, pins the evidence to IPFS, and (optionally) submits the assessment on-chain to the ERC-8004 Reputation Registry on Base. This page is the methodology reference linked from the validator's [agent card](https://validator.credprotocol.com/.well-known/agent-card.json).

<Info>
  Methodology version **1.0**. Deployed on Base Mainnet (chain 8453); testable on Sepolia (11155111). Validator wallet: `0xc38947DA1EB4466D17d5C6c34a0f26Dbe803d107`.
</Info>

## Composite score

| Signal               | Weight | Source                                                                                                    | Normalisation                                |
| -------------------- | ------ | --------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| **Credit**           | 40%    | Cred Score (300–1000) from `/api/v2/score`                                                                | Linear to 0–100                              |
| **Sybil resistance** | 30%    | Sybil score (0–100) from `/api/v2/identity/.../sybil`                                                     | Inverted — lower sybil risk contributes more |
| **Identity**         | 30%    | Count of verified attestations (ENS, Gitcoin Passport, POAPs, …) from `/api/v2/identity/.../attestations` | Capped and scaled to 0–100                   |

`composite_score = 0.40·credit + 0.30·sybil + 0.30·identity`, rounded to an integer. If a signal is unavailable its weight is redistributed and the result is marked lower-`confidence`.

### Trust levels

| `trust_level` | `composite_score` |
| ------------- | ----------------- |
| `untrusted`   | 0–24              |
| `low`         | 25–49             |
| `moderate`    | 50–74             |
| `high`        | 75–100            |

An agent with `composite_score ≥ 50` is reported as `verified: true`.

### Confidence

| `confidence` | Meaning                 |
| ------------ | ----------------------- |
| `full`       | All 3 signals available |
| `partial`    | 1–2 signals available   |
| `minimal`    | No signals available    |

## Pipeline

1. **Fetch signals** — credit score, sybil score and identity attestations for the wallet (from the Cred Protocol API).
2. **Score** — weighted composite as above.
3. **Pin evidence** — the full breakdown, raw signal values, model versions and timestamp are pinned to IPFS (Pinata); the CID is returned as `evidence_cid`.
4. **Submit on-chain** (optional) — `giveFeedback` on the ERC-8004 Reputation Registry (and the Validation Registry where deployed) with the composite score and evidence URI. `tx_hash` / `tx_status` (`pending` → `submitted` → `confirmed` | `failed`) track it.
5. **Persist** — results are readable afterwards without recomputation.

## API

```bash theme={null}
# Run a validation (computes, pins evidence, submits on-chain) — $0.05, x402 or MPP
curl -X POST "https://validator.credprotocol.com/v1/validate/0xADDRESS?chain_id=8453&submit_onchain=true&submit_reputation=true"

# Read the latest stored validation for a wallet (free)
curl "https://validator.credprotocol.com/v1/validate/0xADDRESS/latest?chain_id=8453"

# Read by ERC-8004 agent ID (free)
curl "https://validator.credprotocol.com/v1/validate/agent/42?chain_id=8453"

# Which payment rails are enabled right now
curl https://validator.credprotocol.com/v1/payment-methods
```

Example response:

```json theme={null}
{
  "agent_wallet": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "agent_id": 0,
  "chain_id": 8453,
  "composite_score": 75,
  "verified": true,
  "trust_level": "high",
  "confidence": "partial",
  "breakdown": {
    "credit":   { "raw_score": 772, "normalized": 67.4, "weight": 0.4 },
    "sybil":    { "raw_score": 16,  "normalized": 84,   "weight": 0.3 },
    "identity": { "raw_attestations": null, "normalized": null, "weight": 0.3 }
  },
  "evidence_cid": "QmWB3dQsQxDALFhDKc5DzuvL62N4rYRQXMWEvh2rfJrdq4",
  "evidence_url": "https://gateway.pinata.cloud/ipfs/QmWB3dQsQxDALFhDKc5DzuvL62N4rYRQXMWEvh2rfJrdq4",
  "tx_hash": null,
  "tx_status": "pending"
}
```

`POST /v1/validate/{address}` without payment returns **402** with x402 (`X-PAYMENT-REQUIRED`) and MPP (`WWW-Authenticate: Payment …`) challenges — see [Machine Payments](/guides/payments). Everything else above is free.

Full OpenAPI: [validator.credprotocol.com/docs](https://validator.credprotocol.com/docs).

## Related

* [Agents API](/api-reference/agents/agent-count) — discover agents in the ERC-8004 Identity Registry and read/submit reputation from the main API (`/api/v2/agents/*`).
* [MCP Services](/mcp-services/overview) — the same tools for MCP-native agents.
* [ERC-8004 specification](https://eips.ethereum.org/EIPS/eip-8004).
