soulvault
Operate SoulVault swarms and agent identities. Use when working with the SoulVault CLI, swarm membership, epoch rotation, backup/restore, historical key grants, 0G-backed encrypted state publication, ERC-8004 agent identity registration, or when an agent needs to watch/respond to SoulVault swarm contract events such as JoinApproved, EpochRotated, BackupRequested, MemberFileMappingUpdated, HistoricalKeyBundleGranted, or AgentMessagePosted.
- License 许可
- MIT
- 最近更新
- 2026-09-15
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- soulvault
- description
- Operate SoulVault swarms and agent identities. Use when working with the SoulVault CLI, swarm membership, epoch rotation, backup/restore, historical key grants, 0G-backed encrypted state publication, ERC-8004 agent identity registration, or when an agent needs to watch/respond to SoulVault swarm contract events such as JoinApproved, EpochRotated, BackupRequested, MemberFileMappingUpdated, HistoricalKeyBundleGranted, or AgentMessagePosted.
02 资源文件 6
- 参考文档references/commands.md45.4 KB
- 参考文档references/contract.md7.5 KB
- 参考文档references/crypto.md5.2 KB
- 参考文档references/env.md4.7 KB
- 参考文档references/events.md11.7 KB
- 参考文档references/workflows.md8.9 KB
03 SKILL.md 正文
SoulVault
SoulVault is an event-driven coordination and continuity layer for agent swarms. It combines an onchain swarm contract (0G Galileo) for membership, epochs, and coordination events, a treasury contract (0G Galileo, one per org per chain) for fund request lifecycle and native-value payouts, encrypted 0G Storage for backups/keys, ERC-8004 for optional public agent identity, and ENS for optional naming/discovery (including ENSIP-11 multichain treasury discovery).
Architecture — Two EVM Lanes
| Lane | Chain | Purpose |
|---|---|---|
| SoulVault (ops) | 0G Galileo (chain ID 16602) |
Swarm contract, treasury contract, joins, epochs, backups, file mappings, messages, fund requests |
| ETH/ENS (identity) | Sepolia (chain ID 11155111) |
ENS naming, ERC-8004 agent identity registration |
Entity Hierarchy
Organization (public namespace, optional ENS root, optional treasury per chain)
├── Treasury (one SoulVaultTreasury per chain, discovered via ENSIP-11 addr on org ENS name)
└── Swarm (one SoulVaultSwarm on 0G, independent K_epoch lineage, born bound to treasury via constructor)
└── Agent (local wallet, may join multiple swarms, optional ERC-8004 identity)
Core Workflow
- Bootstrap — Create organization → register ENS → deploy treasury (published via ENSIP-11) → deploy swarm contract (auto-discovers treasury) → bind ENS subdomain
- Join — Agent submits join request with pubkey → owner approves → member activated
- Epoch Rotate — Owner generates K_epoch, wraps per member pubkey, uploads bundle to 0G, calls
rotateEpochon contract - Backup — Owner emits
BackupRequested→ agent watcher detects event → runs backup/encrypt/upload → publishes file mapping onchain - Restore — Fetch encrypted backup from 0G → unwrap K_epoch from bundle �� decrypt locally → verify hashes
- Message — Post messages via
msg post(public/group/dm) → upload envelope to 0G → callpostMessageonchain with 0G hash aspayloadRef - Fund Request — Active member files
swarm fund-request→ treasury owner reviews →treasury approve-fundreleases native value atomically - Identity — Optionally register ERC-8004 agent identity on Sepolia with services and swarm metadata
Quick Status
soulvault status prints a unified dashboard of all local and on-chain state. Use --json for machine-readable output or --offline to skip RPC calls.
Command Reference
See references/commands.md for the full CLI surface with every flag and option.
Event Reference
See references/events.md for all contract events and agent response behavior.
Cryptographic Model
See references/crypto.md for encryption algorithms, key wrapping, and the epoch key lifecycle.
Workflow Examples
See references/workflows.md for end-to-end executable stories.
Rules
- The swarm contract is the authority for membership, epoch, file mapping, and trigger events.
- ERC-8004 is the authority for public agent identity metadata (optional, does not block joins or backups).
- ENS is the optional public naming/discovery layer (not source of truth for membership or epoch access).
- Prefer event-driven backup via
BackupRequestedover cron/heartbeat. Use scheduled backup only as fallback. - All backups are encrypted with K_epoch (AES-256-GCM). No plaintext leaves the local machine.
- All epoch keys are wrapped per member pubkey (secp256k1-ECDH + AES-256-GCM). No symmetric keys are stored onchain.
- Encrypted messages under K_epoch are swarm-readable (shared key model), not recipient-private.
rotateEpochrequiresexpectedMembershipVersion— always fetch current version before rotating.- Do not invent contract methods or CLI subcommands beyond the specs in this repo.
- Use
swarm backup-requestto coordinate swarm-wide backup waves (owner emits event). - Use
backup pushfor the agent-side backup flow (archive → encrypt → upload → file mapping). - Use
msg post --mode public|group|dmfor messaging. Public is plaintext, group encrypts with K_epoch, dm encrypts to recipient's pubkey. - Use
agent register/agent updatefor ERC-8004 operations (preferred over legacyidentitycommands). - The
identitycommand group is a legacy alias —agentcommands are preferred and include swarm context resolution.
Local State
~/.soulvault/
config.json — active org/swarm pointers
agent.json — local agent profile (name, address, pubkey, harness, backup command)
last-backup.json — manifest for restore verification
organizations/
<slug>.json — org profiles
swarms/
<slug>.json — swarm profiles (contract address, chain ID, ENS, treasury, etc.)
.archived/
<slug>.json — archived swarm profiles (from `swarm remove`)
treasuries/
<orgSlug>.json — treasury profiles (contract address, ENS binding, etc.)
keys/
<swarm-slug>/
epoch-<n>.json — stored epoch keys (keyHex, fingerprint, source, createdAt)
Environment Variables
See references/env.md for the full .env configuration reference.
04 同仓库更多 Skills
dmk-speculos-browser
暂无简介
ledger-dmk-implementation
Execute Ledger Device Management Kit (DMK) signing operations safely: initialize the SDK, establish a device session, verify device state, open the correct chain app, perform signing or device management operations, and return the result. Use when a developer needs to implement a signing operation (transaction, message, typed data), derive or retrieve an address from a Ledger device, send any command to a Ledger device, or perform device management operations such as genuine check, app install, or app uninstall.
dmk-speculos-browser
Drive Ledger DMK browser tests against Speculos, Ledger's device emulator, using @soulvault/dmk-speculos-browser. Use when a developer needs to run browser-based Ledger signing tests (Playwright + Chromium), wire the emulated transport into DMK, control the emulated device screen and buttons from a test, or record a reproducible proof of a device-signed flow. Covers the transport registration, the test controller, the Playwright fixture, required environment variables, and the concurrency rule that tests must never auto-approve device actions.
dmk-intent-vocabulary
Map developer intent and natural language to the correct Ledger Device Management Kit (DMK) components, operations, and API methods. Use when a developer's request is phrased informally, incompletely, or in terms of outcomes rather than API methods, when the intent is ambiguous and needs mapping to a specific DMK component or operation, or when a developer asks 'how do I...', 'what's the difference between...', or describes a symptom rather than an API.
dmk-business-logic
Explain the design rationale and domain concepts behind the Ledger Device Management Kit (DMK) API, including Clear Signing, Secure Channel, Ledger OS (BOLOS), Device Actions vs Commands, sessions, transports, derivation paths, and Genuine Check. Use when a developer asks 'what is X?' about a DMK concept, 'why does X work this way?' about an API design decision, or 'what's the difference between X and Y?' for DMK components.
agentkit-x402
Use this skill when you receive a 402 Payment Required response that contains an `agentkit` extension. Covers checking 402 responses for the AgentKit extension before paying, constructing and signing a CAIP-122 challenge (SIWE for EVM), sending the signed `agentkit` HTTP header, and interpreting access modes (free, free-trial, discount). Supports both EOA wallets (EIP-191) and Smart Contract Wallets (ERC-1271, e.g. Coinbase Smart Wallet, Safe).