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
IPNS contenthash decoding strips first character from peer ID #4527
Comments
Thanks! I’ll look into this right away. |
The problem is that Base58 is more an encoding for numeric data, not binary data, so as a result the leading-0's are getting trimmer (while in base-58, the character Most protocols that use Base58 as a result tend to specify a bit width to pad to. I'll update shortly. :) |
Useful resource: https://medium.com/concerning-pharo/understanding-base58-encoding-23e673e37ff6 I've made the change and am just waiting for the CI to complete. |
Fixed in v6.9.2. Thanks! :) |
Ethers Version
6.9.1
Search Terms
ipns, contenthash
Describe the Problem
When attempting to decode a contentHash record set to an IPNS peer ID, the first character is stripped, resulting in an unparsable IPNS pointer:
For example (
esteroids.eth
):Wrong:
ipns://2D3KooWKrB93pwXDdeyz2WRMwcSBny5ECjA1JasB4GTo4ijUUtf
Should be:
ipns://12D3KooWKrB93pwXDdeyz2WRMwcSBny5ECjA1JasB4GTo4ijUUtf
Code Snippet
Contract ABI
No response
Errors
No response
Environment
node.js (v12 or newer)
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: