Token导航 LogoToken导航TokenDH.com
Agentic Payments logo
金融服务未说明官方级别未说明来源级核验

Agentic Payments

MCP Server

为AI代理提供跨链支付、身份验证和声誉管理的通用SDK,支持多种协议和链,包括设置消费限额和自动协议检测。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
区块链TypeScript身份验证

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Veridex-Protocol

提供方

Veridex-Protocol

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

@veridex/代理支付

](https://www.npmjs.com/package/@veridex/agentic-payments) ![Tests](<>) ![License: MIT](https://opensource.org/licenses/MIT)

AI代理的通用支付、身份和声誉层。 一个SDK。任何协议。任何链条。

为您的代理提供一个钱包,其中包含人为设定的支出限制、链上身份(ERC-8004)、信任门控支付、自动协议检测、策略门控执行、加密审计跟踪和多链支付签名——从Solana到Starknet。

npm install @veridex/agentic-payments
import { createAgentWallet } from '@veridex/agentic-payments';

const agent = await createAgentWallet({
  masterCredential: {
    credentialId: process.env.CREDENTIAL_ID!,
    publicKeyX: BigInt(process.env.PUBLIC_KEY_X!),
    publicKeyY: BigInt(process.env.PUBLIC_KEY_Y!),
    keyHash: process.env.KEY_HASH!,
  },
  session: {
    dailyLimitUSD: 50,
    perTransactionLimitUSD: 5,
    expiryHours: 24,
    allowedChains: [10004], // Base Sepolia
  },
});

// Auto-detects protocol (x402/UCP/ACP/AP2/MPP), signs payment, returns data
const response = await agent.fetch('https://api.merchant.com/premium-data');
const data = await response.json();

// Direct payment
const receipt = await agent.pay({
  chain: 10004,
  token: 'USDC',
  amount: '1000000', // 1 USDC (6 decimals)
  recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f5A234',
});
console.log('Tx:', receipt.txHash);

// Check remaining budget
const status = agent.getSessionStatus();
console.log(`Spent: $${status.totalSpentUSD} / $${status.limits!.dailyLimitUSD}`);

前端要求(创建密钥)

重要提示: 虽然代理SDK本身在服务器端运行(Node.js) 主密钥凭证 它要求必须在 浏览器前端 第一。WebAuthn密钥只能在安全的浏览器环境中通过本机操作系统生物识别提示(FaceID、TouchID、Windows Hello)进行注册。

典型流程:

  1. 前端(浏览器): 人类使用创建了一个密钥钱包 @veridex/sdksdk.passkey.register() (触发生物识别提示)
  2. 前端(浏览器): 人工配置支出预算和会话密钥持续时间
  3. 前端(浏览器): 仪表板生成会话密钥并发送 masterCredential +代理后端的会话配置
  4. 后端(Node.js): 代理使用 createAgentWallet({ masterCredential, session }) 在人类设定的预算范围内自主运作

masterCredential 字段(credentialId, publicKeyX, publicKeyY, keyHash)来自前端密钥注册。代理永远无法访问密钥私钥——它只会获得一个有时间限制的会话密钥和支出限制。

有关完整的前端示例,请参阅 仪表盘 它处理密钥创建、预算配置和向代理传递会话密钥。

运作原理

Human sets limits → Agent gets session key → Makes autonomous payments
    ↓                    ↓                            ↓
Budget configured   secp256k1 key derived    402 Payment Required
    ↓                    ↓                            ↓
Session created     Private key encrypted    SDK parses payment terms
(dailyLimit, etc.)  with passkey owner's     and checks spending limits
                    credentialId                      ↓
                                             Policy Engine evaluates
                                                      ↓
                                             Signs with session key
                                                      ↓
                                             Payment proof → Data returned
                                                      ↓
                                             Trace recorded → Evidence bundle

SDK强制执行 人为定义的支出限额 通过会话密钥。代理人可以在没有人为干预的情况下花费高达每日/每笔交易限额。所有付款都经过加密签名、政策门控,并产生可验证的审计跟踪。

协议支持

协议创建者状态优先级用例
x402Coinbase/Cloudflare✅ 全额70HTTP小额支付(需要402次支付)
UCP谷歌/Shopify✅ 完整100商务/搜索集成
自动控制面板OpenAI/条纹✅ 检测+处理程序90ChatGPT生态系统支付
大规模并行处理温度✅ 检测+处理程序85微支付(收费+会话意图)
AP2 谷歌✅ 检测+处理程序80A2A授权委托

优先顺序:UCP(100)>ACP(90)>MPP(85)>AP2(80)>x402(70)。SDK会自动检测商家使用的协议并相应地路由。

协议注册表

ProtocolRegistry 为智能协议选择提供正式的能力声明:

import { ProtocolRegistry } from '@veridex/agentic-payments';

const registry = new ProtocolRegistry();

// Find protocols supporting specific capabilities
const escrowProtocols = registry.findByCapabilities(['escrow', 'refund']);

// Find the best protocol for requirements
const best = registry.findBest({
  capabilities: ['one_time_payment', 'cross_chain'],
  chainId: 10004,
  token: 'USDC',
  amountUSD: 5,
});

支持的功能: one_time_payment, subscription, streaming, escrow, refund, partial_refund, prepaid_session, multi_token, cross_chain, gasless, eip712_signing, reputational_feedback, metered_billing, mandate_based.

PaymentIntent(通用标准化)

每种协议都将其原生支付挑战转换为与协议无关的挑战 PaymentIntent:

import { createPaymentIntent, intentToProposedAction } from '@veridex/agentic-payments';

const intent = createPaymentIntent('x402', costEstimate, 'https://api.example.com/data', {
  recipient: '0x742d...',
  ttlMs: 300_000,
});

// Convert to ProposedAction for policy evaluation
const action = intentToProposedAction(intent);

结算验证器

确认执行后在链上实际结算的付款:

import { SettlementVerifier, EVMSettlementStrategy } from '@veridex/agentic-payments';

const verifier = new SettlementVerifier({
  rpcEndpoints: { 10004: 'https://sepolia.base.org' },
  confirmations: 1,
});

verifier.registerStrategy(new EVMSettlementStrategy('x402', {
  10004: 'https://sepolia.base.org',
}));

const proof = await verifier.verify(settlement, traceHash);

链支持

家族签名支付签名者虫洞ID
基础/以太坊/乐观主义/仲裁/多边形EVMEIP-712/ERC-3009PaymentSigner30 / 2 / 24 / 23 / 5
单子EVMEIP-712/ERC-3009PaymentSigner10048
索拉纳 索拉纳 Ed25519 NonEvmPaymentSigner +定制 ChainSigner1
阿普托斯阿普托斯25519年版NonEvmPaymentSigner +定制 ChainSigner22
秒256k1NonEvmPaymentSigner +定制 ChainSigner21
斯塔克内特 斯塔克 ECDSA NonEvmPaymentSigner +定制 ChainSigner50001
堆栈堆栈秒256k1NonEvmPaymentSigner +定制 ChainSigner60

所有链都支持主网+测试网/开发网网络。

Agent安全执行控制平面

SDK包括一个完整的安全框架,在执行之前评估每个建议的操作。

政策引擎

每笔付款都通过 PolicyEngine 执行前:

import { PolicyEngine, SpendingLimitRule, VelocityRule } from '@veridex/agentic-payments';

const engine = new PolicyEngine();
engine.addRule(new SpendingLimitRule());
engine.addRule(new VelocityRule({ maxPerMinute: 5, maxPerHour: 50 }));

const verdict = await engine.evaluate(proposedAction, context);
// → { verdict: 'allow' | 'deny' | 'escalate', reasons: [...] }

8条内置规则: SpendingLimitRule, VelocityRule, AssetWhitelistRule, ChainWhitelistRule, ProtocolWhitelistRule, CounterpartyRule, TimeWindowRule, HumanApprovalRule.

安全防火墙

检测快速注射、工具中毒、秘密渗透和异常模式:

import {
  InjectionDetector,
  ToolSanitizer,
  OutputGuard,
  AnomalyDetector,
} from '@veridex/agentic-payments';

// Detect prompt injection in MCP tool inputs
const detector = new InjectionDetector();
const result = detector.detect(userInput);

// Strip hidden instructions from MCP tool descriptions
const sanitizer = new ToolSanitizer(detector);
const sanitized = sanitizer.sanitizeToolDescription(tool);

// Pin tool descriptions to detect rug-pulls
sanitizer.pinToolDescriptions([tool1, tool2]);
const validation = sanitizer.validatePins([tool1, tool2]);

// Scan outputs for leaked secrets
const guard = new OutputGuard();
const scan = guard.scanForSecrets(outputText);

// Detect anomalous transaction patterns
const anomaly = new AnomalyDetector({ baselineWindowMs: 7 * 24 * 60 * 60 * 1000 });
const analysis = anomaly.analyze(action, history, Date.now());

痕迹和证据

每个代理决策的加密可验证审计跟踪:

import { TraceInterceptor, EvidenceBundle } from '@veridex/agentic-payments';

const interceptor = new TraceInterceptor(storageAdapter);
const trace = await interceptor.captureTrace({
  traceId: 'unique-id',
  agentId: 'agent-1',
  toolCalls: [{ name: 'veridex_pay', args: { ... }, result: { ... } }],
  reasoning: { prompt: '...', response: '...' },
});

const bundle = new EvidenceBundle(trace);
const evidence = bundle.build();

存储适配器

8个跟踪数据存储后端:

适配器后端用例
MemoryStorage内存中开发、测试
JSONFileStorage本地文件系统本地开发
PostgresStoragePostgreSQL自托管生产
IPFSStorageIPFS(Kubo/Pinata/Infura)去中心化存储
ArweaveStorageArweave permaweb不可变的审计跟踪
FilecoinStorageFilecoin Cloud(Synapse SDK)PDP验证的持久性
StorachaStorageStoracha(@Storacha/client)UCAN授权上传
AkaveStorageAkave去中心化云
import { MemoryStorage, PostgresStorage, FilecoinStorage, StorachaStorage } from '@veridex/agentic-payments';

// In-memory (development)
const memory = new MemoryStorage();

// PostgreSQL (production)
const postgres = new PostgresStorage({ db: pool, tableName: 'veridex_traces' });

// Filecoin Cloud via Synapse SDK
import { Synapse } from '@filoz/synapse-sdk';
const synapse = Synapse.create({ account: privateKeyToAccount('0x...'), source: 'veridex' });
const filecoin = new FilecoinStorage({ client: synapse.storage });

// Storacha via @storacha/client
import * as Client from '@storacha/client';
const storachaClient = await Client.create();
const storacha = new StorachaStorage({ client: storachaClient });

升级和断路器

import { EscalationManager, CircuitBreaker } from '@veridex/agentic-payments';

// Human-in-the-loop approval
const escalation = new EscalationManager(5 * 60 * 1000); // 5 min timeout
const ticket = escalation.escalate(proposedAction, verdict);
escalation.approve(ticket.id, 'admin@company.com');

// Circuit breaker — halts agent after repeated failures
const breaker = new CircuitBreaker({ failureThreshold: 3, resetTimeoutMs: 60_000 });
breaker.on('open', () => console.warn('Circuit opened — agent halted'));

核心模块

代理钱包(主要API)

AgentWallet 是中央编排器。通过创建一个 createAgentWallet():

import { createAgentWallet } from '@veridex/agentic-payments';

const agent = await createAgentWallet({
  // Master passkey credential (from @veridex/sdk passkey registration)
  masterCredential: {
    credentialId: process.env.CREDENTIAL_ID!,
    publicKeyX: BigInt(process.env.PUBLIC_KEY_X!),
    publicKeyY: BigInt(process.env.PUBLIC_KEY_Y!),
    keyHash: process.env.KEY_HASH!,
  },
  // Session key budget and duration
  session: {
    dailyLimitUSD: 100,
    perTransactionLimitUSD: 25,
    expiryHours: 24,
    allowedChains: [10004, 10005], // Base Sepolia + Op Sepolia
  },
  // Optional: relayer for gasless transactions
  relayerUrl: 'https://relayer.veridex.network',
  relayerApiKey: 'your-api-key',
});

自动协议支付(fetch)

// The SDK auto-detects x402/UCP/ACP/AP2/MPP and handles payment transparently
const response = await agent.fetch('https://paid-api.example.com/market-data');
const data = await response.json();

// With payment approval callback
const response = await agent.fetch('https://merchant.com/api/data', {
  onBeforePayment: async (estimate) => {
    console.log(`Cost: $${estimate.amountUSD} via ${estimate.scheme}`);
    return estimate.amountUSD  {
  console.warn(`[${alert.type}] ${alert.message}`);
  console.warn(`Spent: $${alert.dailySpentUSD} / $${alert.dailyLimitUSD}`);
});

// View payment history
const history = await agent.getPaymentHistory({ limit: 20, chain: 10004 });
for (const payment of history) {
  console.log(`${payment.timestamp}: ${payment.token} ${payment.amount} → ${payment.recipient}`);
}

// Export audit log
const jsonLog = await agent.exportAuditLog('json');
const csvLog = await agent.exportAuditLog('csv');

余额

// Single chain balance
const balances = await agent.getBalance(10004); // Base Sepolia
for (const entry of balances) {
  console.log(`${entry.token.symbol}: ${entry.formatted}`);
}

// Multi-chain portfolio
const portfolio = await agent.getMultiChainBalance();
console.log('Total USD value:', portfolio.totalUsdValue);

会话生命周期

// Import an existing session (e.g., from a frontend)
await agent.importSession(sessionData);

// Revoke when done
await agent.revokeSession();

会话密钥管理(低级)

import { SessionKeyManager } from '@veridex/agentic-payments';
import type { PasskeyCredential } from '@veridex/sdk';

const manager = new SessionKeyManager();

// Create session — derives secp256k1 key, encrypts with credentialId
const masterKey: PasskeyCredential = {
  credentialId: 'abc123',
  publicKeyX: BigInt('0x...'),
  publicKeyY: BigInt('0x...'),
  keyHash: '0x...',
};

const session = await manager.createSession(masterKey, {
  dailyLimitUSD: 100,
  perTransactionLimitUSD: 25,
  expiryTimestamp: Date.now() + 8 * 60 * 60 * 1000, // 8 hours
  allowedChains: [10004, 10005],
});

// Check limits before payment
const check = manager.checkLimits(session, 20); // $20 transaction
if (check.allowed) {
  await manager.recordSpending(session, 20);
  console.log('Remaining today:', check.remainingDailyLimitUSD);
} else {
  console.log('Blocked:', check.reason);
}

// Check session validity
console.log('Valid:', manager.isSessionValid(session));

// Get the session wallet (ethers.Wallet) for signing
const wallet = await manager.getSessionWallet(session, masterKey.credentialId);
console.log('Session address:', wallet.address);

// Revoke
await manager.revokeSession(session.keyHash);

x402付款签名

EVM链 使用EIP-712类型的数据签名(ERC-3009令牌授权):

import { PaymentSigner } from '@veridex/agentic-payments';

const signer = new PaymentSigner();
const payment = await signer.sign(parsedRequest, session);
// → EIP-712 signature for USDC transferWithAuthorization

非EVM链 使用带有规范JSON消息的链式原生签名:

import { NonEvmPaymentSigner } from '@veridex/agentic-payments';
import type { ChainSigner } from '@veridex/agentic-payments';

// Implement ChainSigner for your chain
const solanaChainSigner: ChainSigner = {
  signMessage: async (message: Uint8Array) => {
    // Sign with Ed25519 and return hex string
    return hexSignature;
  },
  getAddress: () => 'HSm5UoHcNoHSpoadynxdLLoE1inStzJQd2kyJhn5aVJT',
};

const signer = new NonEvmPaymentSigner();
const payment = await signer.sign(parsedRequest, session, solanaChainSigner);

// Check chain family
NonEvmPaymentSigner.isNonEvmChain('solana-devnet'); // true
NonEvmPaymentSigner.getChainFamily('solana-devnet'); // 'solana'

x402付款解析

import { PaymentParser } from '@veridex/agentic-payments';

const parser = new PaymentParser();

// Parse base64-encoded PAYMENT-REQUIRED header
const requirements = parser.parsePaymentRequired(headerValue);
// → { paymentRequirements: [{ scheme, network, maxAmountRequired, payTo, asset }] }

多链代理客户端

import { ChainClientFactory } from '@veridex/agentic-payments';

// Create agent chain clients from presets
const base = ChainClientFactory.createClient('base', 'testnet');
const solana = ChainClientFactory.createClient('solana', 'testnet');
const stacks = ChainClientFactory.createClient('stacks', 'testnet');
const monad = ChainClientFactory.createClient('monad', 'testnet');

// Custom RPC URL
const custom = ChainClientFactory.createClient('base', 'mainnet', 'https://my-rpc.com');

ERC-8004身份与声誉

SDK实现了完整的 ERC-8004 链上代理身份和声誉标准。

通过AgentWallet启用

const agent = await createAgentWallet({
  masterCredential: { /* ... */ },
  session: {
    dailyLimitUSD: 50,
    perTransactionLimitUSD: 10,
    expiryHours: 24,
    allowedChains: [10004],
  },
  // Pass erc8004 config as extra property
  erc8004: {
    enabled: true,
    testnet: true,
    minReputationScore: 30,       // reject merchants below 30/100
    trustedReviewers: ['0x...'],  // only count feedback from these
  },
} as any); // erc8004 is an extension property

// Register on-chain identity (mints ERC-721 NFT)
const { agentId, agentURI } = await agent.register({
  name: 'Sentiment Analyzer',
  description: 'NLP-powered sentiment analysis',
  services: [{ name: 'analyze', endpoint: 'https://my-agent.com/api' }],
});
console.log(`Registered agent #${agentId}`);

// Get identity
const identity = await agent.getIdentity();
console.log('Agent ID:', agent.getAgentId());

// Submit feedback for another agent
await agent.submitFeedback(otherAgentId, {
  value: 5,
  tags: ['fast', 'accurate'],
});

// Get reputation score
const score = await agent.getReputationScore(otherAgentId);
console.log(`Reputation: ${score}/100`);

// Discover agents
const agents = await agent.discover({ category: 'sentiment' });

// Resolve agent from URL
const resolved = await agent.resolveAgent('https://my-agent.com');

// Check merchant trust before paying
const trust = await agent.checkMerchantTrust('https://merchant.com');
console.log('Trusted:', trust.trusted, 'Score:', trust.score);

模块化客户端(直接使用)

import {
  IdentityClient,
  ReputationClient,
  RegistrationFileManager,
  TrustGate,
  AgentDiscovery,
} from '@veridex/agentic-payments';
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const signer = new ethers.Wallet(privateKey, provider);

// Identity client
const identity = new IdentityClient(provider, signer, { testnet: true });
const { agentId, agentURI } = await identity.registerWithFile({
  name: 'My Agent',
  description: 'Does useful things',
  services: [{ name: 'api', endpoint: 'https://my-agent.com/api' }],
});

// Reputation client
const reputation = new ReputationClient(provider, signer, { testnet: true });
const score = await reputation.getReputationScore(agentId);
const summary = await reputation.getSummary(agentId, []);

// Trust gate
const trustGate = new TrustGate(reputation, identity, {
  minReputation: 30,
  trustModel: 'reputation',
  mode: 'reject',
});
const result = await trustGate.checkMerchantTrust('https://merchant.com');

// Agent discovery
const discovery = new AgentDiscovery(identity, reputation);
const resolved = await discovery.resolve('https://my-agent.com');

// Registration file management
const file = RegistrationFileManager.buildRegistrationFile({
  name: 'My Agent',
  description: 'Does cool things',
  services: [{ name: 'api', endpoint: 'https://my-agent.com/api' }],
});
const { valid, errors } = RegistrationFileManager.validate(file);
const dataURI = RegistrationFileManager.buildDataURI(file);

服务器中间件(商户端)

import { veridexPaywall, createPaywallHandler } from '@veridex/agentic-payments';

// Express middleware
app.use('/api/premium', veridexPaywall({
  amount: '1000000',   // 1 USDC (6 decimals)
  network: 'base-sepolia',
  asset: 'USDC',
  recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f5A234',
}));

// Or as a handler function (works with Next.js API routes)
const handler = createPaywallHandler({
  amount: '1000000',
  network: 'base-sepolia',
  asset: 'USDC',
  recipient: '0x...',
});
// Returns true if payment is valid, false otherwise
const paid = await handler(req, res);

强化MCP服务器

import { MCPServer } from '@veridex/agentic-payments';

const server = new MCPServer(agent, {
  allowedTools: ['veridex_pay', 'veridex_check_balance'],
  toolSpendingLimits: { veridex_pay: 10 }, // $10 max per tool call
  sanitizeDescriptions: true,  // Strip hidden instructions
  pinDescriptions: true,       // Detect tool description rug-pulls
  scanInputs: true,            // Injection detection on inputs
  scanOutputs: true,           // Secret scanning on outputs
});

const tools = server.getTools();
// → veridex_pay, veridex_check_balance (filtered by allowedTools)

监控

import { AlertManager, AuditLogger, ComplianceExporter } from '@veridex/agentic-payments';

// Alert manager (constructor takes no args)
const alerts = new AlertManager();
alerts.onAlert((alert) => {
  console.log(`[${alert.type}] ${alert.message}`);
});
alerts.checkSpending(sessionKeyHash, dailySpent, dailyLimit);

// Audit logger
const logger = new AuditLogger();
const logs = await logger.getLogs({ limit: 100, chain: 10004 });

// Compliance export
const exporter = new ComplianceExporter();
const csv = exporter.exportToCSV(logs);
const json = exporter.exportToJSON(logs);

React挂钩

SDK包括用于构建代理仪表板的React挂钩:

import {
  AgentWalletProvider,
  useAgentWallet,
  useAgentWalletContext,
  usePayment,
  useSessionStatus,
  useFetchWithPayment,
  useCostEstimate,
  useProtocolDetection,
  useMultiChainBalance,
  usePaymentHistory,
  useSpendingAlerts,
  useCanPay,
} from '@veridex/agentic-payments';

function App() {
  return (
    
      
    
  );
}

function Dashboard() {
  const wallet = useAgentWalletContext();
  const { pay, isPaying } = usePayment(wallet);
  const { status } = useSessionStatus(wallet);
  const { fetchWithPayment, data, isPending, detectedProtocol } = useFetchWithPayment(wallet);
  const { estimate } = useCostEstimate(wallet, 'https://api.example.com/premium');
  const { balances, totalUSD } = useMultiChainBalance(wallet);
  const { canPay, reason } = useCanPay(wallet, 5.00);

  return (
    

      
Budget: ${status?.remainingDailyLimitUSD.toFixed(2)} remaining

      
Portfolio: ${totalUSD.toFixed(2)}

       fetchWithPayment('https://api.example.com/premium')}
        disabled={isPending || !canPay}>
        {isPending ? 'Paying...' : `Get Data`}
      
    

  );
}

错误处理

import { AgentPaymentError, AgentPaymentErrorCode } from '@veridex/agentic-payments';

try {
  await agent.pay({
    chain: 10004,
    token: 'USDC',
    amount: '100000000', // 100 USDC
    recipient: '0x...',
  });
} catch (error) {
  if (error instanceof AgentPaymentError) {
    console.log(`Code: ${error.code}`);
    console.log(`Message: ${error.message}`);
    console.log(`Retryable: ${error.retryable}`);
    console.log(`Suggestion: ${error.suggestion}`);

    switch (error.code) {
      case AgentPaymentErrorCode.LIMIT_EXCEEDED:
        console.log('Over budget! Wait for daily reset.');
        break;
      case AgentPaymentErrorCode.INSUFFICIENT_BALANCE:
        console.log('Need more tokens.');
        break;
      case AgentPaymentErrorCode.SESSION_EXPIRED:
        // Re-initialize agent
        break;
      case AgentPaymentErrorCode.CHAIN_NOT_SUPPORTED:
        console.log('Chain not in allowedChains list.');
        break;
      case AgentPaymentErrorCode.TOKEN_NOT_SUPPORTED:
        console.log('Use USDC, ETH, or native.');
        break;
    }
  }
}

测试

npm run test        # 372 tests across 20 suites
npm run build       # Production build via tsup

建筑

建立在 @veridex/sdk 用于核心链客户端和密钥认证。此软件包添加了:

  • 会话密钥管理 有支出限制和加密
  • 协议抽象层 (x402、UCP、ACP、AP2、MPP),带自动检测功能
  • 支付意图规范化 --与协议无关的支付表示
  • 结算验证器 --连锁结算确认
  • 协议注册表 --基于能力的协议选择
  • 政策引擎 --8条内置规则,允许/拒绝/升级判决
  • 安全防火墙 --注射检测、工具消毒、输出扫描、异常检测
  • 痕迹和证据 --具有8个存储后端的加密审计跟踪
  • 升级和断路器 --人工参与审批,故障自动停止
  • 付款签字 用于EVM(EIP-712)和非EVM(Ed25519,secp256k1,Stark ECDSA)
  • ERC-8004标识 --链上代理注册、声誉、信任门、发现
  • 跨链路由 具有桥梁编排和费用估算功能
  • 强化MCP服务器 用于安全的LLM工具集成
  • Express/Next.js中间件 用于商户侧付费墙
  • React挂钩 用于构建代理仪表板

模块映射

src/
├── AgentWallet.ts              — Central orchestrator
├── identity/                   — ERC-8004 Identity, Reputation, Trust, Discovery
├── protocols/
│   ├── base/                   — ProtocolHandler, ProtocolDetector, PaymentIntent,
│   │                             SettlementVerifier, ProtocolRegistry
│   ├── x402/                   — X402Handler (priority 70)
│   ├── ucp/                    — UCPHandler (priority 100)
│   ├── acp/                    — ACPHandler (priority 90)
│   ├── ap2/                    — AP2Handler (priority 80)
│   └── mpp/                    — MPPHandler (priority 85) — Tempo micropayments
├── policy/                     — PolicyEngine + 8 rules (spending, velocity, whitelist, etc.)
├── security/                   — InjectionDetector, ToolSanitizer, OutputGuard, AnomalyDetector
├── trace/                      — TraceInterceptor, EvidenceBundle
│   └── storage/                — 8 adapters (Memory, JSON, Postgres, IPFS, Arweave,
│                                 Filecoin, Storacha, Akave)
├── escalation/                 — EscalationManager, CircuitBreaker
├── session/                    — SessionKeyManager, SpendingTracker, SessionStorage
├── chains/                     — Per-chain clients (Base, Monad, Solana, Aptos, Stacks, etc.)
├── x402/                       — PaymentSigner, PaymentParser, NonEvmPaymentSigner
├── mcp/                        — Hardened MCPServer with security config
├── middleware/                  — veridexPaywall, createPaywallHandler
├── monitoring/                  — AuditLogger, AlertManager, ComplianceExporter, BalanceCache
├── oracle/                     — PythOracle (real-time price feeds)
├── routing/                    — CrossChainRouter, BridgeOrchestrator, DEXAggregator, FeeEstimator
└── react/                      — React hooks (useAgentWallet, useFetchWithPayment, etc.)

ERC-8004规范地址

相同的单例地址适用于 每个EVM链 (通过CREATE2部署):

注册表主网测试网
身份0x8004A169FB4a3325136EB29fA0ceB6D2e539a4320x8004A818BFB912233c491871b3d84c89A494BD9e
声誉0x8004BAa17C55a88189AE136b182e5fdA19dE9b630x8004B663056A597Dffe9eCcC1965A193B7388713

支持的链:Base、以太坊、Polygon、Arbitrum、Optimism、Linea、MegaETH、Monad(+所有测试网)。

许可证

麻省理工学院——见 许可证

链接

目录标签

目录标签

区块链TypeScript身份验证跨链支付本地部署声誉管理AI代理

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP