Just had a realization that I don't know the best way to write my nostr identity as a contact, on a pdf slide for a presentation I'm giving. I want to just write the npub, that's a possibility, so that at least people who have the pdf file can copy it (if I make it copyable), but that's useless most of the time. Can we make human readable versions of npubs (like maybe 4 or 5 words or something)? A very vague thought. Note that bip39 has 12 words for 128 bit entropy with 2000ish dictionary words. An npub is 256 bits so clearly you can't do that in 5 words, but what if we used a bigger dictionary?

#asknostr

Reply to this note

Please Login to reply.

Discussion

maybe put a qr code xD

Oh yeah good point. But what exactly should I be encoding?

I'd use a nip-05 after thought, it's convenient

People can just search for your nip05 ID if you set one up.

More words would be cool for this

if you are okay with using DNS then NIP-05

Nip05 addresses were designed for the human readable use case

Encode your npub or nip 05 address in a qr code

Nip 5 is like an email address eg greenart7c3@greenart7c3.com

This QR code is of a link to your profile via primal.net. I used this website to generate it (I simply took a screenshot of the generated QR code rather than bothering to sign up). If you'd prefer to use a link via some other client, you should be able to paste it in the appropriate field to generate a new QR code. Don't interpret this as an endorsement of this website; but, it seemed to work in this case:

https://qr.io/

... it just occurred to me (I had forgotten) that it seems pretty common for Nostr clients to include a button on your profile page to generate a QR code for your nPub and/or a link to your profile directly.

Yep, good point! Amethyst indeed has this. Thanks.

QR codes are an imperfect solution but probably the best we have for now.

Word list idea is good, but very difficult. You might want to try some kind of character encoding.

The current dictionary uses 2048 words to represent 11 bits per word (2^11) because it's getting close to the limit of how many 3 or 4 letter combinations match recognizable words, making for a good mnemonic device.

There are 17576 possible combinations of 3 letters, but we already have to go into 4 letter combinations to limit it to recognizable words instead of random letter combos.

To put 256 bits in 5 words, you'd need 52 bits per word, so you need 4,503,599,627,370,496 possible combinations per word (2^52).

There are more than that many possible combinations of 12 letters, but not so many words people know.

You're better off losing the mnemonic device and just using different text encoding to make a more condensed format of npub (which is of course just a text encoding format for the binary public key).

That's really hard, so for now, we have QR codes.

Sorry for wasting your time with one of my caveman-esque replies, by the way. I thought I'd take a crack at it since nobody else had addressed the math of your question in a couple hours, even though I understand that the almighty nostr:npub1235tem4hfn34edqh8hxfja9amty73998f0eagnuu4zm423s9e8ksdg0ht5 devs say I'm "not technical," less capable of providing useful input than a chat bot, etc. and they also don't give a fuck if Digit is safe, the woman who inspired me to find math questions interesting enough to try answering you.

Yes that sounds reasonable from what I remember. It might work at around 9-10 words with a plausible dictionary but maybe that is too large to be viable. I'm sure this is a fairly well studied problem.

Can npub generate a unique profile pic ? Not a QR code ..something that makes sense to a human ?

For example you mix your npub with a picture - say elephant or something - and let a specific image of elephant appear ! .. just like every elephant has a unique face !

Yeah, identicons are a similar idea.

I tried to do that a while ago and did some math but then it didn't work and I don't remember the reason, so maybe I should try again.

I doubt my idea is possible, sadly. An interesting nuance here: look at how mnemonics evolved in btc, which is using the same keys. we decided that a range of possible entropies from 128 bits to 256 bits is reasonable. I believe this is related to the fact that the best attacks on ECDLP are O(sqrt n) so your 256 private key really "only" has 128 bits anyway. So let's say you start with a 128 bit master secret and then you generate a quasi-infinite number of keys from that with HD (BIP32). So, hmm, it's 12 words this way with a 2000 word dictionary (because 10^3 is about 2^10 so 2000 is about 2^11 and if you raise it to a power 12 you get 132>128. But if we reduce the number of words it's (obviously) an exponential loss of entropy. Say you choose 6 words, then you're looking at solving (k)^6 = 2^128 so k has to be ~ 2^21 or like a million words; a dictionary size of even 20K is nowhere near.