wallet: create/import in-app (no key paste on create) + opt-in spend
All checks were successful
ci / test (pull_request) Successful in 4m15s
ci / sdk (pull_request) Successful in 1m12s

/ 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.
This commit is contained in:
Lance Walters 2026-09-13 23:25:25 -04:00
commit cf0a517cd2
No known key found for this signature in database
12 changed files with 758 additions and 48 deletions

View file

@ -1,14 +1,23 @@
# OnionWire + monero-wallet-rpc
OnionWire is not a wallet. It never holds a seed, a spend key, or a view key.
It talks optional JSON-RPC to a `monero-wallet-rpc` that **you** run, on
loopback, only to:
Chat does not require a wallet. A wallet is opt-in.
**Default: no spend.** No seed and no spend key on the device. Receive uses the
profile `xmr_addr`, or a view-only wallet for invoices (`create_address`) and
receipt checks (`get_transfers`). `/tip` is off.
**Spend is opt-in** at wallet create or restore (seed-backed). That makes
OnionWire a local spend authority for that wallet file — see the spend-authority
warning below. The threat-model write-up is [THREAT_MODEL.md](THREAT_MODEL.md).
The app talks to `monero-wallet-rpc` over loopback HTTP Digest only, whether
that process is one you already run or one the app spawns:
- hand out a receive subaddress for `/pay` invoices (`create_address`),
- read incoming transfers to verify a peer's receipt (`get_transfers`),
- and — only if you let it — spend for `/tip` (`transfer`).
- and — only if you opted into spend — `/tip` (`transfer`).
**Run it view-only, and switch `/tip` off explicitly.** Everything else in this
**Prefer view-only until you actually want `/tip`.** Everything else in this
document explains why, and what breaks when you do.
## Env vars
@ -21,6 +30,20 @@ document explains why, and what breaks when you do.
`README.md` carries the operator summary; this file is the long form.
## Create vs import
Create does **not** take a private key. `/wallet create` (TUI: F6 then `c`) asks
the RPC to generate a new spend-capable wallet (`create_wallet`), then shows the
seed **once** for backup (`query_key mnemonic`). Type `SPEND` to accept the
spend-authority warning, set a passphrase, write the seed down, type `SEEN`.
Import is the only path that takes an existing secret: `/wallet import` (F6 then
`i`) pastes the 25-word seed into `restore_deterministic_wallet`. Do not put the
seed on the composer line — it would sit in chat history.
The RPC must be started with `--wallet-dir` (not only `--wallet-file`) or create
and import fail. The in-app filename is `onionwire`.
## Recommended topology
```
@ -34,9 +57,26 @@ document explains why, and what breaks when you do.
└──────────────────────────────────────────────────────────────┘
```
Loopback is the only address OnionWire will dial. `.onion` RPC URLs are
rejected: there is no Arti dial for the wallet, and a remote wallet would move
your key material off the box.
Loopback is the only address OnionWire will dial for **wallet RPC**. `.onion`
wallet-RPC URLs are rejected: there is no Arti dial for the wallet process, and
a remote wallet RPC would move spend authority off the box.
## Chain source
The wallet needs a daemon for scan, verify, and spend. You pick one; OnionWire
does not pick a public remote node for you.
1. **Spawn a local `monerod`** (pruned on-device). Chain traffic stays on the
box. You accept disk, first sync, and (on Android) the daemon not always
running.
2. **A daemon address you supply** — `--daemon-address` on the wallet child.
Loopback if you already run `monerod`. `.onion` if you want chain traffic
over Tor (wallet child `--proxy` to a localhost SOCKS listener; the daemon
operator still sees addresses). Clearnet only if you type it — ISP sees
Monero-node traffic; not a default.
Remote daemons are untrusted (`--trusted-daemon` off). Unsynced or unreachable
→ receipts stay unverified and spend is refused. That is the honest state.
## Create a view-only wallet
@ -88,7 +128,7 @@ Restore the wallet from a height *at or before* its first incoming transaction
| Receipt verification (`get_transfers`) | works | works |
| Profile `xmr_addr` fallback when RPC is down | works | works |
| `/tip <xmr>` (`transfer`) | **cannot work** | works |
| OnionWire learns your spend key | never | never (it stays in the wallet) |
| OnionWire copies your spend key into its own process | never | never (it stays in the wallet file / RPC) |
With `ONIONWIRE_WALLET_NO_SPEND=1` a `/tip` is refused before the RPC is
contacted, with: