-
@ Skroo
2023-06-01 18:35:15All that is required to have a verified nostr address is a properly formatted JSON file that is hosted on the domain name you wish to verify to. This file simply maps a HEX based public Nostr key with a name. All it really does is verify that your key is mapped to a name/domain pair.
Assumptions
It is assumed you have a registered domain you want to use already. If not, register one with a domain registrar. It does not need to be Cloudflare. It is also assumed you have a Cloudflare account. These are free, and can be easily obtained at cloudflare.com.
Steps
Create the nostr.json file
Create your nostr.json file locally. This is going to go up to your host in the path domain.com/.well-known/nostr.json. You are going to make the contents of the file:
{ "names": { "yourname": "<HEX public key, NOT npub>" } }
Replace yourname with whatever you want to be called, for example skroo@ufocult.cc. You'll need your hex key, not your npub. You can convert that here: https://nostrtool.com/
- Save this file in a local directory called
.well-known
. I.e.,~/.well-known/nostr.json
. - Compress the
.well-known
directory into a zip file. The only way to direct upload a directory tree to Cloudflare Pages is if you build it in the zip, otherwise everything stays flat at the root level.
Configure Cloudflare
- Open your Cloudflare account dashboard and click on the Workers and Pages item. If you don't see this, you are likely in your domain dashboard and need to go up a level.
- Click the Create application button. It is big, shiny, and blue. You will be on the Workers tab. Click the Pages tab to the right of it.
- You will be given the option to "connect to git" or to upload your files directly. For this purpose, I prefer to upload directly, since this static page won't change often, if at all, really. So, for this example, we pick "Upload assets" for our model.
- Give your project a name. It doesn't really matter what it is, as long as you remember.
- Upload the zip file you made earlier.
Test the URL
- If
- Save this file in a local directory called