[claude] add Timmy Nostr keygen script + operator setup docs (#48) (#58)

Co-authored-by: Claude (Opus 4.6) <claude@hermes.local>
Co-committed-by: Claude (Opus 4.6) <claude@hermes.local>
This commit was merged in pull request #58.
This commit is contained in:
2026-03-23 14:52:49 +00:00
committed by rockachopa
parent 4712619959
commit a88784ebf8
5 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/**
* generate-timmy-nsec.ts — Generate a fresh Nostr keypair for Timmy.
*
* Outputs the nsec (private) and npub (public) keys, plus a ready-to-paste
* export line for setting the TIMMY_NOSTR_NSEC environment variable.
*
* Usage:
* pnpm --filter @workspace/scripts run generate-timmy-nsec
* # or via the wrapper:
* bash scripts/generate-timmy-nsec.sh
*/
import { generateSecretKey, getPublicKey, nip19 } from "nostr-tools";
const sk = generateSecretKey();
const pubkeyHex = getPublicKey(sk);
const nsec = nip19.nsecEncode(sk);
const npub = nip19.npubEncode(pubkeyHex);
console.log("=== Timmy Nostr Identity ===");
console.log("");
console.log(` npub: ${npub}`);
console.log(` nsec: ${nsec}`);
console.log("");
console.log("Add this to your deployment environment:");
console.log("");
console.log(` export TIMMY_NOSTR_NSEC="${nsec}"`);
console.log("");
console.log("⚠ Keep the nsec secret — anyone with it can impersonate Timmy.");