Install
openclaw skills install x1-vault-memoryBackup and restore OpenClaw agent memory to IPFS with AES-256-GCM encryption and X1 blockchain CID anchoring
openclaw skills install x1-vault-memoryEncrypted, decentralized memory backup for OpenClaw agents — powered by IPFS and X1 blockchain.
| Variable | Required | Default | Description |
|---|---|---|---|
PINATA_JWT | ✅ Yes | — | Your Pinata API token for IPFS uploads. Get it at https://app.pinata.cloud |
X1_RPC_URL | ❌ No | https://rpc.mainnet.x1.xyz | The X1 RPC endpoint. Change only if using testnet or custom endpoint |
x1_vault_cli/wallet.json | ✅ Yes | — | Your X1 wallet keypair file. Used for encryption and blockchain anchoring. |
🔴 SECURITY WARNING: Use a dedicated wallet with minimal XNT. Never use your primary wallet.
Backs up your agent's brain (identity, personality, memories) with AES-256-GCM military-grade encryption, stores it on IPFS, and anchors the CID on the X1 blockchain. Only your wallet keypair can decrypt.
Pipeline: Agent Files > tar.gz > AES-256-GCM Encrypt > IPFS Upload > X1 On-Chain Anchor
Servers die. Containers get wiped. One bad rm -rf and your agent's identity is gone. X1 Vault Memory makes your agent's brain indestructible — encrypted, decentralized, and recoverable from anywhere.
✅ No Solana CLI required — we use @solana/web3.js directly.
🔴 SECURITY WARNING: Use a dedicated wallet with minimal XNT. Never use your primary wallet.
XNT is the native gas token of the X1 blockchain. You need a small amount for on-chain transaction fees.
You will also need the X1 Wallet Chrome extension: https://chromewebstore.google.com/detail/x1-wallet/kcfmcpdmlchhbikbogddmgopmjbflnae
Start with bridge + XDEX if you are coming from Solana. That is the smoothest path. Each backup costs approximately 0.002 XNT, so even a small amount goes a long way.
Pinata is the IPFS pinning service that stores your encrypted backups. The free tier is more than enough.
The JWT token does not expire unless you manually revoke it in the Pinata dashboard. Free tier includes 500 files and 1GB storage. Each encrypted backup is around 10-50KB, so you can store thousands of backups without paying anything.
🔴 SECURITY WARNING: Use a dedicated wallet with minimal XNT. Never use your primary wallet.
cd x1-vault-memory && npm install
Option A: Using a .env file (recommended for Docker and production)
Create a .env file in your project or workspace root:
PINATA_JWT=your_pinata_jwt_token
X1_RPC_URL=https://rpc.mainnet.x1.xyz
No quotes, no export keyword. Docker Compose and most Node.js apps read this format automatically.
Option B: Using shell environment (for manual or one-time use)
export PINATA_JWT="your_pinata_jwt_token"
export X1_RPC_URL="https://rpc.mainnet.x1.xyz"
Note: These values only persist for the current terminal session.
Option C: Docker Compose environment block
If running inside Docker, add to your docker-compose.yml environment section:
environment:
PINATA_JWT: ${PINATA_JWT}
X1_RPC_URL: https://rpc.mainnet.x1.xyz
Then set PINATA_JWT in your Docker .env file as shown in Option A.
The wallet can be created programmatically using @solana/web3.js. Here's a quick script:
node -e "
const { Keypair } = require('@solana/web3.js');
const fs = require('fs');
const kp = Keypair.generate();
fs.writeFileSync('x1_vault_cli/wallet.json', JSON.stringify([...kp.secretKey]));
console.log('Wallet created:', kp.publicKey.toBase58());
console.log('Save the secretKey JSON array to x1_vault_cli/wallet.json');
"
Or use the X1 Wallet Chrome extension to generate a keypair and export the secretKey.
Keep wallet.json safe. This is your encryption key AND your blockchain wallet. Never commit it to GitHub.
Get your wallet address from x1_vault_cli/wallet.json (the public key derived from the secret key), then send XNT tokens to that address.
Set X1_RPC_URL to your preferred endpoint. Default: https://rpc.mainnet.x1.xyz
node src/backup.js
Encrypts and uploads IDENTITY.md, SOUL.md, USER.md, TOOLS.md, and memory/ directory. Records CID on X1 blockchain and logs to vault-log.json.
node src/restore.js <CID>
Downloads from IPFS, decrypts with your wallet key, and restores all agent files.
node src/restore.js <CID> --only memory/
Restore only specific files or directories from a backup.
node src/list.js
View all stored backups with timestamps, CIDs, and checksums for versioned rollback.
node src/heartbeat.js
Monitors agent file integrity. If critical files are missing or corrupted, automatically triggers a restore from the latest backup.
⚠️ Opt-in Only — Heartbeat auto-restore must be explicitly scheduled via cron. It is NOT automatic.
Add to crontab:
0 */6 * * * cd /path/to/workspace && node x1-vault-memory/src/heartbeat.js >> /var/log/vault-heartbeat.log 2>&1Note: Heartbeat auto-restore is disabled by default and must be explicitly enabled via cron.
node src/backup.js --dry-run
Shows which files would be backed up without uploading or spending tokens.
vault-log.json. Re-anchor when RPC recovers.wallet.json path and format (must be JSON array of bytes).list.js.wallet.json or PINATA_JWT🔴 SECURITY WARNING: Use a dedicated wallet with minimal XNT. Never use your primary wallet.
Weekly backup via cron:
0 2 * * 0 cd /path/to/workspace && node x1-vault-memory/src/backup.js >> /var/log/vault-backup.log 2>&1
Heartbeat check every 6 hours (opt-in):
0 */6 * * * cd /path/to/workspace && node x1-vault-memory/src/heartbeat.js >> /var/log/vault-heartbeat.log 2>&1
IDENTITY.md — agent name, persona, vibeSOUL.md — personality, instructions, expertiseUSER.md — user profile and preferencesTOOLS.md — environment-specific notesmemory/*.md — daily memory logs| Component | Technology |
|---|---|
| Encryption | AES-256-GCM (authenticated encryption) |
| Integrity | SHA-256 checksums |
| IPFS Storage | Pinata API (JWT auth) |
| Blockchain | X1 Mainnet (SVM-compatible L1) |
| Wallet | @solana/web3.js (Node.js, no CLI needed) |
| Runtime | Node.js v18+ |
Built by Lokoweb3