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:
authorfiatjaf <fiatjaf@gmail.com>2022-12-18 06:35:30 -0300
committerfiatjaf <fiatjaf@gmail.com>2022-12-18 06:35:30 -0300
commit745297e8c4cbb742f9252cfdd654844d1cad4040 (patch)
tree6413b94e69247bd539ead4d39ef12add19a7e095 /07.md
parentc840d75ce023f64918f57a519417e39f57f0f53b (diff)
add blockcore to nip-07 and mark extra methods as optional.
Diffstat (limited to '07.md')
-rw-r--r--07.md11
1 files changed, 8 insertions, 3 deletions
diff --git a/07.md b/07.md
index 644b23c..0bd3de6 100644
--- a/07.md
+++ b/07.md
@@ -13,12 +13,17 @@ That object must define the following methods:
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 and returns it with the `sig` 15async window.nostr.signEvent(event: Event): Event // takes an event object and returns it with the `sig`
16async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a map of relay urls to relay policies 16```
17async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext+iv as specified in nip-04 17
18async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext+iv as specified in nip-04 18Aside from these two basic above, the following functions can also be implemented optionally:
19```
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
22async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04
19``` 23```
20 24
21### Implementation 25### Implementation
22 26
23- [nos2x](https://github.com/fiatjaf/nos2x) is available as a Chromium extension that provides such capabilities. 27- [nos2x](https://github.com/fiatjaf/nos2x) is available as a Chromium extension that provides such capabilities.
24- [Alby](https://getalby.com) is a Bitcoin extension that also provides a compatible `window.nostr`. 28- [Alby](https://getalby.com) is a Bitcoin extension that also provides a compatible `window.nostr`.
29- [Blockcore](https://www.blockcore.net/wallet)