wallet: create/import in-app (no key paste on create) + opt-in spend
/ 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:
parent
7ad3679b51
commit
cf0a517cd2
12 changed files with 758 additions and 48 deletions
|
|
@ -575,6 +575,30 @@ impl Wire {
|
|||
.await
|
||||
.map_err(WireError::new)
|
||||
}
|
||||
|
||||
/// Create a new spend-capable wallet. Returns the 25-word seed once so the
|
||||
/// UI can show a backup screen. The user does not paste a key on this path.
|
||||
/// Requires `ONIONWIRE_WALLET_RPC` pointed at a `--wallet-dir` RPC.
|
||||
pub async fn create_wallet(&self, password: String) -> WResult<String> {
|
||||
self.node()?
|
||||
.wallet_create(&password)
|
||||
.await
|
||||
.map_err(WireError::new)
|
||||
}
|
||||
|
||||
/// Import a wallet from an existing 25-word seed. This is the only path
|
||||
/// that takes a user-supplied secret.
|
||||
pub async fn import_wallet(&self, password: String, seed: String) -> WResult<()> {
|
||||
self.node()?
|
||||
.wallet_restore(&password, &seed)
|
||||
.await
|
||||
.map_err(WireError::new)
|
||||
}
|
||||
|
||||
/// Spend-authority warning shown before create. Not a tooltip.
|
||||
pub fn spend_authority_warning(&self) -> String {
|
||||
onionwire::wallet::SPEND_AUTHORITY_WARNING.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
fn from_core_flush(o: CoreFlushOutcome) -> FlushOutcome {
|
||||
|
|
|
|||
Loading…
Reference in a new issue