**v0.2.1** — Linux TUI + Android SDK/APK. Two people add each other with an `onionwire:v1:…` invite string (`F2` share / `F3` paste). There is no QR graphic. Chat is Noise IK over your own v3 onion. Unreachable chat peers go to a **local outbox** (device-only retry queue — no relay); file transfer and payment frames still fail closed. Optional Monero payments: `/pay` invoices (receive), `/tip` payments (send), and a full in-app wallet create/import (`F6` wallet screen, `/wallet create`, `/wallet import`). Arti onion services are still experimental. The whole store is encrypted at rest with SQLCipher; message bodies add a row-bound AEAD layer on top.
CI (`.forgejo/workflows/release.yml`) does **not** release on a merge. Releases are manual and batched: a maintainer runs the workflow at a stopping point (Actions → release → Run workflow, `dry_run=true` first), which tags the next `v*.*.*` version and publishes both Linux binaries — aarch64 on the Pi runner, x86_64 on the amd64 runner — to one [Forgejo release](https://forgejo.siriusdevops.com/sirius/onionwire/releases), with the Android APK + AAR attached to that same tag. Policy and inputs: [docs/RELEASING.md](docs/RELEASING.md). `scripts/build-release-local.sh` remains the offline x86_64 fallback. This Forgejo does not serve `/releases/latest/download/…` (404); pin the tag.
Needs [Rust](https://rustup.rs/) **1.91+** (`edition = "2024"`; the pinned Arti 0.46 crates require rustc 1.91). A distro `rustc` is fine if `rustc --version` reports 1.91 or newer. Do not install `tor` for this app.
On start you are prompted for a store passphrase (echo off, like other CLI passwords) or set `ONIONWIRE_STORE_PASSPHRASE`. Empty passphrase is rejected; a wrong passphrase does not open chat. Then you should see `onionwire: bootstrapping Arti…` on stderr. Directory bootstrap is usually under a minute; the onion is ready once a probe connect works (combined Arti status may still say Bootstrapping). Fail closed at 360s. Data lives in `ONIONWIRE_HOME` if set, otherwise `~/.local/share/onionwire/` (`onionwire.db` + Arti state, mode 0700). First open creates an ed25519 identity key. That key **is** you.
Then `F2` to share your invite, `F3` to paste a friend's. Mouse-select the `onionwire:v1:…` line to copy. Highlight them in the roster, type in the composer, Enter to send. Chat rows show delivery state from the local outbox (`✓` delivered, `◷ queued (try n/8, retry …)`, `» sending`, `✗ failed: …`); the footer shows `{n} queued` while anything is outstanding. If their onion is down the message stays on this device and the retry worker re-dials with backoff — nothing is handed to a third party. File transfer and payments are still one-shot (both sides online).
A friend is an ed25519 pubkey (`UNIQUE(pubkey)`). The `.onion` on that row is only where they are reachable right now. Pasting the same `k` updates the locator; it never creates a second person.
Focus starts on the composer so typing works immediately. `Tab` cycles panes; `j`/`k` and arrows only move the focused pane (roster or chat). `1`/`2`/`3` switch focus when you are not typing in the composer. `?` opens help from every screen except paste (so a payload can contain `?`).
Give that string to a friend. They `F3` paste it (`(o) paste invite`). Unknown `k` asks for approval. Same `k` already in the roster updates `onion` only.
never leaves the device, and it dies with the device. Two consequences are real and are accepted:
- **Device seizure.** A pending (never-delivered) message sits in the same SQLCipher store as the rest of the history, under the same per-row AEAD and the same passphrase-derived key — no weaker, but also no shorter-lived. Seizure *with* the passphrase reveals messages that were never actually sent, including ones the sender may have moved on from; seizure without it reveals nothing in this store. `/wipe` clears outbox rows with the rest of chat history; `/wipe-all` removes them with the data dir. Neither is a forensic erase — SSD wear-leveling can keep copies. Roster and identity stay.
- **Retry cadence is a local traffic-analysis surface.** A queued send re-dials the peer's onion on a backoff schedule while the app runs. An observer of your Tor client (or the network in front of it) sees a repeating connection attempt to one onion on a predictable cadence — it does not learn the plaintext or the recipient identity, but it can infer that you have an undelivered message for someone, and roughly when you composed it. The backoff is per-row, capped at one attempt per 30 min per message, and stops after 8 attempts or on a terminal failure.
Delivery markers in the TUI and Android chat UI are the store's own statuses:
The footer shows `{n} queued` while any row is outstanding. `try {n}/{8}` is the outbox attempt count; `retry {s}s` / `retry {m}m` / `retry now` comes from the stored absolute `next_attempt_at`. Failed reasons are sanitized, cut to the tail of the `a: b: c` chain, and capped at 24 cells.
`/profile` edits your friend-visible display name, bio, and optional Monero address (64 / 512 byte limits, no images). Enter saves and one-shot sends a signed `prf` frame to the selected friend. `F5` or `/who` shows their last signed profile. There is no directory: unknown pubkeys are ignored.
Loopback only, HTTP Digest (RFC 2617, matching `--rpc-login`), 5s timeout, 1 MiB response cap. `.onion` RPC URLs are rejected (no Arti dial; do not point this at a remote wallet). Unset → chat still works; `/pay`, `/tip`, and `F6` say so. Do not log the RPC password.
| `/pay <xmr> [memo]` | `inv ` | Invoice to receive. We want to be paid. Uses a wallet subaddress if RPC is up, else the profile `xmr_addr`. |
| `/tip <xmr> [memo]` | `rcp ` + `tip ` | Pay the selected friend. Sends a Monero `transfer`, then a signed receipt claim and a tip frame. Disabled under `ONIONWIRE_WALLET_NO_SPEND`. |
-`/pay` sends a signed `inv` frame one-shot (both sides must be online).
-`/tip` does the chain transfer first, then sends a signed `rcp` frame **and** a `tip` frame — both one-shot. Peer onion down → fails after the transfer. Not queued.
## In-app wallet (create / import)
`/wallet create` (F6 then `c`) generates a new spend-capable wallet on the RPC
(`create_wallet`), then shows the 25-word seed **once** for backup
(`query_key mnemonic`). Type `SPEND` to accept the spend-authority warning, set a
wallet passphrase, write the seed down, type `SEEN`. The seed is never pasted into
the composer or chat history — collect it on the dedicated screen.
`/wallet import` (F6 then `i`) restores from an existing 25-word seed via
`restore_deterministic_wallet`. This is the only path that takes a user-supplied
secret. The seed is collected on its own screen.
Both paths require the wallet RPC to be started with `--wallet-dir` (not only
`--wallet-file`); the in-app filename is `onionwire`.
**Spend-authority warning** — unavoidable at create/restore:
> An OnionWire instance pointed at a spend-capable `monero-wallet-rpc` is a local spend authority. Any process that can read the RPC credentials (env var, `/proc/<pid>/environ`, shell history, a stored URL) can spend the wallet's balance, and `/tip` gives a chat peer a supported path to ask for a transfer. Prefer a view-only wallet or a separate low-balance hot wallet for spend.
The wallet screen (`F6`) shows a receive address (fresh subaddress when the wallet is up, else the profile `xmr_addr`), the current balance, and up to 8 recent transfers. Press `r` (or Enter) to toggle a QR code of the receive address. `Esc` returns to the chat.
Losing `identity_sk` loses every friend relationship.
-`/backup /path` — type `BACKUP`, passphrase twice. Writes `owbak1` (Argon2id + ChaCha20-Poly1305). Onion is **not** in the file (locator is disposable; F4 after restore if needed).
-`/restore /path` — type `RESTORE`, passphrase. Overwrites self keys. **Does not rewrite the roster** — you may become a different person talking to old friends.
0.1.2 peers store unknown plaintext as chat. A 0.2 sender of `prf ` / `inv ` / `rcp ` / `tip ` / `fil ` will leave a garbage line on an un-upgraded peer. Upgrade both sides. The Noise handshake is unchanged.
-`/wipe` — confirm by typing `WIPE`. Chat and payments history gone (overwrite message bodies, drop `payments`, `VACUUM`, WAL checkpoint). Identity key and friends stay. Not a forensic erase (SSD wear-leveling). `/wipe-all` is the identity burn.
-`/wipe-all` — confirm by typing `WIPEALL`. Deletes the data dir. Next start is a **new person** (new identity key). Same disk caveat. Esc cancels. Nothing is wiped without confirm.
The whole sqlite file is SQLCipher (`rusqlite` feature `bundled-sqlcipher-vendored-openssl`). A 32-byte key is derived from the store passphrase with Argon2id over a per-install 16-byte salt in `store_salt` (mode 0600, in `ONIONWIRE_HOME`) and handed to SQLCipher as a **raw** key (`PRAGMA key = "x'…'"`) as the first statement after open. The file header, schema, `self.identity_sk`, friend public keys, locators, profiles and payment rows are all ciphertext on disk, so a disk grep of `onionwire.db` must not yield the message log, your identity key or your roster. A wrong or empty passphrase fails closed before any write; an encrypted store whose `store_salt` is missing refuses to open instead of guessing. v0.2.1 plaintext installs upgrade in place on the first open with the right passphrase; a wrong one leaves the plaintext file untouched.
Chat bodies carry a second, row-bound layer: ChaCha20-Poly1305 (`nonce || ciphertext` in `messages.plaintext`) with AAD `owmsg1 || friend_id_le64 || dir || 0x00 || row_id_le64`, plus a random 32-byte data key in `store_meta` wrapped with Argon2id from the same passphrase. Whole-file encryption does not stop someone who can write the file from moving one row's ciphertext into another row; the row-bound AAD does, and it stays. Unlock is fail-closed: wrong or empty passphrase does not open chat. Empty-AAD v0.2 blobs are rewrapped once on unlock; `list_messages` never falls back to empty AAD.
At-rest encryption is not a defense against a live compromise: while OnionWire runs, the passphrase, the db key and decrypted rows are in process memory, and SQLCipher's page cache holds decrypted pages. Secret material (Noise/Ed25519/X25519 ephemerals, store key copies, TUI passphrase buffer) is zeroized with the `zeroize` crate when dropped; that shrinks the window, it does not close it. It also does not stop an attacker who has your passphrase. Pending outbox rows live in the same encrypted store as delivered chat — seizure *with* the passphrase can reveal messages that never left the device. `/wipe` deletes chat, payments and outbox history; it is not a forensic erase — SSD wear-leveling can keep copies. `/wipe-all` deletes the data dir (new identity). Ctrl-Q can clear history on the way out (`CLEAR`) without becoming a new person.
Same repository, same protocol, separate product from the Linux TUI. An Android peer and a Linux peer that exchange invites interoperate — one protocol, not two.
- **SDK** — `onionwire-sdk-<version>.aar`. UniFFI Kotlin bindings over the same Rust crate the TUI runs on, plus `libonionwire_sdk.so` for `arm64-v8a`. `Wire.send()` returns `SendState.Sent` | `SendState.Queued`; chat rows carry `delivery` and `id`; `Wire.outbox(pubkey)` exposes attempt count and next attempt time so the UI can render `queued (try n/8, retry 45s)` without inventing a countdown. Explicit Tor lifecycle bindings (`shutdown`/`flush`/`torState`) stop, flush, and report observable Tor state. Another Android app can depend on the AAR directly.
- **Payment surface** — `sendInvoice(pubkey, amountXmr, memo)` for `/pay`-style invoices, `sendTip(pubkey, amountXmr, memo)` for `/tip`-style payments (chain transfer + signed `rcp` + `tip`), `walletBalance()`, `walletReceiveAddress()`, `walletRecentTransfers(cap)`, `createWallet(password)` (returns the 25-word seed once), `importWallet(password, seed)`, and `spendAuthorityWarning()`. All payments are one-shot; none are queued. See [crates/onionwire-sdk/README.md](crates/onionwire-sdk/README.md).
- **APK** — `onionwire-<version>-android-arm64-v8a.apk`. Kotlin + Jetpack Compose + Material 3 messenger that depends on `:sdk` and nothing else. Per-row delivery markers and a chat-level outbox footer match the TUI vocabulary. A foreground keep-alive service (ongoing notification) keeps the in-process Arti onion published and the outbox retry worker alive through Doze while the user wants the node reachable. The store passphrase can be remembered as an AES-256-GCM blob wrapped by the **Android Keystore** (StrongBox first, TEE/software fallback, labelled honestly). A Compose wallet route (receive QR, balance, transfers, create/import) and roster bottom actions are wired without dropping wipe-chat.
- [`.forgejo/workflows/ci.yml`](.forgejo/workflows/ci.yml) — two jobs on the Pi runner (`docker` label), serialized by `onionwire-ci-pi`. `test`: `cargo test --locked` + `cargo clippy --all-targets -- -D warnings` at the repo root. `sdk`: the same for `crates/onionwire-sdk` (separate cargo workspace — own `Cargo.lock`, root crate by path, `rustls` instead of `native-tls` — so a root signature change cannot silently break the Android SDK). Both run on `main` and PRs when `src/`, `crates/`, `tests/`, `Cargo.toml`, `Cargo.lock`, or this workflow change (ignored Tor-live tests are not run). `workflow_dispatch` always runs the suite.
- [`.forgejo/workflows/release.yml`](.forgejo/workflows/release.yml) — manual, batched release (`workflow_dispatch` only: `dry_run`, `bump`, `version`, `tag`): next tag, aarch64 (`docker`) + x86_64 (`docker-amd64`), one release, fail-closed tag delete on failure. Dispatch [`android-release.yml`](.forgejo/workflows/android-release.yml) with that tag to add the APK + AAR (no automatic trigger fires on this Forgejo; it is `workflow_dispatch` only). Concurrency group `onionwire-ci-pi` (same as `ci.yml`, `cancel-in-progress: false`) so cargo jobs do not overlap on the Pi. Amd64 dind is serialized by runner `capacity=1`.
- [`.forgejo/workflows/android-release.yml`](.forgejo/workflows/android-release.yml) — amd64-only Android build (dispatch-only on this Forgejo; wakes from an explicit `tag=` input, not a tag push).
- [`scripts/publish-release.sh`](scripts/publish-release.sh) — create-or-update a release and (re)upload assets via the Forgejo API. Needs `FORGEJO_TOKEN` (repo secret in CI, env locally).
| Hang on `bootstrapping Arti…` / `hs status: Bootstrapping` | Outbound network required. Combined Arti status can stay Bootstrapping through a 5 min HsDir upload round; OnionWire probes the onion and proceeds once a connect works. Still fail closed after 360s if neither a probe nor `DegradedReachable`/`Running` — no C-tor fallback. |
Prosody, XMPP, s2s, MAM, carbons, a **server-side** outbox / store-and-forward relay, multi-device, DHT / name server, QR codes, A/V. The **local** chat retry queue is in; it never leaves the device. Protocol lock: [docs/PROTOCOL.md](docs/PROTOCOL.md).