README.md raw

smesh

smesh

nostr web client — one language, no frameworks, no npm

moxie is a Go derivative that compiles to native binaries and WebAssembly. No Google Go toolchain. No node. No build pipeline.

What is this

Smesh is the browser side of a self-hosted Nostr stack: the web client and its signer extension, written in moxie and compiled to WASM.

The relay is a separate repository: [morly](https://git.smesh.lol/morly). It was carved out of this tree and, for a while, its source stayed here too — which is how relay ports kept landing in the wrong repo. It is gone now (pkg/, main.mx, cmd/ are not this repo), the shared protocol types live in nostr, and nothing under web/ imports a relay package.

The client runs entirely in the browser. The relay is a dumb pipe. Crypto happens client-side. Key material never leaves the browser.

Architecture

morly relay (native binary)      ← separate repo
  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 (compiler) built from the moxie repo; point MOXIE/MOXIEROOT at that tree.

# web client + service worker
make dev

# signer extension (.xpi)
make build-ext

# everything
make build

# the relay, for the test suite to serve the app from (builds ../morly)
make relay-bin

Packages

PackageDescription
web/wasm/appBrowser client
web/wasm/swService worker
web/wasm/signerIn-page signer worker (vault, NIP-07, NIP-04/44)
web/wasm/relay-proxyPage-side relay proxy worker
web/wasm/{store,verify,profile,feed,notif,mls}Supporting workers
web/commonShared types, crypto, jsbridge stubs, relay pool
extOptional Firefox signer extension

The relay's packages (relay, store, sync, grapevine, crawler, blossom, …) and the shared protocol library now live in their own repositories.

Vault format

The signer extension uses the Plebeian/Smesh vault format:

Argon2id runs via WebAssembly (hash-wasm). Source in web/wasm/argon2-src/.

Principles

License

Licensed under AGPL-3.0-or-later.