1 Commits
Author SHA1 Message Date
chad.curtisandreya 67d6e26093 fix: convert the stored hex key to bytes before nip44 getConversationKey (#1)
Since 1.0.0 every `window.nostr.nip44.encrypt`/`decrypt` call fails with `expected Uint8Array, got type=string`, which breaks NIP-17 DMs and anything else using NIP-44 on sites that use the extension.

`private_key` is stored as hex, and nostr-tools 2.23 (noble-curves v2) no longer accepts hex strings in `getConversationKey`. `signEvent` and `getPublicKey` already convert with `hexToBytes(sk)`; this does the same in `getSharedSecret`.

Also adds NIP-44 tests (hex key rejected, converted key round-trips with a peer) in place of the note saying NIP-44 was only covered by the build. `vitest run` passes (50 tests), biome is clean, and a `build.js prod firefox` bundle encrypts where the published 1.0.0 throws.

Reviewed-on: #1
Co-authored-by: Chad Curtis <chad@chadwick.site>
2026-10-16 00:37:09 +00:00