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

p2p: ENS name validation #25

Open
avichalp opened this issue Mar 11, 2024 · 0 comments
Open

p2p: ENS name validation #25

avichalp opened this issue Mar 11, 2024 · 0 comments

Comments

@avichalp
Copy link
Collaborator

Hub needs to normalize ENS names before validating them.

Normalization is the process of canonicalizing a name before running it through the Namehash algorithm. It is important to always normalize all input, because even one little difference (like a capital vs lowercase character) will cause the namehash to be completely different.

For example, NaMe.EtH normalizes to name.eth. This ensures that the correct Registry node is used, no matter how the user types in the name.


Hubble uses viem's name normalization library for this purpose. There is no equivalent Rust implementation available out of the box. The good news is that the normalization standard is well defined in ENSIP-15. Plus, there are well written implementations to use as a reference:

We need the name normalization for #19. I think, we should implement a module for ENS name normalization within Teleport for now. We could extract it out into its own library once it it is battle tested.

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