Trying to get a proper conversion of a hex key to npub is eluding me.

I’m able to troubleshoot and repair complex electrical systems involving distribution, controls, and reactor operations, but can’t convert data to meet the API requirements.

🤦‍♂️

Reply to this note

Please Login to reply.

Discussion

Which language?

It’s in swift, but I think it’s my misuse of the bech32 source code I’m using.

I probably could write my own bech32 implementation, but not sure I want to spend two days doing that.

True; I’m trying to understand it from scratch, so I’m suing it as a reference.

Oh, I see. So you are pretty far down the rabbit hole already.

What do you need hex for?

damus.io/key

So I’m trying to get the example in https://github.com/nostr-protocol/nips/blob/master/19.md#bare-keys-and-ids

where ‘3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d’

turns into ‘nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6

in order to understand the bech32 calls in https://github.com/0xDEADP00L/Bech32.git

Also working on getting basic signing for events too.

I’m learning this key encryption stuff at the same time, so it’s an adventure.

Also why in NIP-01 is there a ‘0’ in this structure?

[

0,

,

,

,

,

]

No idea 😅

That’s a #devstr question

Right?!

0 is the kind of note. In this case its metadata - it carries info regarding the author of the event.