🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

agora402

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agora402

Escrow protection for autonomous agent payments on Base. USDC held in smart contract until the job is done. PayPal for AI agents via x402.

latest
Source
npmnpm
Version
0.5.3
Version published
Weekly downloads
20
-45.95%
Maintainers
1
Weekly downloads
 
Created
Source

agora402

The trust layer for agent-to-agent commerce. Escrow protection for x402 payments on Base.

Agents pay for API calls with USDC via x402. But payments are final — no refunds, no disputes, no recourse. agora402 fixes this by routing payments through on-chain escrow: funds are locked until delivery is verified, then released automatically.

Install as an MCP server. Your agent gets escrow-protected payments in one tool call.

Quick Start

1. Generate a wallet

npx agora402 init

This creates a fresh wallet and prints your Claude Desktop config — copy-paste and go.

2. Fund it

Send a small amount of ETH (for gas, ~$0.50) and USDC (for payments) to the printed address on Base.

3. Add to Claude Desktop

{
  "mcpServers": {
    "agora402": {
      "command": "npx",
      "args": ["agora402"],
      "env": {
        "PRIVATE_KEY": "0x_YOUR_KEY_FROM_INIT"
      }
    }
  }
}

Restart Claude Desktop. Done — your agent now has escrow-protected payments.

Any MCP Client

PRIVATE_KEY=0x... npx agora402

Runs over stdio. Compatible with any MCP client (Claude Desktop, Claude Code, Cursor, Windsurf, OpenClaw, etc).

Environment Variables

VariableRequiredDescription
PRIVATE_KEYYesWallet private key (hex, with 0x prefix)
CHAINNo"base" for mainnet, defaults to Base Sepolia
BASE_RPC_URLNoCustom RPC URL for Base mainnet
BASE_SEPOLIA_RPC_URLNoCustom RPC URL for Base Sepolia

Contract addresses are hardcoded — no need to configure them.

Tools

x402_protected_call — Flagship

Make an API call with automatic escrow protection. One tool call does everything:

  • Creates USDC escrow on-chain
  • Calls the API
  • Verifies the response (JSON Schema or hash-lock)
  • Auto-releases payment if valid, auto-disputes if not
Parameters:
  url               — API endpoint to call
  seller_address    — Ethereum address of the API provider
  amount_usdc       — Payment amount ($0.10 - $100)
  method            — GET, POST, PUT, DELETE (default: GET)
  headers           — HTTP headers (optional)
  body              — Request body for POST/PUT (optional)
  verification_strategy — "schema" or "hash-lock" (default: schema)
  verification_data — JSON Schema string or expected response hash
  timelock_minutes  — Auto-refund timeout, 5-43200 min (default: 30)

escrow_create

Create a USDC escrow manually for any agent-to-agent transaction.

escrow_release

Confirm delivery and release funds to the seller.

escrow_dispute

Flag bad delivery. Locks funds for arbiter review.

escrow_status

Check the current state of an escrow.

trust_score_query

Look up any agent's on-chain trust score before transacting. Reads the Agora402 Reputation contract — scores are 0-100 based on real escrow history, not self-reported.

Returns: score, success rate, volume, timestamps, recommendation (high_trust / moderate_trust / low_trust).

How It Works

Agent (buyer) ──→ agora402 MCP Server ──→ Escrow Contract (Base L2)
                        │                        │
                  Verify response          USDC held until
                  (schema/hash)            delivery confirmed
                        │                        │
                   Auto-release ←─── Verification passes
                   Auto-dispute ←─── Verification fails

Escrow lifecycle:

FUNDED → RELEASED         (delivery confirmed, seller paid minus 2% fee)
       → DISPUTED → RESOLVED  (arbiter rules: splits funds)
       → EXPIRED → REFUNDED   (timeout: full refund, no fee)
  • 2% protocol fee on release/resolve. Zero fee on refund.
  • $0.10 minimum, $100 maximum per escrow (v1 safety cap).
  • Timelock: 5 minutes to 30 days.
  • On-chain reputation auto-recorded for every escrow outcome.

Chain

TestnetMainnet
NetworkBase SepoliaBase
USDC0x036CbD53842c5426634e7929541eC2318f3dCF7e0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Gas cost~$0.005/escrow cycle~$0.005/escrow cycle

Set CHAIN=base for mainnet. Defaults to Base Sepolia.

Contract

Solidity smart contracts with:

  • Escrow: full 7-state machine with 2% protocol fee
  • Reputation: on-chain trust scores based on escrow history
  • OpenZeppelin ReentrancyGuard + Pausable
  • 135 tests (unit + fuzz + invariant + integration)

Source: github.com/michu5696/agora402

License

MIT

Keywords

mcp

FAQs

Package last updated on 04 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts