daniele [revoked] on Nostr: Cannot be null? ...
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.
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.