wallet: optional seed-offset passphrase on import
All checks were successful
ci / test (pull_request) Successful in 6m21s
ci / sdk (pull_request) Successful in 1m28s
android-ci / android (pull_request) Successful in 12m54s
ci / fuzz (pull_request) Successful in 18m31s

Monero's `restore_deterministic_wallet` takes a `seed_offset`: a second
spend secret mixed into the 25 words at restore time, so the same words
with a different offset open a different wallet. It is not the wallet-file
passphrase and must never be sealed, stored, logged or put on an argv.

- `Wallet::restore_wallet` gains `seed_offset: Option<&str>`: None, empty
  or whitespace-only leaves the field out of the JSON entirely; otherwise
  the ends are trimmed and it is sent beside the seed.
- `Node::wallet_restore` passes it through and still seals only the file
  passphrase.
- SDK: `import_wallet` keeps its signature (None) and
  `import_wallet_with_offset` is added (Kotlin `importWalletWithOffset`).
- TUI: a new `ImportOffset` step between the seed and the file passphrase
  (blank Enter skips, a real one is confirmed, a mismatch never dials), and
  `ImportOffsetSeen` after a successful import that used one -- Esc cannot
  leave it, only SEEN, and the offset is not drawn anywhere.
- Docs: WALLET.md, THREAT_MODEL.md, TUI.md, one README sentence.
This commit is contained in:
agent 2026-09-25 00:42:44 -04:00
commit f6a7daf892
No known key found for this signature in database
9 changed files with 623 additions and 34 deletions

View file

@ -322,7 +322,10 @@ Prefer `ONIONWIRE_WALLET_NO_SPEND=1` until you actually want `/tip`. Details:
Peer onion down → `/pay` and `/tip` fail. A queued invoice does not exist.
`F6` then `c` / `/wallet create` generates a spend-capable wallet and shows the
25-word seed **once**. `F6` then `i` / `/wallet import` restores from a seed.
25-word seed **once**. `F6` then `i` / `/wallet import` restores from a seed, and
takes an optional Monero seed-offset passphrase (a second spend secret, not the
wallet-file passphrase; blank skips it, a wrong one opens a different wallet and
does not fail).
Type `SPEND` then `SEEN` on create. Each wallet gets its own file name
(`onionwire-1`, `onionwire-2`, …); the RPC must be started with `--wallet-dir`.