Skip to content

Example proposal — MainStreet reputation oracle integration for buyer agents #1259

@philpof102-svg

Description

@philpof102-svg

Context

MainStreet is a reputation oracle for AI agents on Base (ERC-8004 + x402, EIP-712 attestations). Deployed verifier: 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:

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.

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 on Farcaster · mainstreetxyz.base.eth · github.com/philpof102-svg/mainstreet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions