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

Support for resolving TLDs with punycodes #24

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

apbigcod
Copy link
Contributor

The current implementation is not able to resolve root domains with puny codes.

ENS supports unicode characters and therefore TLDs with special characters can be directly registered as they are without mapping to punycodes or other encodings.

As an example, if we take ☢㣎, punycode xn--j4h059d, we can create an ENS registry with ☢㣎 whose hash is 0x9944186df8dbb5bd89fd1d89d38b3889b75f7aa9fd3a0b66921a49372935804c.

When typing subdomain.☢㣎 in a browser, it will be mapped to subdomain.xn--j4h059d which will trigger fingertip to query the handshake record for xn--j4h059d resulting in a contract address which then needs to be queries using ☢㣎 rather than its punycode equivalent.

In short the flow currently is:

  1. type subdomain.☢㣎 in brower
  2. browser maps to domain.xn--j4h059d
  3. Fingertip queries handshake for .xn--j4h059d and gets ENS registry contract address
  4. Fingertip queries contract for domain.xn--j4h059d

But step 4 should be:
4. Fingertip queries contract for domain.☢㣎

This PR normalises the name to resolve before we call the ENS contract.

Copy link
Member

@buffrr buffrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@buffrr buffrr merged commit 0b0b8fb into imperviousinc:main Mar 31, 2023
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 this pull request may close these issues.

2 participants