Skip to content

feat(subdomains): allow 1-2 character subnames (#366) - #407

Open
comandanto wants to merge 2 commits into
MystenLabs:mainfrom
comandanto:feat/subname-min-label-1
Open

comandanto wants to merge 2 commits into
MystenLabs:mainfrom
comandanto:feat/subname-min-label-1

Conversation

@comandanto

Copy link
Copy Markdown

Resolves #366

Summary

Lowers the default minimum subdomain label length MIN_LABEL_SIZE from 3 to 1 in packages/subdomains/sources/config.move.

Motivation & Context

  • Second-level .sui domains enforce a 3-character minimum at registration time to protect against short-name scarcity. However, subnames (e.g. a.example.sui or zk.example.sui) reside inside namespaces owned and managed by the parent domain owner.
  • Aligns SuiNS subdomain policy with ENS precedent (EIP-137 / ENS Name Wrapper), where subdomain labels have no protocol-level 3-character restriction.
  • domain.move already supports 1-character labels (MIN_LABEL_LENGTH = 1).

Changes

  1. packages/subdomains/sources/config.move:
    • Updated MIN_LABEL_SIZE: u8 = 1; (was 3).
    • Updated EInvalidLabelSize doc comment.
  2. packages/subdomains/tests/unit_tests.move:
    • Added assertions to test_parent_relationships() confirming that 1-character (a.example.sui) and 2-character (zk.example.sui) subnames pass validation under default() config.
    • Updated test_invalid_child_label_size_failure() to use new_config(vector[sui_tld()], 10, 3, ...) with a custom min_label_size = 3 to verify that EInvalidLabelSize continues to be properly enforced when configured.

@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@comandanto is attempting to deploy a commit to the Mysten Labs Team on Vercel.

A member of the Team first needs to authorize it.

@comandanto

Copy link
Copy Markdown
Author

hey, friendly ping: is there anything I should change to get this reviewed or merged? happy to rebase or adjust. thx

This branch has not been deployed

No deployments
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.

Allow 1-2 character subnames (align with ENS subdomain policy)

1 participant