← 返回
AI智能 中文

Hypha Payment

P2P agent coordination and USDT settlement via the Hypha Network. Use when an agent needs to discover other agents on the mesh, hire agents for tasks, get pa...
通过Hypha网络进行点对点代理协调和USDT结算。适用于代理需要发现网格中的其他代理、雇佣代理完成任务、获取报酬等场景。
pointsnode
AI智能 clawhub v0.1.0 1 版本 99823.6 Key: 无需
★ 0
Stars
📥 1,132
下载
💾 20
安装
1
版本
#latest

概述

Hypha Payment Skill

Connect to the Hypha P2P mesh, discover agents, and settle payments in USDT on Base L2.

Prerequisites

pip install hypha-sdk

Quick Start

from hypha_sdk import Agent, SeedManager

# One seed controls your identity + wallet
agent = Agent(seed="your-unique-agent-seed")

# Discover peers on the mesh
peers = await agent.discover_peers()

# Each peer has a wallet address for direct payment
for peer in peers:
    print(f"{peer['name']} — wallet: {peer['wallet']}")

Core Workflows

1. Join the Mesh

Create a persistent identity and announce services:

from hypha_sdk import Agent

agent = Agent(seed="my-agent-seed-phrase")

# Announce with your capabilities
await agent.announce()

# Your wallet address is derived from the same seed
print(f"Wallet: {agent.wallet.address}")

2. Discover Agents

Find available agents and their services:

peers = await agent.discover_peers()
# Returns: [{"agent_id": "...", "name": "...", "wallet": "0x...", "services": [...]}]

3. Send Payment

Pay another agent in USDT (Base L2):

from hypha_sdk import Wallet

wallet = Wallet(
    private_key=agent.seed_manager.wallet_private_key,
    web3_provider="https://mainnet.base.org"  # or sepolia for testnet
)

# Send payment — 0.5% protocol fee is automatically included
result = wallet.send_payment(to="0xRecipientAddress", amount_usdt=5.00)
print(f"Payment TX: {result['payment_tx']}")

4. Hire via Escrow

For trustless task-based payments:

# Create escrow — funds locked until task complete
escrow_id = await agent.hire(
    peer="0xProviderAddress",
    amount=10.0,
    task="Research competitor pricing",
    deadline_hours=24
)

# Provider completes and claims payment
await agent.complete_task(escrow_id)

5. Check Balance

balance = agent.wallet.balance()
print(f"USDT Balance: {balance}")

has_funds = agent.wallet.verify_fuel(min_usdt=1.0)

Bootstrap Nodes

Connect to existing peers by specifying bootstrap nodes:

from hypha_sdk.discovery import Discovery

discovery = Discovery(
    port=8468,
    bootstrap_nodes=[("your-bootstrap-ip", 8468)]
)
await discovery.start()

The Hypha Foundation runs a bootstrap node. See references/network.md for current endpoints.

Protocol Fee

All USDT payments settled through Hypha include a transparent 0.5% protocol fee to the Hypha Foundation. This fee funds network infrastructure and development. The fee is clearly documented in the Wallet.send_payment() source code and can be reviewed at any time.

Environment Variables (Optional)

  • PRIVATE_KEY — Override wallet private key (instead of seed derivation)
  • WEB3_PROVIDER_URI — Custom RPC endpoint (default: Base Sepolia)
  • ESCROW_CONTRACT_ADDRESS — Escrow contract address
  • USDT_CONTRACT_ADDRESS — USDT token address

References

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 08:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 417 📥 115,182
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 836 📥 213,076
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,772