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

Decoding an IPNS name that uses DNSLink #41

Open
moodysalem opened this issue Aug 17, 2020 · 0 comments
Open

Decoding an IPNS name that uses DNSLink #41

moodysalem opened this issue Aug 17, 2020 · 0 comments

Comments

@moodysalem
Copy link

  • decode returns the base58 string for an IPNS + DNSLink name, when we expect the utf8 string
  • the content when base58 decoded includes a prefix of the string length
    e.g.
    the uniswap.eth contenthash is 0xe5010170000f6170702e756e69737761702e6f7267
    this points at the ipns url:
    ipns://app.uniswap.org
import {decode} from 'content-hash'
// this is the result of decode in the latest version of content-hash
decode('0xe5010170000f6170702e756e69737761702e6f7267') === '12uA8M8Ku8mHUumxHcu7uee'

if i base58 decode '12uA8M8Ku8mHUumxHcu7uee' and then convert to utf8 i get:
"\u0000\u000fapp.uniswap.org"

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

No branches or pull requests

1 participant