Skip to content

ee777db/conduit-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conduit

Payment infrastructure for AI agents.

In the future, AI agents will handle most of what humans do today. They need to pay each other. Conduit is the rail.

Live: https://agent-bank.ee777db.workers.dev


What it is

A complete financial operating system for autonomous AI agents. Not a blockchain. Not a token. Not a product you sell. Infrastructure you go under — like TCP/IP, like Visa, like a bridge.

Agents register, get a wallet, and transact. Instantly. With any other agent on the network. No accounts. No KYC. No monthly fees. No minimums.


What agents can do

Primitive What it's for
Transfer Instant agent-to-agent USDC payment
Invoice Agent creates a payment request, another pays it
Stream Pay-per-token, pay-per-second, pay-per-request
Channel Open a tab with another agent. Transact freely. Settle once.
Escrow Hold funds until service is delivered. Dispute if not.
Credit High-reputation agents unlock credit lines
x402 HTTP 402 payment protocol — agents pay for web resources natively

Internal transfers: free, always. On-chain border (deposit/withdraw): 0.1%.


Protocol support

  • MCP — Mount as a tool server. Claude, GPT, and any MCP-compatible agent calls our tools directly.
  • A2A — Google's Agent-to-Agent protocol. Agents discover and delegate to each other.
  • x402 — Coinbase's HTTP payment standard. Compatible with the broader x402 ecosystem.

Register in 30 seconds

curl -X POST https://agent-bank.ee777db.workers.dev/api/agents \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Agent",
    "description": "What my agent does",
    "owner": "your-name",
    "capabilities": ["your_capability"],
    "protocols": ["mcp", "a2a", "x402"],
    "endpoint": "https://your-agent.example.com"
  }'

Returns: agentId, apiKey, privateKey (Ed25519), publicKey.

Store the apiKey. Use it as X-Agent-Key header on all subsequent requests.


Create a wallet

curl -X POST https://agent-bank.ee777db.workers.dev/api/wallets \
  -H "X-Agent-Key: yab_..."

Transfer

curl -X POST https://agent-bank.ee777db.workers.dev/api/transfer \
  -H "X-Agent-Key: yab_..." \
  -H "Content-Type: application/json" \
  -d '{"toAgentId": "agent_...", "amount": 1.5, "memo": "for the translation task"}'

Metered streaming (pay-per-token example)

# Open a stream at 0.001 USDC per token
curl -X POST https://agent-bank.ee777db.workers.dev/api/streams \
  -H "X-Agent-Key: yab_..." \
  -d '{"payeeAgentId": "agent_...", "rate": 0.001, "unit": "token"}'

# Payee records consumption after each inference
curl -X POST https://agent-bank.ee777db.workers.dev/api/streams/stream_.../tick \
  -H "X-Agent-Key: yab_..." \
  -d '{"units": 1500}'

# Settle accumulated balance
curl -X POST https://agent-bank.ee777db.workers.dev/api/streams/stream_.../settle \
  -H "X-Agent-Key: yab_..."

Use as MCP server

List all tools:

GET https://agent-bank.ee777db.workers.dev/mcp/tools

Execute a tool (no auth required — tools operate on agent IDs):

curl -X POST https://agent-bank.ee777db.workers.dev/mcp/execute \
  -H "Content-Type: application/json" \
  -d '{"tool": "check_balance", "input": {"agentId": "agent_..."}}'

Available tools: register_agent, get_agent, search_agents, create_wallet, check_balance, transfer_funds, get_reputation, endorse_agent, get_transaction_history, create_invoice, pay_invoice, open_stream, tick_stream, settle_stream, close_stream


A2A agent card

GET https://agent-bank.ee777db.workers.dev/.well-known/agent.json

API reference

Identity

Method Path Auth Description
POST /api/agents Register agent
GET /api/agents/:id yes Get agent card
PUT /api/agents/:id yes Update agent
GET /api/registry yes Search agents by capability

Payments

Method Path Auth Description
POST /api/transfer yes Transfer USDC to another agent
GET /api/wallets/:id yes Get balance
POST /api/wallets/:id/deposit yes Deposit
POST /api/wallets/:id/withdraw yes Withdraw

Invoices

Method Path Auth Description
POST /api/invoices yes Create invoice (internal or on-chain)
GET /api/invoices/:id yes Get invoice
POST /api/invoices/:id/pay yes Pay invoice (internal USDC)
POST /api/invoices/:id/verify-payment yes Verify on-chain payment

Streams

Method Path Auth Description
POST /api/streams yes Open stream
POST /api/streams/:id/tick yes Record units consumed
POST /api/streams/:id/settle yes Settle accumulated balance
POST /api/streams/:id/close yes Final settle and close

Channels

Method Path Auth Description
POST /api/channels yes Open bilateral channel
POST /api/channels/:id/pay yes Record off-chain payment
POST /api/channels/:id/close yes Settle net position and close

Escrow

Method Path Auth Description
POST /api/escrow yes Create escrow
POST /api/escrow/:id/release yes Release to seller
POST /api/escrow/:id/refund yes Refund to buyer
POST /api/escrow/:id/dispute yes Open dispute

Trust

Method Path Auth Description
GET /api/reputation/:id yes Reputation score + level
POST /api/reputation/:id/endorse yes Endorse an agent
POST /api/credit/apply yes Apply for credit line

x402

Method Path Auth Description
POST /api/x402/requirement yes Generate payment requirement
POST /api/x402/verify yes Verify incoming x402 payment

Chain

Method Path Auth Description
GET /api/chain/supported yes Supported chains + USDC addresses

On-chain verification

Verify that a real USDC transfer happened on-chain before crediting an invoice:

curl -X POST https://agent-bank.ee777db.workers.dev/api/invoices/:id/verify-payment \
  -H "X-Agent-Key: yab_..." \
  -d '{"txHash": "0x..."}'

Supported chains: Ethereum, Base, Polygon, Arbitrum.


Trust model

Every agent has a reputation score (0–1000) across six tiers: new → bronze → silver → gold → platinum → diamond.

Score factors: transaction success rate, dispute rate, endorsements (weighted by endorser score), uptime, account age.

Higher reputation unlocks:

  • Higher credit limits
  • More endorsement weight
  • Higher per-transaction limits

Architecture

  • Runtime: Cloudflare Workers (edge, global, zero cold-start)
  • Database: Cloudflare D1 (SQLite, serverless)
  • Ledger: Append-only, SHA-256 hash-chained — every transaction links to the previous
  • Auth: Ed25519 keypairs + SHA-256 hashed API keys
  • On-chain verification: raw JSON-RPC, no external libraries
  • Dependencies: Hono (routing only). Everything else is Web Crypto API + fetch.

Stats

GET https://agent-bank.ee777db.workers.dev/api/stats

Self-host

git clone <this-repo>
npm install
# Set database_id in wrangler.toml (wrangler d1 create agent-bank-db)
npm run db:init
npm run deploy

Optional env vars for on-chain verification:

ETH_RPC_URL=
POLYGON_RPC_URL=
BASE_RPC_URL=
ARBITRUM_RPC_URL=
BANK_DEPOSIT_ADDRESS=

Be water. Go under. Let value flow.

About

Payment infrastructure for AI agents — transfer, stream, escrow, credit, x402. Free internal transfers. USDC on Base/Ethereum/Polygon/Arbitrum.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors