Skip to content

Commit 19b545d

Browse files
committed
fix(provider): stop advertising unimplemented nip04 and getRelays
window.nostr.nip04 delegated to a background handler that throws "not implemented", and getRelays returned {}. Feature-detection (window.nostr.nip04 / .getRelays) was therefore lying to callers. NIP-04 is a distinct, deprecated scheme we do not implement (Podkey ships NIP-44 v2 only), and Podkey holds no relay list, so the honest signal is the absence of both methods. The dead background cases are removed alongside the NIP-98 work. Co-Authored-By: jjohare <github@thedreamlab.uk>
1 parent adf1912 commit 19b545d

1 file changed

Lines changed: 4 additions & 31 deletions

File tree

src/nostr-provider.js

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,10 @@
5757
});
5858
},
5959

60-
/**
61-
* Get relays (optional NIP-07 extension)
62-
* @returns {Promise<object>} Relay configuration
63-
*/
64-
async getRelays () {
65-
return sendMessageToExtension({ type: 'GET_RELAYS' });
66-
},
67-
68-
/**
69-
* Encrypt (NIP-04)
70-
* @param {string} pubkey - Recipient public key
71-
* @param {string} plaintext - Message to encrypt
72-
* @returns {Promise<string>} Encrypted message
73-
*/
74-
nip04: {
75-
encrypt: async (pubkey, plaintext) => {
76-
return sendMessageToExtension({
77-
type: 'NIP04_ENCRYPT',
78-
pubkey,
79-
plaintext
80-
});
81-
},
82-
83-
decrypt: async (pubkey, ciphertext) => {
84-
return sendMessageToExtension({
85-
type: 'NIP04_DECRYPT',
86-
pubkey,
87-
ciphertext
88-
});
89-
}
90-
},
60+
// NIP-04 is intentionally not provided: it is a deprecated, unauthenticated
61+
// scheme and Podkey only ships NIP-44 (v2). Advertising window.nostr.nip04
62+
// would make feature-detection lie. NIP-07 getRelays is also omitted because
63+
// Podkey holds no relay list — a missing method is the honest signal.
9164

9265
/**
9366
* Encrypt / decrypt (NIP-44 v2)

0 commit comments

Comments
 (0)