NIP-21: nostr: URI Scheme
NIP-21 defines the nostr: URI scheme, a standard way for applications, websites, and operating systems to register interest in opening Nostr identifiers such as npub, nprofile, nevent, and naddr through whichever Nostr client the user has registered as a handler.
How It Works
A nostr: URI is the scheme prefix followed by any of the NIP-19 bech32 identifiers except nsec. Clients and operating systems treat the scheme the same way they treat mailto: or tel:: registering as a handler lets the user click a nostr: link anywhere in the system and have it open in their Nostr client of choice.
Examples from the specification:
nostr:npub1sn0wdenkukak0d9dfczzeacvhkrgz92ak56egt7vdgzn8pv2wfqqhrjdv9points to a user profilenostr:nprofile1...points to a user profile with relay hints bundled innostr:nevent1...points to a specific event with relay hintsnostr:naddr1...points to a parameterised replaceable event (such as a long-form article)
Linking HTML Pages to Nostr Entities
NIP-21 also specifies two useful <link> conventions for web pages that correspond to Nostr entities. A page that serves the same content as a Nostr event (for example a blog post rendered from a NIP-23 kind:30023 article) can include a <link rel="alternate"> pointing at the Nostr URI. A profile page can include a <link rel="me"> or <link rel="author"> pointing at an nprofile to assert Nostr-based authorship.
Why It Matters
The scheme is the interoperability layer that lets any Nostr identifier become a working link outside of a single client’s UI. Browser extensions, mobile OS handlers, and desktop shells can all route nostr: URIs to whichever client the user has installed, which makes it possible to share a profile or event by pasting a URI anywhere without losing the ability to open it in a Nostr-native way.
Implementations
Support for nostr: URIs is broad across the client ecosystem, including the major web, mobile, and desktop Nostr clients. Browser extensions such as nos2x and Alby handle URI registration on desktop browsers.
Primary sources:
Mentioned in:
See also: