The selection screen shipped as presentation only: `F6 w` opened its
unavailable state, the rows were never read, and Enter on a wallet said
switching was not wired up. The catalogue, the create path and the screen
all existed; nothing joined them.
- `App::open_wallet_select` builds its rows from `Node::list_wallets` at
the moment the screen opens (never cached from startup), and a failed
read is the screen's own error state rather than "no saved wallets".
- `App::choose_wallet` resolves `WalletChoice::Open(index)` against the
catalogue as it is now — the index is a position, and two saved wallets
may share an identity key — then loads it. `+ create new wallet` still
starts the existing create flow.
- `Node::open_wallet(filename)` is the load: it refuses a file the
catalogue does not hold, re-points the sealed wallet-child record with a
read-modify-write (the generated RPC creds survive), and restarts a
running child onto the new file. An idle child takes the change on its
next start.
- `App::new` starts on the selection screen when the catalogue is
non-empty and on the create flow when it is empty, so a restart lands on
the wallets it remembers and a first run has no dead empty list.
- The stored identity/locator stay catalogue columns: a locator rotates
(F4) and identity is the roster key the node already holds, so the live
header keeps reading them from the node.
- `SELECT_UNAVAILABLE` is gone with the state it described; docs/TUI.md
now describes the wired behaviour.
Tests (both new): `Node::open_wallet` over an offline node — the chosen
file, the creds kept across the read-modify-write, the choice surviving a
reopen, and a non-catalogue file refused; and the app path in src/tui.rs
over a real store-backed node — start screen both ways, catalogue mapping,
row index over a shared identity, the create row, and a wallet recorded
after startup appearing the next time the list opens.
Screen::WalletSelect: a table of saved wallets — name, identity prefix,
locator prefix, creation day — the selected row's full identity and locator
under it, and a `+ create new wallet` row as the last item. j/k or arrows
move, Enter takes the choice, Esc back. Empty, failed and in-flight reads
each get their own copy; a wallet with a NULL label, no published locator or
no usable timestamp reads `(unlabelled)` / `-` / `unknown` rather than blank.
Presentation only. Rows are plain display data (WalletRow) built by the
caller; the render path never reads the store, and the selection is by row
index because two records may share an identity key. Loading a chosen record
into the session is the wallet-store integration step, so the F6 `w` entry
opens the screen on its unavailable state until that accessor lands, and the
create row works today either way.
Evidence: tests/tui_select.rs (16 tests) drives the real draw path through
TestBackend at 80x24, 120x40 and 200x60, pins the dumped frame's footer to
status_footer_phased(..., wallet_select_footer_hint()), asserts exactly one
focus marker, a cell-width line budget from 20 to 200 columns, the window
disclosure with the create row always visible, hostile labels (ESC/BEL/C1/
bidi/newline/tab) and the crate-local UTC date formatter.
(cherry picked from commit 99a4ab640e)
monero-wallet-rpc (epee) keeps its Digest nonce per TCP connection: the
`http_server_auth` lives inside `http_custom_handler`, which is created per
connection, so its nonce starts empty and any request without a valid
`Authorization` field mints a fresh one. The client opened a *second* connection
for the authenticated retry, presenting a nonce that socket never issued — so a
real wallet RPC answered 401 forever, however correct the login was. That is the
`wallet RPC HTTP HTTP/1.1 401 Unauthorized` the TUI and Android showed; the
canned mocks replayed the challenge on any socket, so they stayed green.
- `post_digest`/`http_digest`: one `TcpStream` for the challenge and the retry,
no `Connection: close` on the challenge (epee closes the socket with the 401
when the request asks for it), `read_one_response` honouring `Content-Length`
(a keep-alive response never ends in EOF; with no length the body ends at EOF,
which is what keeps the 1 MiB cap meaningful for an open RPC).
- A 401 after our *own* challenge now reads: the login does not match the
child's `--rpc-login`.
- Mocks in `tests/wallet.rs` and `src/node.rs` model the per-connection nonce:
`serve_one_conn`/`serve_rpc_conns`. Two tests pin it — one RPC call uses one
connection, and a nonce presented on another connection is refused.
- `docs/WALLET.md`: what a 401 means and why it is not the flow.
Verified end-to-end against `monero-wallet-rpc` v0.18.5.1 (`--rpc-login`,
`--offline`, real wallet open): unfixed tree → `wallet RPC HTTP HTTP/1.1 401
Unauthorized`; fixed tree → `connected: true` with the wallet's real address.
Audit the operator docs against the source: pin downloads to v0.14.0,
document the real CLI/flags/env/F-keys (including F9, no F7), keep 18081
as the app-owned daemon port, describe the local chat outbox vs a
server-side one, and stop implying SECURITY_AUDIT.md is a third-party
audit. Spike reports stay; they get a status header only.
Wire::wallet_status() is the cheap cached read (no dial); only
Node::wallet_child_refresh() writes state/height/target_height, and it was
reachable over UniFFI from exactly one place — start_wallet_child. An Android
refresh loop polling wallet_status() therefore shows a frozen sync line.
Add the additive export, reusing the existing child_status mapper so the record
is the same shape as wallet_status(), and the core probe as the only probe
path. Docs: one sentence in docs/WALLET.md, which enumerates the SDK
wallet-child surface.
Tests: SDK-level (a Wire cannot be built offline in this crate — open_wire
bootstraps Arti): the unprobed child maps to the same 'off' record both reads
report, pinned with an exhaustive record literal; and the probe on a stopped
handle is a typed WireError.Stopped.
The user watching an in-process Cuprate node on Android saw only a phase
word (connecting, with 'wallet connect: Connection refused (os error
111)') and asked to see height vs tip.
- WalletChildStatus gains height / target_height, and line() appends
'sync h/t' when a probe read either number. No percentage is invented
when the daemon reports no target (h/0 is honest), and an off/exited
child reports 0/0.
- Node::wallet_child_refresh fills them: one wallet-RPC get_info now
answers both the readiness gate and the numbers (Wallet::chain_info,
with chain_ready built on the same parse), and when the wallet RPC is
down while the chain source is local/in-process, the loopback daemon
is asked directly (ChildConfig::daemon_probe_addr). A refused daemon
stays 0/0 — unknown, not caught up. Only refresh dials; the draw path
reads two atomics.
- UniFFI WalletChildStatus carries the same two u64 fields so Android can
show them; SDK test covers the round trip.
Tests: cargo test --locked --target x86_64-unknown-linux-gnu (all
green), clippy -D warnings clean; crates/onionwire-sdk cargo test
--locked + clippy clean (separate workspace).
main moved under this PR when #120 (clean-look chrome redesign) landed, which
touched the same three files (src/tui.rs, tests/tui_spec.rs, docs/TUI.md) and
left PR #121 unmergeable.
- docs/TUI.md: both sections kept — the peer-payment-history section from this
branch, then #120's chrome-redesign section.
- tests/tui_spec.rs: #120's `fit_cells` flake relaxation kept (it is a superset
of the one on this branch: same cut point plus the ellipsis assertion).
- src/tui.rs merged cleanly; `cargo test --locked` 383 passed / 0 failed and
`cargo clippy --locked --all-targets -- -D warnings` clean afterwards.
The peer-payments frames are byte-identical after the merge, so the dumps in
this PR body still hold.
Review round 1 on the F9 `payments` row found two false affordances.
1. `footer_hints(Screen::PeerPayments)` prints `F9 menu`, and docs/TUI.md says
F9 reopens the menu, but the `KeyCode::F(9)` arm opened it only from
`Screen::Main`, so pressing F9 on the peer history did nothing.
The function keys are now routed through one table, `function_key_for(screen,
code)`, and the F9 arm no longer has the Main-only guard: it opens (or
reopens) the menu from `Main`, `WalletsSettings` and `PeerPayments`. A screen
that names a key has to answer it while it is open — that is what the table
encodes, and `mod function_key_tests` locks it, including a test that reads
the screen's own hint and asserts every `F<n>` it names is answered there.
2. The PR's frame dumps passed `"Esc back up/down select ? help"` to
`status_footer` by hand, so every dumped frame showed a footer the app never
renders. `peer_payments_footer_hint()` is now the single source both
`footer_hints` and the fixture read, and
`peer_payments_frame_shows_the_shipped_footer` pins the dumped frame's last
line to the shipped one.
Also restores the rustfmt-only reflow of unrelated tests in `tests/tui_spec.rs`
(`queued_row`, a `failed_row` call, `rgb_tokens_…`, `alert_line_…`), keeping this
card's real edits there.
Presentation only: no wire, store, session, send-path or `Node` change.
Mouse-selecting the invite copied the pane border: draw_share rendered the
payload inside themed_block, which is Borders::ALL, so every wrapped row sat
between a leading and a trailing glyph. OnionWire enables no mouse capture,
so the terminal's own drag-select is the copy path and it picks up chrome.
The payload now has its own region — flush at column 0, full frame width,
no block, no title, no gutter on any row it occupies — with the block
(title, fp, onion, copy hint) above it. Measured in cells, not chars.
Also add C: OSC 52 hand the payload to the terminal clipboard (same
sequence the F9 menu uses), with the key named on the screen and the mouse
selection named as the fallback for terminals that block the sequence.
Regression tests reconstruct the payload out of the rendered frame at
80x24, 120x40, 200x60 and 60x20 (they fail on base: the leading border
column) and assert no payload row carries a border glyph.
The F9 / `/settings` menu's only payment row showed the wallet's own transfer
list (`Node::wallet_recent_transfers`, F6). The signed `/pay` invoices and
`/tip` receipts a peer sent live in the `payments` table and had no path from
the TUI, so they were invisible. `Node::list_payments` (PR #119) closes that
gap; this wires it into a screen.
- `Screen::PeerPayments { state }` + `PeerPaymentsState` /
`PeerPaymentRow`, built by `PeerPaymentsState::from_payments` from
`Node::list_payments`' rows (newest first: the store returns `payments.id`
ascending, the screen windows the vector).
- Key handler: `p` on the F9 screen opens it (`open_peer_payments`); `up`/`down`
(or `k`/`j`) move the selection, `Esc` goes back, `F9` reopens the menu.
- Rows carry direction, kind, amount (`pay::atomic_to_xmr_str`, the same
piconero formatter the chat lines use), memo (sanitized at draw time) and the
receipt's `verified` / `unverified` word; the focused row is marked with `>`
and bold. The selected row's txid and address sit under the rows — the
address wrapped over two lines rather than clipped.
- States: populated, `no payments with {peer}`, `could not read payments`, and
a menu row that refuses when no friend is selected. An empty history is a
state, never an error.
- Menu: the wallet's own list is retitled `transfers` (F6, unchanged), and the
new `payments` row (key `p`) names the peer and the count. Two histories, two
rows, no ambiguity.
- Widths are measured in cells (`Span::width`); trailing columns are dropped
before they can wrap, so the body fits 80x24 (20 inner rows of 21) as well as
120x40 and 200x60.
Tests: new `tests/tui_payments.rs` (11 tests) dumps and asserts the screen at
80x24, 120x40 and 200x60 including the empty history, asserts a memo carrying
ESC/BEL/C1/bidi/newline bytes never reaches the frame buffer, and asserts the
window/column invariants for every width from 20 to 200.
Also relaxes one width assertion in `tests/tui_spec.rs`: `fit_cells` was
asserted to start with `"abcdef"`, which only holds when another test's
in-flight `ONIONWIRE_ASCII` mutation is not visible — the suite mutates env vars
without a global lock, so that test flaked (it also fails on an unmodified tree,
1 run in 2). It now accepts either chrome's cut point, which is what the comment
already claimed.
Docs: `docs/TUI.md` gains the screen's section, the retitled/replaced rows and
the updated row count; the "peer payment history" gap entry is closed.
Applies the bitchat-tui clean-look principles to the OnionWire main screen.
- Hierarchy: header, roster + one primary chat pane, one status line, one
footer hint line. The header gives up the accent (the accent is reserved
for focus), so it stops competing with the panes.
- Tor phase is a first-class state: Node::tor_state() -> TorPhase (glyph +
word, header and footer) so connecting / ready / degraded / off are never
colour-only and never implied. No new data field.
- Footer changes with the focused pane (pane_footer_hints) and the phase; the
main footer drops the redundant onion (the header already prints it) and
uses those cells for hints. status_footer keeps its signature and strings.
- Empty roster / empty chat / connecting / degraded / off are designed states
with their own copy, not blank panes.
- draw_main_chrome + MainView: the real main render path is public and
Node-free, so tests/tui_frames.rs dumps the actual chrome at 80x24, 120x40
and 200x60 (12 tests, 5 states, real Message/OutboxEntry rows) instead of a
reconstructed stand-in.
- Widths in cells everywhere touched: status_footer*, alert_line,
main_header_line*, draw_text_overlay, roster_row_text. The roster spends its
budget name-first, so a 22-cell pane reads `bob-the-sta… stale` instead of
`… bbbbbbbb… stale`.
- draw_text_overlay is centered with a one-cell side margin and clears
underneath; never full-bleed.
Also fixes a pre-existing race in tests/tui_spec.rs (the ellipsis-form
assertion did not tolerate ONIONWIRE_ASCII being set by a parallel test).
Co-Authored-By: Hermes <[email protected]>
The Monero wallet and the cuprate node shipped behind function keys only, so a
user who did not already know F6 opened the wallet could not find wallet setup,
the child wallet, the chain source or the settings.
F9 (also /settings) now opens one discoverable screen with the two groups the
card fixes: WALLET (endpoint, child, sync, receive, balance, payments, create,
import) then SETTINGS (nickname, profile, identity, colour, backup, restore,
wipe, wipe-all). Every actionable row prints the key or command that fires it,
including the F6 wallet screen's own keys, and those keys stay live on the
screen so no row can name a dead key.
- Screen, not popup: 19 rows at 80x24 against 21 inner rows; 120x40 and 200x60
hold. The footer is the shared status_footer, so TOR / identity / ? help stay
put.
- No credentials: WalletMenuState carries booleans, labels and display-ready
error strings only. rpc_login, secret(), seeds and passphrases have no field
to travel in.
- Untrusted values are display data: sanitize + newline/tab strip, then
truncated in cells.
- Cells, not chars: cell_width() measures through ratatui's own Span::width, so
no unicode-width dependency was added and chars().count() is never a width.
- Copy without a clipboard crate: c writes the receive address as an OSC 52
sequence; the terminal owns the clipboard and it survives SSH.
- Colour is never the only signal: every state also spells itself out.
- F7 stays free for the endpoint config screen that names it (db208be,
docs/WALLET.md).
F2/F3/F4/F5/F6/F8 keep working: the function keys are now handled once, for Main
and this screen, instead of inside the Main arm.
ChainChoice gains InProcessCuprate, the SDK passes the core's cuprate-daemon
feature through as its own, and an empty monerod_datadir for that kind resolves
to $ONIONWIRE_HOME/chain so Kotlin never invents a path. wallet_status now
carries chain_in_process / node_available / node_state beside the core's five
state words; no second state machine, no timer, no env var.
start/stop stay the core's pass-through: one call launches the node and the
wallet child, one stops both, both idempotent.
Replayed onto main (25e029e): PR #111 was merged into the core branch
onionwire/t_04975420-cuprate-land-the-in-process-chain-source, not main, so
main had only the core half (from PR #110). This is the same tree change with
no core commits replayed.
`ChainSource::InProcessCuprate { datadir }` is the fourth chain source: P2P,
consensus and RandomX run inside the OnionWire process instead of as a spawned
`monerod`. The wallet layer does not move — the daemon binds the same loopback
unrestricted RPC (`127.0.0.1:18081`) that `WalletChild::daemon_address` already
returns for a local source, so `wallet_rpc_argv`, the RPC client, the payment
frames and the receipt-verification path are untouched.
- Cargo.toml: `cuprated` (git, rev 4f8fcd1b) + `toml`, both optional, behind the
`cuprate-daemon` feature, OFF by default. `cuprated`'s own `arti` feature is
disabled (`default-features = false`): its arti-client 0.44 cannot unify with
this crate's 0.46, and the in-process daemon is clearnet-only. One Tor stack in
the process. `Cargo.lock` gains the graph; a default build's
`cargo tree --locked -e normal -i cuprated` still says "did not match any
packages", and only `arti-client v0.46.0` is in the lock.
- src/cuprate.rs (new): `CuprateNode` builds the cuprated config as TOML
(testnet, unrestricted RPC on loopback, restricted RPC disabled, inbound P2P
off), launches it on a runtime it owns, and owns the node. `launch` is
synchronous on purpose: `WalletChild::start` is sync (the TUI calls it from its
blocking thread, UniFFI calls it from an async context) and a runtime cannot be
started from inside a runtime, so the launch runs on a thread of its own and
the node + its runtime come back over a channel. Dropping the value asks the
node to shut down and `shutdown_background`s the runtime, which is the only
exit that cannot panic when the value is dropped inside another runtime.
The type exists in every build (feature off: `launch` fails with the feature
name), so the chain-source type, its stored record and its copy do not fork on
a cargo feature.
- src/wallet.rs: the variant, its label (`in-process node`), and the chain-daemon
client the wallet line carried (typed `WalletError`, de-chunked HTTP,
`get_height` over the URI endpoint, an above-the-tip height as one typed
error). Cuprate answers those three differently from monerod and the
in-process source is what makes them the *local* case.
- src/wallet_child.rs: launches/holds/stops the node, `chain_datadir` for the
free-space/ownership question, the honest `chain_copy` line, `kind =
"cuprate"` in the sealed record, and `ChildConfig::validate` for it.
- src/tui.rs: the wallet screen's chain line carries the testnet caveat when the
configured source is the in-process one. It computes the line at draw time, so
`Screen::Wallet`'s shape (which tests construct) does not change.
- docs/WALLET.md, docs/THREAT_MODEL.md, docs/cuprate-android-spike.md: the
feature flag and how to enable it, where the (fjall) chain store lives, the
**measured** +11.8 MiB delta, the pre-production/testnet caveat, and the
in-repo aarch64-linux-android proof with exit codes.
Scope deviations, stated plainly:
- `src/cuprate.rs` and its one `src/lib.rs` module line are not in the card's
allowed list; the card's own deliverable describes the module's behaviour.
- `crates/onionwire-sdk/src/lib.rs` is forbidden, but adding a variant to a
`pub enum` that the SDK matches exhaustively breaks the SDK workspace, and the
root CI `sdk` job runs on every PR. One variant plus two match arms land here
so the SDK keeps compiling (`cargo test --locked` + clippy clean); the SDK card
owns the rest — feature passthrough, the config field's semantics, the label
and its tests, and the Android check.
- `tests/wallet.rs` carries the launch test. `tests/tui_frames.rs` is untouched:
main has no `ChainChoice` to pin (the chain-source picker is the unmerged F7
work, and `docs/WALLET.md` says so rather than describing a picker that does
not exist).
Proof (all on this tree):
- Default build: `cargo test --locked --target x86_64-unknown-linux-gnu` → 345
passed / 0 failed across 33 suites, exit 0; `cargo clippy --locked
--all-targets --target x86_64-unknown-linux-gnu -- -D warnings` exit 0.
- Feature on: `cargo test --locked --features cuprate-daemon --target
x86_64-unknown-linux-gnu` → 347 passed / 0 failed, exit 0; same clippy with
`--features cuprate-daemon` exit 0. The two extra tests are the real thing:
`wallet_child::tests::in_process_source_launches_a_daemon_and_stop_shuts_it_down`
and `tests/wallet.rs::an_in_process_cuprate_node_answers_the_typed_daemon_client`
— the latter launches the node, drives `get_info` / `get_height` / `get_block`
through the typed client, checks the above-the-tip 500 maps to
`DaemonHeightOutOfRange`, checks the chain store is under the chain datadir,
and checks the listener dies with the node.
- aarch64: `cargo check --locked --release --target aarch64-linux-android
--features cuprate-daemon` exit 0 (1m 50s), and the full link exit 0
(`cargo rustc ... --bin onionwire -- <NDK C++ runtime / compiler-rt link
args>`) producing `ELF 64-bit LSB pie executable, ARM aarch64, for Android 26,
built by NDK r28c`.
- Size: stripped aarch64 release binary, 24,725,704 bytes without the feature and
37,053,472 with it — +12,327,768 bytes (≈ +11.8 MiB), the figure
`docs/WALLET.md` now quotes.
The inherited section described an F7 config screen with endpoint entry and
test-connection that is not in this stack (it lives on
feat/wallet-create-import), and called local mode 'not wired yet'. Both are
now wrong: the child is wired, and the stored wallet config is a core API
without a screen. Say which is which.
The only input path for the wallet was env. Add the same three remote-mode
fields as stored config so the F7 screen can set them and headless runs read
one source of truth:
- `wallet_config` table in the encrypted store (one row; the login is sealed
with the store data key under `onionwire/wallet-config/v1`, on top of
SQLCipher). Empty URL clears it. `Store::load_wallet_config` /
`save_wallet_config`.
- `WalletConfig { rpc_url, rpc_login: Zeroizing<String>, no_spend }` with a
redacting `Debug`; `Wallet::from_config`, and `Wallet::for_boot` which
prefers stored config, falls back to env, and refuses to dial a bad stored
endpoint. Node::start* now reads the store before constructing the wallet.
- `WalletStatus { configured, connected, last_error, balance_line,
receive_address }`: `connected` only ever comes from a probe
(`Wallet::status`, get_address + get_balance); config alone leaves it false.
`Node::wallet_status` is the cheap draw-path read, `wallet_refresh` the
probe that folds into it.
- One-shot `Wallet::ping(rpc_url, rpc_login) -> PingResult { ok, status,
error }` for the Test-connection button: same loopback/digest rules, errors
redacted and capped.
- `readiness(configured, connected, no_spend, is_tip) -> Readiness` plus
`Node::wallet_readiness` (async, block_on-friendly): not configured →
NOT_CONFIGURED_MSG; /tip on a no-spend wallet → VIEW_ONLY_MSG before any
dial; configured but not connected → NOT_CONNECTED_MSG; else ready.
- `Node::wallet_save_config` persists, validates first, then re-reads so the
live wallet and snapshot follow a Save without a restart.
- `Node::wallet` is now a Mutex<Wallet> (cloned out before each await) so the
wallet can be re-pointed mid-session.
Local-mode fields stay reserved: the child lifecycle is t_69ce8e46 and is not
wired here. docs/WALLET.md documents the stored config, boot precedence and
the exact guard copy.
Tests: 38 in tests/wallet.rs including exact-refusal-copy, boot precedence,
sealed-on-disk login, ping sanitization and connected-only-after-probe.
The app now owns monero-wallet-rpc (and monerod when the chain source is
local) instead of requiring the user to start them and export
ONIONWIRE_WALLET_RPC.
- ChainSource enum: None / Local { monerod_bin, datadir } / Remote { host,
port }. No default remote node; Remote is only constructed from explicit
user input. A .onion Remote is refused without a SOCKS proxy (separate
card).
- WalletChild in src/wallet_child.rs spawns monero-wallet-rpc with
--rpc-bind-ip 127.0.0.1, a random free loopback port, generated
--rpc-login, and --wallet-dir /wallet; monerod too for a
local source. --trusted-daemon is never passed.
- Generated RPC creds are sealed in the encrypted SQLCipher store
(wallet_child table, AEAD on top of whole-db encryption), never a
plaintext file. The Wallet client is built from the generated loopback
URL, not from_env.
- Readiness predicate: chain_ready() requires synchronized==true, height>0,
height>=target_height; can_spend() and can_verify_receipts() gate on it.
Unsynced -> receipts stay verified=0, spend refused with a clear message.
- Backend-aware timeouts: local management calls keep 5s; chain-dependent
calls (get_info, get_transfers, transfer) get 60s (CHAIN_RPC_TIMEOUT),
because a first sync or a remote daemon outlasts 5s and a 5s cap there
is what left receipts permanently unverified.
- node.rs ingest_receipt gates on can_verify_receipts() instead of
configured() alone.
- docs/WALLET.md rewritten for the child lifecycle + chain source.
Base: feat/wallet-create-import (PR #66). Do not rebase onto main.
Co-Authored-By: Hermes Agent <agent@local>
The signed prekey was set at invite creation and never rotated: a long-lived
static is a long-lived forward-secrecy window. F8 now rotates it.
- Node::rotate_prekey(): new X25519 keypair, written through the existing
replace_identity_keys prekey columns (no store change needed), live Keys
updated, new pubkey returned for the invite re-encode. Identity untouched.
- It drops every stored ratchet session: the bootstrap epoch is derived from
the prekey DH, so each friend has to F3-paste the new invite. Nothing is
pushed to peers \u2014 there is no in-band prekey update.
- TUI: F8 on Main opens the confirm screen (type ROTATE, same prompt as F4),
then re-opens the F2 share path with the new invite; help overlay + footer
hint list it.
- Docs: THREAT_MODEL gains a section on the F8 hard cut and the prekey-bound
epoch bullet; README key table and PROTOCOL 'Roles and keys' follow.
Tests: node-level rotation test (identity/pk/stored row/ratchet drop/invite),
tests/rotate.rs screen text + prompt, tui_chrome help needs F8.
Arti's TLS backends are non-additive; the root crate defaulted to
`native-tls` (OpenSSL). Switch `default = ["rustls"]` and pin the `rustls`
crate with its `ring` feature — `tor-rtcompat` pulls rustls in with
`default-features = false`, so without that pin the backend compiles with no
`CryptoProvider` and the first TLS config fails (same reason already recorded
in crates/onionwire-sdk/Cargo.toml).
`native-tls` stays as an opt-in feature. SQLCipher still builds vendored
OpenSSL (`bundled-sqlcipher-vendored-openssl`); that is unrelated to TLS.
- tests/tls_backend.rs: compile-time pin that the default features select
rustls, plus a runtime check that rustls resolves a provider with no manual
install.
- ci.yml: the root `test` job no longer installs pkg-config/libssl-dev (the
SDK job keeps it).
- docs: README build deps, ARTI_UPGRADE backend table, release-body and the
SDK README now describe the rustls default; the false "binaries link
libssl.so.3 dynamically" claim is corrected.
- crates/onionwire-sdk/Cargo.lock: regenerated for the root crate's new
dependency (separate workspace, --locked would otherwise fail).
Add a Reachability section to docs/THREAT_MODEL.md: no sealed mailbox or
server-side message store, the chat outbox is local-device retry only, and
there is no mutual-online indicator — a send is a one-shot Noise IK session
and an unanswered dial queues locally with the retry clock shown.
OutboxSummary now carries the outstanding row's attempt count and soonest
retry, so the footer reads 'peer unreachable, queued (n/8, retry 45s)'
instead of a bare 'n queued'. Tests updated to the real outbox wording; the
Android KDoc note stops claiming the footer copy is mirrored (Android shows
per-row 'queued (try n/8, retry …)' via OutboxDetail).
Spike evidence for the Phase 1 Android question: cargo check --release --target
aarch64-linux-android exits 0 and the PoC binary links as an Android 26 aarch64 ELF.
Documents the env recipe, the four link args the C++ RandomX build needs, the
cargo-ndk linker-wrapper bug, and the RANDOMX_DIR/DARCH no-op.
Spike A of the Cuprate exploration: Node::launch(config).await runs a real
testnet chain daemon in-process (no monerod, no subprocess). Unrestricted RPC
on 127.0.0.1:18089 answers get_info, /get_height and get_block (heights 0, 1, 2,
1000) with monerod-shaped payloads, and clearnet P2P synced 0 -> 23,758 testnet
blocks in ~120s. Verdict VALIDATED with four parity gaps recorded:
out-of-range get_block returns a bare HTTP 500 with an empty body (monerod
returns a JSON-RPC error object), get_info reports zero peers while syncing,
restricted get_info returns placeholder database_size/version, and the version
label is 0.1.0-preview-release.
Adds strategic recommendation: Phase 1 (Cuprate in-process for chain +
monero-wallet-rpc subprocess pointing at it) and Phase 2 (monero-wallet
crate for full in-process wallet). Includes RPC compatibility note,
binary size comparison (+5.6 MB vs ~52 MB monerod), and version
conflict resolution confirmation.
See references/cuprate-integration.md and Obsidian notes for full details.
Adds §7a documenting the alternative approach of embedding Cuprate's
crates directly into the OnionWire binary instead of spawning monerod
as a subprocess. Includes PoC results (cargo check passed with both
arti-client 0.44 and 0.46), the wallet-layer gap, dependency bloat
assessment, and exploration card titles.
Does not change any locks — the subprocess wrapper model remains the
default path. See references/cuprate-integration.md for full test log.
PROTOCOL.md gains a 'Ratchet (v1 chat layer)' section written so a second
implementation can interoperate from the text alone: byte-exact frame layout
(rat , 0x01, dh_pub||N||PN as header and AAD, 12-byte nonce,
ChaCha20-Poly1305), the KDF_RK/KDF_CK constructions and the role-separated
epoch rule, the derived bootstrap epoch, the receive and DH-step rules, the
MAX_SKIP/MAX_SKIPPED_KEYS bounds with the replay rule, the SQLCipher
ratchet_sessions row, and what stays unratcheted.
THREAT_MODEL.md gains the corresponding gains (per-chain forward secrecy, PCS
after a DH step, header not on the wire) and honest limits (skipped-key
window, the prekey-bound bootstrap epoch, no deniability, no one-time
prekeys, compromised endpoint out of scope, no metadata gain, the no-server-
outbox lock untouched) plus the amended transport wording.
README.md documents the operator-visible consequence: no reset command yet,
prekey change / invite re-paste is the only recovery, /wipe keeps the state,
and a desync is currently stderr-only.
An android-only PR ran zero jobs: ci.yml's path allowlist never matches
android/**, and android-release.yml is dispatch-driven. #70 merged on an
empty check list.
android-ci.yml runs the release's gradle targets through the release's own
script (scripts/build-android-local.sh) on the amd64 runner, debug-signed,
publishing nothing. Same concurrency group and runner volumes as
android-release.yml so the build is warm and cannot collide with a release.
/ wallet create generates a wallet on the RPC and shows the 25-word seed
once for backup; /wallet import is the only path that takes an existing
seed, and it is collected on a dedicated screen so it never reaches the
composer line or chat history.
Threat model now states the real policy: payments are opt-in, default is
no spend key, spend is a local authority at create/restore, and the chain
source is the user's choice (spawned local monerod or a daemon address
they supply). WALLET.md and README follow.
Tests: canned-RPC create/restore, slash parse, help overlay.
Neither decoupled trigger fires on Forgejo 10.0.3: a tag created by the CI
(API or git push) is an Actions-user push and is not dispatched back into
Actions, and reusable workflows need Forgejo >= 12. The release procedure is
therefore two dispatches: release.yml, then android-release with that tag.
Drop `push: branches: [main]` from both release workflows. release.yml now
runs only via workflow_dispatch, with bump (default minor), version, tag and
dry_run inputs; contradictory input is rejected instead of guessed at.
android-release.yml keeps the Android assets on the same tag by subscribing to
`push: tags: v*.*.*`: creating a tag over the API sends the same push
notification a git push does, so the core's tag wakes it. No workflow_call —
this Forgejo is 10.0.3, where reusable workflows are not supported.
docs/RELEASING.md is the policy and procedure.
The v0.2 banner and the "Seized laptop" section still claimed only chat
bodies were encrypted, that `self.identity_sk` and the roster were
plaintext, and that "sqlcipher is out of v1". That has been false since
#43.
- README banner: whole store is encrypted at rest with SQLCipher, with the
row-bound AEAD layer kept on top.
- "Seized laptop": whole-file SQLCipher (Argon2id key over the 16-byte
`store_salt`, raw `PRAGMA key`), identity/friends/locators inside the
encrypted file, fail-closed unlock and `store_salt`-missing refusal, and
the in-place v0.2.1 upgrade. Kept the honest caveats: no defense against
a live compromise or a known passphrase, `/wipe` is not a forensic erase
(SSD wear-levelling), and THREAT_MODEL.md stays the reference.
- "Not in v1": drop `sqlcipher` (shipped in #43).
- docs/SECURITY_AUDIT.md "Still true" bullet repeated the same plaintext
claim; restated it as the residual risk that actually remains.
No code change. Evidence: cargo test --test store (21 passed, incl.
whole_store_file_is_encrypted_at_rest) and cargo test --lib -- store::
(6 passed, incl. the plaintext->SQLCipher upgrade and the wrong-passphrase
no-op).
Card: t_f2fc5190
`chat_with_delivery` matched pending outbox rows to chat rows by body
because `store::Message` carried no id, so an older send that was still
queued showed a delivered mark whenever a newer send of the same text had
already crossed the circuit.
`store::Message` now carries its `messages.id`, and the TUI joins
`OutboxEntry::message_id` == `Message::id`. The body match and its
newest-first fallback are gone.
`list_messages()` keeps its signature; callers that do not need the id
are untouched.
/tip needs monero-wallet-rpc `transfer`, which a view-only wallet cannot do.
With ONIONWIRE_WALLET_NO_SPEND=1 (`1`/`true`/`yes`/`on`) `Wallet::transfer`
refuses locally, before any RPC dial, and /pay + receipt verification are
unchanged.
When a transfer does fail, ask the documented signal before surfacing the raw
wallet error: `query_key` key_type=spend_key answers
WALLET_RPC_ERROR_CODE_WATCH_ONLY (-29) on a view-only wallet
(wallet_rpc_server.cpp on_query_key). Both paths return one sentence —
"wallet is in view-only/no-spend mode — /tip is disabled; /pay and receipt
verification still work". Fail closed: if the probe cannot answer, the wallet's
own error stands; no fabricated detection.
New docs/WALLET.md: --generate-from-view-key / generate_from_keys watch-only
setup, --rpc-login Digest, why loopback still needs auth, the local
spend-authority warning, and the detection trade-off (a spend-capable wallet
answers the probe with its spend key, which is discarded). Linked from
docs/THREAT_MODEL.md.
Chat rows now carry the state the local outbox actually holds: `✓` delivered,
`◷ queued (try n/8, retry 45s)` while the retry worker still has it, `» sending`
mid-attempt and `✗ failed: <short reason>` once attempts are exhausted. The
footer replaces the flat `sent` / `send failed` copy with the live count
(`2 queued`), and keeps a fail-closed `send failed: …` statement as long as any
row is terminally failed.
States come from the outbox API (`Node::outbox_pending` → `Queued` / `Sending` /
`Failed`; a delivered row is deleted, so absence is `Sent`). No parallel state
model, no new wire prefix. Every new glyph has an ASCII fallback (`ok` plus the
state word) exercised by a test.
- `chat_with_delivery()` / `delivery_tag()` / `retry_in_text()` /
`short_send_reason()` / `OutboxSummary::note()` are pure and unit-tested.
- `draw_chat()` is now the real chat-pane renderer (extracted from
`App::draw_main`) so width/wrap is testable without a `Node`.
- docs/TUI.md: delivery markers, copy, and the 80x24 floor / 120x40 target.
Verified: cargo test 26/26 suites ok (tui_spec 20/20, incl. a real Store +
Outbox::send -> pending() -> render path); clippy --all-targets -D warnings clean.
Queue a chat send locally when the peer's v3 onion is unreachable and retry
it with exponential backoff (30s doubling, capped at 30 min, 8 attempts then
terminal Failed). Still peer-to-peer: no server, no store-and-forward relay,
no new frame prefix — every attempt is a fresh Noise IK handshake.
- src/outbox.rs: Outbox + Deliverer + ArtiDeliverer, pure backoff_secs(),
is_permanent_send_error(), background worker (15s scan).
- store: `outbox` table (no body column — the body is read from the joined
messages row, under that row's existing AEAD + AAD), append_message_id(),
queue/due/pending/mark_* helpers, reset_sending_outbox(), wipe.
- Node::send() returns Result<OutboxStatus, String> (Sent/Queued) instead of
Err on transport failure; protocol errors still fail immediately and are
never queued.
- Retry triggers: timer, unlock/foreground (spawn_flush_all), and "that peer
was just seen" (handshake or connect_onion -> spawn_flush_friend).
- File transfer and payment/rcp frames stay fail-closed.
- docs/PROTOCOL.md + docs/THREAT_MODEL.md: replace the no-queue statements;
add the seizure/cadence delta to the threat model.
src/tui.rs gets one forced arm change (Ok(()) -> Ok(_)); UI surfacing is
child card t_d9a5b065.
The db held the ed25519 identity secret, friend pubkeys, locators, profiles
and payment rows in the clear; only chat bodies were encrypted. Switch
rusqlite to `bundled-sqlcipher-vendored-openssl` and open every store with
`PRAGMA key = "x'<64 hex>'"` as the first statement after open, using the
existing Argon2id output as a raw key (no second KDF pass).
The per-install KDF salt moves out of the db into `store_salt` (0600) — a key
cannot be derived from a salt that lives inside the file it opens. The
per-message ChaCha20-Poly1305 + row-AAD layer is unchanged: whole-db
encryption does not defend against ciphertext swapped between rows, the AAD
does.
v0.2.1 installs are plaintext. The first open with the right passphrase
upgrades in place (WAL checkpoint, ATTACH ... KEY, sqlcipher_export) and only
swaps the file after the new one opens, passes integrity_check and unwraps
store_meta. A wrong passphrase leaves the plaintext file untouched; a
missing `store_salt` next to an encrypted db refuses to open rather than
guessing.
SQLCipher's internal "hmac check failed" ERROR on a rejected key is
suppressed (cipher_log_level = NONE) so a typo'd passphrase is not an error
dump.
docs/THREAT_MODEL.md: the store is now encrypted at rest; sqlcipher leaves
the "Out of v1" list.
.forgejo/workflows/arti-watch.yml runs daily (06:17 UTC) and via
workflow_dispatch: scripts/arti-watch.py compares each tor-*/arti-* pin in
Cargo.toml against crates.io and files one Forgejo issue per distinct
major.minor bump, deduped on the title so a repeat run is a no-op. It changes
no dependency.
docs/ARTI_UPGRADE.md records the pinned set (arti-client, tor-cell,
tor-hsservice, tor-rtcompat at 0.46), the lockstep rule, the rustc 1.91
floor, and the tests a bump must pass (tests/tor_hs.rs live publish +
probe-connect + byte pipe, the 360s fail-closed wait and the src/hs.rs
circuit-timeout workarounds in tests/hs.rs, the Android rustls build).
Both artefacts state what this does not cover: Tor Project security
announcements, a yanked crate, and a vulnerability with no version bump.
ONIONWIRE_ASCII (and NO_COLOR) switches truncation to ... and ASCII
borders. Share/paste wrap at : so a mouse-copy cannot lose a mid-hex
line. Alerts truncate to the frame; empty threads and paste errors keep
the next-step hint. Skip the optional 40-row wordmark.