Mine Nostr public keys (npubs) with custom vanity prefixes.
npm installPass your desired prefixes as arguments:
node vanity-generator.js g0lf eagle putt green wedgeComma-separated works too:
node vanity-generator.js g0lf,eagle,putt,greenInvalid bech32 characters are automatically detected and skipped.
q p z r y 9 x 8 g f 2 t v d w 0 s 3 j n 5 4 k h c e 6 m u a 7 l
Characters not available: b i o 1
- 4 characters: minutes
- 5 characters: hours
- 6 characters: days
- 7+ characters: weeks
Ctrl+Cto stop and save progress- Resumes from where it left off on next run (loads saved keys)
caffeinate -i node vanity-generator.js g0lf eagle puttKeys are saved to pow-keys.enc using AES-256-CBC encryption. You should set a password via the ENCRYPTION_KEY environment variable.
openssl rand -base64 32Save the output somewhere safe (password manager, etc). You'll need it to decrypt your keys later.
read -s ENCRYPTION_KEY && export ENCRYPTION_KEYThis prompts you to type/paste your password without echoing it to the terminal or saving it in shell history. Then run:
node vanity-generator.js g0lf eagle puttWith the same ENCRYPTION_KEY still exported:
node read-keys.jsUnset the password from your shell session:
unset ENCRYPTION_KEY# 1. Generate a password (save this somewhere safe!)
openssl rand -base64 32
# 2. Set password without exposing it
read -s ENCRYPTION_KEY && export ENCRYPTION_KEY
# (paste your password, press enter)
# 3. Mine
node vanity-generator.js g0lf eagle putt green
# 4. Read results
node read-keys.js
# 5. Clean up
unset ENCRYPTION_KEYnode read-keys.jsDisplays all found keys with their npub and nsec (private key). Make sure ENCRYPTION_KEY is set to the same password used during mining.
- Never share your private keys (nsec)
- Keep secure backups of both your keys file and encryption password
- Use
read -sto avoid passwords appearing in shell history - Don't run this script where others can see the terminal output of
read-keys.js