Skip to content

feat: pwd, mnemonic, profile scaffolding - #73

Open
kassandraoftroy wants to merge 8 commits into
masterfrom
feat/simplify-networks
Open

kassandraoftroy wants to merge 8 commits into
masterfrom
feat/simplify-networks

Conversation

@kassandraoftroy

@kassandraoftroy kassandraoftroy commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Each of mainnet, sepolia, and local is 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> (default mainnet) opens that instance. Later commands inherit it from the session. Unlocking another network replaces the session (only one network is unlocked at a time). gather never auto-creates or auto-unlocks.
  • First unlock seeds an active default networkConfig with a public/default RPC endpoint. You can add more named configs on the same chain ID.
  • Session file is process-wide ($XDG_RUNTIME_DIR/edw/session, else $TMPDIR//tmp), not keyed by tty ctime (that broke just run / cargo run on macOS). Store errors are not swallowed; “Unlocked” only prints after a successful write. Paths are canonicalized so /var vs /private/var still match.

@kassandraoftroy
kassandraoftroy marked this pull request as ready for review September 12, 2026 12:23
Comment thread spec/02-backlog.md Outdated
@kassandraoftroy

Copy link
Copy Markdown
Collaborator Author

Merged #74 into here (changed PR name to match). Additional notes:

Important Design Decisions

Profiles 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.

CLI

profile 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.

@kassandraoftroy kassandraoftroy changed the title feat: one pwd and wallet instance per network feat: pwd, mnemonic, profile scaffolding Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants