Why Nostr? What is Njump?
2022-11-24 12:34:12
in reply to

daniele [revoked] on Nostr: Cannot be null? I created the custom_addr class adapting segwit_addr and stripping ...

Cannot be null?

https://github.com/dtonon/nostr-ruby-playground/blob/main/lib/custom_addr.rb
https://github.com/dtonon/nostr-ruby-playground/blob/main/lib/segwit_addr.rb

I created the custom_addr class adapting segwit_addr and stripping the version completely.

As I can see from https://github.com/dtonon/nostr-ruby-playground/blob/main/lib/bech32.rb the encode/decode functions do not explicitly require the version.

The conversion seem working well:
https://github.com/dtonon/nostr-ruby-playground/blob/main/02-bech32-hex-conversion.rb

Disclaimer: I played with the code reading the BIP-173, but without any deep knowledge of the matter.
Author Public Key
npub15rw0hw9wxh55q7chh8yykmmhp9skra566crr8kl3w609wqvj8c7qzuckn6