upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/07.md
diff options
context:
space:
mode:
Diffstat (limited to '07.md')
-rw-r--r--07.md17
1 files changed, 7 insertions, 10 deletions
diff --git a/07.md b/07.md
index d733d01..9f836d8 100644
--- a/07.md
+++ b/07.md
@@ -4,7 +4,7 @@ NIP-07
4`window.nostr` capability for web browsers 4`window.nostr` capability for web browsers
5------------------------------------------ 5------------------------------------------
6 6
7`draft` `optional` `author:fiatjaf` 7`draft` `optional`
8 8
9The `window.nostr` object may be made available by web browsers or extensions and websites or web-apps may make use of it after checking its availability. 9The `window.nostr` object may be made available by web browsers or extensions and websites or web-apps may make use of it after checking its availability.
10 10
@@ -12,14 +12,16 @@ That object must define the following methods:
12 12
13``` 13```
14async window.nostr.getPublicKey(): string // returns a public key as hex 14async window.nostr.getPublicKey(): string // returns a public key as hex
15async window.nostr.signEvent(event: Event): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it 15async window.nostr.signEvent(event: { created_at: number, kind: number, tags: string[][], content: string }): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it
16``` 16```
17 17
18Aside from these two basic above, the following functions can also be implemented optionally: 18Aside from these two basic above, the following functions can also be implemented optionally:
19``` 19```
20async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies 20async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies
21async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 21async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 (deprecated)
22async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 22async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 (deprecated)
23async window.nostr.nip44.encrypt(pubkey, plaintext): string // returns ciphertext as specified in nip-44
24async window.nostr.nip44.decrypt(pubkey, ciphertext): string // takes ciphertext as specified in nip-44
23``` 25```
24 26
25### Recommendation to Extension Authors 27### Recommendation to Extension Authors
@@ -28,9 +30,4 @@ To make sure that the `window.nostr` is available to nostr clients on page load,
28 30
29### Implementation 31### Implementation
30 32
31- [horse](https://github.com/fiatjaf/horse) (Chrome and derivatives) 33See https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions.
32- [nos2x](https://github.com/fiatjaf/nos2x) (Chrome and derivatives)
33- [Alby](https://getalby.com) (Chrome and derivatives, Firefox, Safari)
34- [Blockcore](https://www.blockcore.net/wallet) (Chrome and derivatives)
35- [nos2x-fox](https://diegogurpegui.com/nos2x-fox/) (Firefox)
36- [Flamingo](https://www.getflamingo.org/) (Chrome and derivatives)