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