Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 2.43 KB

File metadata and controls

52 lines (43 loc) · 2.43 KB

Changelog

0.2.1 — 2026-07-21

Security

  • Transitive cryptography CVE fix. This package pulls cryptography only through nostrkey, which previously capped cryptography<45.0 and so shipped the vulnerable 44.0.3 (four advisories: PYSEC-2026-35, PYSEC-2026-2141, GHSA-537c-gmf6-5ccf, and a related OpenSSL fix). The nostrkey floor is raised to >=0.3.5, whose lifted ceiling resolves cryptography 49.0.0. Verified against the local nostrkey 0.3.5 build: full test suite and pip-audit green on cryptography 49. No source changes.

0.2.0 — 2026-07-17

NIP-47 compliance and response-verification fixes. Minor bump because error behavior changed (see below).

Fixed

  • Encryption negotiation (critical): the client always used NIP-44 but never signalled it. Per NIP-47, requests default to NIP-04; NIP-44 requires the wallet's kind-13194 info event to advertise nip44_v2 AND an ['encryption', 'nip44_v2'] tag on each kind-23194 request. On connect the client now fetches the wallet's info event, requires nip44_v2, and adds the encryption tag to every request. Wallets that only support NIP-04 raise a clear NWCError (UNSUPPORTED_ENCRYPTION) — nostrkey has no NIP-04 implementation yet; NIP-04 fallback is a planned follow-up.
  • lookup_invoice always reported unpaid: it read a nonexistent paid field from the NIP-47 result. paid is now derived from settled_at / preimage. LookupInvoiceResponse gains settled_at, payment_hash, amount, fees_paid, and expires_at.
  • Wallet responses were trusted blindly: response events from the relay are now validated before decryption — kind 23195, authored by the wallet pubkey, ['e', <request id>] tag matching our request, and a valid BIP-340 signature over the recomputed event id (via nostrkey.events.verify_event). Invalid/forged/replayed events are skipped and the client keeps waiting for the genuine response until the timeout.
  • NWCError is now an Exception subclass (it was a plain dataclass, so raise NWCError(...) crashed with TypeError). It is exported from the package root.
  • Response decryption failures now raise a descriptive NWCError (DECRYPTION_FAILED) instead of a raw ValueError.

Changed

  • Response-wait timeout (already configurable via NWCClient(uri, timeout=...)) now raises NWCError with code TIMEOUT instead of TimeoutError.

0.1.2

Initial published release.