earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
623 stars 18 forks source link

What is the rationale for the generateAuthorKeypair shortname only allowing lengths of 4 chars? #322

Open gobengo opened 1 year ago

gobengo commented 1 year ago

https://github.com/earthstar-project/earthstar/blob/1523c640fedf106f598bf79b184fb0ada64b1cc0/src/core-validators/addresses.ts#L79

If I try this, it returns a ValidationError

  const newAuthor = await Earthstar.Crypto.generateAuthorKeypair('abcde')

Are you open to allowing differently lengthed shortnames?

sgwilym commented 1 year ago

Hi @gobengo!

The idea behind the four character limit is that they are just long enough to form a descriptive label, and short enough that they obviously can't be unique. They're not really for identity, but more like a label hanging off the keychain to remind you what it's for (which makes me think they should be renamed to labels / fobs).

Display names are data you'd store inside of an Earthstar share and associate with your keypair, e.g. with the about format. This means your display name can a much broader scope for expression (non-ASCII characters, spaces, extra long, emoji, can change at any time), and you can have different identities in different shares.

Then again, to argue with myself, share addresses don't have this limitation though logically the same argument could be applied. How persuasive is the above?

Here's a short FAQ on shortnames in the spec which may give more context.