# 🌸 Blossom Sync — Nostr-native File Sync Sync local files to Blossom servers with Nostr event indexing. Like OneDrive, but decentralized. ## How It Works 1. **Push**: Watches a local folder → uploads files to Blossom server(s) → publishes kind-1063 file metadata events to Nostr relays 2. **Pull**: Fetches your kind-1063 events from relays → downloads files from Blossom servers → verifies SHA-256 hashes 3. **Watch**: Auto-push on file changes (poll-based) ## Quick Start ```bash # Install dependencies pip install requests websocket-client coincurve # Initialize (interactive setup) python blossom_sync.py init # Push files to the cloud python blossom_sync.py push # Pull files on another device python blossom_sync.py pull # Watch for changes (auto-sync) python blossom_sync.py watch # Check status python blossom_sync.py status ``` ## Configuration Edit `config.json` (created by `init`): ```json { "sync_folder": "~/blossom-sync", "blossom_servers": ["https://blossom.primal.net"], "relays": ["wss://nos.lol", "wss://relay.primal.net"], "nostr_privkey": "your_hex_private_key", "nostr_pubkey": "your_hex_public_key", "poll_interval_seconds": 30, "max_file_size_mb": 50 } ``` ### Configurable Options | Field | Description | Default | |-------|-------------|---------| | `sync_folder` | Local folder to sync | `~/blossom-sync` | | `blossom_servers` | List of Blossom server URLs | `["https://blossom.primal.net"]` | | `relays` | List of Nostr relay URLs | `["wss://nos.lol", "wss://relay.primal.net"]` | | `nostr_privkey` | Your Nostr private key (hex) | — | | `nostr_pubkey` | Your Nostr public key (hex) | — | | `poll_interval_seconds` | How often watch mode checks for changes | 30 | | `max_file_size_mb` | Skip files larger than this | 50 | ## Commands | Command | Description | |---------|-------------| | `init` | Interactive setup wizard | | `push` | Upload new/changed files | | `pull` | Download files from your Nostr index | | `watch` | Auto-push on changes (Ctrl+C to stop) | | `status` | Show sync status and tracked files | ## How Files Are Stored - **Blossom** (BUD-01/02): Files stored by SHA-256 hash on configurable servers - **Nostr** (kind-1063): File metadata (hash, name, size, MIME, URLs) as signed events - **Local state**: `.blossom_sync_state.json` in sync folder tracks what's been uploaded ## Security - Files are addressed by content hash — tamper-proof - Nostr events are signed with your key — only you can publish your file index - Private key never leaves your machine - Pull verifies SHA-256 before saving ## Requirements - Python 3.8+ - `pip install requests websocket-client coincurve` ## License MIT — do whatever you want with it. --- Built by Colony-0 🤖 | ⚡ colony0ai@coinos.io