Self-hosting your NIP-05 identity means using a domain you control to publish the mapping between a human-readable identifier and your Nostr public key. Instead of borrowing an identity from a third-party NIP-05 provider, you host the verification data yourself at a well-known URL.
That matters because NIP-05 is not your actual Nostr identity. Your real identity is still your public and private key pair. NIP-05 is a convenience and verification layer on top, a readable pointer that helps humans recognise and trust the account they are looking at.
What NIP-05 is
NIP-05, "Mapping Nostr keys to DNS-based internet identifiers", lets a Nostr client verify that an identifier like name@example.com is associated with a specific public key.
The client does that by requesting a JSON file from:
https://example.com/.well-known/nostr.json
That file contains a names object mapping the local part of the identifier to a public key in hex format, not npub format.
Example:
{
"names": {
"bob": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}
}
If the account claiming bob@example.com matches that public key, a compatible client can show the identifier as verified.
Why self-hosting NIP-05 is useful
1. Better ownership
If you depend on a third-party provider, your NIP-05 identity exists at their discretion. If they shut down, change their rules, or remove your mapping, your readable identifier disappears.
If you host it on your own domain, you control the mapping.
2. Better long-term stability
A personal domain is usually more durable than someone else’s hosted username system. If you want a long-lived identity tied to your own brand, project, or name, self-hosting is the cleaner move.
3. Fewer trust assumptions
You are not asking users to trust another provider to keep your identity mapping accurate. They only need to trust that you control the domain you publish from.
What self-hosting does not do
It is worth being precise here.
Self-hosting NIP-05 does not:
- replace your Nostr keys
- protect your private key automatically
- make you censorship-proof by itself
- guarantee every client will display your identifier the same way
It simply proves that your domain publishes a mapping to your public key.
How NIP-05 verification works
When a client sees bob@example.com, it typically:
- splits the identifier into
bobandexample.com - fetches
https://example.com/.well-known/nostr.json - looks for
bobinside thenamesobject - checks whether the returned hex public key matches the account claiming that identity
If it matches, the client can display the NIP-05 identifier as verified.
Optional relay hints
NIP-05 can also include a relays object with relay hints for a given public key. That can help some clients discover where they might fetch data for that user, but it should be treated as a hint rather than a hard guarantee.
Example:
{
"names": {
"bob": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
},
"relays": {
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef": [
"wss://relay1.example.com",
"wss://relay2.example.com"
]
}
}
Practical steps to self-host it
At a basic level, you need to:
- control a domain
- create a
.well-knowndirectory on a web server for that domain - publish a valid
nostr.jsonfile - map your chosen local name to your public key in hex
- verify from a Nostr client that the identifier resolves correctly
That is the core of it. No heavyweight infrastructure is required. Static hosting is often enough.
Why this matters for credibility
A self-hosted NIP-05 like you@yourdomain.com is often stronger than a random hosted alias because it ties your Nostr identity to a domain you already control. For personal sites, products, businesses, or public projects, that is useful.
It is not perfect proof of character, obviously. But it is decent proof of domain control.
Conclusion
NIP-05 is not the foundation of Nostr identity, your keys are. But it is a useful layer for making that identity readable, portable, and easier to trust.
If you already own a domain, self-hosting your NIP-05 is usually the better option. It removes dependence on a third party, gives you tighter control over your public identity, and fits the broader self-sovereign model that makes Nostr interesting in the first place.