From cee34c47e5a5b4995126f74528ac649ab1ae8aaf Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 21 Oct 2026 17:14:26 +0300 Subject: [PATCH] hermes: name+password signup, Settings panel, seed backup gated by password MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Third signin option on the panel: enter a bare name + password, Hermes mints a 12-word BIP-39 mnemonic locally, derives the Nostr key, password-wraps the mnemonic for later Settings → Backup, and persists the sealed sk the same way the other paths do. Save-forever still handles routine signin — the password is only used to reveal the seed phrase and only from Settings. - main.js: hermesWrapMnemonic / hermesUnwrapMnemonic via scrypt (N=2^15) + aes-256-gcm. Wrapped blob at /hermes-identity/mnemonic.wrapped.json, plaintext JSON — the wrap itself is the protection. On sign-out the blob is nuked alongside the sealed sk. - main.js: init() now takes { create: true, handle, password }. Handle is validated (1-32 chars, kebab-friendly) and stored as `.erm` so a mainnet free-manifest reservation lands on the same canonical form later. Mnemonic-path init optionally takes a password too — "promote this seed-phrase session to a password-protected backup" in one step. - main.js: new _hermesAPI.getBackup({password}) and .hasBackup. status() now returns handle + source so the panel can label the restored session. - panel.html: "Create a new account" button on signin reveals handle + password + confirm. ⋯ menu adds Settings… showing account info, display mode picker (hermes:alice / alice.erm / alice@hermes.tel — persisted via silentmode.storage), and the gated seed-phrase reveal. Reveal lays words out 12-across with 1-indexed numbering so a user copying to paper doesn't miscount. Backup section hides for vault / mnemonic sessions. Still off-chain only — handles created this way are local labels until the mainnet mint of the free manifest lets us register them against the `hermes.erm` signed-records store (see [[hermes-name-scheme-plan]]). --- bundled-addons/hermes/index.js | 6 +- bundled-addons/hermes/panel.html | 143 +++++++++++++++++++++++++++++-- main.js | 140 +++++++++++++++++++++++++++--- 3 files changed, 269 insertions(+), 20 deletions(-) diff --git a/bundled-addons/hermes/index.js b/bundled-addons/hermes/index.js index c8c1629e..80e33e61 100644 --- a/bundled-addons/hermes/index.js +++ b/bundled-addons/hermes/index.js @@ -18,9 +18,9 @@ const { ipcMain } = require("electron"); const PANEL_METHODS = [ - "status", "canUseVault", "close", "init", "signOut", "inbox", "send", - "markThreadRead", "contactsList", "contactsAdd", "contactsUpdate", - "contactsRemove", + "status", "canUseVault", "close", "init", "signOut", "getBackup", "hasBackup", + "inbox", "send", "markThreadRead", + "contactsList", "contactsAdd", "contactsUpdate", "contactsRemove", ]; module.exports = { diff --git a/bundled-addons/hermes/panel.html b/bundled-addons/hermes/panel.html index f931a86b..976a9a90 100644 --- a/bundled-addons/hermes/panel.html +++ b/bundled-addons/hermes/panel.html @@ -179,10 +179,43 @@ -