wallet: optional seed-offset passphrase on import #156
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_dc9b74a6-onionwire-wallet-optional-seed-offset-pa"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Monero's optional seed-offset passphrase at wallet import.
restore_deterministic_wallet'sseed_offsetis a second spend secret mixed into the 25 words at restore time, so the same words plus a different offset open a different wallet.It is not the wallet-file passphrase: it is never sealed, never stored, never logged and never on an argv, and it travels only in the JSON-RPC body. A wrong offset is not an error - the RPC succeeds and the wallet is simply a different one, and the UI says so.
Core
Wallet::restore_wallet(filename, password, seed, seed_offset: Option<&str>)-None/empty/whitespace-only leavesseed_offsetout of the JSON entirely (neverseed_offset: ""); otherwise the ends trim and it is sent beside the existing fields, interior spaces kept. Existing local refusals (filename, file passphrase, seed) are unchanged.Node::wallet_restore(password, seed, seed_offset)passes it through and still seals only the file passphrase. In-tree test caller passesNone.SDK (additive)
import_wallet(password, seed)keeps its signature and callswallet_restore(..., None)- Android onmainstill compiles.import_wallet_with_offset(password, seed, seed_offset). Blank/whitespace is the same asimport_wallet(passesNone).uniffi-bindgenon the built cdylib:importWalletWithOffset(password, seed, seedOffset), withimportWallet(password, seed)unchanged.TUI
ImportSeed -> ImportOffset -> ImportPass, reusingPassphraseEntry(the offset is never drawn).optional. not the wallet file passphrase. blank Enter skips. a wrong offset opens a different wallet and does not error.Footerblank Enter skips Esc cancel ? help.ImportPasswith no offset and no confirm. A non-empty one goes throughPassphraseEntry::with_first; confirm footerEnter submit Esc cancel ? help.entry.close(), seed zeroized, alertoffset passphrases do not match, back to Main, no RPC.ImportPasscarries the offset through both passphrase prompts, including the mismatch path (seed and offset zeroized).ImportOffsetSeenwall (offset not saved/type SEEN ? help) instead of opening the wallet. The wallet file already exists, so Esc is a no-op there (that variant is excluded from the outer Esc arm) and onlySEENopens the wallet with status notewallet imported. Nothing is stored or deleted.Docs
docs/WALLET.md(import paragraph),docs/THREAT_MODEL.md(spend section: second spend secret, never sealed, a wrong offset is silent, not a second gate on an imported wallet),docs/TUI.mdWalletSetuprow, one addedREADME.mdsentence around theF6thenicopy. The README does not claim the phone screen has the field - that is the child card.Tests
tests/wallet.rs(request bytes are the proof this card owns):Noneand asserts the recorded body does not containseed_offsetharbor-offsetis sent as"seed_offset":"harbor-offset"with the seed still in the body" harbor offset "is sent as"harbor offset"(ends trim only)src/tui.rsaddswallet_offset_tests(7 tests): the seed step reaches the offset step with the locked footer, blank Enter skips without confirming, a non-empty offset is confirmed, a mismatch returns to Main with the locked alert and never reaches the node, the offset is not drawn, Esc does not leaveImportOffsetSeen, and onlySEENproceeds.Locked strings kept verbatim:
paste seed Enter Esc ? help,wallet imported,seed required to import a wallet,offset passphrases do not match,blank Enter skips Esc cancel ? help,offset not saved,type SEEN ? help.Verify
Root crate (
TMPDIR=/home/lancelot/.hermes/tmp/offset-pass):SDK workspace (own
CARGO_TARGET_DIRunder$TMPDIR):Not verified against a live
monero-wallet-rpc(none on PATH, none downloaded). No new crates;Cargo.toml/Cargo.lockuntouched.Scope note
src/tui.rsgained a#[cfg(test)] mod wallet_offset_tests;tests/wallet.rsanddocs/*are as listed. Noandroid/change.