fileverse/poc/ipfs-storage/README.md

37 lines
976 B
Markdown

# IPFS File Storage POC
Proof-of-concept for encrypted file uploads to IPFS, replacing centralized storage for rNotes.
## Flow
```
1. User picks file in TipTap editor
2. Client generates per-file symmetric key
3. Client encrypts file with AES-256-GCM
4. Encrypted blob uploaded to IPFS (via Pinata or self-hosted kubo)
5. CID + encrypted file key stored in Automerge document metadata
6. To view: fetch CID → decrypt with file key → display
```
## Setup
```bash
# Using Pinata (managed IPFS pinning)
# Store API keys in Infisical: infisical-project=fileverse, path=/ipfs
export PINATA_API_KEY=...
export PINATA_SECRET_KEY=...
npm install
npm run test
```
## Files
- `src/ipfs-client.ts` — Upload/download encrypted files to IPFS
- `src/tiptap-image-extension.ts` — TipTap extension for IPFS-backed images
- `src/test.ts` — End-to-end test: encrypt → upload → download → decrypt
## Status
Not started — waiting on Phase 1 crypto evaluation results.