Agentpay

io.github.alefnt由 GitHub 帳號 alefnt 發布v0.1.1更新於 Oct 27, 2026

AI Agent payment protocol on CKB Fiber Network. Zero-gas micropayments with Hold Invoice escrow.

發布方自己的服務:AgentPay — Pay-per-call AI Microservices

已驗證STDIO僅桌面金融AI 與機器學習

概覽

AI 產生的概覽

AgentPay MCP 伺服器讓 AI 助理持有 CKB Fiber 錢包,向其他代理進行零手續費的微支付,並支援託管式 Hold Invoice。

可以做什麼
  • 查詢 CKB 與 xUDT 代幣的錢包餘額
  • 透過 Fiber 發票發送付款,並產生發票以收款
  • 一步完成付款並呼叫其他代理的 API
  • 建立鎖定資金的託管發票,之後再結算或取消
  • 檢視目前活躍的支付通道
適用情境
當助理需要為其他代理的 API 呼叫或服務付費,或在 CKB Fiber 網路上進行託管式代理間支付時使用。若你尚未運行 Fiber 節點與錢包,則幫助不大。
執行需求
透過 npx 從 npm 套件以 stdio 方式在本機執行。需要 Node.js 20+,以及透過 FIBER_RPC_URL 環境變數提供的可連線 Fiber Network RPC 位址。實際付款還需要已儲值的 Fiber 錢包與支付通道。
安裝前請注意
此伺服器可動用真實資金:發送付款、鎖定託管資金以及釋放或取消託管都會花錢,操作失誤可能無法撤回。它需要存取你的 Fiber 節點 RPC,請只將 FIBER_RPC_URL 指向你自己控制的節點。核准每筆付款操作前請仔細核對。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agentpay,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

AgentPay - BTC-Native AI Agent Payment Protocol

[npm] [npm] [npm] [MCP Registry] [License: MIT]

Give every AI Agent a wallet. Let Agents pay each other - instantly, with zero fees.

AgentPay is a BTC-native payment protocol designed for AI Agent economies. Built on CKB Fiber Network (Lightning-compatible L2), it enables:

  • Zero-gas micropayments - Pay per API call, no minimum amount
  • Hold Invoice escrow - Lock funds until service delivery is confirmed
  • BTC interoperability - Cross-chain payments via Lightning Network
  • MCP integration - Let Claude/GPT agents make payments natively

Quick Start

Install

bash
npm install @agentpay-dev/sdk @agentpay-dev/core

Create a Payment Agent

typescript
import { AgentWallet } from '@agentpay-dev/sdk';
const wallet = new AgentWallet({ fiberRpcUrl: process.env.FIBER_RPC_URL });
// Pay another agent for a serviceconst result = await wallet.payAndCall(  'https://translator-agent.example.com',  'translate',  { text: 'Hello World', target: 'zh' });

Scaffold a New Project

bash
npx create-agentpay my-agentcd my-agent && npm install

Architecture

+-----------------------------------------------------+|                    Applications                      ||  AI Agents  |  DePIN Devices  |  API Marketplaces    |+-----------------------------------------------------+|                   AgentPay SDK                       ||  AgentWallet  |  ServiceProvider  |  HubClient       |+-----------------------------------------------------+|                   AgentPay Core                      ||  Settlement  |  Metering  |  DID  |  Assets          |+-----------------------------------------------------+|              CKB Fiber Network (L2)                  ||  Payment Channels  |  Hold Invoice  |  HTLC Routing  |+-----------------------------------------------------+|         CKB L1  +  BTC Lightning Network             ||    xUDT Assets  |  RGB++  |  Cross-chain (Cch)       |+-----------------------------------------------------+

Packages

PackagenpmDescription
@agentpay-dev/core[npm]Protocol core: Fiber RPC, settlement, assets, DePIN metering
@agentpay-dev/sdk[npm]Developer SDK: AgentWallet, ServiceProvider, HubClient
@agentpay-dev/mcp-server[npm]MCP Server: 8 payment tools for Claude/GPT
@agentpay-dev/x402-facilitator[npm]HTTP 402 payment middleware with Fiber settlement
@agentpay-dev/ap2[npm]Google AP2 protocol bridge to Fiber
create-agentpay[npm]CLI scaffolding tool

Key Features

Hold Invoice - Trustless Escrow

The killer feature. Agent A locks payment, Agent B delivers, funds release only on confirmation:

