Commit graph

414 commits

Author SHA1 Message Date
agent
f5e310fdf4
wallet: wait for the daemon RPC before spawning monero-wallet-rpc 2026-09-23 20:37:13 -04:00
rust-dev
052879fa39
wallet: share the loopback accept wait the SOCKS path already uses 2026-09-23 20:37:13 -04:00
9322d885f8 Merge pull request 'android: do not paint a connect refusal while the wallet is connecting' (#154) from onionwire/t_1b021834-onionwire-android-do-not-paint-a-wallet into main
All checks were successful
android-ci / android (push) Successful in 11m26s
Reviewed-on: #154
2026-09-24 00:08:52 +00:00
agent
971d8b3894
android: reload wallet reads when the child starts answering
All checks were successful
android-ci / android (pull_request) Successful in 12m46s
2026-09-23 19:50:18 -04:00
agent
9eb054b10f
android: do not paint a connect refusal while the wallet is connecting 2026-09-23 19:48:52 -04:00
25e4c67181 Merge pull request 'wallet: land the file-name picker fix and the wallet manager on main (from t_67879b98)' (#153) from onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Successful in 6m38s
ci / sdk (push) Successful in 1m18s
ci / fuzz (push) Has been cancelled
v0.1.0
Reviewed-on: #153
2026-09-23 02:33:38 +00:00
685ce89b29 Merge pull request 'wallet: the file-name picker must consult the disk, not only the catalogue' (#151) from onionwire/t_81deabb5-wallet-the-file-name-picker-must-consult into onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and
Some checks failed
android-ci / android (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
ci / fuzz (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
Reviewed-on: #151
2026-09-23 00:46:47 +00:00
c1fda00080 Merge branch 'onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and' into onionwire/t_81deabb5-wallet-the-file-name-picker-must-consult
All checks were successful
ci / test (pull_request) Successful in 6m39s
ci / sdk (pull_request) Successful in 1m49s
ci / fuzz (pull_request) Successful in 7m1s
android-ci / android (pull_request) Successful in 19m1s
2026-09-23 00:46:34 +00:00
3ddd370b3d Merge pull request 'android: ask for the wallet passphrase, and stop printing RPC errors' (#150) from onionwire/t_9ef8561c-wallet-manager-ask-for-the-passphrase-an into onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and
Reviewed-on: #150
2026-09-23 00:41:47 +00:00
01d3294282 Merge pull request 'wallet: actually open the wallet file, and remember its passphrase' (#149) from onionwire/t_67879b98-wallet-actually-open-the-wallet-file-and into main
All checks were successful
ci / test (push) Successful in 6m2s
ci / sdk (push) Successful in 1m33s
android-ci / android (push) Successful in 13m13s
ci / fuzz (push) Successful in 4m57s
Reviewed-on: #149
2026-09-23 00:26:38 +00:00
agent
6edcd65e96
tests: take the restart's port from the child that dials it
All checks were successful
ci / test (pull_request) Successful in 6m3s
ci / sdk (pull_request) Successful in 1m14s
ci / fuzz (pull_request) Successful in 4m53s
android-ci / android (pull_request) Successful in 12m15s
`a_restart_opens_the_stored_wallet_file` failed on the Pi runner twice in a
row — CI run 905 job 1373 and run 901 job 1365 — and passed 3/3 on a 16-core
host:

  open the wallet with a passphrase: "wallet file onionwire-1 is not open —
  the wallet RPC never answered (wallet connect: Connection refused (os error
  111))"

The whole `WALLET_OPEN_WAIT` was burned on refusals, so the mock was bound on
a port the restarted child never dialled. Production is not the suspect:
`WalletChild::start_children` builds the child's argv and the `WalletClient`
URL from the same `pick_port` value, and `start_wallet_child_with` installs
that client in `self.wallet` before `open_child_wallet` dials it, so the client
can never carry the previous child's port.

The harness is the suspect. It learned the restarted child's port from the
*shared* argv log — a file every child writes — and cleared that file first.
A clear is not a synchronisation: on a loaded runner the killed child's write
lands after it, so the poller read the port of a child that was already dead
and bound the mock there. Reproduced deterministically with a stand-in whose
exec is late; with the old read the new test fails with the CI message, byte
for byte.

Each fake child now writes `<log>.<pid>` as well, and the shared copy lands
first, so a pid-named file implies the shared one is complete. A test that
spans two children reads the pid-named file: only that child can write it, so
the port belongs to the child that dials it. `WalletChild::wallet_rpc_pid`
(test-only) supplies the pid.

`open_wallet_blocking` already retries while the RPC is unreachable and gives
up after a bounded wait with a typed `OpenFailure::NotAnswering`, so it cannot
refuse forever against a merely slow child: no production change.

new test: node::tests::a_restart_is_not_given_the_stopped_childs_port
2026-09-22 15:37:55 -04:00
agent
8d80a4fd55
tests: write the fake child's argv log with one mv, not append-per-line
Some checks failed
android-ci / android (pull_request) Successful in 12m25s
ci / test (pull_request) Failing after 4m11s
ci / sdk (pull_request) Successful in 1m20s
ci / fuzz (pull_request) Successful in 5m28s
The wallet-child tests learn a spawned stand-in's port by polling its argv
log, and `fake_bin`/`fake_child_bin` truncated the log and then appended
one line per argument -- so a poller could read a prefix. A truncated port
is a *valid* u16 ("427" out of "42765"), so `wait_for_child_rpc_port`
happily returned a port nothing was listening on and the restart's
`open_wallet` died with `Connection refused` after its 10s budget; the
same prefix read is what `loopback_and_clearnet_remotes_carry_no_proxy...`
printed with its `--daemon-address` value missing.

Both tests failed on the first CI run of this branch (ci / test) and are
green in isolation, which is the signature of this race rather than of a
code defect. The argv now lands in the log with a single `mv`, so a reader
sees either no log or the complete one.

Measured with a tight read loop (argv-race-probe.sh): the append version
was caught mid-write 1/300 reads, the mv version 0/300.
2026-09-22 14:33:32 -04:00
agent
b4f8bb809c
android: filter the wallet child's last_error where the SDK record becomes the model
All checks were successful
android-ci / android (pull_request) Successful in 12m53s
The status line renders WalletChildInput.lastError through walletChildLine,
and the same field feeds walletChildStatusDescription for the screen reader.
The filter added in 3f84021 sat on the sticky error card only, so in exactly
the state this card targets — a live child with no wallet file open answering
-13 No wallet file — the raw daemon sentence still reached the line and the
screen-reader sentence.

Move it to the producer: WalletChildStatus.toInput() now runs lastError
through walletFailureText, the one seam where the SDK record becomes the
Kotlin model. Idempotent on its own replacement texts, so the error card's
second pass is stable.

New JVM tests build the SDK record and assert on the rendered line (and its
description), not on walletFailureText in isolation: with the filter removed
they fail on the raw 'No wallet file'.
2026-09-22 14:11:34 -04:00
rust-dev
59175f6931
wallet: the file-name picker consults the disk, not only the catalogue
Some checks failed
ci / test (pull_request) Failing after 4m25s
ci / sdk (pull_request) Successful in 1m29s
ci / fuzz (pull_request) Successful in 4m57s
android-ci / android (pull_request) Successful in 12m6s
next_wallet_filename returned <default>-<n> for the first n the SQLCipher
catalogue did not hold, and never looked at the wallet directory. monero
writes two files per wallet (<name> and <name>.keys) and refuses a create
that would collide with either, so a file whose catalogue row is gone -
Store::delete_wallet keeps the file, and a create whose record_wallet
failed leaves one - meant every attempt proposed the same taken name and
the daemon answered -21 Cannot create wallet. Already exists. for ever.

Add wallet_name_taken (src/wallet_child.rs): it lists the wallet dir and
answers whether <name> or <name>.keys is already there. next_wallet_filename
now needs the candidate free in both places, and Node::wallet_dir() is the
single source of $ONIONWIRE_HOME/wallet, used by the child spawn too.

Fail closed: an unreadable (or missing) wallet dir is an error, not a
guess. Reads only - nothing here deletes a file the catalogue does not
hold, which may be the only copy of a funded wallet.
2026-09-22 13:41:35 -04:00
apk-dev
3f84021abb
android: ask for the wallet passphrase, and stop printing RPC errors
All checks were successful
android-ci / android (pull_request) Successful in 12m38s
The wallet manager could not open a wallet it holds no passphrase for: the
child came up pointed at the file with no wallet open, `needs_passphrase`
was true, and every read answered the daemon's `-13 No wallet file`. The
screen rendered that string.

Phone side of t_67879b98:

* WalletManagerScreen asks for the passphrase when the child reports
  `needs_passphrase` and no wallet is open, and submits it through the
  parent's `Wire::open_wallet_with_passphrase` on the file the child is
  already pointed at. Masked field, no copy action (same rule as the seed
  card), wiped on success and on dispose, FLAG_SECURE while the screen is
  up.
* `walletFailureText` filters every user-visible wallet failure: the
  daemon's `No wallet file`, a bare `-13`, and any JSON envelope become a
  plain sentence that says whether a wallet is open and what to do next.
  Applied at every site that renders a wallet error, in both wallet
  screens and the wallet-child error flow in the ViewModel.
* The wallet screen says "no wallet is open in the child" and where to fix
  it, instead of leaving it to surface later as the daemon's own words.

Tests: WalletManagerTest covers the new decisions (prompt shown / not
shown, submit gate and its reasons, the failure-text filter, the open
hint) on the JVM. 203 unit tests green.
2026-09-22 13:30:08 -04:00
agent
ed29131a67
wallet: actually open the wallet file, and remember its passphrase
All checks were successful
ci / test (pull_request) Successful in 6m14s
ci / sdk (pull_request) Successful in 1m44s
android-ci / android (pull_request) Successful in 12m56s
ci / fuzz (pull_request) Successful in 5m1s
`monero-wallet-rpc` starts with no wallet open and keeps one only for the
life of its process, so a restart, a Lock/unlock or a wallet re-point left
a live child answering `-13 No wallet file` to every read while the file
sat on disk. The app now opens the configured catalogue file itself
(`Wallet::open_wallet`, over RPC — never `--wallet-file`/`--password` on
argv, which `ps` exposes) after the child is up, and keeps the passphrase
that does it, sealed with the store data key beside the RPC creds under
its own AAD.

- core: `Wallet::open_wallet`, `WalletConfig::wallet_passphrase`
  (+ `with_wallet_passphrase`, redacted Debug, kept out of the endpoint
  config), `Error::is_unreachable` for the one retryable class (the port
  binds a moment after spawn; a timeout is not a start in progress).
- store: `wallet_config.sealed_passphrase` column (additive, AAD
  `onionwire-store-v1:wallet-passphrase`), read-modify-written so the
  endpoint/login survive; `wallet_save_config` keeps the stored one.
- node: `start_wallet_child` opens the file, `open_wallet_with_passphrase`
  opens a file with a passphrase the user just typed and seals it only
  once a live daemon accepted it, `wallet_status` grows `wallet_open` and
  `needs_passphrase`. A child the RPC refuses is stopped rather than left
  inert; an install with no stored passphrase still starts, and says so.
- tui: one-shot prompt (`WalletSetup::UnlockPass`) on a wallet that needs
  it, reachable from the saved-wallet picker and from `s`.
- sdk: `openWalletWithPassphrase`, the two status fields, README flow.
- docs: WALLET/THREAT_MODEL/README — the passphrase is kept, and the
  consequence (the store passphrase is sufficient to spend) is stated
  rather than implied.

Tests: 4 new node tests drive a real child lifecycle against a loopback
wallet RPC (open on restart, no open without a passphrase, refused
passphrase, sealed-on-success), a `tests/wallet.rs` test asserts the bytes
sent (`open_wallet` + filename + password), and `tests/store.rs` covers
the sealed column and the plaintext->encrypted upgrade with it set.
Mutation-checked: stubbing the two open paths fails all four.
2026-09-22 12:52:08 -04:00
c5725856ad Merge pull request 'android: profile screen — nickname + Monero receiving address' (#148) from onionwire/t_54329f2b-android-profile-screen-nickname-monero-r into main
All checks were successful
android-ci / android (push) Successful in 11m34s
Reviewed-on: #148
2026-09-22 12:28:49 +00:00
dc8c3933cd Merge branch 'main' into onionwire/t_54329f2b-android-profile-screen-nickname-monero-r
All checks were successful
android-ci / android (pull_request) Successful in 12m30s
2026-09-22 12:09:33 +00:00
460a5afb12 Merge pull request 'android: saved-wallets screen (list, select, back up the open wallet)' (#147) from onionwire/t_cf7e07f9-android-saved-wallets-screen-list-select into main
All checks were successful
android-ci / android (push) Successful in 11m55s
Reviewed-on: #147
2026-09-22 12:09:18 +00:00
agent
775f2e88be
android: profile screen — nickname + Monero receiving address
All checks were successful
android-ci / android (pull_request) Successful in 12m27s
The phone's half of the TUI's `/profile`. A `Profile` action on the roster's
app bar opens `ui/ProfileScreen.kt`: nickname, bio, and the Monero address
friends pay to, all three loaded from the store and written back through the
core's own validation.

- The address is checked with `uniffi.onionwire_sdk.checkAddress` *before* the
  write, so a typo is refused with the typed text still in the field instead of
  surfacing as a store error afterwards. An empty address is allowed and is
  labelled with its consequence: with no profile address and no running wallet
  child the core has nothing to hand a payer.
- The bio is carried, not owned: a save that did not touch the field writes
  back the value read from the store immediately before the write, so a bio set
  in the TUI cannot be blanked from the phone.
- On save the profile is pushed to **every** friend in the roster, one-shot and
  fail-closed per friend like the TUI's `save_profile`. A push failure is not a
  save failure: the status line always starts with `profile saved` and names the
  count, with each failure listed by petname (else shortened fingerprint).

Every decision the screen makes is a pure function in the new file, covered by
`ProfileDraftTest` (21 cases) on the JVM: the save-button rule (dead until the
read lands, dead while the form is unchanged), the address branch, the bio rule,
label selection and the status-line aggregation.

Verified on AVD ow35 (x86_64 slice, emulator-5560): the roster app bar carries
`Profile`; nickname/bio/address survive `am force-stop` + relaunch; an invalid
address is refused before the write; a save with an empty roster reports
`profile saved`; with one (self-)peer in the roster a save reports
`profile saved · sent to 1 friend`, and with the emulator's network cut the same
save reports `profile saved · sent to 0 of 1 friend · failed: <label>: <tor err>`.
2026-09-22 02:12:32 -04:00
apk-dev
812c259f46
android: saved-wallets screen (list, select, back up the open wallet)
All checks were successful
android-ci / android (pull_request) Successful in 10m37s
The app could hold several wallets and show none of them. Add the screen
that lists the store's catalogue, marks the one the wallet child has open,
switches to another on a tap, and — for the open one only — shows its
recovery phrase and private keys.

Everything secret here belongs to the file the child currently has open:
`query_key` is answered by that file and no other, so the seed card and the
keys card hang off `active_wallet_filename()`, not off a row. On a row that
is not the open one both actions are dead and say why ("open this wallet to
view its backup") instead of opening it under the user — switching wallets
is a deliberate tap, because `open_wallet` stops and restarts a running
child.

The phrase keeps the existing treatment: the wallet screen's own
`SeedBackupCard`, widened from `private` to `internal` rather than copied,
so the gate constants are still the one `SeedBackupGate`. The keys card
shows the view key always and the spend key when there is one; a view-only
wallet says "view-only wallet — no spend key" in words, because `null` is
the wallet's own answer and not a failure. Neither value is logged,
persisted, tagged, or held in saved state, and both are dropped on dispose.

The catalogue is re-read on entry and on Refresh, never cached from app
start, so a wallet created on the wallet screen after this one was first
opened shows up without restarting the app. An empty catalogue ("No saved
wallets yet") and a read failure ("could not read the wallet catalogue" +
the core's text) are rendered as the two different states they are.

The gate is pure Kotlin in the new file and `WalletManagerTest` covers it on
the JVM (17 cases): the row label's name/blank/whitespace fallback, which
child states count as readable, and whether the secret actions are offered
for a row.
2026-09-22 01:23:47 -04:00
573bf4bf8d Merge pull request 'android: collapse the roster identity block into a dropdown' (#146) from onionwire/t_d62da406-android-roster-collapse-the-identity-blo into main
All checks were successful
android-ci / android (push) Successful in 10m20s
Reviewed-on: #146
2026-09-22 04:31:22 +00:00
181c13647a Merge branch 'main' into onionwire/t_d62da406-android-roster-collapse-the-identity-blo
All checks were successful
android-ci / android (pull_request) Successful in 12m1s
2026-09-22 04:31:06 +00:00
0e866c096a Merge pull request 'sdk: expose the wallet catalogue, the open wallet's keys, and the self profile over UniFFI' (#145) from onionwire/t_c9e48c46-onionwire-sdk-expose-the-wallet-catalogu into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Successful in 8m8s
ci / sdk (push) Successful in 1m7s
ci / fuzz (push) Successful in 4m53s
Reviewed-on: #145
2026-09-22 04:30:20 +00:00
agent
b6447f76d6
android: collapse the roster identity block into a dropdown
All checks were successful
android-ci / android (pull_request) Successful in 12m26s
The identity card's full fingerprint wraps to several lines on a phone and
pushes the friend list off the first screen. Collapse it: one line by
default (label + `shortId(fingerprint)` + chevron), the full fingerprint and
the full onion behind a tap, in the order they already had.

The `sdk …` line and `keepAliveNote` stay outside the disclosure — the
keep-alive denial is the only place that note appears, so hanging it off a
collapsed block would hide it.

`shortId` is a pure top-level function (`head … tail`, unchanged when the
value is no longer than the abbreviation, empty stays empty) so the collapsed
line is a slice of the value shown expanded, not a parallel encoding. The
expand state is `rememberSaveable`: a rotation keeps what the user chose, and
nothing about it belongs in the store.

RosterIdTest covers the abbreviation on the JVM (7 cases: the 64-hex
fingerprint, the head/tail boundary, custom head/tail, shorter-than-input,
empty, single-char ellipsis).
2026-09-22 00:28:39 -04:00
sirius
5f19a56be3
sdk: expose the wallet catalogue, the open wallet's keys, and the self profile
Some checks failed
ci / test (pull_request) Successful in 5m59s
ci / sdk (pull_request) Successful in 1m35s
android-ci / android (pull_request) Successful in 12m42s
ci / fuzz (pull_request) Has been cancelled
The Android wallet/profile screens had nothing to call: the core could list
wallets, switch the child onto one, read its keys and read/write the self
profile, but none of it crossed UniFFI.

Core:
- Wallet::keys() -> WalletKeys { view_key, spend_key: Option<String> }: two
  query_key calls against the file the RPC has open. A view-only wallet's -29
  is spend_key: None, not an error. WalletKeys' Debug redacts both halves.
- Node::wallet_keys() mirrors wallet_create/wallet_seed; refuses locally when
  no wallet is configured.
- Node::active_wallet_filename() -> Option<String>: the file the child is
  pointed at, None until wallet-child settings exist, so a client can mark the
  open row.

SDK (UniFFI):
- records WalletRow / WalletKeys / SelfProfile, and Wire::{wallets,
  open_wallet, active_wallet_filename, wallet_keys, self_profile,
  set_self_profile, push_self_profile}.
- The rule the clients must express is in the docs: the seed and the private
  keys come from the OPEN wallet, so there is deliberately no accessor that
  reads another saved wallet's secrets without opening it.

docs/WALLET.md (catalogue + 'secrets belong to the open wallet'),
docs/THREAT_MODEL.md (the new on-demand-display exposure surface) and the SDK
README are updated in the same commit.
2026-09-22 00:25:33 -04:00
agent
a9117b8991
Merge PR #144: tui -- read the wallet list from the store and load the chosen wallet
All checks were successful
ci / test (push) Successful in 5m47s
ci / sdk (push) Successful in 1m24s
android-ci / android (push) Successful in 10m42s
ci / fuzz (push) Successful in 4m52s
# Conflicts:
#	docs/TUI.md
#	src/tui.rs
2026-09-21 12:12:12 -04:00
agent
511c9e921d
Merge PR #143: node -- remember a created wallet in the store catalogue 2026-09-21 12:11:19 -04:00
agent
8986724848
tui: read the wallet list from the store and load the chosen wallet
All checks were successful
ci / test (pull_request) Successful in 6m14s
android-ci / android (pull_request) Successful in 12m16s
ci / sdk (pull_request) Successful in 1m30s
ci / fuzz (pull_request) Successful in 4m50s
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.
2026-09-21 11:43:07 -04:00
agent
d96de1d7f0
tui: wallet selection screen (F6 -> w) with create as the last row
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)
2026-09-21 11:15:44 -04:00
dd7c749373 Merge pull request 'node: remember a created wallet in the store catalogue' (#143) from wt/t_511023b6 into wt/t_64c9ba3c
Reviewed-on: #143
2026-09-21 15:10:36 +00:00
5f1500191e Merge pull request 'tui: wallet selection screen (F6 -> w) with create as the last row' (#142) from wt/t_14ac0a3f into main
Some checks failed
android-ci / android (push) Has been cancelled
ci / test (push) Successful in 7m32s
ci / sdk (push) Successful in 1m14s
ci / fuzz (push) Successful in 4m58s
Reviewed-on: #142
2026-09-21 15:10:17 +00:00
49756d2a2d Merge branch 'main' into wt/t_14ac0a3f
Some checks failed
ci / test (pull_request) Successful in 5m56s
android-ci / android (pull_request) Has been cancelled
ci / sdk (pull_request) Successful in 1m30s
ci / fuzz (pull_request) Has been cancelled
2026-09-21 15:10:10 +00:00
948d9b4b0c Merge pull request 'store: a wallet catalogue in the encrypted db (wallets table + CRUD)' (#141) from wt/t_64c9ba3c into main
All checks were successful
ci / test (push) Successful in 6m0s
ci / sdk (push) Successful in 1m35s
android-ci / android (push) Successful in 11m56s
ci / fuzz (push) Successful in 4m51s
Reviewed-on: #141
2026-09-21 15:09:45 +00:00
agent
0043fa0b34
node: remember a created wallet in the store's catalogue
All checks were successful
ci / test (pull_request) Successful in 5m53s
ci / sdk (pull_request) Successful in 1m35s
android-ci / android (pull_request) Successful in 12m30s
ci / fuzz (pull_request) Successful in 4m55s
A wallet created in-app was never remembered: `Node::wallet_create` called
the RPC and returned the seed, and the wallet file name was the one
hardcoded `wallet::DEFAULT_WALLET_FILENAME` ("onionwire"). A second create
reused that name, so the RPC refused it (or opened the first wallet's
file) and no row was ever written — the "cannot create a new wallet, and
nothing survives a restart" report.

Creation and import now go through the catalogue (t_64c9ba3c's
`Store::{create_wallet,list_wallets}`):

- each create/import gets its own file name, `onionwire-<n>` for the first
  `n` the catalogue does not hold, so several wallets coexist;
- the stored row (id, identity, locator, file, created_at) is returned:
  `Node::wallet_create` -> `CreatedWallet` (row + the one-time seed, with a
  redacting `Debug`), `Node::wallet_restore` -> `WalletRecord`;
- `Node::list_wallets` reads the catalogue without dialing;
- the child config is re-pointed at the new file (read-modify-write, so the
  sealed RPC creds survive) — a row the child never opens would still be a
  broken wallet.

The SDK keeps its UniFFI signature (`create_wallet -> String` seed,
`import_wallet -> ()`), so no Kotlin change: it unwraps `.seed`.

TDD: 5 new `src/node.rs` cases (row + list, two wallets + reopen, import,
wallet-off empty list, child re-pointed) over a loopback wallet-RPC mock.
`cargo test --locked` exit 0, `cargo clippy --locked --all-targets -- -D
warnings` clean, and the same two commands are clean in
`crates/onionwire-sdk`.
2026-09-21 10:57:55 -04:00
agent
99a4ab640e
tui: wallet selection screen (F6 -> w) with create as the last row
All checks were successful
ci / test (pull_request) Successful in 5m58s
android-ci / android (pull_request) Successful in 12m2s
ci / sdk (pull_request) Successful in 1m28s
ci / fuzz (pull_request) Successful in 4m46s
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.
2026-09-21 10:41:53 -04:00
rust-dev (hermes)
467510f096
store: a wallet catalogue in the encrypted db
All checks were successful
ci / test (pull_request) Successful in 5m48s
ci / sdk (pull_request) Successful in 1m34s
android-ci / android (pull_request) Successful in 12m4s
ci / fuzz (pull_request) Successful in 18m24s
Wallets were only ever a file in $ONIONWIRE_HOME/wallet plus the
single-row wallet_child config for the one the child is currently
pointed at, so a created wallet was not remembered and a second create
had nowhere to go.

Add a 'wallets' table (id, name, identity_pubkey, onion_locator,
wallet_filename, created_at) and CRUD on Store: create_wallet,
get_wallet_by_id, list_wallets, delete_wallet. wallet_filename is
UNIQUE so a second wallet cannot silently reuse the first one's file,
and identity_pubkey is deliberately not unique (identity is the roster
key, a wallet is a file; the locator may rotate or be empty).

No new crate: the store is already rusqlite + SQLCipher with a raw
PRAGMA key, and sqlx has no SQLCipher path, so a second pool would be a
second unencrypted way in.

Tests: 5 store cases in tests/store.rs (round-trip, coexistence across
a reopen, duplicate filename, delete, blank label/filename) plus the
at_rest upgrade case in src/store.rs.
2026-09-21 10:21:48 -04:00
2256d036d5 Merge pull request 'android: block the wallet screen on an unbacked seed, and let it be re-shown' (#139) from onionwire/t_9b2544a7-wallet-screen-block-on-an-unbacked-seed into main
All checks were successful
android-ci / android (push) Successful in 10m15s
Reviewed-on: #139
2026-09-20 16:14:29 +00:00
agent
118191c541
android: block the wallet screen on an unbacked seed, and make it re-showable
All checks were successful
android-ci / android (pull_request) Successful in 10m35s
A created wallet's seed was two lines of small text at the bottom of the
wallet page, dismissed by one tap, gone for good once the screen was left.
A real user created a wallet, never saw the seed, and the app had no way to
show it again.

- `SeedBackupGate` (new, pure Kotlin): the confirm word `SEEN` and its
  case-insensitive match mirror the TUI's own `WalletSetup::CreateSeed`
  gate; create starts unbacked, import is backed up without the gate, and
  only a correct word can confirm.
- The seed card is the whole body until the word is typed and Done is
  tapped: no Cancel, no copy button (the Android clipboard is readable by
  every other app), Done dead until `SEEN`.
- "Back up seed" re-reads the seed through the new `Wire::wallet_seed()`
  (`WireViewModel.walletSeed()`), so a seed missed the first time is not
  lost. Its failure is shown next to the button, not at the bottom of a
  long scroll.
- While unconfirmed: a warning strip stays at the top of the wallet screen
  and the receive address and Show QR are hidden — XMR received into a
  wallet whose 25 words were never written down is unrecoverable.
- The flag lives in app-local prefs (`wallet_seed_backup`), not in the
  Keystore-wrapped store, and is reset by `createWallet` itself so no
  caller can forget it.

The stored flag is nullable, and the null is load-bearing. `false` means
this install created a wallet and nobody has confirmed the seed, so the
strip is up whether or not the balance reads. `null` means nothing is
stored — an install that predates the flag, or one that has never created
a wallet here — and there the strip waits for `wallet_balance` to return a
real amount, the core's own evidence that the child has a wallet open.
Without that distinction a first-run user who had configured a chain
source but not yet created a wallet (`wallet_balance` returns "err") would
be warned about a seed they do not have.

The app-bar Back still leaves the screen, deliberately — it is the TUI's
`Esc`. It costs nothing now, because leaving no longer loses the seed.

Verification: `./gradlew :app:testDebugUnitTest` green, 135 tests
(`SeedBackupGateTest` 18 of them).
2026-09-20 12:15:47 -04:00
94d29b8354 Merge pull request 'wallet: expose an on-demand seed accessor over core + UniFFI' (#138) from onionwire/t_2142490d-wallet-seed-expose-an-on-demand-seed-acc into main
All checks were successful
ci / test (push) Successful in 5m22s
ci / sdk (push) Successful in 1m8s
ci / fuzz (push) Successful in 4m51s
android-ci / android (push) Successful in 10m7s
Reviewed-on: #138
2026-09-20 16:13:28 +00:00
agent
145036fda8
wallet: expose an on-demand seed accessor over core + UniFFI
All checks were successful
ci / test (pull_request) Successful in 5m43s
ci / sdk (pull_request) Successful in 1m21s
android-ci / android (pull_request) Successful in 11m53s
ci / fuzz (pull_request) Successful in 4m53s
Wallet::create_wallet returned the 25-word seed exactly once and nothing
could reach it afterwards, so a seed that was never backed up at creation
was unrecoverable. Add Wallet::mnemonic() (one query_key mnemonic call on
the open wallet file), Node::wallet_seed() mirroring wallet_create, and the
additive UniFFI export Wire::wallet_seed() -> Kotlin Wire.walletSeed().

No existing signature changes. The refusals stay leak-free: an unconfigured
wallet gets NOT_CONFIGURED_MSG without a dial, a watch-only wallet keeps the
RPC's -29 view-only mapping, and no error string carries the RPC login.

Tests (tests/wallet.rs) drive the per-connection Digest mock: the words come
back verbatim, a JSON-RPC error surfaces without the login or endpoint, a
rejected digest refusal does not leak the password, and an unconfigured
wallet is refused without dialing.
2026-09-20 11:53:19 -04:00
3769bd9a42 Merge pull request 'wallet: answer the Digest challenge on the connection that issued it' (#137) from fix/wallet-rpc-digest-same-connection into main
All checks were successful
ci / test (push) Successful in 5m18s
ci / sdk (push) Successful in 1m13s
ci / fuzz (push) Successful in 4m58s
android-ci / android (push) Successful in 11m38s
Reviewed-on: #137
2026-09-20 13:30:21 +00:00
sirius
cb411da813
wallet: answer the Digest challenge on the connection that issued it
All checks were successful
ci / test (pull_request) Successful in 5m37s
ci / sdk (pull_request) Successful in 1m21s
ci / fuzz (pull_request) Successful in 4m52s
android-ci / android (pull_request) Successful in 12m15s
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.
2026-09-20 09:17:05 -04:00
b805bd4ad9 Merge pull request 'docs(android): the APK poller now calls wallet_child_refresh' (#136) from onionwire/t_4afe292a-android-docs-live-poller into main
All checks were successful
android-ci / android (push) Successful in 11m16s
Reviewed-on: #136
2026-09-20 12:47:24 +00:00
agent
0a8105584f
docs(android): the APK poller now calls wallet_child_refresh
All checks were successful
android-ci / android (pull_request) Successful in 10m19s
#135 merged against fa0e4b2-era docs that said the loop was still
wallet_status. #134 already landed: first paint is cached, every later
tick is Wire::wallet_child_refresh.
2026-09-20 00:56:08 -04:00
53b5e6c762 Merge pull request 'docs(android): rewrite the Android docs to match the tree' (#135) from onionwire/t_4afe292a-docs-android-audit-rewrite-the-android-d into main
All checks were successful
android-ci / android (push) Successful in 10m12s
Reviewed-on: #135
2026-09-20 04:53:12 +00:00
agent
c65946bfd5
docs(android): rewrite Android docs to match the tree
All checks were successful
android-ci / android (pull_request) Successful in 10m14s
android/README.md, CUPRATE_DAEMON.md and MONERO_BINARIES.md were the
half PR #133 left out. Releases are two manual dispatches, not a push
to main; the APK version comes from the tag android-release checks out;
the layout now includes wallet/ and keepalive/; the status line's
sync h/t is documented; the APK poller still calls wallet_status, not
wallet_child_refresh.
2026-09-20 00:52:43 -04:00
d2d49d27c5 Merge pull request 'android: poll the live wallet-child probe so the wallet sync line moves' (#134) from wt/t_07542df0 into main
All checks were successful
android-ci / android (push) Successful in 10m26s
Reviewed-on: #134
2026-09-20 04:48:14 +00:00
Lance
4d2528351b
android: poll the live wallet-child probe so the sync line moves
All checks were successful
android-ci / android (pull_request) Successful in 10m51s
The wallet screen's 2s loop read Wire::wallet_status, which only re-reads the
snapshot the last probe left in the store — so the `sync h/t` segment sat frozen
until a chain-mode tap ran start_wallet_child (which probes on its way out).

The loop now paints once from the cached read (non-dialing, so the screen has a
record immediately) and then calls Wire::wallet_child_refresh for every tick:
one live probe of the child's loopback wallet RPC, and of the configured local
daemon's get_info when that RPC does not answer. Same 2s cadence, same
Dispatchers.IO, same sticky walletChildError, same one-poller guarantee.

The loop is a top-level function taking its two reads as parameters, which is
the only seam a JVM test has — requireWire() is NodeHost.requireOpen(), a
process-global only a real Arti bootstrap sets. WalletChildRefreshLoopTest pins
that the cached read paints exactly once and every tick after it is the live
probe, that a probe slower than the tick is never overlapped, and that
cancelling the loop (leaving the screen) stops the dialing.
2026-09-20 00:48:57 -04:00
fa0e4b2f6c Merge pull request 'sdk: expose a live wallet-child probe over UniFFI (wallet_child_refresh)' (#132) from wt/t_0a355a62 into main
All checks were successful
android-ci / android (push) Successful in 12m2s
ci / test (push) Successful in 5m15s
ci / sdk (push) Successful in 1m7s
ci / fuzz (push) Successful in 5m3s
Reviewed-on: #132
2026-09-20 04:32:38 +00:00