-
Notifications
You must be signed in to change notification settings - Fork 1
Extensions
NIP-07 is an optional draft that specifies the window.nostr
object for use in web browsers or extensions. This object enables websites and web applications to interact with the Nostr network, provided it is available. The window.nostr
object must define specific methods to enable this functionality.
The window.nostr
object must define the following methods:
async window.nostr.getPublicKey(): string // returns a public key as hex
async window.nostr.signEvent(event: Event): Event // takes an event object, adds `id`, `pubkey` and `sig` and returns it
In addition to the basic methods above, the following optional functions can also be implemented:
async window.nostr.getRelays(): { [url: string]: {read: boolean, write: boolean} } // returns a basic map of relay URLs to relay policies
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04
The following browser extensions and applications have implemented NIP-07:
- Horse (Chrome and derivatives)
- Nos2x (Chrome and derivatives)
- Alby (Chrome and derivatives, Firefox, Safari)
- Blockcore (Chrome and derivatives)
- Nos2x-fox (Firefox)
- Flamingo (Chrome and derivatives)
- AKA
- Token Pocket
If you're a developer looking to install or test an extension that uses the window.nostr
object, follow the appropriate links above for the browser you're using. Each implementation provides instructions on how to install and use the extension or application.
Once you have installed the extension or application, you can start building web applications that interact with the Nostr network using the window.nostr
object and its available methods.
- Hello World Tests getPublicKey
- Encrypted Pastebin Tests signEvent, encrypt, decrypt
Thank you for visiting our project's wiki! We hope you found the information useful. If you have any questions or suggestions, please feel free to open an issue or submit a pull request. We appreciate your contribution and support!