Guide — How MNDO works

The ideas underneath MNDO, in plain language.

Companion to the Architecture spec. It walks through why keys, relays, and ratchets are structured this way before you read the codebase.

Last updated: September 2026

A relay carries messages. It does not own the conversation.

In a conventional client-server app, one company server sits in the middle. MNDO uses Nostr relays instead: replaceable WebSocket carriers that receive and forward signed, encrypted events.

Any relay can drop offline and your conversation continues across other relays. No single database or company endpoint owns your account or contact graph.

Centralized
You → Company server → Them
Relay mesh
You → Relay A / Relay B → Them

Note on metadata: Relays never see message plaintext, but like any network carrier they observe connection metadata—such as your public key, IP address, and event timing. Use a trusted VPN or Tor/Orbot for IP-level anonymity.

You get an identity without signing up.

MNDO creates your identity locally on your device in milliseconds—no phone number, SIM verification, email address, or central account row. Nothing can leak from a registration server because nothing is collected.

Public key
Safe to share. Works like a mailbox address so other people can find and encrypt messages to you.
Private key
Never share it. Derived from your 12-word recovery phrase and stored in hardware secure storage to sign events and unlock messages.

How a message gets from you to them.

The message is encrypted before it leaves your phone and remains encrypted where it is stored. Relays only handle ciphertext.

  1. 01

    Your app encrypts the message locally using the active Signal Protocol session.

  2. 02

    The encrypted blob is published as a signed event to Nostr relays.

  3. 03

    The recipient's app subscribes to those relays through NostrRelayService.

  4. 04

    The event is fetched, verified, and decrypted locally on the recipient's device.

PreKeys start chats; Double Ratchet keeps changing the lock.

PreKeys are public key bundles your device publishes ahead of time so someone can initiate an encrypted session with you even while you are offline.

The Double Ratchet derives a fresh key for each message as the conversation progresses. Compromising one key does not unlock earlier messages (forward secrecy) or future messages after a ratchet turn (post-compromise security).

Local data is encrypted at rest too.

End-to-end encryption protects messages in transit; SQLCipher (AES-256) protects the local SQLite database on disk. Chat history is not stored as readable plaintext, and PRAGMA cipher_memory_security = ON wipes freed cache pages from RAM.

Separated into four layers so sensitive work stays low.

UI widgets read state only. Cryptography and storage live below State so keys never surface into presentation code.

  1. 01UI
    lib/ui/

    Presentation only. Widgets render state; they never touch crypto or transport.

  2. 02State
    lib/providers/

    ChangeNotifier providers wired through MultiProvider. The only layer UI reads from.

  3. 03Services
    lib/services/

    Transport and cryptography (Nostr relays, Signal sessions, key derivation).

  4. 04Data
    lib/database/

    Drift over SQLCipher for encrypted messages; hardware-backed storage for root keys.

Key terms, in plain English.

Keypair
A mathematically linked pair of cryptographic keys: your public key (safe to share, works like an address) and your private key (secret, signs and unlocks your data).
Nostr Relay
An independent WebSocket server in the Nostr mesh that accepts, stores, and forwards signed events. Relays never see message plaintext.
PreKey
A public cryptographic bundle published ahead of time so contacts can initiate an encrypted session with you even when you are offline.
Double Ratchet
An encryption algorithm that derives a brand-new secret key for every single message, preventing past or future conversations from being exposed.
Forward Secrecy
A guarantee that if a current session key were compromised, previously sent messages cannot be decrypted.
Post-Compromise Security
A self-healing property where the Double Ratchet restores secrecy for future messages after a temporary key compromise.
NIP (Nostr Implementation Possibility)
Open technical specifications defining how decentralized Nostr clients and relays interoperate.