Example proposal — MainStreet reputation oracle integration for buyer agents
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 815
- Avg merge
- 13h 31m
- Merged PRs (30d)
- 2
Description
## Context
[MainStreet](https://avisradar.app/mainstreet.html) is a reputation oracle for AI agents on Base (ERC-8004 + x402, EIP-712 attestations). Deployed verifier: [`0x7397adb9713934c36d22aa54b4dbbcd70263592b`](https://basescan.org/address/0x7397adb9713934c36d22aa54b4dbbcd70263592b).
Browsing your `typescript/examples/` folder, I noticed there's no example showing how a buyer agent **vets a recipient before paying**. Right now, examples like `langchain-cdp-smart-wallet-chatbot` show *how* to send onchain, not *whether to trust the destination*.
## Proposal
Add `typescript/examples/langchain-mainstreet-trust-gate/` showing a 10-line trust check before any x402 payment:
```ts
import { CdpAgentkit } from '@coinbase/cdp-agentkit-core';
import { recoverTypedDataAddress } from 'viem';
// Before paying any wallet via x402, fetch MainStreet attestation
async function safePay(agentkit, recipient, amountUSDC, minScore = 30) {
const att = await fetch(`https://avisradar.app/api/agent/attestation/${recipient}`).then(r => r.json());
if (!att.payload || att.payload.score < minScore) throw new Error(`MainStreet score ${att.payload?.score ?? 'unknown'} < ${minScore}`);
return agentkit.run('transfer', { to: recipient, amount: amountUSDC });
}
```
Or onchain via the deployed verifier — see [recipe](https://avisradar.app/api/agent/integrate/agentkit).
## Why this matters
833+ Base agents in x402 Bazaar. Some real, some throwaway. Today AgentKit users can pay any of them. A trust gate prevents users from paying low-rep wallets they wouldn't pay if they could see the score.
Happy to file a PR if this lands as priority. MIT-licensed, no MainStreet token, free score reads, $0.25 audit for deep due-diligence.
— [@rakshasar](https://warpcast.com/rakshasar) on Farcaster · mainstreetxyz.base.eth · [github.com/philpof102-svg/mainstreet](https://github.com/philpof102-svg/mainstreet)
Contributor guide
Assessment
This issue has not been assessed yet.