Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse nprofile #723

Open
dluvian opened this issue Jan 19, 2025 · 2 comments
Open

Failed to parse nprofile #723

dluvian opened this issue Jan 19, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@dluvian
Copy link
Contributor

dluvian commented Jan 19, 2025

Describe the bug

The nprofile nprofile1qyxhwumn8ghj7cnjvghxjme0qyxhwumn8ghj7cnjvghxjme0qyt8wumn8ghj7etyv4hzumn0wd68ytnvv9hxgtcpzemhxue69uhk2er9dchxummnw3ezumrpdejz7qgwwaehxw309ahx7uewd3hkctcppemhxue69uhkummn9ekx7mp0qy08wumn8ghj7mn0wd68yttsw43zuam9d3kx7unyv4ezumn9wshsz8nhwden5te0dehhxarj94c82c3wwajkcmr0wfjx2u3wdejhgtcpr4mhxue69uhkummnw3ezucnfw33k76twv4ezuum0vd5kzmp0qyv8wumn8ghj7mn0wd68ytnxd46zuamf0ghxy6t69uq3samnwvaz7tmwdaehgu3wvekhgtnhd9azucnf0ghsz9mhwden5te0dehhxarj9eex2mrp09jhytnnv5hsz9mhwden5te0dehhxarj9eex2mrp09jhytnnv5hszythwden5te0dehhxarj9emkjmn99uq3gamnwvaz7tmwdaehgu3w0qcxvtn0wfnj7qgnwaehxw309ahkvenrdpskjm3wwp6kytcpzdmhxue69uhk7enxvd5xz6tw9ec82c30qyv8wumn8ghj7un9d3shjtnrw4e8yetwwshxv7tf9uq3samnwvaz7tmjv4kxz7fwvd6hyun9de6zuenedyhsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qgkwaehxw309aex2mrp0yhx6mmnw3ezuur4vghsz9mhwden5te0wfjkccte9ehx7um5wghxyctwvshsz9mhwden5te0wfjkccte9ehx7um5wghxjmnxduhsz9mhwden5te0wfjkccte9ehx7um5wghxjmnxduhszxthwden5te0wfjkccte9ehx7umhdpjhyefwvdhk6tcpzamhxue69uhhyetvv9ujuurjd9kkzmpwdejhgtcpr9mhxue69uhhyetvv9ujuumwdae8gtnnda3kjctv9uq3jamnwvaz7tmjv4kxz7fwwdhx7un59eek7cmfv9kz7qpqsyluunzwwmc70d85d9alzqc2jrc6pdur7xrax2vqpfxas6tljavsrwlyyy fails to parse to a Nip19Profile with the error rust.nostr.sdk.NostrSdkException$Generic: no valid bech32 or bech32m checksum.

I found this nprofile while scrolling nostr (nevent1qqsw2w7ha4vn0cx4ygd4y9pxmypa8ctfgym52v3lpsjd7xk3rnryeagzyz7mj6knrtr27y3uw6pu24m4acsn3ks03uq3uwv5644zwfcwdyjh2qcyqqqqqqgpr3mhxue69uhkummnw3ezucnfw33k76twv4ezuum0vd5kzmquw82w6). Other clients have no problem parsing it so maybe failing the parse process is too harsh?

To Reproduce

Use nprofile above

Expected behavior

Ignore the error or keep it as is. If the nprofile really is invalid and you think failing is the correct move then close this issue, I just want to let you know that these nprofiles are out there

Build environment

  • Library: nostr-sdk
  • Language: Kotlin
  • Language version: v0.38.3
  • Tag/commit:
  • OS+version:

Additional context

@dluvian dluvian added the bug Something isn't working label Jan 19, 2025
@yukibtc
Copy link
Member

yukibtc commented Jan 19, 2025

I think it's related to the same issue I mentioned here: #394 (review)

The bech32 crate check the string length from v0.11 (enforced by the BIP-173), and that nprofile is pretty long.

I receive this error:

Bech32Decode(Checksum(CodeLength(CodeLengthError { encoded_length: 1179, code_length: 1023 })))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants