Avatar
CryptoDrew
81e80c46b9bd0b7c564f59864527fa5f1cc94ea68a07f286858984a341b0a2e8
Developer of Hauprich, a layer-one cryptocurrency built on the Nostr protocol. Still in pre-alpha, so don't look for it yet. Follow me here for updates.

Excellent! Glad to help. Thanks for the response⚡️

The pubkey would just be a 32-byte hex-encoded string, which will always be 64 hex characters in length since 2 hex characters represents 1 byte.

So, pubkey regex is:

[0-9a-fA-F]{64}

For the npub, I believe that is always a consistent length of npub1 + 58 bech32-encoded characters (not bech32m).

So, npub regex is:

npub1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58}

Possible that I am wrong about the public length, but I have yet to come across one of a different length.

Also, validating whether the values decode to a valid secp256k1 key is not something that you could do w/ regex.

Thanks for sharing! If no one responds back to me, then I'll just have to open a ticket on github tonight 😁 Which I might do anyway as a formality since it really should be documented for us devs.

Nostr Dev Question:

When serializing an event to generate the hash ID, how should tags be ordered?

I cannot find anything under NIP-01 for this.

Currently, I am storing metadata external to the event to keep track of the tag order respective of how it was received, but that doesn't seem optimal.

Is there a recommended standard? Maybe alphabetical based on the UTF8 serialized strings of each tag? Although, that is certainly less optimal since that would require individual serialization of each tag plus a string compare sort.

#nostrdev #nostrdevs #devstr #nip01 #asknostr

Watching the Iowa caucus and realized that no one voted for Pedro.

#iowa #voteforpedro #trump #haley #politics #dynamite

Finally broke 20 followers on Nostr! Do I get a YouTube Play Button plaque for that?

#nostr #grownostr #notyoutube

Who is excited for Iowa? 🙄 #politics #primary #2024

One of the reasons that I am glad to be moving to FL later this year.

I'm cooking up some yummy curry chicken. And by "I'm", I mean "my husband is". Otherwise, it wouldn't be that yummy 😅

Swampy. But I still want to say... beautiful?