Skip to content

individuality: build the full-username claim #372

Description

@Imod7

Description

The SDK says whether a person may claim a bare name (canClaimFullUsername, packages/individuality/src/username.ts:162, from #311 closing #302) and has nothing that claims one. The person origin ships (withAsPerson({ tag: "AliasWithAccount" }), as-person-signer.ts:126) and @parity/product-sdk-tx submits. Only the middle is missing.

The proof is out of scope: no signBytes path here can produce the call's lite_identity_proof, because the host wraps every raw payload in <Bytes>...</Bytes>. That is paritytech/host-rust-core#612, which blocks claiming today and owns that API. With the call and the gates here, adopting it changes one input.

Deliverable

Three exports, as signup-lite.ts and register.ts do for a gated write:

  • A pure validator, minimum as a parameter since pure helpers read no chain: at least MinUsernameLength bytes, every byte is_ascii_lowercase() so digits and hyphens fail too, at most 32 (the Username BoundedVec bound) checked before the encode. Nobody reads that constant: polkadot-ios-community alone carries (6, 30) and (7, 32) (ClaimUsernameModels.swift:8, Username.swift:33), where 30 refuses valid names and 7 is the pallet mock's value.
  • A pinned eligibility read returning Result with { canClaim, blockers, minLength, aliasToSign }. Gates are blockers carrying the offending value (LiteSignUpBlocker, signup-types.ts:125), never errors and never display copy.
  • A call builder for the Standalone arm, structurally typed, proof as opaque caller-supplied bytes as in registerPersonhoodTx. One arm because no TypeScript caller needs Reservation, not because it is unimplemented: iOS builds both.

Chain rules, individuality-community pallets/resources/src/lib.rs: validation :1680, gates :1370-1386, proof :1433, Reservation :1402.

How to test

Validator boundaries driven off the constant, blockers against a structural double, the encoded call against a fixture, and the call shape proved offline against the three pinned descriptors. No live run: #612 records this call finalizing on Preview with a patched host.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions