TBD54566975 / did-nostr

35 stars 8 forks source link

note on hex case sensitivity #6

Closed melvincarvalho closed 1 year ago

melvincarvalho commented 1 year ago

I was just looking up publicKeyHex

https://w3c-ccg.github.io/security-vocab/#publicKeyHex

It says there:

A publicKeyHex property is used to specify the hex-encoded version of the public key, based on section 8 of rfc4648. Hex encoding is also known as Base16 encoding.

Following RFC 4648:

Base 16 encoding is the standard case insensitive hex

Wheras NIP-01 is case lower case

I think in that case it's good to go with the status quo, because no one will really care. Those making nostr stuff will use lower case.

I'm just noting this here, to show it's been looked at, and see if there's any comment. The issue can be closed shortly.

metacatdud commented 1 year ago

Shouldn't we use publicKeyMultibase instead of the deprecated publicKeyHex?

melvincarvalho commented 1 year ago

No, multibase is a bad idea, and doesnt align well with nostr ecosystem. Too much complexity for nostr's simplicity

e.g. https://cid.ipfs.tech/#QmXv7TpGgdhyjp7L1QkSFNjdq9zwoG1YHi4nykYt16Ve1r

base16 is fine and models nostr's internal structures

There is actually hexBinary too which is native to linked data but that makes matching harder.

publicKeyHex is fine

melvincarvalho commented 1 year ago

I traced through the history of the 'deprecation' and it seemed to be a somewhat arbitrary design-by-committee decision, which would funnel people onto IPFS

While most of the DID community like IPFS (and alt coin tokens), most of the nostr community feels the opposite way see:

https://fiatjaf.com/d5031e5b.html

This is one of the issues with different cultures and ways of doing things. Nostr can cherry pick the best parts of DID and gain competitive advantage through not being funneled down certain rabbit holes preferred by certain alt coin gate keepers

metacatdud commented 1 year ago

Yeah, probably this is too much for my knowledge :) I don't understand some things For example: What do you mean

  1. "multibase is a bad idea" Where can I read more? To understand why you make this statement
  2. "doesn't align well with nostr ecosystem". Again, why? I am just trying to understand.
  3. "Too much complexity for nostr's simplicity". Again, where can I read to understand why you say this? I know you have worked with them and you probably know some things by heart, by now :)

I know that article :)) This is how I end up in nostr in the first place.

Either way, thanks for the replay.

melvincarvalho commented 1 year ago

Yes, there's quite a few articles at the bottom that are worth reading too

Multibase is aligned with IPFS

With nostr all you would be doing is converting the multibase string back into a hex string to match the event structure. It's an unnecessary step.

Hex aligns with the nostr eco system because it's used for event ids and public keys

We save a step by not being rail roaded onto the bespoke format

metacatdud commented 1 year ago

Ok. Thanks and thank you for being patient. I think I am beging to undetstand.

melvincarvalho commented 1 year ago

No worries, I learnt something too! I think this can be closed.