Mining your Vanity Pubkey

A look at branded vanity npubs and mnemonic backups, why you want these and how to set them up.

Rod

5. Oktober 2024October 5, 2024 · 8 Min. Lesezeit8 min read · Aktualisiert am 10. Oktober 2024Updated October 10, 2024

Tldr

The first ID you’ll ever own

The first step in setting up a Nostr profile is to get your keys. These keys are your identity. For almost everyone, this is the first ID you’ll have that you truly own. That is, this ID is yours because you say it is. That’s different from almost every other ID, which was issued to you by someone else, and is yours because they say it is.

Not only is it yours. It’s portable. You can use this ID to be yourself in any app that supports Nostr.

Consider the legacy internet—every app requires a separate account. That’s a separate login and password to remember. And worse than that, it’s a separate set of content you have to generate, and a separate following you have to create. Every time a new platform launches, you need to encourage your followers to join you on the new platform. At any time, any platform can deplatform you. If they do, you lose your content and your following, with no recourse.

On Nostr, it’s different. All your content and all your following is linked to your identity, and you take it with you everywhere. You build your content once, and it appears with you everywhere. You build one following once, and they follow you everywhere. If a platform deplatforms you, you don’t lose your following or content, you just take it all to another platform.

This may be the first ID you ever own, and if Nostr keeps on growing, it may be the last ID you’ll ever need.

Getting branded with a “vanity” npub

Every nostr user has an identity like this, and every user can be found and known by their public key, their “npub” or “pubkey”. By default, most people go by a pubkey that is completely random, like npub1asdfgh….

My view is, if you’re going to create your first-ever ID that is truly yours, you might as well make it special. It’s possible to create a pubkey that has a bit of branding to it.

The technical name for these is a “vanity npub”. You could call it a branded npub.

There are some good examples:

These pubkeys have specific characters at the start (or at the end). It is better branding. It’s also helpful for defeating spammers who might choose to imitate you, as only you have the vanity npub.

Keys are generated at random. To get one with your specific branding on it, you need to set up your computer to generate keys at random until it finds one that suits your needs. Once set up your computer will generate keys by the millions–checking and discarding each one until it creates the one with your characters.

The more characters you want, the longer this process will take.

Nostrogen provides a helpful table for that:

The good news is, for your npub to have nice branding, you don’t need a lot of characters.

For myself I only needed four “r0d8”.

Getting a mnemonic, for backup, and for lightning

Once you have your ID, you will want to use it different places and back it up securely. The problem with writing down your ID as an nsec is that it’s long and complicated to write, and too easy to misread and enter the wrong characters when you type it back into your device.

A better alternative exists. You can generate a 12-word mnemonic, and then use that to derive your nsec (documented in NIP-06). The mnemonic is much easier to read, easier to type into new apps, and easier to backup correctly.

If you generate your keys directly as npub and nsec you can never go “backward” to generate a mnemonic. But if you generate a mnemonic first, you can always generate an npub and nsec from it. Furthermore if you generate a mnemonic, you can (optionally) use that same mnemonic to generate your lightning wallet for making payments with.

For these reasons, my view is that using an identity with a mnemonic is best.

Once we have our 12-word mnemonic, we generate our keys (npub and nsec), and we’re ready to use anything in the Nostr ecosystem.

How to mine a 12-word mnemonic with a branded vanity npub

You’ll need an application for mining. There are very many to choose from, which you can see on this awesome Nostr list by Aljaz

Some work in your web browser, like nostr.rest. Many others you can find on github and install. I tried many including nostr-pubminer, and nostr_vanity_npub, before settling on Rana.

To run these requires basic command line knowledge. I didn’t have that, so I fed the GitHub readme page to ChatGPT, and it walked me through getting everything set up.

Failing many times

Here’s what I did wrong so you don’t have to make the same mistakes.

Success with Rana

In the end I succeed using Rana by Negrunch

You can find Rana here on Github with a very helpful readme.

In short the process is:

That command breaks down as:

And the outcome is:

In summary

The first step in setting up a Nostr profile is to get your identity.

While it’s easy to get an identity made with random keys, if we think our Nostr IDs are going to mean something important in the future, then we may as well set ourselves up with keys that are easy to use, and branded.

That means

The mnemonic is easier to backup and also can be used to create a lightning wallet. The branding helps people know your npub is really you

To do this

Next

#grownostr#nip-06#nostr

Written by

Comments

No comments yet. Start the conversation.