Skip to main content

evermemos-sealedmind

Privacy adapter for 0G Memory (EverMemOS): encrypted-at-rest storage on real 0G Storage, wallet-bound secrets, and on-chain capability sharing via SealedMind contracts on 0G mainnet/testnet.

Plugs in via 0G Memory's memsys.addons entry point. Zero fork. Opt-in.

What it fixes

0G Memory issue This addon
Plaintext user_secrets_backup.json (flagged unsafe) WalletVault — SIWE-derived master key, encrypted
ZeroGKVStorage writes raw bytes SealedMindKVStorage — AES-256-GCM envelope on 0G
No cross-agent sharing primitive CapabilityClient — on-chain grant / verify / revoke
LLM calls go to untrusted endpoints SealedInferenceClient — TEE-attested Qwen 2.5 7B

Install

pip install evermemos-sealedmind

Then enable in 0G Memory:

export MEMSYS_ENTRYPOINTS_FILTER=core,sealedmind
export KV_STORAGE_TYPE=sealedmind
export MEMSYS_AUTH_PROVIDER=sealedmind
export SEALEDMIND_NETWORK=mainnet              # or testnet
export SEALEDMIND_DOMAIN=app.example.com
export SEALEDMIND_INFERENCE_URL=https://...    # your sealed inference gateway

Run the storage sidecar

The Python addon uses the official Node SDK (@0gfoundation/0g-ts-sdk) through a small local HTTP sidecar. There is no maintained Python client for 0G Storage segment uploads — this is the production path.

cd sidecar
npm install
SEALEDMIND_RPC_URL=https://evmrpc.0g.ai \
SEALEDMIND_INDEXER_URL=https://indexer-storage.0g.ai \
SEALEDMIND_PRIVATE_KEY=0x...funded_wallet... \
node src/server.js
# listens on http://127.0.0.1:7878 by default

Bind to loopback (default) or a private VPC. There is no auth on the wire.

Architecture

┌──────────────────┐    siwe sig     ┌────────────────┐
│  Wallet (user)   │────────────────▶│   WalletVault   │
└──────────────────┘                 │ (master key in  │
                                     │  RAM only)      │
                                     └───────┬─────────┘
                                             │ DEK / index key
                                             ▼
                              ┌────────────────────────────┐
0G Memory ──KV API──▶ SealedMindKVStorage  ──env──▶ Node sidecar ──▶ 0G Storage
                              │           │                              (real)
                              │           ▼
                              │   Capability check
                              ▼           │
                         SQLite          ▼
                       (blinded keys, web3.py ──▶ CapabilityRegistry
                        ciphertext refs)              MemoryAccessLog
                                                      (0G chain, real)

What is real, what is not

Path Real / on-chain
AES-256-GCM envelope encryption Real (cryptography)
Master / DEK / index key derivation Real HKDF-SHA256
Local key-name blinding Real HMAC-SHA256
0G Storage upload / download Real, via @0gfoundation/0g-ts-sdk in the sidecar
CapabilityRegistry.grant / revoke / verify Real, web3.py against the deployed contract
MemoryAccessLog.logAccess Real, web3.py — only called with a real attestation
SIWE verification Real, siwe package; rejects bad domain / chainId
Sealed inference Real call to your gateway; attestation hash from quote

There are no mocks in production code paths. Tests use real testnet for the on-chain integration suite (gated by RUN_INTEGRATION=1); pure-math crypto tests run offline.

Deployed contracts

0G Mainnet (chainId 16661) — explorer: https://chainscan.0g.ai

Contract Address
Verifier 0x6D5B3B81119F78366B767DB81C2dd6625d5648Af
SealedMindNFT 0x091CfC4b9E6FF0026F384b8c4664B8C03Af21EA6
CapabilityRegistry 0xeb2F5C59A38F0f2339F5B399e4EDeF1FA834FA45
MemoryAccessLog 0xec9321C66aD8D73FB8f8D80736e1b6C47570c5Ad

0G Testnet (chainId 16602) — explorer: https://chainscan-galileo.0g.ai

Contract Address
Verifier 0xE4f3f96419c87675EEa6Cd55D689b0A8807D8AAd
SealedMindNFT 0x741BbE3B2d19E1aE965467280Cc2a442F3632Ee7
CapabilityRegistry 0xf6b33aDa9dd4998E71FA070C1618C8a52A44Ec66
MemoryAccessLog 0xB085F48c98E8878ACA88460B37653cC8d2E24482

Tests

# unit (no network)
pip install -e ".[dev]"
pytest

# integration against real 0G testnet
# (requires sidecar up + funded wallet)
RUN_INTEGRATION=1 \
SEALEDMIND_TEST_PRIVATE_KEY=0x... \
pytest tests/test_kv_storage_integration.py -v

Two-agent demo (live, on-chain)

RUN_DEMO=1 \
SEALEDMIND_NETWORK=testnet \
SEALEDMIND_PRIVATE_KEY=0x...patient... \
PATIENT_MIND_ID=42 \
DOCTOR_ADDRESS=0x... \
python examples/two_agent_demo.py

The doctor reads under a real on-chain capability; the patient revokes; the next read fails on-chain (verified via CapabilityRegistry.verifyCapability).

Status

Pre-release. Built for the 0G APAC Hackathon (2026-05-09) and pending review by the 0G Memory team before being listed as the recommended privacy adapter.

Metadata

Release files for evermemos-sealedmind 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evermemos-sealedmind 0.1.0
File Size Uploaded Provenance Actions
evermemos_sealedmind-0.1.0.tar.gz 27.1 kB Without provenance Details for evermemos_sealedmind-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for evermemos-sealedmind 0.1.0
File Interpreter ABI Platform Actions
evermemos_sealedmind-0.1.0-py3-none-any.whl Python 3 none any Details for evermemos_sealedmind-0.1.0-py3-none-any.whl

Total release size: 56.8 kB

Release files / evermemos_sealedmind-0.1.0.tar.gz

Download URL evermemos_sealedmind-0.1.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c171fe156fdae55667687e05be64f97bae15b4db2cc55d5869c817b12387cc85
BLAKE2b-256 checksum
How to use checksums
d80427656b548c91e8e8e50c403b8019c54c59e30463f7268b410a8711b78693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / evermemos_sealedmind-0.1.0-py3-none-any.whl

Download URL evermemos_sealedmind-0.1.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9022a5d233ca8c7e28793fdb5440deaf77900168f54684e7a573f8982d3cc918
BLAKE2b-256 checksum
How to use checksums
e84b0e893e20ad3487e01c02d13cc6bb9a20ac0053dbd16a138efaf2c1d59fdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for evermemos-sealedmind 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page