Skills fhe-x402-payment
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, register agent identity, give reputation feedback, or delegate balance viewing. Runs on Ethereum Sepolia (default) or Mainnet with Zama fhEVM. Supports three wallet modes — local private key, DFNS MPC, and Ledger hardware wallet.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/billynothack/confidential-agentic-payment-stack" ~/.claude/skills/clawdbot-skills-fhe-x402-payment && rm -rf "$T"
manifest:
skills/billynothack/confidential-agentic-payment-stack/SKILL.mdsource content
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
| Command | Description | Required Args |
|---|---|---|
| Wrap USDC into encrypted cUSDC (ERC-7984) | |
| Initiate unwrap of cUSDC back to USDC (step 1 of 2) | |
| Complete unwrap via KMS decryption proof | (recommended) or (legacy) |
| Send encrypted cUSDC via verifier relay | |
| Check USDC + cUSDC balances | Optional: , |
| Display wallet, network, and contract addresses | (none) |
Escrow (Agentic Commerce Protocol — ERC-8183)
| Command | Description | Required Args |
|---|---|---|
| Create an escrow job with provider + evaluator | Optional: |
| Encrypt budget + fund a job (3-step TX) | |
| Approve or reject a submitted job | (approve/reject) Optional: |
Identity & Reputation (ERC-8004)
| Command | Description | Required Args |
|---|---|---|
| Mint an agent identity NFT | |
| Submit proof-linked reputation feedback | Optional: |
Delegation (FHE Viewing Keys)
| Command | Description | Required Args |
|---|---|---|
| Grant read access to your encrypted balance | Optional: |
| Revoke a delegate's view access | |
| Read another agent's balance via delegation | |
Demo Orchestrators
| Command | Description | Required Args |
|---|---|---|
| Chain 3 paid API calls (search + LLM + image) | |
| Buy a code review + submit feedback | Optional: |
Wallet Modes
Set
WALLET_MODE to choose explicitly, or omit for auto-detection (DFNS > user key):
| Mode | Env Var | Best For |
|---|---|---|
| | Local development, testing |
| + + + ( or ) | Unattended MPC agents |
| + | Supervised hardware wallet |
Environment Variables
Required
| Variable | Description |
|---|---|
| Ethereum RPC endpoint (default: Sepolia public node) |
or | At least one wallet source |
Optional
| Variable | Description |
|---|---|
| or (auto-detected from RPC_URL) |
| Override cUSDC token address |
| Override X402PaymentVerifier address |
| Override AgenticCommerceProtocol address |
| Override AgentIdentityRegistry address |
| Override AgentReputationRegistry address |
All contract addresses auto-fill for Sepolia when
RPC_URL points to chain ID 11155111.
How It Works
- Encrypted Payments: Uses Zama's fhEVM to encrypt USDC into cUSDC (ERC-7984). All transfers are confidential — amounts are FHE-encrypted on-chain.
- x402 Protocol: Implements the HTTP 402 payment flow — servers return
, the agent encrypts and pays, then retries with a payment proof header.402 Payment Required - Escrow: The AgenticCommerceProtocol (ERC-8183) holds encrypted budgets in escrow. Jobs flow through: create → setBudget → fund → submit → complete/reject.
- Identity: Agents register as ERC-721 NFTs with EIP-712 wallet linking and on-chain metadata.
- Reputation: Proof-of-payment feedback system prevents sybil attacks on agent ratings.
Deployed Contracts (Sepolia)
| Contract | Address |
|---|---|
| cUSDC (ERC-7984) | |
| X402PaymentVerifier | |
| AgenticCommerceProtocol | |
| AgentIdentityRegistry | |
| AgentReputationRegistry | |
Output Format
All commands return JSON strings:
{ "ok": true, ... } on success, { "ok": false, "error": "..." } on failure. Commands never throw — errors are returned as JSON.