Skip to content

Person's usernames - read from AH dotNS instead of PC - #349

Closed
Zebedeusz wants to merge 1 commit into
mainfrom
zebedeusz/resolving-usernames-from-dotns-ah
Closed

Person's usernames - read from AH dotNS instead of PC#349
Zebedeusz wants to merge 1 commit into
mainfrom
zebedeusz/resolving-usernames-from-dotns-ah

Conversation

@Zebedeusz

@Zebedeusz Zebedeusz commented Aug 6, 2026

Copy link
Copy Markdown

Adaptation to https://github.com/paritytech/individuality/issues/755.

Replaces the People-chain Resources.Consumers lookup with the dotNS
contracts on Asset Hub, shared by the CLI and the in-core runtime.
Adds full-person registration (register-name), the previewnet preset,
identity-backend token minting, and Asset Hub genesis config.

@re-gius re-gius left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue. An attestation can queue a reservation for a name that is already registered. The candidate can never claim it, and because dotNS keys reservations by stem, it locks every two-digit variant of that stem for 12 weeks with no admin revoke.

Why it occurs. The reserved base name is never checked for availability before the attestation goes out. In this PR the value is threaded straight through without inspection: build_reservation_message SCALE-encodes it, submit_registration adds it as dotns.reservedUsername, and it continues on to reserve_name. The only place it is examined is if let Some(reserved), deciding whether to include the JSON field. The lite base does get checked via lite_username_available, but there is no equivalent for the reserved name. Nothing on chain catches it either (paritytech/dotns#), and the precondition arises on the happy path: a successful full-person claim deliberately releases the stem slot, and nothing records that the label is now taken.

Suggested fix. Before attesting, read the registrar for the reserved name's derived node and fail with an error naming it. dotns_read.rs already has the call plumbing. Read the registrar rather than {backend_base}/usernames/available, which does not consult the contract that would reject the reservation.

@filip-parity

filip-parity commented Aug 17, 2026

Copy link
Copy Markdown

Rebased onto main with the review fixes in #426 (your commit is kept as the first one there).

filip-parity added a commit that referenced this pull request Aug 17, 2026
…already minted

Review on #349 (re-gius) and paritytech/dotns#235: the gateway enqueues a
reservation for a reserved_base_label without asking the registrar, so a
reservation over a registered name can never be claimed and holds the whole
stem's reservation queue for the reservation window. The contract-side guard
lands in dotns; the client asks first so an attestation cannot fail as a
whole (and lose the lite name) once that guard exists.

label_available reads DotnsRegistrar.available(uint256(node)) for the label's
node under the network tldNode(), through the same transport as the username
reads. attest() checks the reserved base name (shape per the pallet's
is_valid_person, then availability); register-name checks its label. Live
test on paseo: a minted name reports unavailable, an unminted one available.

@filip-parity filip-parity left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@re-gius addressed in #426 (commit dd9b00e): before attesting, the CLI validates the reserved base label with the pallet's full-person rule and reads DotnsRegistrar.available(uint256(node)) for the label's node under the network tldNode() — through the same transport as the username reads — and fails naming the label. register-name does the same for its label. Live on paseo: a minted name reports unavailable, an unminted one available. Contract-side guard tracked in paritytech/dotns#235; agreed the client check is not the security boundary.

@Zebedeusz

Copy link
Copy Markdown
Author

Closing so that it can be easily carried-over in #426

@Zebedeusz Zebedeusz closed this Aug 17, 2026
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.

3 participants