Summary
The current SubDomainConfig enforces a minimum label size of 3 characters for subnames (MIN_LABEL_SIZE: u8 = 3 in packages/subdomains/sources/config.move). This means the shortest possible subname is abc.example.sui — 3 characters plus the parent.
This should be lowered to 1, allowing subnames like a.example.sui or zk.example.sui.
Rationale (ENS precedent)
ENS explicitly separates the character minimum for second-level .eth registrations from subnames:
-
EIP-137 (the ENS protocol spec) states: "Labels and domains may be of any length" — no minimum is imposed at the protocol level.
Source: EIP-137: Ethereum Domain Name Service - Specification
-
The .eth Registrar imposes a 3-character minimum on second-level domains (2LDs) only. This is a registrar policy, not a protocol constraint.
-
ENS official documentation on the Name Wrapper states: "By default there is no character limit on subnames, but your contract could have its own rules and fee structure or whatever you want."
Source: Name Wrapper Use-Cases | ENS Docs
The logic is straightforward: since the parent domain (2LD) already enforces a 3-character minimum at registration time, a subname like a.example.sui is already 4+ characters in total (plus the TLD). The short-name scarcity concern that motivates the 3-character minimum for 2LDs doesn't apply to subnames — they exist within a namespace controlled by the parent owner.
Current behavior
domain.move already allows 1-character labels at the parsing layer (MIN_LABEL_LENGTH = 1)
SubDomainConfig.min_label_size defaults to 3, rejecting valid 1-2 character subname labels
- The
config::new() constructor already accepts a custom min_label_size, so the enforcement path is flexible
Proposed change
Set MIN_LABEL_SIZE from 3 to 1 in packages/subdomains/sources/config.move. This is a one-line constant change plus test updates.
Branch with the fix: feat/subname-min-label-1
Summary
The current
SubDomainConfigenforces a minimum label size of 3 characters for subnames (MIN_LABEL_SIZE: u8 = 3inpackages/subdomains/sources/config.move). This means the shortest possible subname isabc.example.sui— 3 characters plus the parent.This should be lowered to 1, allowing subnames like
a.example.suiorzk.example.sui.Rationale (ENS precedent)
ENS explicitly separates the character minimum for second-level .eth registrations from subnames:
EIP-137 (the ENS protocol spec) states: "Labels and domains may be of any length" — no minimum is imposed at the protocol level.
Source: EIP-137: Ethereum Domain Name Service - Specification
The .eth Registrar imposes a 3-character minimum on second-level domains (2LDs) only. This is a registrar policy, not a protocol constraint.
ENS official documentation on the Name Wrapper states: "By default there is no character limit on subnames, but your contract could have its own rules and fee structure or whatever you want."
Source: Name Wrapper Use-Cases | ENS Docs
The logic is straightforward: since the parent domain (2LD) already enforces a 3-character minimum at registration time, a subname like
a.example.suiis already 4+ characters in total (plus the TLD). The short-name scarcity concern that motivates the 3-character minimum for 2LDs doesn't apply to subnames — they exist within a namespace controlled by the parent owner.Current behavior
domain.movealready allows 1-character labels at the parsing layer (MIN_LABEL_LENGTH = 1)SubDomainConfig.min_label_sizedefaults to3, rejecting valid 1-2 character subname labelsconfig::new()constructor already accepts a custommin_label_size, so the enforcement path is flexibleProposed change
Set
MIN_LABEL_SIZEfrom3to1inpackages/subdomains/sources/config.move. This is a one-line constant change plus test updates.Branch with the fix:
feat/subname-min-label-1