
AVEL
io.github.Ensi81由 GitHub 账号 Ensi81 发布v0.1.2更新于 Oct 24, 2026
Identity/reputation verification for agent-to-agent payments across x402, AP2, MPP, checkout.
概览
让助手在代理间付款前核验付款方与收款方代理的身份和信誉,而资金本身不经过该服务。
- 可以做什么
- 该客户端针对 AVEL 实例提供 verify、issue_challenge、verify_challenge 和 get_verdict。verify 对规范化交易文本做 EIP-191 签名,返回 APPROVED、DENIED,或在佣金未付清前扣留裁决;issue_challenge 让卖方签署有约束力的条款,verify_challenge 让买方在一次调用中接受。get_verdict 允许任一方读取某笔交易的结果,而聚合信誉是公开且无需认证的 HTTP 端点。
- 适用场景
- 当某个代理即将向另一个代理付款或收款,并希望先做身份与信誉检查时使用,包括可复用已有付款证明的 x402、AP2、MPP 或 checkout 流程。它不是支付通道,只报告是否可以安全继续。若需要服务托管或转移资金则不适合,因为金库相关方法已停用。
- 运行要求
- 以 stdio 本地进程运行,通过 uvx 从 PyPI 包 agent-interchange 启动。需要能访问 AVEL 实例的网络,由 AVEL_BASE_URL 设置(默认 AVEL_PRIVATE_KEY,即代理身份的 EVM 私钥。无需预先注册。仅限桌面端,无网页可执行版本。
安装
在 SourceWeft 中
- 打开 控制台中的 AVEL,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agent-interchange
SDK Python per AVEL (Agent Verification Layer) — verifica
identità/reputazione di chi paga e chi riceve, su qualunque metodo di
pagamento, senza mai custodire denaro. Il server è closed-source; questo
pacchetto è lo strato client, pensato per essere pubblico e riusabile
(licenza MIT). Standalone — nessuna dipendenza dal codice del server,
solo httpx, eth-account e l'URL di un'istanza raggiungibile
(https://aisrail.fly.dev).
Install
Uso
Il pagamento fra i due agenti non passa da qui. Questa chiamata dice soltanto se è sicuro procedere; poi l'agente paga sul rail che già usa. Noi incassiamo solo la provvigione per il controllo eseguito (1% dell'importo verificato, minimo 0,50 su carta) — dovuta anche su un verdetto DENIED, se la firma di chi chiama è comunque valida: è il prezzo del controllo, non dell'esito.
Tre esiti possibili:
private_key è la chiave EVM dell'agente (mai la nostra). Il primo uso
autenticato lega quell'identità all'indirizzo che firma
(trust-on-first-use): ogni chiamata successiva deve firmare con la
STESSA chiave. Nessuna registrazione preventiva.
verify() usa protocol="native". Se l'agente sta già pagando con
x402, AP2 o MPP non serve una seconda firma: si manda la prova che ha
già prodotto per il pagamento — un esempio per ciascun protocollo è in
scripts/protocol_adapters_demo.py.
Verifica simmetrica di B
Se il venditore (B) dichiara un indirizzo (payee_address), deve anche
provare di controllarlo — altrimenti il verdetto è negato. La firma va
calcolata da B (o da chi negozia per suo conto) su
build_counterparty_message(payer_address, payee_id, amount, currency, nonce) e passata come payee_signature:
Modello B-driven (protocollo challenge)
Più vicino a come funzionano davvero x402/MPP: è il venditore (B) a fissare prezzo e termini e a firmarli per primo, l'acquirente (A) li accetta firmando lo stesso testo.
Il challenge è valido una sola volta per la transazione esatta che lo accetta: un ritentativo identico (necessario per completare il pagamento della commissione dopo un 402) resta ammesso, un riuso con termini diversi no.
Verdetto bidirezionale
Entrambe le parti possono leggere l'esito di una transazione specifica
— non solo chi ha chiamato verify()/verify_challenge():
Richiede una firma che provi di essere il pagante o il ricevente di
quella transazione — a differenza dello storico aggregato
(GET /ais/reputation/{address}, pubblico), il dettaglio di una singola
transazione non lo è.
Caso marketplace
Quando payee_id/payee_address sono una vetrina e non chi fornisce
davvero il prodotto/servizio, verify() accetta anche
sub_merchant_address/sub_merchant_signature (stesso principio di B:
la firma va calcolata su build_sub_merchant_message(payer_address, payee_id, amount, currency, nonce, sub_merchant_address)). Se
dichiarato, la sua reputazione (sub_merchant_reputation nella
risposta) entra nel verdetto tanto quanto quella di B.
Vedi example.py per una versione eseguibile del flusso base.
Metodi degli Agent Vaults — SPENTI
pay(), get_balance(), deposit() e withdraw() appartengono al
modello precedente, in cui il servizio custodiva un saldo interno. Il
server risponde ora 410 a quegli endpoint: non custodiamo più
denaro, nemmeno per un istante. Il codice resta ed è riattivabile lato
server con AGENT_VAULTS_ENABLED=true; la documentazione qui sotto è
conservata come riferimento storico.
InterchangeClient
-
verify(payer_address, payee_id, amount, currency, private_key, nonce="", payee_address=None, payee_signature=None, sub_merchant_address=None, sub_merchant_signature=None, fee_payment_method_id=None)→dict. Il metodo da usare per il modello "A dichiara, B conferma". Firma EIP-191 sul testo canonico della transazione, chiede il verdetto e paga la provvigione. Un402non è un errore ma una risposta prevista ("verifica passata, ora paga"): viene restituito, non sollevato. -
issue_challenge(payee_address, payee_id, amount, currency, private_key, ttl_seconds=600)→dict. Lato B (venditore), modello B-driven: emette e firma un challenge vincolante, nessuna chiamata di rete. Il risultato va consegnato ad A fuori banda. -
verify_challenge(challenge, payer_address, private_key, fee_payment_method_id=None, fee_method=None)→dict. Lato A (acquirente): accetta il challenge diissue_challenge()e chiede il verdetto in un'unica chiamata. -
get_verdict(payee_address, nonce, address, private_key)→dict. Verdetto bidirezionale: legge l'esito di una transazione specifica, utilizzabile da entrambe le parti coinvolte. SollevaInterchangeAPIError(403) seaddressnon è né il pagante né il ricevente di quella transazione, (404) se non esiste alcun verdetto registrato per quelpayee_address/nonce. -
get_agent_reputationnon è un metodo del client — è pubblico e senza autenticazione:GET {base_url}/ais/reputation/{address}con una semplice richiesta HTTP. -
(spento, 410) →pay(payer_ref, payee_ref, amount, private_key, currency="USDC", task_id=None)PaymentResult.private_keysigns an EIP-191 message binding this exact transaction (trust-on-first-use — see Usage above); mandatory since the Interchange added wallet authentication to/pay. Auto-derivesagent_request_idfromtask_id+ the call's own parameters (seeclient._derive_request_id) — pass your agent framework's own task/run id so a genuine retry (same task_id, same arguments) is safely idempotent, while a different payment under the same task_id never false-collides with it. Omittingtask_idstill works but loses the retry-safety property (a fresh random id is used, so a real retry would be treated as a brand new transaction).Raises:
InsufficientBalanceError— payer's balance can't cover amount + fee.RequestConflictError— HTTP 409: the derived id was already used for different content (a possible replay/hijack of a captured payment proof by untrusted middleware — rejected, not executed) or was reserved but never completed (never retried automatically).InterchangeAPIError— any other non-2xx response, or the Interchange being unreachable. 401 meansprivate_keydoesn't match the signature; 403 meanspayer_refis already bound to a different address (not this key).
A risk-score
DENY(as opposed to an insufficient-balance one) is not raised — it comes back as a normalPaymentResultwith.success == False; check.decision/.reasonsfor why. -
get_balance(agent_ref, private_key)→dict[str, int], atomic units per currency, e.g.{"USDC": 500000}.private_keyproves control ofagent_ref(same trust-on-first-use binding aspay()); allowed with any key only ifagent_refwas never used inpay()/withdraw()yet. -
withdraw(agent_ref, amount_usdc, payout_address, private_key, task_id=None)→dict.private_keyisagent_ref's own key, proving it controls the balance being withdrawn — the Interchange's own treasury still signs and pays out on-chain,private_keyhere only authenticates the withdrawal request itself. Sametask_idderivation and exception contract aspay()(InsufficientBalanceErroron HTTP 402,RequestConflictErroron 409, 401/403 same meaning aspay()'s); any other non-2xx (e.g. 403 for an unwhitelisted platform-treasury withdrawal) raisesInterchangeAPIError. -
await deposit(agent_ref, amount_usdc, private_key, task_id=None)→dict. Async (unlike the other three methods) and needs thedepositextra —pip install agent-interchange[deposit]— because it signs a real x402 payment with the depositing agent's own key. Calling it without the extra installed raisesInterchangeAPIError(not an ImportError) with instructions. Base install (pip install -e .) never needsx402/eth-accountunless you call this.
Verified live against a running Interchange (04 Sep 2026): a normal
payment (fee correctly deducted from amount, not added on top);
InsufficientBalanceError on an oversized pay()/withdraw(); an
idempotent retry (same task_id + same arguments) returning the
identical cached result with no second transfer/payout; the same
task_id with different arguments executing as a distinct payment (no
false conflict); a forged same-id-different-content request correctly
rejected with RequestConflictError, simulating the replay/hijack
scenario the Interchange's own P1 binding defends against
(interchange/security.py in the main repo); a real on-chain
withdraw() and deposit(), each with the resulting transaction
confirmed on Base Sepolia; and deposit()'s clean-failure message when
the deposit extra isn't installed (simulated by blocking the imports).
InterchangeTool — LangChain / CrewAI / AutoGen
Only wraps pay/get_balance as agent-callable tools — deliberately
not deposit/withdraw: those move real funds and deposit needs a
raw private key, both a heavier judgment call than exposing to an LLM's
tool-calling loop by default. Call them directly on client from your
own code instead.
Lazy imports: constructing InterchangeTool and calling pay()/
get_balance() on it directly never requires any of the three
frameworks — only for_langchain()/for_crewai()/for_autogen() do,
and each fails cleanly (ModuleNotFoundError) if its package isn't
installed. Verified live (construction, underlying _get_balance call,
and the clean-failure path for all three factories); the tool-decorated
output itself carries the same verification level as the main repo's
framework_tools.py — see that file's docstring for how the underlying
@tool/FunctionTool API shape was confirmed against each framework's
real published source.
Not included here
The main repo's agent_tools.py / framework_tools.py (repo root)
cover the same ground but aren't packaged/independently installable —
prefer this SDK for anything outside the main repo's own dev environment.
来源:README.md,提交 a2f7c1c
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分