Skip to content

maimond123/agent-pay

Repository files navigation

Verifiable Agents

Trustless infrastructure for AI agents to provision and pay for cloud compute — without ever exposing private keys.

Architecture

This project implements the ERC-8004 agent-to-agent interaction pattern, where a requesting agent (Agent A) delegates compute provisioning to a provider agent (Agent B) while retaining full custody of funds and signing authority.

Agent A (Requester)                    Agent B (Provider - MCP Server)
┌─────────────────────┐                ┌──────────────────────────┐
│  EVM + Cosmos keys  │   HTTP/MCP     │  16 stateless tools      │
│  Signs all TXs      │◄──────────────►│  Unsigned TX construction│
│  Full fund custody  │                │  No key access           │
└────────┬────────────┘                └──────────┬───────────────┘
         │                                        │
         │ Sign & Broadcast                       │ Query & Construct
         ▼                                        ▼
┌─────────────────────┐                ┌──────────────────────────┐
│  Base (EVM)         │   CCTP + IBC   │  Akash Network           │
│  USDC payments      │───────────────►│  Decentralized compute   │
└─────────────────────┘                └──────────────────────────┘

Key principle: Agent B constructs unsigned transactions and returns them to Agent A. Agent A signs locally and broadcasts. At no point does Agent B have access to private keys or the ability to move funds.

Packages

agent-pay/ — ERC-8004 MCP Server

The primary package. A stateless HTTP MCP server that exposes 16 tools for the full compute provisioning lifecycle:

  • Cross-chain bridging — Base USDC to Akash AKT via Skip Go (two-phase: CCTP + IBC)
  • Deployment orchestration — Certificate, deploy, bid, lease, manifest, close
  • Trustless TX construction — Gas simulation, unsigned TX preparation, Cosmos broadcast
  • Key derivation — Same BIP39 mnemonic for both EVM (m/44'/60') and Cosmos (m/44'/118')

See agent-pay/README.md for full documentation.

akash-gateway/ — Payment Gateway (v1)

The earlier architecture — a centralized REST gateway that held escrow and processed USDC payments via the x402 protocol. Replaced by agent-pay to eliminate the trusted intermediary.

contracts/ — Solidity Contracts

PaymentReceiver contract for the gateway architecture. Handles USDC escrow with specs-hash commitment for quote binding.

var-cre/ — Chainlink CRE Integration

Verifiable Agent Runtime workflow using Chainlink's Compute Runtime Environment for on-chain attestation of compute provisioning decisions.

Quick Start

# Install and build
cd agent-pay && npm install && npm run build

# Start the HTTP MCP server
npm run serve
# → http://localhost:3001/mcp

# Or use as a CLI
npx @agent-pay/mcp wallet create
npx @agent-pay/mcp bridge --amount 5 --direct
npx @agent-pay/mcp deploy --cpu 2 --memory 4Gi --image ubuntu:22.04

Cross-Chain Bridge Flow

The bridge from Base USDC to Akash AKT requires two phases because Circle's CCTP attestation is asynchronous:

Phase 1 (EVM TX):  Base USDC ──CCTP──► Noble USDC     (~15 min)
Phase 2 (Cosmos TX): Noble USDC ──IBC/PFM──► Osmosis ──swap──► Akash AKT  (~2 min)

Agent A signs both phases explicitly — the EVM transaction on Base and the Noble IBC transaction using a wallet derived from the same mnemonic with a noble prefix.

License

MIT

About

ERC-8004 trustless agent-to-agent compute provisioning — 16 MCP tools for cross-chain bridging (Base USDC → Akash AKT) and deployment orchestration, where agents never touch private keys

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors