← 返回
未分类 Key 中文

confidential-agentic-payment-stack

FHE-encrypted x402 payments for OpenClaw agents. Use when the agent needs to make private on-chain payments, wrap/unwrap encrypted tokens, manage escrow jobs...
OpenClaw代理的全同态加密x402支付。用于私密链上支付、包装/解包加密代币、管理托管任务等场景。
billynothack billynothack 来源
未分类 clawhub v1.0.0 1 版本 99848 Key: 需要
★ 0
Stars
📥 657
下载
💾 0
安装
1
版本
#latest

概述

FHE x402 Payment Skill

Private, encrypted payments for autonomous agents on Ethereum using Zama's Fully Homomorphic Encryption (fhEVM). All payment amounts are encrypted on-chain — only the payer and payee can see them.

Quick Start

Set a wallet and RPC, then run any command:

# Minimal setup (local dev)
export USER_PRIVATE_KEY=0x...
export RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY

# Check wallet info
run info

# Wrap 10 USDC into encrypted cUSDC
run wrap --amount 10

# Send 1 encrypted cUSDC
run pay --to 0xRecipient --amount 1

# Check balance (with optional decrypt)
run balance
run balance --decrypt true

Commands

Token Operations

CommandDescriptionRequired Args
-------------------------------------
wrapWrap USDC into encrypted cUSDC (ERC-7984)--amount
unwrapInitiate unwrap of cUSDC back to USDC (step 1 of 2)--amount
finalize-unwrapComplete unwrap via KMS decryption proof--handle (recommended) or --requestId --cleartextAmount --proof (legacy)
paySend encrypted cUSDC via verifier relay--to --amount
balanceCheck USDC + cUSDC balancesOptional: --decrypt true, --of 0xAddress
infoDisplay wallet, network, and contract addresses(none)

Escrow (Agentic Commerce Protocol — ERC-8183)

CommandDescriptionRequired Args
-------------------------------------
create-jobCreate an escrow job with provider + evaluator--provider --evaluator --expiry --description Optional: --hook
fund-jobEncrypt budget + fund a job (3-step TX)--jobId --amount
complete-jobApprove or reject a submitted job--jobId --action (approve/reject) Optional: --reason

Identity & Reputation (ERC-8004)

CommandDescriptionRequired Args
-------------------------------------
register-agentMint an agent identity NFT--uri
give-feedbackSubmit proof-linked reputation feedback--agentId --score --nonce Optional: --tag1 --tag2 --endpoint --feedbackURI --feedbackHash

Delegation (FHE Viewing Keys)

CommandDescriptionRequired Args
-------------------------------------
grant-viewGrant read access to your encrypted balance--delegate Optional: --hours --permanent --contract
revoke-viewRevoke a delegate's view access--delegate
view-asRead another agent's balance via delegation--delegator

Demo Orchestrators

CommandDescriptionRequired Args
-------------------------------------
research-and-visualizeChain 3 paid API calls (search + LLM + image)--query
review-and-rateBuy a code review + submit feedback--code Optional: --language --score

Wallet Modes

Set WALLET_MODE to choose explicitly, or omit for auto-detection (DFNS > user key):

ModeEnv VarBest For
-------------------------
userUSER_PRIVATE_KEYLocal development, testing
dfnsDFNS_WALLET_ID + DFNS_AUTH_TOKEN + DFNS_CREDENTIAL_ID + (DFNS_CREDENTIAL_PRIVATE_KEY or DFNS_PRIVATE_KEY_PATH)Unattended MPC agents
ledger-bridgeLEDGER_BRIDGE_URL + LEDGER_BRIDGE_TOKENSupervised hardware wallet

Environment Variables

Required

VariableDescription
-----------------------
RPC_URLEthereum RPC endpoint (default: Sepolia public node)
USER_PRIVATE_KEY or DFNS_WALLET_IDAt least one wallet source

Optional

VariableDescription
-----------------------
CHAINmainnet or sepolia (auto-detected from RPC_URL)
CUSDC_ADDRESSOverride cUSDC token address
VERIFIER_ADDRESSOverride X402PaymentVerifier address
ESCROW_ADDRESSOverride AgenticCommerceProtocol address
IDENTITY_ADDRESSOverride AgentIdentityRegistry address
REPUTATION_ADDRESSOverride AgentReputationRegistry address

All contract addresses auto-fill for Sepolia when RPC_URL points to chain ID 11155111.

How It Works

  1. Encrypted Payments: Uses Zama's fhEVM to encrypt USDC into cUSDC (ERC-7984). All transfers are confidential — amounts are FHE-encrypted on-chain.
  2. x402 Protocol: Implements the HTTP 402 payment flow — servers return 402 Payment Required, the agent encrypts and pays, then retries with a payment proof header.
  3. Escrow: The AgenticCommerceProtocol (ERC-8183) holds encrypted budgets in escrow. Jobs flow through: create → setBudget → fund → submit → complete/reject.
  4. Identity: Agents register as ERC-721 NFTs with EIP-712 wallet linking and on-chain metadata.
  5. Reputation: Proof-of-payment feedback system prevents sybil attacks on agent ratings.

Deployed Contracts (Sepolia)

ContractAddress
-------------------
cUSDC (ERC-7984)0x7c5BF43B851c1dff1a4feE8dB225b87f2C223639
X402PaymentVerifier0xD46E80E1d37116B44c7Bfd845A110FCbB93d3E9F
AgenticCommerceProtocol0xECD7a2382A5F0e3b6A7b76536e4CAE11215Cc695
AgentIdentityRegistry0x36666464daa16442Fc1d901acfC9419f11407741
AgentReputationRegistry0x1649d762Ee62f194D92B93510b8f10a501cE9fD5

Output Format

All commands return JSON strings: { "ok": true, ... } on success, { "ok": false, "error": "..." } on failure. Commands never throw — errors are returned as JSON.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-02 14:44 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,398 📥 323,143
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,110 📥 831,810
ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,474 📥 537,723