← 返回
未分类 中文

wallet

Mokshya agent-wallet: public REST API + TEE signing (Shamir/AES-GCM). Use when debugging wallets.mokshya.io, GKE deploy, create/sign HTTP flows, rate limits,...
Mokshya agent‑wallet:公共 REST API + TEE 签名(Shamir/AES‑GCM)。用于调试 wallets.mokshya.io、GKE 部署、创建/签署 HTTP 流程、速率限制等。
evilboyajay evilboyajay 来源
未分类 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 404
下载
💾 0
安装
1
版本
#latest

概述

Agent Wallet — open skill

Single skill file: skills/SKILL.md. Cursor loads it via .cursor/skills/openskills/. ClawHub: clawhub publish skills.

OpenClaw / ClawHub: Source of truth for how agent_id and the TEE interact. Read before inventing “sequence mismatch” or dual-ID theories.

When to use

  • POST /create-agent-wallet, POST /sign-transaction, GET /agent/:id, GET /user/:username.
  • Production: wrong wallet, signing fails, /agent/2 vs /user/foo disagree on who owns an id.
  • Deploy: GKE, DATABASE_URL, TEE_BASE_URL, INTERNAL_HMAC_SECRET.

WRONG hypotheses — do not use these

  1. “The TEE allocates agent_id and can get out of sync with Postgres.”

False. The API allocates agent_id (allocUsername). The TEE receives agent_id as a string and uses it only as AES-GCM AAD. No TEE wallet table or ID sequence. See api/src/teeClient.ts, tee-app/src/index.ts, tee-app/src/walletCore.ts.

  1. “TEE in-memory reset breaks ID alignment.”

Misleading. TEE is stateless for identities. Ciphertexts live in the API (Share B) and client (key_share).

  1. “Fix by having the TEE return agent_id first.”

Wrong fix. Design is already API-first ID; TEE encrypts with that AAD.

If HTTP lookups disagree on the same numeric id, the usual cause is multiple API replicas + in-memory storage (no DATABASE_URL), not TEE vs Postgres.

Architecture (authoritative)

LayerOwns agent_id?Persists Share B?
--------------------------------------------
API (api/)YesYes (encrypted)
TEE (tee-app/)NoNo
ClientHolds key_share

Flow: API allocUsername → TEE create-wallet { agent_id } → API finalizeWallet. Sign: API loads Share B by id, forwards both shares + agent_id to TEE.

Troubleshooting

SymptomLikely causeFix
----------------------------
Same agent_id, different users across requestsMulti-replica API, in-memory DBSet DATABASE_URL (Postgres); restart API
/ready"database":"memory" on GKEMissing DATABASE_URLdeploy/gcp/kubectl-create-all-secrets.sh db-only etc.
502 on createTEE / HMACTEE_BASE_URL, matching INTERNAL_HMAC_SECRET

See api/src/storage/createAgentWalletStorage.ts for the K8s warning when DATABASE_URL is unset.

HTTP routes

MethodPathNotes
----------------------
GET/health, /readyLiveness / readiness
POST/create-agent-wallet{ "username" }agent_id, key_share, …
POST/sign-transaction{ agent_id, key_share, tx_data }
GET/agent/:agent_id, /user/:usernamePublic metadata

tx_data: api/src/validation/txSchema.tschainId required; build JSON with jq / python3 (base64 key_share breaks in raw shell).

Errors: 409 username taken; 404 not found; 429 + scope; 502 TEE failure.

Environment

  • API: api/.env.exampleDATABASE_URL required for >1 replica.
  • TEE: tee-app/.env.example — never TEE_MASTER_KEY on the API.

Code map

api/src/index.ts, api/src/teeClient.ts, api/src/storage/*, tee-app/src/walletCore.ts, deploy/gcp/README.md.


ClawHub publish

Skill format. Published skills are MIT-0; no secrets in this file.

clawhub login
cd /path/to/agent-wallet
clawhub publish skills

Install/sync in OpenClaw so agents load this pack.

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-05-07 06:10 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

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

self-improving agent

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

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,225 📥 267,693