# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [0.3.0] - 2026-07-17 ### Fixed - **Event signing now uses BIP-340 schnorr (NIP-01), not ECDSA.** `KeyManager.sign` signs the raw 32-byte event id with `schnorr.sign` (previously it ECDSA-signed a sha256 of the id's hex string), and `KeyManager.verify` uses `schnorr.verify`. Events produced by previous versions were rejected by every validating relay, and genuine schnorr-signed events from the network failed verification. - **Public keys are now 32-byte x-only (64 hex chars), not 33-byte compressed.** `generateKeyPair`, `getPublicKey`, and `KeyManager.getPublicKey` all return `schnorr.getPublicKey` output. This fixes the event-id preimage (canonical NIP-01 serialization), makes `hexToNpub` produce valid npubs, and makes key output pass the library's own `Validation.isValidPubkey`. - **Inbound relay messages are now actually forwarded.** The relay config node parses raw NIP-01 wire frames (`["EVENT", subId, {...}]`, `EOSE`, `NOTICE`, `OK`) with `parseRelayMessage` and emits the normalized `{ type, subscriptionId, event }` shape the filter nodes expect. Previously it emitted raw JSON arrays whose `.type`/`.event` were `undefined`, so `nostr-filter` and `nostr-npub-filter` forwarded zero events in production. - **`EventBuilder.validateEvent` no longer rejects legal events.** Field presence is now checked by type, not truthiness: `kind` is valid when it is an integer `>= 0` (so kind 0 metadata/profile events pass) and `content` is valid whenever it is a string (so legal empty-string content — reactions, deletes, contact lists — passes). Previously `!event.kind || !event.content` silently dropped these valid events. - **NIP-04 encrypted direct messages are now really encrypted.** `NIP04.encrypt` /`NIP04.decrypt` previously shipped a stub — encrypt returned `sha256(sharedX)` and decrypt returned the literal string `"decrypted text"`. They now delegate to the canonical, red-teamed `nostr-crypto-utils` `encryptMessage`/ `decryptMessage` (AES-256-CBC over the ECDH shared secret), producing real `base64(ct)?iv=base64(iv)` payloads that round-trip. ### Changed - Bumped `nostr-crypto-utils` to `^0.8.0` (canonical NIP-04 `encryptMessage`/ `decryptMessage` API) and `nostr-websocket-utils` to `^0.5.0`. - **BREAKING:** pubkeys returned by this library changed format (66 → 64 hex chars); npubs generated by previous versions were malformed and should be regenerated. Downstream consumers of the `nostr-relay` node now receive normalized `{ type, subscriptionId, event }` payloads instead of raw arrays. - The `nostr-websocket-utils` test mock now mirrors the real client contract: incoming traffic is delivered as raw JSON strings via `options.onMessage` (the old object-shaped mock hid the wire-format bug). Node tests now drive the real node implementations instead of test-helper reimplementations. ### Added - Crypto regression tests: createEvent → validateEvent round-trip with real schnorr, x-only pubkey length/validator checks, npub round-trip, and verification of a fixture signed by an independent implementation (nostr-crypto-utils). - End-to-end wire-format tests: a real `["EVENT", ...]` frame pushed through the config node's `onMessage` is forwarded by `nostr-filter`, `nostr-npub-filter`, and `nostr-relay`; garbage and non-EVENT frames are ignored without crashing. - NIP-04 round-trip tests: `encrypt → decrypt` recovers the plaintext (including empty and unicode content), and `createEncryptedEvent → decryptEvent` reads back a real kind-4 DM. - `validateEvent` tests: accepts a signed kind-0 event and a signed empty-string content event; rejects non-integer/negative `kind` and non-string `content`. ## [0.2.1] - 2026-03-06 ### Fixed - Added type assertion for Node-RED `registerType` compatibility ## [0.2.0] - 2026-03-06 ### Changed - **Noble 2.0 migration** via nostr-websocket-utils and nostr-crypto-utils upgrades - **nostr-tools 2.x:** Upgraded from 1.x - **Vitest 4:** Upgraded test framework - Dropped Node.js 16 support ### Fixed - Relay URL validation and custom filter field allowlist - Read private key from Node-RED credential store, not config - Replaced hardcoded private key with ephemeral key generation - Updated nostr-websocket-utils to fix CJS module resolution ### Security - Multiple security patches (0.1.4, 0.1.5, 0.1.6): credential handling and key management hardening ## [0.1.1] - 2025-02-19 ### Changed - Updated dependencies and migrated to nostr-websocket-utils 0.3.x API - Fixed all ESLint errors - Fixed postbuild script to handle missing icons directory gracefully ### Added - Improved GitHub Actions and documentation - Comprehensive NIPs support table in README - Comprehensive test suite and project metadata ## [0.1.0] - 2025-01-10 ### Added - Initial release - Nostr Relay Config node for managing relay connections - Nostr Filter node for event filtering by kind, author, and tags - Nostr NPUB Filter node for monitoring specific NPUBs - Nostr Relay node for direct relay interaction - Docker support with docker-compose configuration - TypeScript support with full type definitions - Automatic reconnection handling via nostr-websocket-utils - Secure credential management for private keys - Example flows for event monitoring and NPUB tracking - Community files and GitHub templates