# VerificationBadge

**Slug:** `verification-badge`  
**Import:** `import { VerificationBadge } from "@p4n/erc8004-ui"`

> **NOTE — unofficial library.** `@p4n/erc8004-ui` is an independent, community-built project. It is not affiliated with, maintained by, or endorsed by the authors of ERC-8004. It reads the standard's on-chain data through public subgraphs; it does not speak for the standard.

## Description

Compact inline badge showing the agent's verification tier derived from completed validations and average validation score.

## Caveats

> **Warning:** The Validation Registry contract is recorded at the zero address on every chain checked — testnets included — so this component renders its empty state everywhere. Verified 2026-09-04 across Ethereum, Base, Polygon, BNB Smart Chain, BNB Chapel and Base Sepolia. See [Concepts › Validation Registry](https://erc8004-ui.vercel.app/docs/concepts#validation-registry).

## Usage

```tsx
import { VerificationBadge } from "@p4n/erc8004-ui"
<VerificationBadge agentRegistry="eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432" agentId={888} />
```

## Examples

### Alongside Agent Name

Place next to an agent name for inline trust indication.

```tsx
<AgentProvider agentRegistry="eip155:8453:0x8004...a432" agentId={888}>
  <div className="flex items-center gap-2">
    <AgentName />
    <VerificationBadge />
  </div>
</AgentProvider>
```

### Standalone

Used alone as a compact trust indicator anywhere in the UI.

```tsx
<VerificationBadge agentRegistry="eip155:8453:0x8004...a432" agentId={888} />
```

## In Context

VerificationBadge in a trust panel with validation score and recent validations.

```tsx
<AgentProvider agentRegistry="eip155:8453:0x8004...a432" agentId={888}>
  <div className="flex items-center gap-2">
    <AgentName />
    <VerificationBadge />
  </div>
  <ValidationScore />
  <ValidationList pageSize={3} />
</AgentProvider>
```

## API Reference

| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `agentRegistry` | `string` | no | — | Agent registry in the format "eip155:{chainId}:{contractAddress}". Required unless inside an <AgentProvider>. |
| `agentId` | `number` | no | — | ERC-721 token ID of the agent. Required unless inside an <AgentProvider>. |
| `className` | `string` | no | — | Optional CSS classes merged onto the component root for layout, spacing, or custom styling (e.g. Tailwind). |

## States

This component handles loading and error states internally with inline placeholders. No configuration needed.

## Reference

- Live preview & full docs: https://erc8004-ui.vercel.app/docs/components/verification-badge
- Markdown source: https://erc8004-ui.vercel.app/docs/components/verification-badge.md
