67d6e26093c5002b598ca7942b6dc3fc9c51ed67
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>
Nostr Signer (formerly Nostr Connect)
A Nostr Signer Extension - sign nostr events on web-apps without giving them your keys. Forked from nos2x with a fancy UI, crafted by Karnage.
Features
Implements NIP-07 and more:
async window.nostr.getPublicKey(): string // returns your public key as hex
async window.nostr.signEvent(event): Event // returns the full event object signed
async window.nostr.getRelays(): { [url: string]: RelayPolicy } // returns a map of relays
async window.nostr.nip04.encrypt(pubkey, plaintext): string // NIP-04 encryption
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // NIP-04 decryption
async window.nostr.nip44.encrypt(pubkey, plaintext): string // NIP-44 encryption
async window.nostr.nip44.decrypt(pubkey, ciphertext): string // NIP-44 decryption
Install
Develop
git clone https://git.reya.su/reya/nostr-connect
cd nostr-connect
bun install
bun run build
Then:
- Go to
chrome://extensions - Enable "developer mode"
- Click "Load unpackaged"
- Select the
extension/output/folder
Commands
bun run dev # Development mode
bun run build # Production build
bun run lint # Lint code
bun run test # Run tests
bun run package:chrome # Package for Chrome
Languages
JavaScript
99.9%