Skip to content
Back to skills

Architecture

ASecurity

Explains the Keychat app architecture and key components

  • 97 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 10, 2026
developmentrustsqlreactapidatabase

Works with

  • api

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add keychat-io/keychat-app --skill architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Architecture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/keychat-io-architecture/badge)](https://www.skillsdirectory.com/skills/keychat-io-architecture)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: architecture
description: Explains the Keychat app architecture and key components
user-invocable: true
disable-model-invocation: false
---

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/)

- **signal_chat.service.dart** - Signal protocol session management
- **mls_group.service.dart** - MLS group key operations
- **websocket.service.dart** - Nostr relay connections
- **chat.service.dart** - High-level message routing
- **relay.service.dart** - Relay management
- **identity.service.dart** - User identity management

## State Management

Uses **GetX** pattern:
- Controllers in `lib/controller/`
- Services are singleton instances
- Reactive state with `.obs` observables

## Database

Uses **Isar** (NoSQL for Flutter):
- Models in `lib/models/`
- Models use `@collection` annotation
- Generated code via build_runner (*.g.dart, *.isar.dart)

## Rust FFI Bridge

Native crypto operations use flutter_rust_bridge:
- Rust code: `packages/keychat_rust_ffi_plugin/rust/src/`
- Generated Dart bindings: `packages/keychat_rust_ffi_plugin/lib/`
- Key APIs: Cashu, Nostr, Signal, MLS

## 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.