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:
28
scripts/src/generate-timmy-nsec.ts
Normal file
28
scripts/src/generate-timmy-nsec.ts
Normal 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.");
|
||||
Reference in New Issue
Block a user