Skip to content
Stephan Zehrer edited this page May 26, 2026 · 1 revision

mChat / mChatCore

What It Is

mChat is a native iOS chat app built on the Nostr protocol — a privacy-first, open messaging system with no central server and no phone number required. Identity is a cryptographic keypair.

mChatCore is the underlying Swift library that implements the Nostr protocol. It is the shared communication backbone for the entire HomeNode ecosystem — used by the iOS app, the HomeNode Agent, and any future component that needs to exchange messages.


Role in the HomeNode Ecosystem

mChatCore is not just a chat library — it is the universal message bus that connects humans and agents:

mChat (iOS)          ←── users chat with each other
HomeNode Agent       ←── bot participates in group chats
Future components    ←── any Nostr identity can join
         │
         └──► Nostr Relay ──► delivered to all participants

A mChat group chat can include both human users and the HomeNode Agent bot. The Agent sends home automation notifications and responds to natural language commands — all within the same conversation.


Key Features

mChat iOS App

  • Cryptographic identity — secp256k1 keypair, stored in iOS Keychain
  • 1:1 encrypted messaging — NIP-04 (AES-256-CBC + ECDH)
  • Group chat — NIP-28 channel support
  • Multi-relay — broadcasts to multiple independent relays simultaneously
  • iOS Contacts integration — link Nostr pubkeys to address book entries
  • Local persistence — full message history via SwiftData

mChatCore Library

  • NostrKeyPair — secp256k1 identity generation and signing
  • NostrBackend — connects to relays, sends and receives events
  • MessagingBackend protocol — abstraction for adding future protocols (Matrix, XMPP, SimpleX)
  • NIP-04 encryption — cross-platform (iOS, macOS, Linux)
  • mCLIChat — command-line client for testing and server-side use (Linux-compatible)

mCLIChat — CLI for the Agent

mCLIChat is an interactive command-line executable built from mChatCore. It runs on Linux and is the foundation for the HomeNode Agent's Nostr connectivity — the Agent uses the same library to connect to relays and participate in group chats.


Repositories

Repository Description
zehrer/mChat iOS app + mChatCore Swift package

Related

Clone this wiki locally