docs/WALLET.md §Chain source offered "spawn a local monerod (pruned
on-device)" but nothing implemented it. Add src/monerod.rs: find monerod
on PATH, mkdir $ONIONWIRE_HOME/monero at 0700, spawn it with
--prune-blockchain --non-interactive and its RPC bound to 127.0.0.1:18089,
poll the port for readiness, and stop it with SIGTERM (SIGKILL after 10s).
Locks held: loopback-only RPC, no --trusted-daemon, no SOCKS, no C-tor,
no clearnet default, no UDP, no new dependency (std only — SIGTERM goes
through kill(1) because the crate takes no libc). A missing binary or a
port that never answers is an Err the node logs and shrugs off: no local
chain is the honest state, not a crash.
Node wires it opt-in via ONIONWIRE_MONEROD=1: start_monerod spawns on a
blocking task during start_with_passphrase, shutdown() takes the daemon
and stops it off the reactor, and monerod_rpc_addr() reports where the
wallet child should point --daemon-address.
Tests (7, in-module): argv is pruned/loopback and carries no forbidden
flag; PATH lookup needs an executable; empty PATH and a missing binary
both Err with a clear message (and the data dir is 0700); default addr is
127.0.0.1:18089; wait_for_ready times out against a dead port; a fake
daemon spawns, reports its addr, and stops via SIGTERM (its pid is gone).
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.
Drives the shipped chat ratchet offline against real SQLCipher stores and
the real encode/decode pair Node::send and Node::handle_incoming call, with
a capture-and-release Deliverer so arrival order and drops are controlled.
tests/ratchet_e2e.rs: full exchange, out-of-order arrival, a dropped frame,
a retried frame re-sent byte-identically, and a restart of both peers.
tests/ratchet_adversarial.rs: a frame claiming a jump past MAX_SKIP, a
post-compromise snapshot across a DH step, an unknown friend, a retired
epoch after an invite refresh, and five corruption shapes. Every rejected
frame is asserted to leave the persisted ratchet blob byte-identical.
src/node.rs gains a test-only module that builds a Node with an
unbootstrapped Tor client and drives Node::send plus the real receive path
(Noise IK handshake over an in-memory stream into handle_incoming).
Chat plaintext is ratchet-encrypted once, before the first delivery attempt,
and the frame is what the outbox stores and retries, so a retried message
re-sends identical bytes instead of advancing the sending chain twice.
- dispatch: Kind::Ratchet for the `rat ` prefix, matched before the unknown
[a-z]{3} prefix rule
- node: encode_chat_frame / ingest_chat_frame (the wire halves of Node::send
and handle_incoming), bootstrap derived from the peers' static prekey DH
because the Noise handshake is frozen and carries no ratchet key
- outbox: nullable outbox.payload + Outbox::send_payload; NULL payload keeps
the previous row-for-row behaviour
- store: additive outbox.payload migration, enqueue_outbox_payload,
OutboxEntry::payload
- add_friend_payload: a changed prekey clears the (prekey-bound) ratchet state
tests/ratchet_wire.rs (5) covers one frame per send, byte-identical retries,
out-of-order delivery, replay, tampering and fresh-friend both directions.
tests/tui_spec.rs and crates/onionwire-sdk/src/lib.rs only gained a
`payload: None` field in their OutboxEntry test fixtures: the card's required
field on a pub struct cannot be added without it.
New additive ratchet_sessions table (friend_id PK -> friends(id) ON DELETE
CASCADE, state BLOB, updated_at), plus load/save/clear_ratchet on Store. The
blob is the opaque versioned RatchetState::to_bytes output; the store never
parses or re-serializes it. wipe_messages deliberately keeps sessions: wiping
history is not a session reset.
New wire-independent `src/ratchet.rs` + `tests/ratchet.rs`: KDF_RK/KDF_CK as in
the Signal spec, symmetric ratchet, DH ratchet, skipped-key store with the
MAX_SKIP / MAX_SKIPPED_KEYS bounds, versioned state serialization and zeroize
of every superseded secret.
Initiation gate: per-direction chains seeded by ratchet-key ordering (option
(a)), so both peers can build a sending chain before either has received, and a
single deterministic tie-break (lower ratchet key rotates first) keeps exactly
one rotation in flight. Documented under "Initiation and convergence" and
covered by both_peers_send_first_converges, which fails on a crossing rotation.
Adds hkdf 0.12 + hmac 0.12 (0.13 pulls digest 0.11 and will not build against
sha2 0.10) and regenerates crates/onionwire-sdk/Cargo.lock.
The alert_line_prefixes_when_no_color test stashed the prior NO_COLOR
value and restored it with is_none() + unwrap() — a clippy lint failure
under -D warnings. Replace with a match that takes ownership.
No behavior change; the restored env var is identical.
Co-authored-by: openhands <[email protected]>
Make ColorMode a pub enum with pub color_mode() fn, add TokenStyles
struct and tokens_for(mode) as the single source of truth for the
style_* helpers. Tests assert RGB/None/Ansi16 fg/bg/modifier resolution
without depending on process environment.
The SDK could already send an invoice or a tip through Node::pay_invoice /
Node::tip, but it could not touch the payment frames themselves: pay::sign_*
take the ed25519 identity secret and Node exposed only identity_pk(), so the
signing half lived nowhere the SDK could reach.
Add the signing surface to the node instead of exporting the key:
* Node::sign_invoice / sign_receipt / sign_tip sign with the node's own
identity key and return the core frame struct. The secret never leaves
the process and there is no API that hands it out.
* pay_invoice and tip now call those methods rather than signing inline, so
there is one signing path, not two.
SDK (crates/onionwire-sdk), all backward compatible:
* Records Invoice, Receipt, Tip mirroring src/pay.rs, sig as raw bytes so a
frame re-encodes byte-for-byte.
* Wire::sign_invoice / sign_receipt / sign_tip (async, over the node).
* Free functions encode_invoice / encode_receipt / encode_tip,
decode_invoice / decode_receipt / decode_tip (None on a foreign or
truncated frame), verify_invoice / verify_receipt / verify_tip against
the sender's pubkey hex (false on a bad key, never a panic).
Tests: 8 new SDK unit tests (record round-trips through the core encoders,
signer-key-only verification, tamper rejection, foreign/truncated frame,
typed Stopped error after shutdown). SDK 27 passed, 0 failed; SDK clippy
--all-targets -D warnings clean; root clippy --all-targets -D warnings
clean; root lib tests 14 passed; tests/pay.rs 11 passed.
The icon change landed as a bitmap dropped straight into
res/mipmap-anydpi-v26/ and wired to android:icon only, so the installed app
kept showing the old art:
- android:roundIcon still pointed at @mipmap/ic_launcher (the old vector
adaptive icon). Launchers that prefer roundIcon — Pixel Launcher, Samsung
One UI — render it in preference to android:icon, so the new bitmap never
appeared. Verified on the ow35 emulator drawer: old cyan/green line-art
onion while android:icon was already the new PNG.
- a bitmap under mipmap-anydpi-v26 is a legacy icon, not an adaptive one: the
launcher pads it into the mask itself and it is not density-aware.
Now:
- drawable-nodpi/onionwire_app_icon.png: the artwork squared to 432x432 with
the logo at 62% of the canvas (inside the 66dp/108dp safe zone) over a
seamless blurred backdrop of itself, so no launcher mask clips the logo.
- mipmap-anydpi-v26/ic_launcher.xml and ic_launcher_round.xml: adaptive icons
with that bitmap as the background layer and a transparent foreground.
- AndroidManifest.xml: icon=@mipmap/ic_launcher, roundIcon=@mipmap/ic_launcher_round.
- Delete the retired vectors (ic_launcher_background/foreground.xml) and the
misplaced mipmap-anydpi-v26/onionwire_app_icon.png.
The file reached main with an unresolved stash conflict at the auth_json
helper (line 24) and the asset-upload curl (line 133). Both publish jobs
run it directly, so every release/android-release publish dies with
"line 24: syntax error near unexpected token <<<". Keep the HTTP Basic
auth_json with the CR strip, and the single-line -X POST -u asset upload.
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.
The chat screen owned a LaunchedEffect(Unit) that fetched maxAttempts once and
then called loadMessages/loadOutbox every 2s forever, fed by three suspend
lambdas from MainActivity — one SDK poller per composition. The cadence now
lives in WireViewModel: openChat(peer) starts one 2s loop in viewModelScope
(closeChat stops it, re-entering the same peer is a no-op), exposed as
ChatState(messages, outbox, maxAttempts, error) and collected with
collectAsStateWithLifecycle. Same 2s cadence, maxAttempts read once, messages
and outbox refreshed together, load failures sticky on ChatState.error, and
the QUEUED notice unchanged; a send clears the load error.
Auto-scroll no longer steals the reader's place: the tail is followed only when
the last visible index is >= count - 2 (or the list has not filled yet), while
the user's own send still scrolls their message into view. The first fill keeps
its one jump to the bottom. A delivery-only change (same size) still does not
re-run the effect — documented in a comment rather than changed.
The composer keeps ImeAction.Send with maxLines = 4, documented as a deliberate
wrap limit rather than a newline affordance: the action key sends (hardware
Enter still inserts a newline inside the field).
No polling LaunchedEffect remains in ChatScreen.kt.
The two screens whose action row lives inside a non-scrollable Column could
not be un-covered by insets alone: the container had no scroll range at all.
- WalletScreen: root Column is now a verticalScroll viewport that consumes
systemBars ∪ ime itself (screenContentInsets()) before the scroll, paired
with Scaffold(contentWindowInsets = 0). The nested LazyColumn becomes a
plain Column (a lazy list cannot be measured inside a scroll container with
unbounded height) and the weight(1f) bottom spacer goes with it: a weighted
spacer cannot live in a scrollable Column.
- RosterScreen: same inset treatment; the friends LazyColumn drops
fillMaxSize() for weight(1f) so the wipe-confirm strip above it keeps its
height when the IME shrinks the window.
- Insets.kt is PR #67's helper, taken verbatim (this branch does not carry #67).
Stacked on PR #67 (wt/chat-ime-insets, 08381c4) for ui/Insets.kt.
LocalClipboardManager is deprecated in compose ui 1.10; the warning was the
only one in :app:compileDebugKotlin. Switch ShareInviteScreen to
LocalClipboard.setClipEntry(ClipEntry(ClipData.newPlainText(...))) on a
rememberCoroutineScope, since the new API is suspend. Same text, same
copied-state flip, same label, no permission change.
enableEdgeToEdge() sets decorFitsSystemWindows=false, so on API 30+ the framework
no longer resizes the window for the soft keyboard. The manifest's
android:windowSoftInputMode="adjustResize" therefore has nothing to resize and the
IME arrives as an unconsumed window inset; Scaffold's contentWindowInsets covers
systemBars only. Result: the composer row, its Send button and the typed body were
drawn underneath the keyboard and only reachable by dismissing it.
- ui/Insets.kt (new): screenContentInsets() applies systemBars ∪ ime once, at the
screen's content root. union is per-side max, so the keyboard and the navigation
bar are never summed; the Top side is excluded because a Scaffold's pad.top is
already the app bar's measured height (the app bar carries its own status-bar
inset). @Composable because WindowInsets.ime is a composable read.
- ChatScreen: Scaffold(contentWindowInsets = 0) plus the root consuming the inset;
the body region holds weight(1f) in every branch (loading and empty included) so
the composer can never be squeezed off the bottom; Send is always drawn instead
of being swapped for a spinner (no layout jump under the thumb); the field sets
ImeAction.Send so the keyboard's own action key sends; focus returns to the
field after a send; testTag on the composer/input/send.
- InviteScreens (both screens) and RotateScreen: same inset handoff, so the
Verify / Approve / confirm buttons under a text field stay reachable by scrolling.
- UnlockScreen: safeDrawingPadding(). It had no system-bar insets at all (title
drawn under the status bar) and its Open button sat under the keyboard while a
passphrase was being typed.
Verified on emulator-5554 (ow35, x86_64, API 35) with the debug build whose sources
are byte-identical to this commit:
element keyboard closed keyboard open
composer y=2232 y=1380
Send button y=2253 y=1433
keyboard top - y≈1500
mInputShown=true while the draft text was visible; the message sent both via the
Send button and via the keyboard's action key (paper-plane = ImeAction.Send), each
landing with the ✓✓ delivery marker. :app:testDebugUnitTest green.
Note: no CI job covers this — ci.yml's path allowlist is src/**, crates/**,
tests/**, Cargo.*, so an android-only change runs nothing, and android-release.yml
only fires on v*.*.* tags.
/ 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.
Expose wallet balance/address/transfers plus one-shot invoice and tip on
the UniFFI SDK. Wire a Compose wallet route (QR, composers) without dropping
wipe-chat. Ignore machine-local android/.cargo NDK paths.
README still claimed "peer down → send fails / no outbox" after the local
chat outbox, TUI/Android delivery markers, SDK SendState/outbox rows,
view-only wallet switch, zeroize, Keystore-wrapped passphrase, and
foreground keep-alive all landed on main. Align the operator-facing
summary with PROTOCOL.md / THREAT_MODEL.md / TUI.md / WALLET.md:
- intro + first-run: local outbox for chat, fail-closed for fil/rcp
- replace Fail closed section with Local outbox (chat) and fail closed
- Monero: prefer view-only + ONIONWIRE_WALLET_NO_SPEND
- seized laptop: zeroize + pending outbox rows in the same store
- Android: SendState/outbox rows, delivery UI, FGS keep-alive, Keystore;
android-release is dispatch-only
- Not in v1: ban is server-side outbox only