Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b3nac/nostr_keygen
Probably the easiest way to locally generate Nostr keys. So much punk cybers in this Python script. 💻☕
https://github.com/b3nac/nostr_keygen
cyberpunk nostr nostr-protocol python python3
Last synced: 8 days ago
JSON representation
Probably the easiest way to locally generate Nostr keys. So much punk cybers in this Python script. 💻☕
- Host: GitHub
- URL: https://github.com/b3nac/nostr_keygen
- Owner: B3nac
- License: mit
- Created: 2023-11-13T23:02:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-15T03:29:14.000Z (about 1 year ago)
- Last Synced: 2024-11-09T06:09:45.353Z (2 months ago)
- Topics: cyberpunk, nostr, nostr-protocol, python, python3
- Language: Python
- Homepage:
- Size: 335 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Why
I was looking for the easiest way to generate `npub` and `nsec` keys myself locally without a ton of dependencies. There wasn't a solution out there for Python so here we are. Currently planning on building upon this example and adding various features.
### Dependencies to run nostr_keygen.py
1. On Debian/Ubuntu you might need to install
`sudo apt install build-essential automake pkg-config libtool libffi-dev`
to compile libsecp256k1.
2. Python3 and what's in the requirements.txt file.
If you have multiple Python versions or are worried about dependency conflicts I recommend using a virtual environment.
`python3 -m venv envname`
`source path/to/env/bin/activate`
else:
`pip install -r requirements.txt`
`python3 nostr_keygen.py`
### Build from source into a binary
`pyinstaller --add-data bech32:bech32 --add-binary _cffi_backend.cpython-310-x86_64-linux-gnu.so:. --onefile nostr_keygen.py`
### What nostr_keygen does currently
The script will print out the `npub` and `nsec` address that is randomly generated as well as ascii qrcodes for mobile clients.
#### In the works
- Add import private key function
- Add CLI params for specific output
- Add a way to generate a specific number of key pairs
- Add support for NIP-05 via output of nostr.json via CLI param### Support
Please send Satoshis so I can feed my plants
https://getalby.com/p/proudforest149266