Hermes: wire NIP-17 messaging into Theseus, provision chipnet hermes.bch
- Hermes/proof/: standalone keystone — BIP-39→Nostr, NIP-17 wrap/unwrap,
name-addressed send/receive verified end-to-end via public relay
- Argus/src/lib/hermes-derive.js: HKDF(silentmode/messenger/0) using libauth
so the registrar can compute np without pulling nostr-tools into Argus
- Argus/src/register-hermes-chipnet.mjs: idempotent REG/UPD script; publishes
np (Nostr pubkey) and nr (relay) records for a chipnet name
- TheseusNavigator/lib/hermes.js: same derivation + wrap/unwrap + record
parsing, canonical for Theseus; guarded by lib/package.json type:module
- TheseusNavigator/messages.html + messages-preload.js: Messages panel UI
(identity from mnemonic, live inbox, compose by .bch name), .bch suffix
stripped from displayed names
- TheseusNavigator/main.js: HERMES_MOD + loadHermesLib next to VAULT_MOD;
ipc handlers (hermes-status/init/close/inbox/send/open), per-relay
subscription with auto-reconnect, status pushed on WS open/close,
reverse-resolve pk -> .bch name via cached BNS index, Ctrl+Shift+M shortcut
via web-contents-created (works from any tab)
- Chipnet hermes.bch registered with np=f2c92519...67f4 nr=wss://nos.lol
(txid 7fc6de4544c13b782f163fdb892ea6749785886d05a336282fa659d722c7e92b);
end-to-end verified in Theseus
2026-08-18 20:14:43 +02:00
|
|
|
// Renderer bridge for the Messages panel.
|
|
|
|
|
// All hermes-* IPC returns { ok, ... } | { ok: false, err }.
|
|
|
|
|
const { contextBridge, ipcRenderer } = require("electron");
|
|
|
|
|
|
|
|
|
|
contextBridge.exposeInMainWorld("hermes", {
|
2026-08-19 00:38:52 +02:00
|
|
|
status: () => ipcRenderer.invoke("hermes-status"),
|
|
|
|
|
canUseVault: () => ipcRenderer.invoke("hermes-can-use-vault"),
|
|
|
|
|
init: (mnemonic) => ipcRenderer.invoke("hermes-init", { mnemonic }),
|
|
|
|
|
initFromVault: () => ipcRenderer.invoke("hermes-init", { useVault: true }),
|
|
|
|
|
close: () => ipcRenderer.invoke("hermes-close"),
|
Hermes: wire NIP-17 messaging into Theseus, provision chipnet hermes.bch
- Hermes/proof/: standalone keystone — BIP-39→Nostr, NIP-17 wrap/unwrap,
name-addressed send/receive verified end-to-end via public relay
- Argus/src/lib/hermes-derive.js: HKDF(silentmode/messenger/0) using libauth
so the registrar can compute np without pulling nostr-tools into Argus
- Argus/src/register-hermes-chipnet.mjs: idempotent REG/UPD script; publishes
np (Nostr pubkey) and nr (relay) records for a chipnet name
- TheseusNavigator/lib/hermes.js: same derivation + wrap/unwrap + record
parsing, canonical for Theseus; guarded by lib/package.json type:module
- TheseusNavigator/messages.html + messages-preload.js: Messages panel UI
(identity from mnemonic, live inbox, compose by .bch name), .bch suffix
stripped from displayed names
- TheseusNavigator/main.js: HERMES_MOD + loadHermesLib next to VAULT_MOD;
ipc handlers (hermes-status/init/close/inbox/send/open), per-relay
subscription with auto-reconnect, status pushed on WS open/close,
reverse-resolve pk -> .bch name via cached BNS index, Ctrl+Shift+M shortcut
via web-contents-created (works from any tab)
- Chipnet hermes.bch registered with np=f2c92519...67f4 nr=wss://nos.lol
(txid 7fc6de4544c13b782f163fdb892ea6749785886d05a336282fa659d722c7e92b);
end-to-end verified in Theseus
2026-08-18 20:14:43 +02:00
|
|
|
inbox: () => ipcRenderer.invoke("hermes-inbox"),
|
|
|
|
|
send: (to, text) => ipcRenderer.invoke("hermes-send", { to, text }),
|
|
|
|
|
// Server-push: new decrypted message arrived. Callback gets { senderPkHex, senderName, text, createdAt }.
|
|
|
|
|
onMessage: (cb) => {
|
|
|
|
|
const wrapped = (_e, msg) => cb(msg);
|
|
|
|
|
ipcRenderer.on("hermes-message", wrapped);
|
|
|
|
|
return () => ipcRenderer.removeListener("hermes-message", wrapped);
|
|
|
|
|
},
|
|
|
|
|
// Server-push: relay connection state changed. Callback gets { relaysConnected, relaysTotal }.
|
|
|
|
|
onStatus: (cb) => {
|
|
|
|
|
const wrapped = (_e, s) => cb(s);
|
|
|
|
|
ipcRenderer.on("hermes-status-update", wrapped);
|
|
|
|
|
return () => ipcRenderer.removeListener("hermes-status-update", wrapped);
|
|
|
|
|
},
|
|
|
|
|
});
|