feat(identity): persist a stable node identity across launches

iroh otherwise mints a fresh keypair every run, so a peer's EndpointId
changed on each launch. The friends system (in progress) identifies
people by that id — the public key already embedded in every share
code — so it has to stay stable across launches and across roles.

Add common::identity: load-or-create an ed25519 secret key stored as
hex in a 0600 ~/.config/pixelpass/identity.key, separate from
config.toml so a config reset or hand-edit can't clobber it. A
malformed file is a hard error rather than a silent regenerate, since
quietly minting a new identity would orphan every existing friend.

endpoint::bind() now feeds this key to the builder, so host and viewer
share one stable EndpointId. Verified end-to-end: two launches against
the same config dir emit byte-identical tickets; a fresh dir differs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 15:55:09 -04:00
co-authored by Claude Opus 4.8
parent 2d0143f1aa
commit 9b9328f6a9
3 changed files with 152 additions and 1 deletions
+1
View File
@@ -3,6 +3,7 @@ pub mod bandwidth;
pub mod config;
pub mod deps;
pub mod endpoint;
pub mod identity;
pub mod display;
pub mod output;
pub mod process;