Why Nostr? What is Njump?
2023-03-02 05:19:44

maks on Nostr: Hello nostriches! I have been looking recently for the possibility to set a NIP-05 ID ...

Hello nostriches!

I have been looking recently for the possibility to set a NIP-05 ID using my own domain and hosting. Please take a look at the easier way to do so not having any technical advanced knowledge. This will allow you to have your own verified ID using your domain on your Nostr profile.

Before we get started, make sure you have your own domain and hosting. If you don't have one, you can purchase them from any hosting provider of your choice. Also, make sure you have your Nostr pubkey in hexadecimal format. You can convert it using a tool like https://astral.ninja/devTools

Step 1: The first step is to enter your hosting or web server using Filezilla, an FTP client that allows you to transfer files from your computer to your hosting server. Once you're logged in, navigate to the public_html folder and create a new folder called ".well-known."

Step 2: Now that you have created the ".well-known" folder, you need to create a file called "nostr.json" inside it. Open a text editor on your computer and paste the following code:

{
"names": {
"YOUR_NAME": "YOUR_PUBKEY_IN_HEX_FORMAT"
},
"relays": {
"YOUR_PUBKEY_IN_HEX_FORMAT": [
"wss://nostr.eden.land",
"wss://nostr.relay.damus.io",
"wss://relay.snort.social",
"wss://relay.orangepill.dev"
]
}
}

Replace "YOUR_NAME" with any name you want, and "YOUR_PUBKEY_IN_HEX_FORMAT" with your Nostr pubkey in Hex format. The relay section is optional, but it allows clients to know which relays they are likely to find you on. Therefore, customize it with the relays added to your account.

Step 3: Now, create a new file in the public_html folder and name it ".htaccess". Open the file and paste the following code:
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>

This code allows your NIP-05 ID to be accessible by any domain. You can test your domain with this tool: https://cors-test.codehappy.dev

Step 4: Finally, go to your Nostr client and fulfill the NIP-05 ID with your name you previously added in the nostr.json file + your domain. For example, if your name is "example" and your domain is "domain.com," your NIP-05 ID would be "[email protected]".

Congratulations, you've successfully set up a self-hosted NIP-05 ID on Nostr using your own domain and hosting!
Author Public Key
npub19tep2rsqyeurjazpwtjrznx5gr46srhpecsc0kvn40v7vt9sfgkszmhkrd