Architecture

From keychat-io/keychat-app · View interactive version

Architecture is an AI agent skill from the GitHub repository keychat-io/keychat-app. Explains the Keychat app architecture and key components

How to use this skill

Skill file

Keychat is a secure messaging app with a unique architecture. When explaining or working with the codebase, understand these key components:

Core Technologies

| Technology | Purpose | Implementation |

|------------|---------|----------------|

| Nostr Protocol | Message delivery/storage | lib/nostr-core/, WebSocket connections |

| Signal Protocol | 1:1 E2E encryption | api_signal.rs via FFI |

| MLS Protocol | Group E2E encryption | api_mls.rs via FFI |

| Bitcoin Ecash | Micropayments to relays | api_cashu.rs, keychat_ecash/ |

Package Structure

packages/
├── app/                    # Main Flutter app
├── keychat_ecash/          # Ecash wallet functionality
└── keychat_rust_ffi_plugin/ # Native crypto via Rust

Key Services (packages/app/lib/service/)

State Management

Uses GetX pattern:

Database

Uses Isar (NoSQL for Flutter):

Rust FFI Bridge

Native crypto operations use flutter_rust_bridge:

Message Flow

  1. User composes message
  2. Signal/MLS encrypts content
  3. Message wrapped in Nostr event
  4. Ecash stamp attached (if relay requires payment)
  5. Sent via WebSocket to Nostr relay
  6. Recipient receives, decrypts, displays
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.