did you re-encode as a hex string after decoding? hex_encode(bech32_decode(nsec))

Reply to this note

Please Login to reply.

Discussion

I tried. bech32_ decode returns a tuple with the nsec prefix as the first element and a list of ints as the second. I copy pasted something from stackoverflow to turn the list into bytes and then decode it… it’s possible something went wrong there. I’ll try again more carefully

It's possible it's returning an array of 5bit integers which needs to be converted. I should make a quick webpage for converting to the old format...

Key converter: https://damus.io/key

It worked, thank you! Now I’ll figure out how to publish an event to give myself an avatar

[nostril](https://github.com/jb55/nostril) --envelope --kind 0 --sec hexkey --content '{"name":"j","picture":"https://url.pic","about":"about me"}' | websocat wss://relay.damus.io

For future reference:

noscl setprivate ffff…

noscl relay add wss://relay.damus.io

noscl metadata —picture=“j.gif”

Looks like it worked!