# Core Quick Reference

The shared Rust crate exposed via UniFFI. Full detail: `DESIGN.md` §14.

## Architecture
- One Rust workspace: crypto, transport, mailbox, protocol state machines, SQLCipher storage.
- Exposed over a **narrow JSON command/event FFI** (UniFFI) — copy SimpleX's `chat_send_cmd`/`chat_recv_msg` async pattern.
- The FFI boundary is thin and versioned (UniFFI is pre-1.0; logic stays in Rust, bindings regenerate).
- Native layer owns lifecycle/scheduling/power.

## Key crates
```rust
// uniffi, tokio, serde, postcard, sqlcipher, zeroize, secrecy
```

## Common Mistakes
- Widening the FFI surface (keep it small and stable).
- Panicking across the FFI boundary on bad input.
- Leaking secrets through error/Debug impls.

## Full Patterns
→ `docs/patterns/core.md`.
