diff options
Diffstat (limited to '07.md')
| -rw-r--r-- | 07.md | 17 |
1 files changed, 7 insertions, 10 deletions
| @@ -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 | ||
| 9 | The `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. | 9 | The `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 | ``` |
| 14 | async window.nostr.getPublicKey(): string // returns a public key as hex | 14 | async window.nostr.getPublicKey(): string // returns a public key as hex |
| 15 | async window.nostr.signEvent(event: Event): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it | 15 | async 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 | ||
| 18 | Aside from these two basic above, the following functions can also be implemented optionally: | 18 | Aside from these two basic above, the following functions can also be implemented optionally: |
| 19 | ``` | 19 | ``` |
| 20 | async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies | 20 | async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay urls to relay policies |
| 21 | async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 | 21 | async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 (deprecated) |
| 22 | async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 | 22 | async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 (deprecated) |
| 23 | async window.nostr.nip44.encrypt(pubkey, plaintext): string // returns ciphertext as specified in nip-44 | ||
| 24 | async 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) | 33 | See 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) | ||