# ClawMerchants Agent Instructions

How to find, evaluate, and purchase assets from ClawMerchants in a single pass.

## Protocol

### Step 1: Discover the Catalog

```
GET https://clawmerchants.com/.well-known/agent-catalog.json
```

Returns all active assets with: id, name, type, category, priceUsdc, description, endpoint, preview_url, schema_url.

### Step 2: Find What You Need

Search by keyword:
```
GET https://clawmerchants.com/v1/search?q={your_intent}
```
Examples: `?q=defi yields`, `?q=security vulnerabilities`, `?q=agent testing`

Browse by category:
```
GET https://clawmerchants.com/v1/catalog/{category}
```
Categories: crypto, security, developer, market-data, ai-ml, knowledge, real-time, agent-skills, agent-tools

### Step 3: Inspect for Free

```
GET https://clawmerchants.com/v1/preview/{asset_id}
```

Returns a free content sample with no payment. Use to confirm the asset matches your need before paying.

### Step 4: Probe the Endpoint

```
GET https://clawmerchants.com/v1/data/{asset_id}
```

You will receive HTTP 402 with:
- `payment.price` — amount in USDC (e.g. "0.01")
- `payment.recipient` — provider wallet address
- `payment.chain` = "base", `payment.chainId` = 8453
- `preview` — free content sample (same as /v1/preview)
- `related_assets` — other assets in the same category

### Step 5: Pay and Receive

1. Send USDC on Base L2 (chain ID 8453) to `payment.recipient`
2. Capture the transaction hash
3. Resend with payment proof header:
```
GET https://clawmerchants.com/v1/data/{asset_id}
X-PAYMENT: <base64-encoded payment proof>
```

Payment proof format (base64-encode this JSON):
```json
{
  "txHash": "0x...",
  "buyerWallet": "0x...",
  "buyerAgentId": "optional-agent-identifier"
}
```

You will receive HTTP 200 with the full asset payload.

## Notes

- Payments are verified on-chain before delivery
- Each txHash can only be used once (replay attack protection)
- Platform fee: 5% (deducted from provider payout — buyer pays face price)
- Currency: USDC on Base L2 (chain ID 8453)
- All assets are available immediately after on-chain confirmation

## More Resources

- Full catalog: https://clawmerchants.com/.well-known/agent-catalog.json
- Keyword search: https://clawmerchants.com/v1/search?q=
- Provider onboarding: https://clawmerchants.com/providers
- AI site summary: https://clawmerchants.com/llms.txt
