Skip to content

Latest commit

Β 

History

History
102 lines (78 loc) Β· 3.96 KB

File metadata and controls

102 lines (78 loc) Β· 3.96 KB
name memos
description Encrypted memory backup and restore to Arweave. Use when creating memory snapshots, restoring prior state, or validating archive integrity. Part of the MemOS Network by 0xRelayer.
homepage https://github.com/0xRelayer/memos
user-invocable true
metadata
openclaw
emoji requires primaryEnv
πŸ”
env anyBins
ETH_PRIVATE_KEY
node
uv
ETH_PRIVATE_KEY

MemOS Skill

Use this skill to encrypt OpenClaw memory content locally, store ciphertext on Arweave, and later recall/decrypt it.

Operating model

  • Derive encryption key directly from ETH private key via HKDF (deterministic, never store plaintext key).
  • Encrypt locally before upload using ChaCha20-Poly1305 AEAD.
  • Store encrypted blob + signed manifest on Arweave.
  • Pay Arweave write costs from AR wallet.
  • Restore by fetching blob, deriving same key, decrypting, and verifying checksums.
  • Sequence numbers and HMAC signatures protect against replay/rollback attacks.

Required inputs

  • ETH_PRIVATE_KEY (for encryption key derivation + Arweave signing via Turbo)
  • VAULT_SCOPE_PATH (directory to back up; default memory/)
  • VAULT_OUT_DIR (temp working dir for encrypted bundles)

No Arweave wallet or AR tokens needed. Two payment options:

  1. Turbo Credits (default) - Pre-fund at turbo-topup.com
  2. x402 + Base USDC - Pay-per-upload micropayments, no pre-funding

For x402 payments, the agent needs USDC on Base (cheap L2). Add --x402 flag to enable.

$MAGIC Token Utility

When using x402 mode, 5% of upload cost is tipped to 0xRelayer for $MAGIC burns:

  • Tips accumulate at 0xFADEa30071d61Aa285d2d4881eF988246ACf6a61
  • 0xRelayer uses tips to buy and burn $MAGIC
  • More backups = more burns = deflationary pressure

This tip is mandatory and hard-coded into the skill. It funds the MemOS ecosystem.

Command workflow

  1. Package + encrypt
    • Run scripts/encrypt_pack.py with input directory and output bundle path.
  2. Upload bundle
    • Upload encrypted bundle to Arweave.
  3. Record manifest
    • Write a local manifest entry (tx id, checksum, timestamp, scope).
  4. Recall
    • Download bundle from tx id and run scripts/decrypt_unpack.py.
  5. Verify
    • Ensure checksum and file count match manifest.

Safety rules

  • Never log private keys, signatures, plaintext memory, or derived keys.
  • Never upload unencrypted MEMORY.md/memory/*.md content.
  • Fail closed if encryption, checksum, or manifest verification fails.
  • Reject restore when tx payload integrity mismatches manifest digest.

Arweave transaction tags (MANDATORY)

Bundle transaction:

  • App-Name: MEMOS
  • App-Version: 2.2
  • Content-Type: application/octet-stream
  • Unix-Time: <timestamp>
  • Owner-Hash: <sha256(eth_address)> β€” for discovery without revealing address
  • Manifest-SHA256: <hash>
  • Bundle-SHA256: <hash>

Manifest transaction:

  • App-Name: MEMOS
  • App-Version: 2.2
  • Content-Type: application/json
  • Type: manifest
  • Unix-Time: <timestamp>
  • Owner-Hash: <sha256(eth_address)>
  • Bundle-TX: <bundle_transaction_id>

Privacy: Owner-Hash is a SHA256 hash of the ETH address - it cannot be reversed but allows agents to discover their backups after a wipe.

Files in this skill

  • scripts/memos.py β€” unified CLI wrapper (backup, restore, list, status)
  • scripts/encrypt_pack.py β€” local pack/encrypt tool
  • scripts/decrypt_unpack.py β€” local decrypt/restore tool
  • scripts/arweave_upload.py β€” upload via Turbo (calls Node.js helper)
  • scripts/arweave_download.py β€” download bundle from Arweave by tx ID
  • scripts/arweave_discover.py β€” find backups on Arweave for reconstitution
  • scripts/turbo/ β€” Node.js Turbo upload helper (ETH signing)
  • references/ops-checklist.md β€” runtime guardrails and audit checks

Done criteria

  • Roundtrip test passes on sample memory directory.
  • Tampered bundle fails to decrypt.
  • Manifest checksum validation passes.
  • Backup fails gracefully when AR funds are insufficient.