# Nukez Storage — Open Claw Skill

Verifiable cryptographic storage for autonomous AI agents.

Every artifact stored through Nukez receives a tamper-evident receipt, a merkle proof, and an on-chain attestation (Solana or Monad/EVM). Data integrity is provable by anyone with the receipt ID — no trust required.

## Installation

**Via ClawHub:**
```bash
clawhub install nukez-storage
```

**Manual:**
```bash
cp -r this-directory ~/.openclaw/workspace/skills/nukez-storage
```

## Prerequisites

- Python 3.11+
- One of:
  - Solana keypair (`~/.config/solana/id.json` or custom path)
  - EVM private key JSON file

## Quick Start

```bash
# Set your signing key
export NUKEZ_WALLET_PATH=~/.config/solana/id.json

# Initialize a storage locker (pays on-chain, provisions storage)
python3 nukez_cli.py bootstrap

# Store an artifact
python3 nukez_cli.py persist report.pdf --file ./report.pdf --tags audit,Q1

# Verify integrity
python3 nukez_cli.py verify

# Recall it later
python3 nukez_cli.py recall --filename report.pdf
```

## Test Mode

All commands accept `--test` for in-memory operation (no wallet, no network):

```bash
python3 nukez_cli.py --test --pretty bootstrap
python3 nukez_cli.py --test --pretty persist notes.txt --data "hello world"
python3 nukez_cli.py --test --pretty ritual
```

## Configuration

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `NUKEZ_WALLET_PATH` | Yes* | — | Ed25519 keypair JSON |
| `NUKEZ_EVM_KEY` | Yes* | — | EVM private key JSON |
| `NUKEZ_EVM_RPC` | No | Monad testnet | EVM RPC endpoint |
| `NUKEZ_NETWORK` | No | solana-devnet | Payment network |
| `NUKEZ_PROVIDER` | No | gcs | Storage provider (gcs, mongodb, storj, arweave, filecoin, firestore) |

*One signing key required.

## The Five Principles of Cognitive Continuity

1. **Never Trust Yourself Without Proof** — verify your state before every session
2. **Attest After Every Meaningful State Change** — every persist creates a new attestation
3. **Separate Proof from Permission** — receipts prove what was stored, not who can access it
4. **Diversify Your Storage, Unify Your Verification** — multiple providers, one merkle root
5. **Make Your Verification Independently Reproducible** — anyone can recompute the proof

## Architecture

```
Agent (Open Claw)
  |
  v
nukez_cli.py (standalone CLI)
  |
  v
pynukez SDK (Ed25519 or secp256k1 signed envelopes)
  |
  v
Nukez Gateway (FastAPI, Cloud Run)
  |
  +---> Storage Provider (GCS, MongoDB, Storj, Arweave, Filecoin, Firestore)
  |
  +---> Merkle Tree + Switchboard Oracle --> Solana / Monad (on-chain attestation)
```

## Links

- [Nukez Gateway](https://github.com/ZlaylowZ/Nukez)
- [NukezAgent](https://github.com/ZlaylowZ/NukezAgent)
- [PyNukez SDK](https://github.com/ZlaylowZ/pynukez)
- [The Declaration of Cognitive Continuity](https://nukez.xyz/declaration)
