Overview

MyMonad is a protocol for privacy-preserving similarity-based discovery, with a reference implementation for human matchmaking. This page covers the architecture of both.

Components

mymonad-ingest

The data ingestion daemon. Watches local directories for document changes and builds your Monad vector.

Responsibilities:

  • File system watching (fsnotify)
  • Content extraction from supported formats
  • Embedding generation via Ollama
  • Running average vector updates
  • Encrypted Monad storage

mymonad-agent

The P2P networking daemon. Handles peer discovery, connections, and the handshake protocol.

Responsibilities:

  • libp2p host management
  • Kademlia DHT participation
  • mDNS local discovery
  • LSH-based peer discovery (commit-reveal)
  • Handshake protocol state machine
  • Adaptive anti-spam difficulty
  • ZK proof exchange (optional)
  • Encrypted chat messaging

mymonad-cli

Command-line interface for interacting with the daemons.

Responsibilities:

  • Status queries
  • Peer management
  • Identity display
  • Manual bootstrapping

Data Flow

Documents → Ingest → Embeddings → Monad Vector
                                      ↓
                               LSH Signatures
                                      ↓
                            Agent (P2P Network)
                                      ↓
                           Discovery (DHT + mDNS)
                                      ↓
                            5-Stage Handshake
                                      ↓
                            Compatible Match

Design Principles

  1. Privacy First — Raw data never leaves your device
  2. Decentralized — No central servers or authorities
  3. Progressive Trust — Reveal information only as trust is established
  4. Cryptographic Verification — Math replaces blind trust
  5. User Sovereignty — You own your keys, your data, your connections

Protocol vs Application

AspectProtocolApplication
PurposeGeneric similarity-based discoveryHuman matchmaking
ScopeInfrastructure primitivesUser-facing workflow
CustomizationDomain-agnosticDating/social/professional
ExamplesLSH, handshake, ZK proofsDeal-breakers, chat, unmask

Key Packages

PackageDescription
pkg/monadAffinity vector with running average updates
pkg/protocol5-stage handshake FSM
pkg/lshLocality Sensitive Hashing for discovery
pkg/hashcashProof-of-work anti-spam
pkg/zkproofZero-knowledge circuits (gnark/PlonK, BN254)
internal/antispamLoad-adaptive difficulty controller (16→28 bits)
internal/chatEncrypted messaging with HKDF key derivation
internal/discoveryLSH-based peer discovery with commit-reveal
internal/zkproofZK proof exchange protocol
internal/cryptoEd25519, X25519, encrypted storage
internal/agentlibp2p networking
← Protocol Specification