MVP β Work in Progress. Core features are under active development, APIs may change, and you will hit bugs. Not yet audited β do not use for sensitive production data.
Marble is an E2EE messenger with a Go backend and a Tauri/React client.
Design goals: client sovereignty, server agnosticism, and ephemeral server storage. The server never sees plaintext or your MasterKey. Offline messages are stored encrypted and purged after the recipient ACKs. A local-only vault (Saved Messages) never leaves the device.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MARBLE CLIENT (Tauri) β
β β
β ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββ β
β β Account 1 β β Account 2 β β Offline Vaultβ β
β β (β Server A) β β (β Server B) β β (local-only, β β
β β E2EE β β E2EE β β never syncs)β β
β βββββββββ¬βββββββββββ βββββββββ¬βββββββββββ ββββββββββββββββ β
β β β β
βββββββββββββΌββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β E2EE β E2EE
β Curve25519/OpenPGP β Curve25519/OpenPGP
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β MARBLE SERVER A β β MARBLE SERVER B β ... any server
β Go + Postgres β β Go + Postgres β (self-hostable)
ββββββββββββββββββββ ββββββββββββββββββββ
- Multi-tenant: One client holds multiple accounts, each bound to a different server. Strict isolation per cryptographic domain.
- Server-agnostic: Any Marble server speaks the same WS/REST protocol. No vendor lock-in.
- Offline vault:
Saved Messagesis a local SQLite session β encrypted at rest, never transmitted. - Deterministic errors: Client uses
Result<T, AppError>(Go/Rust-style) instead oftry/catch.
| Layer | Choice |
|---|---|
| Server | Go net/http + httprouter, PostgreSQL, gorilla/websocket, golang-jwt/jwt/v5, ProtonMail/gopenpgp/v3, knadh/koanf (YAML config), uber-go/zap |
| Client | TypeScript, React 19, Vite, Tailwind CSS 4, Zustand, openpgp (Curve25519), jwt-decode, framer-motion, lucide-react |
| Native | Tauri 2, plugins: sql (SQLite), keyring-api, fs, http, clipboard-manager, opener |
| DB | Server: PostgreSQL Β· Client: SQLite (per-account, AES-GCM encrypted) |
Marble has not been externally audited. The model below is the intended design β review
enc/andsrc/logic/enc/before trusting it.
Local data is encrypted with AES-GCM-256. Network payloads are E2EE with OpenPGP Curve25519. Key derivation uses Argon2 (512-bit output).
[ Master Phrase ] (shown once at signup, then wiped)
β
βΌ Argon2 β 512-bit (64 bytes)
β
βββββββββββ΄βββββββββββ split in half
β β
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β Local Hash β β Server Hash ββββΊ sent to server, re-hashed & stored
β (MasterKey) β ββββββββββββββββ used for login + JWT issuance
ββββββββ¬ββββββββ
β
ββββββΊ encrypts βββΊ [ SQLite DB (AES-GCM, per-record) ]
β
βΌ (encrypted at rest by)
ββββββββββββββββ βββββββββββββββββββββββββββββββββ
β Wrapping Key β βββ derived βββ β Daily Passphrase / OS Keyring β
ββββββββββββββββ βββββββββββββββββββββββββββββββββ
Recovery: re-enter Master Phrase β Argon2 β same MasterKey β vault unlocks
Daily unlock: Passphrase/Keyring β Wrapping Key β decrypts stored MasterKey
- Threat model: Server stores only
hash(ServerHash)and never seesMasterKeyor plaintext. It does see account metadata (displayId, session membership, message timing/counts) and temporarily holds offline ciphertext. - What is E2EE today: Message
contentis OpenPGP-encrypted client-side beforeactvsend. Everything else (counts,session_last_seq, avatars) is not. - Daily auth: OS Keychain or a short passphrase derives a Wrapping Key that decrypts the at-rest MasterKey β so you don't retype the Master Phrase every launch.
[ Sender ] ββ E2EE ciphertext βββΊ [ WebSocket Server : /actv ]
β
Recipient state
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
β β
[ ONLINE ] [ OFFLINE ]
β β
βΌ βΌ
in-memory direct persist to Postgres
routing (no DB I/O) (ciphertext only)
β β
βΌ β
[ Recipient ] βββββββββ sync on reconnect βββββββββββββ
β
βββ ACK (delivered) βββΊ [ Server PURGES row ]
- Online: Routed in-memory, zero DB writes.
- Offline: Persisted as ciphertext in
messagetable. - On reconnect: Server syncs pending messages; client ACK triggers
DELETEβ honoring the ephemeral model.
users ββ1:1ββ pgp_profile
β 1
β n
ββββ session (alpha_id, beta_id CHECK alpha < beta, UNIQUE pair)
β β 1
β β n
β ββββ message (session_id, sender_id, seq, content, profile)
β
ββββ tokens (hash PK, user_id, expiry, scope, type)
See db/migrations/000001_init_schema.up.sql for the full DDL.
- Go 1.22+ Β· PostgreSQL 15+ Β·
golang-migrateCLI Β· Node 20+ Β· Rust (for Tauri)
# config
cp tmp/marble.yaml marble.yaml # edit port, jwtSecret, db DSN, mailer
# env var used by Makefile:
export MARBLE_DB_DSN="postgres://user:pass@localhost:5432/marble?sslmode=disable"
# migrate
make -C db migrateUpAll # or: migrate -path=db/migrations -database=$MARBLE_DB_DSN up
# run
go run .
# REST on :6280, WS on /actv, health on GET /marble.yaml shape (see tmp/marble.yaml):
app: { version: v0.1.3, env: Development }
api:
port: 6280
jwtSecret: "<32+ random bytes, base64>"
env: Development
limiter: { enabled: true, rps: 2, burst: 6, timeout: 2m }
users: { properties: [withActivation] }
mailer: { enabled: false, smtp-host: localhost, smtp-port: 1025, ... }cd client/Marble
npm ci
npm run dev # Vite on http://localhost:1420
# or full Tauri window:
npm run tauri dev
npm run build # tsc && vite buildTauri security is locked to csp: default-src 'self'; connect-src 'self' http: https: ws: wss: in src-tauri/tauri.conf.json.
Marble/
βββ app/ # server application
β βββ api/ # REST handlers, JWT, middlewares, routes
β βββ active/ # WS hub, in-memory store, message/session handlers
β βββ session/ # session + message persistence
β βββ users/ # users + tokens
β βββ setup.go # wiring (config, logger, db, api)
βββ config/ # koanf YAML loader
βββ db/ # pg connection + migrations + Models aggregate
βββ enc/pgp/ # server-side OpenPGP helpers
βββ internal/ # helpers, loggy (zap), mailer, validator
βββ client/Marble/ # Tauri + React client
β βββ src/
β β βββ components/ # auth, chat, sidebar, settings
β β βββ logic/ # enc, active (WS), auth, db (SQLite), messages, sessions, states
β βββ src-tauri/ # Tauri Rust shell + tauri.conf.json
βββ tmp/marble.yaml # example config
βββ main.go # entrypoint β app.Main()
| Method | Path | Auth | Notes |
|---|---|---|---|
GET |
/ |
β | Health: {"status":"available"} |
POST |
/auth/signup |
β | Create account |
POST |
/auth/login |
β | Issue JWT + refresh token |
POST |
/auth/refresh |
refresh | Rotate tokens |
PATCH |
/account/update |
JWT | Update profile |
DELETE |
/account/delete |
JWT | Delete account |
GET |
/actv |
JWT (WS) | WebSocket β all realtime messaging |
WS protocol: JSON { status, channel, token, body } β channels auth, message, session, user. See app/active/actTypes.go and client/Marble/src/logic/active/.
- Audit Argon2id params + per-user salt, add
pgx+ context-aware queries, fix WS lifecycle (close/cancel, raise 4KB read limit) - E2EE coverage: encrypt session metadata, add key rotation
- Offline reliability: retry + idempotent ACK, pagination for large sync
- Tests:
go test ./...+ client unit tests forenc/round-trips - CI: lint, test, and Tauri build on PR (currently release-only)
See LICENCE.
Built with care β contributions and sharp reviews welcome.