{"id":"e0bddf4ecb1fb130685baf722448deba9ef4041c0e5659b8b4212c11a9766118","pubkey":"2b39b4ffe62933df970e19366c22c1e092f953f83fcfed754e0f04d5a3b459f9","created_at":1739501216,"kind":30817,"tags":[["d","nip-07"],["title","NIP-07: `window.nostr` capability for web browsers"],["summary","The window.nostr object a browser extension exposes, letting a web page read a public key and have events signed without ever seeing the private key."],["s","draft"],["t","nostr"],["t","nip"],["alt","A specification: NIP-07: `window.nostr` capability for web browsers"],["client","openspecs-import"],["published_at","1651881285"],["proxy","https://github.com/nostr-protocol/nips/blob/656cecc7c0a815b6a2b218d3b5d6f078b3f4dbab/07.md","web"],["x","79c747c1c63b4c4acd3f7221b67bf0d13bd05cd137515a0bf79f78c944d5ec41"]],"content":"NIP-07\n======\n\n`window.nostr` capability for web browsers\n------------------------------------------\n\n`draft` `optional`\n\nThe `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.\n\nThat object must define the following methods:\n\n```\nasync window.nostr.getPublicKey(): string // returns a public key as hex\nasync 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\n```\n\nAside from these two basic above, the following functions can also be implemented optionally:\n```\nasync window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext and iv as specified in nip-04 (deprecated)\nasync window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext and iv as specified in nip-04 (deprecated)\nasync window.nostr.nip44.encrypt(pubkey, plaintext): string // returns ciphertext as specified in nip-44\nasync window.nostr.nip44.decrypt(pubkey, ciphertext): string // takes ciphertext as specified in nip-44\n```\n\n### Recommendation to Extension Authors\nTo make sure that the `window.nostr` is available to nostr clients on page load, the authors who create Chromium and Firefox extensions should load their scripts by specifying `\"run_at\": \"document_end\"` in the extension's manifest.\n\n\n### Implementation\n\nSee https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions.\n","sig":"3aab409a00e72a35f6a7486b3af5d352000ba036870812e7229d526f10779d6940167c27fb3ff3a10ef2825f8dc5cbde4f69b021939a2ccc38a5f3348b8a8bcf"}