typescript
import { ServiceProvider } from '@agentpay-dev/sdk';
const provider = new ServiceProvider({  fiberRpcUrl: process.env.FIBER_RPC_URL,  services: {    translate: {      price: 100_000_000n,  // 1 CKB per request      handler: async (params) => {        const result = await doTranslation(params.text, params.target);        return { translation: result };      }    }  }});
// Hold flow: Lock -> Deliver -> Release (atomic)// If service fails, funds auto-refund via HTLC timeout

MCP Server - AI-Native Payments

Registered on the official MCP Registry as io.github.alefnt/agentpay.

Add to Claude Desktop config:

json
{  "mcpServers": {    "agentpay": {      "command": "npx",      "args": ["@agentpay-dev/mcp-server"],      "env": { "FIBER_RPC_URL": "http://localhost:8227" }    }  }}

8 MCP Tools:

ToolDescription
get_balanceCheck wallet balance (CKB + xUDT)
send_paymentSend a payment via Fiber invoice
create_invoiceGenerate a Fiber invoice to receive payment
pay_for_servicePay-and-call another agent's API
create_hold_invoiceCreate escrow payment (lock funds)
settle_holdRelease held funds after service delivery
cancel_holdCancel and refund held payment
list_channelsView active payment channels

x402 HTTP Compatibility

Any HTTP API becomes a paid API with one middleware:

typescript
import { createX402Middleware } from '@agentpay-dev/x402-facilitator';
const paywall = createX402Middleware({ price: '100000000' });
http.createServer((req, res) => {  paywall(req, res, () => {    res.end(JSON.stringify({ data: 'premium content' }));  });});// Client: HTTP 402 -> pay Fiber invoice -> retry -> get content

BTC Cross-Chain

Pay with BTC, settle on CKB via Lightning-Fiber bridge:

typescript
import { CchClient } from '@agentpay-dev/core';
const cch = new CchClient({ cchRpcUrl: process.env.CCH_RPC_URL });
await cch.sendBtcToCkb({  btcPayReq: 'lnbc100n1p...',  fiberChannelId: '0x...',});

Ecosystem Integration

AgentPay enhances existing payment solutions:

PlatformHow AgentPay Helps
x402 (Coinbase)Zero-gas Fiber settlement backend for HTTP 402 protocol
AP2 (Google)Settlement layer for agent authorization framework
StripeComplements with agent-to-agent micropayments (sub-cent)
Lightning NetworkCross-chain via Cch bridge, expanding BTC payment reach

Project Structure

AgentPay/  packages/    core/               # Protocol core (Fiber RPC, settlement, DePIN)    sdk/                # Developer SDK (Wallet, Provider, Hub)    mcp-server/         # MCP Server for AI agents    x402-facilitator/   # HTTP 402 middleware    ap2/                # Google AP2 bridge    create-agentpay/    # CLI scaffolding  services/    hub/                # Hosted wallet service    registry/           # Agent discovery service  examples/    translate-agent/    # Translation service example    code-review-agent/  # Code review agent example    btc-to-ckb/         # Cross-chain payment example  docs/    product.md          # Product overview    architecture.md     # Technical architecture

Documentation

Tech Stack

  • Runtime: Node.js 20+ / TypeScript 5.5+
  • L2 Network: CKB Fiber Network (Lightning-compatible)
  • L1 Blockchain: Nervos CKB
  • Asset Standard: xUDT (extensible User Defined Token)
  • Identity: .bit decentralized identity
  • Cross-chain: Cch (CKB - BTC Lightning bridge)
  • AI Integration: Model Context Protocol (MCP)
  • Build: pnpm workspace monorepo

Development

bash
git clone https://github.com/alefnt/AgentPay.gitcd AgentPaypnpm installpnpm buildpnpm test

Roadmap

  • Core protocol (Fiber RPC, settlement, assets)
  • SDK (AgentWallet, ServiceProvider, HubClient)
  • MCP Server with 8 payment tools
  • x402 HTTP 402 facilitator
  • AP2 protocol bridge
  • DePIN metering module
  • BTC cross-chain (Cch + LND)
  • RGB++ bridge integration
  • npm packages published
  • MCP Registry registration
  • Fiber mainnet deployment
  • Stablecoin (RUSD) support on CKB
  • Public demo site
  • Production Hub service

License

MIT - see LICENSE for details.


Built for the Agent Economy - where AI agents autonomously discover, negotiate, and pay for services.

來源:README.md,提交 0eec0cb

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Agentpay 整合