![smesh](docs/logo.svg) # smesh nostr relay + client — one language, no frameworks, no npm [moxie](https://git.mleku.dev/moxie) is a Go derivative that compiles to native binaries and ES modules. No Google Go toolchain. No node. No build pipeline. --- ## What is this Smesh is a self-hosted Nostr stack: relay, web client, and browser signer extension. Everything is written in [moxie](https://git.mleku.dev/moxie), a Go derivative that targets native binaries (relay) and JavaScript ES modules (browser). The client runs entirely in the browser. The relay is a dumb pipe. Crypto happens client-side. Key material never leaves the browser. ## Architecture ``` smesh relay (native binary) Serves static files, WebSocket, Blossom AUTH, search, CRUD — that's its scope │ │ HTTP / WS ▼ Browser ├── sm3sh app (.mjs) ← feed, messages, profiles, relay management │ └── signer modal ← vault unlock, identity management │ ├── service worker (.mjs) ← relay proxy, IDB cache, subscriptions │ └── signer extension (MV2) ← NIP-07, vault (Argon2id + AES-256-GCM), ├── background page key store, signing, NIP-04/44 ├── content-script.js permission evaluation ├── injected.js management API └── prompt.js ``` ## Build Requires [moxie](https://git.mleku.dev/moxie) (compiler) and `moxiejs` (JS backend) built from the moxie repo. ```sh # relay make build-relay # web client + service worker make dev # signer extension (.xpi) make build-ext # everything make build ``` ## Packages | Package | Description | |---------|-------------| | `pkg/relay` | HTTP/WebSocket server, pipeline, rate limiting | | `pkg/store` | Append-only event storage with WAL and indexes | | `pkg/nostr` | Event types, filters, tags, codecs, crypto (secp256k1, schnorr) | | `pkg/sync` | Negentropy set reconciliation | | `pkg/grapevine` | Web-of-trust graph evaluation | | `pkg/crawler` | Relay discovery and event harvesting | | `pkg/blossom` | Media storage (BUD-01/02/06) | | `web/app` | Browser client (compiled to .mjs) | | `web/sw` | Service worker (compiled to .mjs) | | `web/signer-bg` | Extension background (compiled to .mjs) | | `web/common` | Shared types, crypto, jsbridge stubs, relay pool | ## Vault format The signer extension uses the Plebeian/Smesh vault format: - **v2**: Argon2id (t=8, m=256MB, p=4) + AES-256-GCM, per-field encryption - **v1**: PBKDF2-SHA256 (1000 iterations) + AES-256-GCM (auto-migrated to v2 on unlock) - Legacy `hex(IV):hex(ciphertext)` AES-CBC vaults are detected and migrated automatically Argon2id runs via WebAssembly (hash-wasm). Source in `web/wasm/argon2-src/`. ## Principles - The server is a post office. It doesn't read your mail. - Crypto happens client-side. Key material never crosses a boundary. - One language both sides. No polyglot build chains. - Implement from scratch. Every dependency compounds. - Eliding obstraction. ## License MIT