sdk: expose the wallet catalogue, the open wallet's keys, and the self profile
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.
This commit is contained in:
parent
a9117b8991
commit
5f19a56be3
7 changed files with 784 additions and 3 deletions
|
|
@ -249,6 +249,32 @@ the app does not pick a public remote node for them.
|
|||
Remote daemons are untrusted (`--trusted-daemon` off). Setup, view-only vs
|
||||
spend, and RPC credentials: [WALLET.md](WALLET.md).
|
||||
|
||||
## The recovery phrase and the private keys are displayable on demand
|
||||
|
||||
Both clients can show the **open** wallet's recovery phrase (`query_key
|
||||
mnemonic`) and its private view and spend keys (`query_key view_key` /
|
||||
`spend_key`), from an explicit user action. That is new exposure the threat model
|
||||
did not previously enumerate: the phone screen — and the Linux TUI window — is
|
||||
now one of the places a spending secret can be read from.
|
||||
|
||||
- The values come from the wallet file the child has **open**. There is no path
|
||||
that reads another saved wallet's secret without opening it first, and none
|
||||
that reads a wallet file directly: the RPC is the only source.
|
||||
- They are never logged, never written to the store or any other file, and never
|
||||
placed in an error string; the records that carry them (`WalletKeys`) redact
|
||||
themselves under `Debug`. They exist in process memory only while a screen
|
||||
shows them.
|
||||
- They are shown only from an explicit user action, never on a refresh path.
|
||||
- What this does **not** stop: a shoulder-surfer, a screen recorder, a
|
||||
screenshot, or a malicious app with screen-capture permission. Whoever reads
|
||||
the screen gets the keys; a view-only wallet leaks only the view key
|
||||
(`spend_key` is `None`), but a spend-capable one leaks everything the file can
|
||||
spend.
|
||||
- The spend-authority warning above still applies and is now easier to reach:
|
||||
the seed that makes a wallet spend-capable can be photographed off the device.
|
||||
Treat any screen that shows a seed or a private key the way you treat the
|
||||
wallet file itself.
|
||||
|
||||
## Backup file is the identity
|
||||
|
||||
`/backup` writes the identity and Noise static secrets. Treat the file like `onionwire.db`. Restore overwrites self keys and does **not** rewrite the friends table.
|
||||
|
|
|
|||
Loading…
Reference in a new issue