From 3b32ca76b391fe4e6b186984b09e9abf1906f0da Mon Sep 17 00:00:00 2001 From: Logen <79722764+btcforplebs@users.noreply.github.com> Date: Mon, 8 Sep 2025 20:00:29 -0400 Subject: [PATCH] 0.1.1 --- README.md | 17 ----------------- main.py | 4 ++-- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5dd71f6..e841787 100644 --- a/README.md +++ b/README.md @@ -90,23 +90,6 @@ Both forms install the console‑script `nostr‑keygen` into `./.venv/bin`. > Keep your `nsec` secret in a secure, offline location. Anyone with that string can sign Nostr events or spend Nostr‑based funds. -## 🔧 How the code works (quick dive) - -```python -# main.py -import argparse, hashlib -from ecdsa import SigningKey, SECP256k1 -from bech32 import bech32_encode, convertbits - -NSEC_PREFIX, NPUB_PREFIX = "nsec", "npub" - -def _to_bech32(data: bytes, hrp: str) -> str: - five_bits = convertbits(list(data), 8, 5, True) - return bech32_encode(hrp, five_bits) - -# … (rest unchanged) … -``` - ### Why the key‑gen algorithm matters 1. **Read file in binary** – We need raw entropy; reading as text would truncate or encode the file in an unexpected way. Binary mode is the most faithful representation of the file’s content. diff --git a/main.py b/main.py index 19b5ce6..beea519 100644 --- a/main.py +++ b/main.py @@ -71,8 +71,8 @@ def main(): print(f"Error: {e}", file=sys.stderr) sys.exit(1) - print("Nsec:", nsec) - print("Npub:", npub) + print("nsec:", nsec) + print("npub:", npub) if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index 5cd8c11..db1e9b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "nostr-keygen" -version = "0.1.0" +version = "0.1.1" description = "Terminal tool to generate nostr npub/nsec from file entropy" authors = [{name = "Your Name", email = "you@example.com"}] readme = "README.md"