You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DPNS: is_valid_username rejects consecutive hyphens that the DPNS contract accepts #6236
is_valid_username (packages/dash-platform-queries/src/dpns_usernames.rs) rejects labels with consecutive hyphens (e.g. web--shop2). The DPNS v3 domain.label pattern ^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$ accepts them (both require at least 3 characters, so that rule agrees).
The narrower rule is applied inconsistently across Rust entry points:
dash_sdk_dpns_check_availability and packages/rs-sdk-ffi/src/dpns/register.rs apply it,
register_name_with_external_signer in packages/rs-platform-wallet/src/wallet/identity/network/dpns.rs does not.
Both example apps gate Register on the availability check, so neither can register such a label, although Platform would accept it.
The doc comment also says the no-consecutive-hyphens rule is "enforced by the pattern". The pattern does not enforce it.
Proposal
Either align is_valid_username with the active contract, or keep the narrower rule on purpose, document why, and apply it consistently across the query and registration APIs.
An option raised in review of #6225: leave the exported is_valid_username unchanged and give the wallet registration flow its own Rust answer (the wallet builder already runs without that predicate). That answer would decide explicitly whether to reject xn---shaped labels without blocking an ordinary label such as web--shop2, and the example apps' availability gate would use it.
Activity
QuantumExplorer commentedon Nov 24, 2026
An option raised in review of #6225: leave the exported
is_valid_usernameunchanged and give the wallet registration flow its own Rust answer (the wallet builder already runs without that predicate). That answer would decide explicitly whether to rejectxn---shaped labels without blocking an ordinary label such asweb--shop2, and the example apps' availability gate would use it.