A Polkadot name service is an idea that has been sitting on the sidelines for a while but has not been fully realised. I have recently revisited what was worked on last year and have attempted to update it into a viable proposition for the Collectives parachain.
Substrate PR:
Pallet Overview
This name service is not a carbon copy of existing services, but instead is a version of what makes sense for the Polkadot ecosystem. This name service pallet is designed to act as a singular service for all parachains, whereby registered names alias an account, and the suffix of the name aliases the parachain ID.
Important note: Name service is not a DID service, it is a means to provide friendly aliases for addresses and chains so UIs can provide a friendlier means of transferring funds.
So provided the Relay Chain registers itself on the name service with the suffix dot
, the following is true for the name ross.dot
:
ross
aliases any provided account (via theset_address
call)dot
aliases the relay chain.
Paras need to register themselves to the name service via register_domain(para_id, suffix)
, which is only callable by the root origin. The preferred way (and only way) for a para to register to the name service is to go through an OpenGov proposal on the Relay Chain, which upon execution can submit a register_domain
call to the Collectives chain .
Pallet Features
Beyond registering and deregistering of Paras, the name service consists of:
- a commit and reveal scheme for registering names.
- renewing, transferring and de-registering of names.
- ability to set an address for a name (primary use case)
- ability to store the text-representation of the name on-chain to act as a reverse-lookup for the hash.
- ability to set a miscellaneous text record (could act as a status message to go alongside an address in a UI).
- recursive subdomain registrations, e.g. I could register a tree of subnodes to compose a
my.polkadot.domain.ross.dot
name. Each subnode supports the above address, name and text metadata.
To prevent the duplication of docs, the pallet is detailed in the pallet docs, that can be found here: https://github.com/paritytech/substrate/blob/f67e9c947147a8d7c051cb3e056844bedf4f223a/frame/name-service/src/lib.rs#L18
Ideal Use Case
The name service can be applied to any form factor of app, but mobile particularly stands out as an opportunity to promote the usage of name service. Users can hand-type addresses to send tokens without the need to copy and past addresses. The name and suffix together provide enough context for the UI to know which para tokens need to be sent to, even if support is initially limited to a single chain.
Call for FRAME devs
The name service pallet needs FRAME expertise for feedback loops and to ensure the above registration mechanism works, as well as general improvements to the pallet.
There are also more nuance requirements like having a generic address
type for supporting all para address types. So some expertise is needed as to head in the right direction with these aspects.
That said, feedback on Github and code optimisations in any area of the pallet are all very welcome.