chore(deps): bump nostr-tools to ^2.23.3 to match lnbits #63

Merged
padreug merged 1 commit from bump-nostr-tools into dev 2026-05-23 13:09:41 +00:00
Owner

Summary

Align nostr-tools with the version lnbits pins (^2.23.3, resolves to 2.23.5 at install time, up from 2.15.0). Same library version across both ends eases the path to Nostr-native transport once aiolabs/lnbits PR #4 lands.

Breaking surface in webapp code

Only one: SimplePool.subscribeMany() dropped the Filter[] form. A single subscription now takes one Filter, and multi-filter REQs go through subscribeMap() (commit c9ff51e upstream).

Fix: new private RelayHub.poolSubscribe(relays, filters, params) adapter routes single-filter through pool.subscribe() and multi-filter through pool.subscribeMap() (cartesian over relays × filters so each relay still receives every filter in one REQ). The external RelayHub.subscribe(config: SubscriptionConfig) API is unchanged — no downstream module touches.

Other 2.15 → 2.23 surface that doesn't affect us

  • Event is now a type alias for NostrEvent; no interface ... extends Event usage in the codebase, so harmless.
  • nip04, nip19, nip59, finalizeEvent, EventTemplate, Filter, getPublicKey, generateSecretKey — signatures stable.
  • New opt-in enablePing() / enableReconnect() / AbortSignal / maxWaitForConnection — left off. RelayHub already has its own VisibilityService-driven reconnect; mixing the two is a follow-up worth doing carefully.

Peer-dep blast radius

@noble/{ciphers,curves,hashes} and @scure/* step from 1.x to 2.x with this bump. pnpm why @noble/hashes shows nostr-tools is the only consumer in the lockfile — single 2.0.1 resolution, no duplicate-version split.

Test plan

  • pnpm install clean
  • pnpm run build (vue-tsc + Vite) green
  • pnpm why @noble/hashes shows single 2.x version
  • pnpm run dev boots; curl localhost:5173/ → 200
  • Feed module: kind-1 stream populates (the multi-filter REQ path — most likely failure mode of the subscribeMany refactor)
  • Chat: send + receive an encrypted DM (exercises nip04.encrypt/decrypt and finalizeEvent with Uint8Array privkey)
  • Market: load a stall page (exercises nip59.unwrapEvent)
  • Activities: create / RSVP to an event (NIP-52 kind-31923/31925 signing)
  • Reactions: like a feed post (kind-7 signing)
  • Browser devtools: no nostr-tools-originated errors

Don't merge until browser smoke passes on aio-demo per the webapp release flow (dev → staging → main).

Follow-ups (separate PRs)

  • Adopt pool.enableReconnect() and retire RelayHub's manual reconnect path if the two prove equivalent.
  • Consolidate the six private hexToUint8Array() re-implementations across modules onto src/lib/utils/crypto.ts.
## Summary Align `nostr-tools` with the version lnbits pins (`^2.23.3`, resolves to `2.23.5` at install time, up from `2.15.0`). Same library version across both ends eases the path to Nostr-native transport once `aiolabs/lnbits` PR #4 lands. ## Breaking surface in webapp code Only one: `SimplePool.subscribeMany()` dropped the `Filter[]` form. A single subscription now takes one `Filter`, and multi-filter REQs go through `subscribeMap()` (commit [c9ff51e](https://github.com/nbd-wtf/nostr-tools/commit/c9ff51e) upstream). **Fix:** new private `RelayHub.poolSubscribe(relays, filters, params)` adapter routes single-filter through `pool.subscribe()` and multi-filter through `pool.subscribeMap()` (cartesian over relays × filters so each relay still receives every filter in one REQ). The external `RelayHub.subscribe(config: SubscriptionConfig)` API is unchanged — no downstream module touches. ## Other 2.15 → 2.23 surface that *doesn't* affect us - `Event` is now a `type` alias for `NostrEvent`; no `interface ... extends Event` usage in the codebase, so harmless. - `nip04`, `nip19`, `nip59`, `finalizeEvent`, `EventTemplate`, `Filter`, `getPublicKey`, `generateSecretKey` — signatures stable. - New opt-in `enablePing()` / `enableReconnect()` / `AbortSignal` / `maxWaitForConnection` — left off. RelayHub already has its own VisibilityService-driven reconnect; mixing the two is a follow-up worth doing carefully. ## Peer-dep blast radius `@noble/{ciphers,curves,hashes}` and `@scure/*` step from 1.x to 2.x with this bump. `pnpm why @noble/hashes` shows `nostr-tools` is the only consumer in the lockfile — single 2.0.1 resolution, no duplicate-version split. ## Test plan - [x] `pnpm install` clean - [x] `pnpm run build` (vue-tsc + Vite) green - [x] `pnpm why @noble/hashes` shows single 2.x version - [x] `pnpm run dev` boots; `curl localhost:5173/` → 200 - [ ] Feed module: kind-1 stream populates (the multi-filter REQ path — most likely failure mode of the `subscribeMany` refactor) - [ ] Chat: send + receive an encrypted DM (exercises `nip04.encrypt/decrypt` and `finalizeEvent` with Uint8Array privkey) - [x] Market: load a stall page (exercises `nip59.unwrapEvent`) - [x] Activities: create / RSVP to an event (NIP-52 kind-31923/31925 signing) - [ ] Reactions: like a feed post (kind-7 signing) - [x] Browser devtools: no nostr-tools-originated errors Don't merge until browser smoke passes on `aio-demo` per the webapp release flow (dev → staging → main). ## Follow-ups (separate PRs) - Adopt `pool.enableReconnect()` and retire RelayHub's manual reconnect path if the two prove equivalent. - Consolidate the six private `hexToUint8Array()` re-implementations across modules onto `src/lib/utils/crypto.ts`.
The only breaking surface in webapp code is SimplePool.subscribeMany —
2.23 dropped the Filter[] form: a single subscription now takes one
Filter, and multi-filter REQs go through subscribeMap. RelayHub gets
an internal poolSubscribe() adapter that routes single-filter to
pool.subscribe() and multi-filter to pool.subscribeMap(), preserving
the external RelayHub.subscribe() API so no downstream modules change.

Peer-dep bump (@noble/* and @scure/* → 2.x) is contained: nostr-tools
is the only consumer in the lockfile, so the major version shift
doesn't conflict with anything else.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
Owner

can't test out feed module yet cause it's not present in the webapp at the moment. not going to bother with the chat since i have to update it to NIP-17 anyway

can't test out feed module yet cause it's not present in the webapp at the moment. not going to bother with the chat since i have to update it to NIP-17 anyway
padreug deleted branch bump-nostr-tools 2026-05-23 13:09:41 +00:00
Sign in to join this conversation.
No description provided.