feat: pwd, mnemonic, profile scaffolding - #73
kassandraoftroy wants to merge 8 commits into
Conversation
486f5fe to
b511fcc
Compare
|
Merged #74 into here (changed PR name to match). Additional notes: Important Design DecisionsProfiles are what users name. Mnemonics are numbered background seeds (mnemonic 0, mnemonic 1). No edw mnemonic commands, API purposefully references named profiles over mnemonics. First unlock of a new instance generates a 12-word seed, creates mnemonic 0 + profile 0, and prints the phrase once. User can rename this profile but it starts with name "default." The generate / import / add commands all create exactly one profile at --index (default 0). Anti-patterns. Importing a phrase that is already stored errors (use profile add instead). Creating an existing (mnemonic, index) pair errors. Profile display names must be unique. Storage: mnemonic records (storage index + phrase) and profile records (mnemonic_index, profile_index, optional name) plus a pointer at profile:{m}:{p}. profile_index is BIP44 account m/44'/60'/'/…. HD keys are not persisted yet. CLIprofile generate creates a new mnemonic and initializes a profile on the desired --index. profile import imports a mnemonic and initializes a profile on the desired --index. profile add adds a new profile index on an already existing/stored mnemonic. |
Summary
mainnet,sepolia, andlocalis its own wallet instance:{data-dir}/{network}/is one encrypted store, one passphrase, and that network’s profiles and settings. There is no need for a multi-network or cross-network list since the wallet is meant to be a single network construction (sepolia and local are just there to be test environments)edw unlock --network <name>(defaultmainnet) opens that instance. Later commands inherit it from the session. Unlocking another network replaces the session (only one network is unlocked at a time).gathernever auto-creates or auto-unlocks.defaultnetworkConfig with a public/default RPC endpoint. You can add more named configs on the same chain ID.$XDG_RUNTIME_DIR/edw/session, else$TMPDIR//tmp), not keyed by ttyctime(that brokejust run/cargo runon macOS). Store errors are not swallowed; “Unlocked” only prints after a successful write. Paths are canonicalized so/varvs/private/varstill match.