#!/usr/bin/env node
/**
* Generate a new Nostr keypair for the bridge
*/
import { generateSecretKey, getPublicKey, nip19 } from 'nostr-tools';
const privateKey = generateSecretKey();
const publicKey = getPublicKey(privateKey);
const nsec = nip19.nsecEncode(privateKey);
const npub = nip19.npubEncode(publicKey);
console.log('🔑 New Keypair Generated:\n');
console.log('Private Key (hex):', Buffer.from(privateKey).toString('hex'));
console.log('Public Key (hex): ', publicKey);
console.log('\nBech32 Format:');
console.log('nsec:', nsec);
console.log('npub:', npub);
console.log('\n⚠️ Save the private key in your .env file:');
console.log(`BRIDGE_PRIVATE_KEY=${Buffer.from(privateKey).toString('hex')}`);