Skip to content

Self-Hosting Nostr Identification

Author's photo
4 min read ·

This article explains why you want to have a NIP-05 identifier for your Nostr account, and suggests an easy way of self-hosting it for yourself for free.

TLDR: @e1himself/nostr-identification-on-netlify

Nostr Identifiers

Because there is no central authority in Nostr, there is no a single body to identify and verify individuals to make sure they are really who they claim they are. Anyone can pretend to be someone else. There are no globally unique usernames. Heck, there are no usernames at all!

The only true identifier of a user is their public key.

Knowing a person's public keys is essential for finding and following their profiles in Nostr clients. However, public keys are not human-friendly. You can't memoize one, or quickly scan it to make sure it is not an impostor.

That's what NIP-05 has been made for. To map Nostr keys to digestable human-friendly identifiers.

NIP-05

I highly recommend checking the NIP-05 spec directly. It's simple, rather short and written in normal human language:
https://github.com/nostr-protocol/nips/blob/master/05.md.

If short, Nostr users set email-address-like identifiers to their profiles (e.g. luke@skywalker.com). In turn, Nostr clients can then request the referenced web domains to check if there is a record for the given user public key. If all things match — the ✅ icon is displayed.

Even though the NIP-05 are identifiers by nature. They also can potentially verify a person. For example, if a profile is identified as david@dhh.dk and the checkmark appears, it says a lot. We assume that only David Heinemeier Hansson has the power of putting a Nostr public key on that domain. So it must be David!2

That's why I want to have my Nostr profile identified with my own domain name. This way anyone can be almost sure that this specific Nostr profile really belongs to me:

A picture showing my Nostr pofile details: avatar, display name, NIP-05 identifier, and the checkmark.

Setting Up a Nostr Identifier

There are easy ways of getting a Nostr identifier. There are ready-made platforms that host your identifier for you. Many people use @nostrcheck.me or a similar service.

You can pay for one from @nostr.com. It's $5/year. A lot less to what they ask for a checkmark on X/Twitter. And brings additional benefits too.

But if you ask me, the true way is to self-host it on your own domain (assuming you have one). This is fully aligned with the decentralised and portable nature of the Nostr ecosystem and its data. That's how it is supposed to work!

It's also simple, actually.

All you need is to host a JSON file with your public key on your domain or its subdomain in the specified location: /.well-known/nostr.json. When you do this, you can use the domain as part of your Nostr profile identifier. Ah! And CORS headers are absolutely necessary — to allow Nostr web clients actually checking the identifier.

Use this Github template to set up your own static micro-website on Netlify: @e1himself/nostr-identification-on-netlify.
It also fits into the Netlify's free tier.

Cheers! 🖖


1 — “The NIP-05 is not intended to verify a user, but only to identify them, for the purpose of facilitating the exchange of a contact or their search”. See NIP-05.

2 — Depending on who you are and the risks you're facing, it might be absolutely not enough to only look at the identifier. You have to make sure the public key is the one you expect.

End of article
Got any comments?