Skip to content

Lightweight Python Skript to Create Nostr identitys and more

Notifications You must be signed in to change notification settings

Buho-Ecosystem/Nostr_Key_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Nostr_Key_Generator

A lightweight Python script to create and manage Nostr identities — no libraries, no clipboard, no external dependencies.

grafik

What this script does

  • ✅ Create a new Nostr identity (nsec, npub, private/public keys)
  • ✅ Show your keys in multiple formats
  • ✅ Convert between formats (npub, nsec, hex)
  • ✅ Export to JSON (with safe permissions on Linux/macOS)
  • ❌ No clipboard
  • ❌ No external libraries

How to use

Recommended: Interactive mode

python nostr_identity_generator.py

You'll get a clean menu with all options explained.

Optional: Non-interactive mode

Generate new key instantly:

python nostr_identity_generator.py --new

Import existing identity from nsec:

python nostr_identity_generator.py --import nsec1yourkeyhere

Import from raw 64-character private key:

python nostr_identity_generator.py --import abc123...yourprivkey

Export result to JSON:

python nostr_identity_generator.py --new --out mykeys.json

Example Output

Your Nostr Identity

npub (public):         npub1abcd...
pubkey (hex, x-only):  7f9d4c...
pubkey (compressed):   02c3f1...
nsec (PRIVATE):        [hidden]
privkey (hex):         [hidden]

Format Converter

You can also convert keys between:

  • npub → public key hex
  • nsec → private key hex
  • privkey hexnsec, npub, pubkey (compressed)
  • pubkey hex (x-only)npub

Useful if you're working across different Nostr tools.

Security Notes

  • Never share your nsec or private key. Anyone who has it can impersonate you.
  • JSON export is written with restricted file permissions (chmod 600) on supported systems.
  • This script is for identity generation and format conversion only — not for message signing or relays.
  • Bech32 encoding/decoding follows NIP-19

License

MIT

About

Lightweight Python Skript to Create Nostr identitys and more

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages