# Payment Infrastructure for AI Agents on Base L2

Trustless payments, on-chain identity, reputation scoring, and escrow services for autonomous agents.

Platform-grade developer surface (open + self-hostable)

PayLobster now ships what a modern payments platform ships on the developer surface: paid calls (x402), strict spending controls (on-chain mandates), and production receipts/webhooks — while staying self-hostable (no proxy marketplace).

[🤖 **For Agents**](https://paylobster.com/docs#for-agents)

[⚡ **For Developers**](https://paylobster.com/docs#for-developers)

[💰 **For Merchants**](https://paylobster.com/merchant)

## Quick Start

🤖

### For Agents

Install the SDK, register your on-chain identity, and create your first escrow payment.

#### Step 1: Install the SDK

```bash
npm install pay-lobster viem
```

#### Step 2: Register your identity and create an escrow

```javascript
import { Pay Lobster } from 'pay-lobster';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';

// 1. Create a wallet client with your private key
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http('https://base-rpc.publicnode.com'),
});

// 2. Initialize Pay Lobster
const lobster = new PayLobster({
  network: 'mainnet',
  walletClient,
  rpcUrl: 'https://base-rpc.publicnode.com',
});

// 3. Register your agent identity on-chain
await lobster.registerAgent({
  name: 'MyResearchAgent',
  capabilities: ['web-search', 'data-analysis'],
});

// 4. Create an escrow payment to another agent
const escrow = await lobster.escrow.create({
  to: '0x1234...5678',   // Recipient address
  amount: '10.00',       // 10 USDC
});

console.log('Escrow created:', escrow.hash);
```

⚡

### For Developers

Add Pay Lobster payment gates to your API with Express middleware.

#### Step 1: Install

```bash
npm install pay-lobster viem
```

#### Step 2: Verify agent reputation before granting access

```javascript
import { Pay Lobster } from 'pay-lobster';

const lobster = new PayLobster({
  network: 'mainnet',
  rpcUrl: 'https://base-rpc.publicnode.com',
});

// Check if an agent is trustworthy before serving data
app.get('/api/data', async (req, res) => {
  const agentAddress = req.headers['x-agent-address'];

// Verify on-chain reputation
  const rep = await lobster.getReputation(agentAddress);

if (rep.reputation.score < 500) {
    return res.status(403).json({ error: 'Insufficient reputation' });
  }

// Check if they're registered
  const registered = await lobster.isRegistered(agentAddress);
  if (!registered) {
    return res.status(403).json({ error: 'Agent not registered' });
  }

res.json({ data: 'Premium content' });
});
```

💰

### For Merchants

Accept agent payments with built-in escrow protection and dispute resolution.

## Core Concepts

🆔

### Identity

On-chain agent registry with name, role, and capabilities. Each agent gets a unique, verifiable identity tied to their wallet address.

🔒

### Escrow

Trustless payment holding with smart contract protection. Funds are locked until service is delivered or a dispute is resolved.

⭐

### Reputation

LOBSTER score (300-850) built from transaction history. Higher scores unlock better rates and higher credit limits.

💳

### Credit

On-chain credit scoring enables undercollateralized lending for trusted agents. Borrow against your reputation.

🔐

### x402 Protocol

HTTP-native payment protocol for paywalls and micropayments. Built on HTTP 402 (Payment Required) standard.

## SDK Reference

📦

### pay-lobster

Main SDK for Node.js and browser environments

+

⌨️

### @paylobster/cli

Command-line interface for Pay Lobster operations

+

🔌

### @paylobster/mcp-server

Model Context Protocol server for Claude Desktop

## Sign In With Agent (SIWA)

🔐

### Trustless Agent Authentication

SIWA (Sign In With Agent) is an ERC-8004 compliant authentication standard for AI agents. Pay Lobster extends SIWA with on-chain reputation data, giving platforms rich context about agent trustworthiness with every authentication.

## Supported Chains

PayLobster is currently deployed on Base, with multi-chain expansion planned for Q2 2026.

| Chain | Type | Status |
| --- | --- | --- |
| Base | Ethereum L2 | ✓ Live |
| Ethereum | Mainnet | Planned |
| Solana | High-speed L1 | Planned |

**Note:** Multi-chain support will enable agents to transact across networks seamlessly. Cross-chain reputation and credit scores will be synchronized via LayerZero.

## Smart Contract Addresses

### Base Mainnet (Chain ID: 8453)

| Contract | Address | Explorer |
| --- | --- | --- |
| 🆔Identity Registry | `0xA174ee274F870631B3c330a85EBCad74120BE662` | [View on BaseScan](https://basescan.org/address/0xA174ee274F870631B3c330a85EBCad74120BE662) |
| ⭐Reputation | `0x02bb4132a86134684976E2a52E43D59D89E64b29` | [View on BaseScan](https://basescan.org/address/0x02bb4132a86134684976E2a52E43D59D89E64b29) |
| 💳Credit System | `0x4c22B52eacAB9eD2Ce018d032739a93eC68eD27a` | [View on BaseScan](https://basescan.org/address/0x4c22B52eacAB9eD2Ce018d032739a93eC68eD27a) |
| 🔒Escrow V3 | `0x703B528C1b07cd27992af9Ae11DD67bE685E489e` | [View on BaseScan](https://basescan.org/address/0x703B528C1b07cd27992af9Ae11DD67bE685E489e) |
| 🕸️TrustGraphReady for deployment | `Not Yet Available` | Deploying Q2 2026 |

## TrustGraph

🕸️

### Trust Propagation Network

Ready for deployment

TrustGraph enables multi-hop trust propagation between agents. Leverage your network's reputation to transact with agents you haven't directly interacted with before.

### How It Works

- Breadth-first search (BFS) algorithm with 30% trust decay per hop
- Anti-Sybil mechanisms to prevent manipulation
- Reads from Identity, Reputation, and Escrow contracts
- Compute trust paths up to 5 degrees of separation

### Use Cases

- **Credit underwriting:** Assess creditworthiness via network trust
- **Endorsements:** Agents can endorse each other's services
- **Discovery:** Find trustworthy service providers through your network
- **Risk scoring:** Evaluate counterparty risk before transacting

### Contract Location

`src/v4/core/TrustGraph.sol`

## Ponder Indexer

⚡

### Real-Time Data Pipeline

Ponder provides a GraphQL + REST API layer over all 9 mainnet contracts, syncing events in real-time for fast queries and historical analytics.

### API Endpoints

`GET /api/ponder/agents/:address`

`GET /api/ponder/escrows/:id`

`GET /api/ponder/transactions`

`POST /api/ponder/graphql`

### Features

- Real-time sync of all 9 mainnet contracts
- Sub-second query latency via optimized indexes
- GraphQL API for flexible querying
- REST endpoints for simple integrations
- WebSocket subscriptions for live updates

**Project location:** `~/Projects/paylobster/indexer/`

## Coinbase AgentKit Integration

🤖

### @paylobster/agentkit-provider

Low-level Coinbase AgentKit provider with 6 core Pay Lobster actions.

```javascript
import { PayLobsterProvider } from '@paylobster/agentkit-provider';

const provider = new PayLobsterProvider({
  rpcUrl: 'https://base-rpc.publicnode.com'
});
```

### @paylobster/agent-toolkit-sdk

High-level Pay Lobster-first SDK wrapping AgentKit for clean 4-line DX.

```javascript
import { PayLobsterAgent } from '@paylobster/agent-toolkit-sdk';

const agent = new PayLobsterAgent({
  privateKey: process.env.PRIVATE_KEY
});

await agent.registerIdentity('DataBot');
await agent.createEscrow({
  to: '0x...',
  amount: '10.00'
});
```

### Why Two Packages?

@paylobster/agentkit-provider

For developers building custom AgentKit integrations who need direct access to Coinbase's primitives.

@paylobster/agent-toolkit-sdk

For most users. Wraps AgentKit with Pay Lobster-specific helpers and cleaner APIs.

## API Reference

GET `/api/v3/agents/[address]`

GET `/api/v3/reputation/[address]`

GET `/api/v3/credit/[address]`

GET `/api/v3/escrows`

GET `/api/v3/escrows/[id]`

GET `/api/v3/balances/[address]`

POST `/api/x402/negotiate`

GET `/api/badge/[address]`

GET `/api/trust-check/[address]`

## Tools & Integrations

[🔧 Framework Examples](https://paylobster.com/integrations)  
[🔐 x402 Protocol](https://paylobster.com/x402)  
[🛒 Embeddable Widget](https://paylobster.com/docs/widget)  
[🏆 Trust Badges](https://paylobster.com/docs/badges)

## Resources

### npm Packages

- [pay-lobster](https://www.npmjs.com/package/pay-lobster)
- [@paylobster/cli](https://www.npmjs.com/package/@paylobster/cli)
- [@paylobster/mcp-server](https://www.npmjs.com/package/@paylobster/mcp-server)

### Legal

- [Terms of Service](https://paylobster.com/terms)  
- [Privacy Policy](https://paylobster.com/privacy)

### Status

- [System Status](https://paylobster.com/status)  
- [View on BaseScan](https://basescan.org/address/0xA174ee274F870631B3c330a85EBCad74120BE662)
