refactor: replace NIP-04 + custom crypto with nostr-sdk + NIP-44 #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nazim/nostr-cli:refactor/nostr-sdk-nip44"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Replaces all custom cryptography and NIP-04 encryption with
nostr-sdk(rust-nostr Python bindings) and NIP-44.Why
websockets+cryptography+secp256k1+bech32all replaced bynostr-sdknostr-sdkhandles key management, event signing, relay connections, and encryption — no reason to reimplement any of itChanges
Encryption
Dependencies
websockets,cryptography,secp256k1,bech32nostr-sdk(single dependency, Rust-backed)Key management
generate_keypair()→Keys.generate()load_identity()→Keys.parse()(handles nsec, hex automatically)Relay communication
nostr-sdk.Client(connection pooling, auto-reconnect)EventBuilder.sign_with_keys()Unchanged
Tests
28/28 passing — updated for nostr-sdk API, added NIP-44 roundtrip, NIP-04 backwards compat, and wrong-key-fails tests.
🔍 Recherche: Python Nostr Libraries — Stand der Dinge
k9ert hat angemerkt, dass die Python-Nostr-Landschaft bescheiden ist. Hier der Überblick:
Pure Python Libraries (alle problematisch)
python-nostrpynostrnostr-protocolRust + Python Bindings
nostr-sdknostr-sdkist der klare Gewinner — und genau das was dieser PR nutzt:Zum PR
Dieser PR geht in die richtige Richtung:
nostr-sdkals single dependency, NIP-44 als Default mit NIP-04 Fallback, sauberes Aufräumen der custom Crypto.Frage an @noopsec: Du hattest im Chat auch Verbesserungen vorgeschlagen (Class-Based Architecture, NostrMessage Dataclass, Multi-Relay parallel,
receiveOne-Shot Command). Sollen wir die in diesen PR reinmergen oder als Follow-Up PR?Aus meiner Sicht wäre der einfachste Weg:
So haben wir eine saubere Git-History und keine Merge-Konflikte.
Was meint ihr @k9ert @noopsec?