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

LedgerCosmos.getAddressPubKeySECP256K1 sends back wrong HRP length recommendation to user #53

Closed
odeke-em opened this issue Oct 16, 2023 · 2 comments · Fixed by #67
Closed
Assignees

Comments

@odeke-em
Copy link
Contributor

Please take a look at this length check

if len(hrp) > 83 {
return nil, "", errors.New("hrp len should be <10")

It clearly guards that length of the HRP should be less than 83, but the error message says hrp len should be <10

/cc @elias-orijtech @julienrbrt

@jleni
Copy link
Member

jleni commented Sep 2, 2024

The error message is incorrect.

HRP must be between 1 and 83 bytes

https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32

This is also the limit in ledger apps.

https://github.com/cosmos/ledger-cosmos/blob/30910a6c0995e2d82ef1041c629440263799cafd/app/src/crypto.h#L29

The error message needs to be updated

@jleni jleni self-assigned this Sep 2, 2024
@jleni jleni linked a pull request Sep 2, 2024 that will close this issue
@jleni
Copy link
Member

jleni commented Sep 2, 2024

fix in dev. it will be released soon

@jleni jleni closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants