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

Implement upgradeable LabelValidator that initially restricts names to same standard as Handshake/DNS #3

Closed
aoxborrow opened this issue Aug 19, 2022 · 2 comments · Fixed by #13
Assignees

Comments

@aoxborrow
Copy link
Collaborator

aoxborrow commented Aug 19, 2022

Maybe LabelValidator could reference external contract so that we can upgrade to change Unicode or Punycode functionality in the future. We are basically punting on the decision to support full Unicode, because we need to be compatible with existing EPP rails.

To start, we'll restrict to the same standard as Handshake and DNS (alphanumeric + hyphen), except that we'll also disallow Punycode (xn--*) and underscores. This restrictive set makes the names compatible with existing EPP registrar infrastructure, but also keeps compatibility with standard ENS/EIP137 resolving (Unicode), which is what current Handshake resolvers use (Beacon, Fingertip, HNSD). There are advantages to staying compatible with ENS such as using existing client libraries and simpler integrations. We should add validation to prevent Punycode names as the ENS standard is to use normalized and hashed Unicode. If we allow Punycode, duplicate names could be registered that both represent the same Unicode.

References
https://github.com/handshake-org/hsd/blob/master/lib/covenants/rules.js#L183
https://github.com/imperviousinc/fingertip/blob/main/internal/resolvers/ethereum.go#L98
https://github.com/adraffy/ensip-norm/blob/main/draft.md
https://discuss.ens.domains/t/on-chain-ens-domain-normalization/13202
https://discuss.ens.domains/t/ens-name-normalization/8652
https://discuss.ens.domains/t/dns-collisions-of-ens-names-in-browser-input/12539
https://discuss.ens.domains/t/suggestion-remove-punycode-from-ens-name-normalization/8025
https://github.com/ensdomains/punycode/blob/development/contracts/Punycode.sol
ethers-io/ethers.js#42
https://github.com/ethers-io/ethers.js/blob/608864fc3f00390e1260048a157af00378a98e41/packages/strings/src.ts/idna.ts#L7680

@aoxborrow aoxborrow self-assigned this Aug 19, 2022
@aoxborrow aoxborrow changed the title Implement upgradeable LabelValidator that initially restricts names to same standard as Handshake/DNS Implement upgradeable LabelValidator that initially restricts names to same standard as Handshake/DNS Aug 19, 2022
@hodlthedoor
Copy link
Collaborator

Can I have a decent sample of passing and failing names so I can create unit tests?

@aoxborrow
Copy link
Collaborator Author

I assigned this to me as I would like to bite off something smallish. I'll do tests as well.

aoxborrow added a commit that referenced this issue Aug 29, 2022
LabelValidator that restricts to ASCII alphanumeric, prevents punycode - see #3

forge install: solidity-stringutils, although not using currently

update readme
aoxborrow added a commit that referenced this issue Aug 30, 2022
LabelValidator that restricts to ASCII alphanumeric, prevents punycode - see #3

update readme
aoxborrow added a commit that referenced this issue Aug 30, 2022
LabelValidator that restricts to ASCII alphanumeric, prevents punycode - see #3

update readme
aoxborrow added a commit that referenced this issue Aug 30, 2022
LabelValidator that restricts to ASCII alphanumeric, prevents punycode - see #3

update readme
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