Name Service (DPNS)#
Overview#
Dash Platform Name Service (DPNS) is a service used to register names on Dash Platform. It is a general service that is used to provide usernames and application names for identities but can also be extended in the future to resolve other cryptocurrency addresses, websites, and more. DPNS is implemented as an application on top of the platform and leverages platform capabilities.
👍 DPNS DIP
The DPNS Dash Improvement Proposal (DIP) provides more extensive background information and details.
Relationship to identities#
DPNS names and Identities are tightly integrated. Identities provide a foundation that DPNS builds on to enable name-based interactions – a user experience similar to what is found in non-cryptocurrency applications. With DPNS, users or application developers register a name and associate it with an identity. Once linked, the identity’s private keys allow them to prove ownership of the name to establish trust when they interact with other users and applications.
Details#
Name Registration Process#
📘
Given the DNS-compatible nature of DPNS, all DPNS names are technically domain names and are registered under a top-level DPNS domain (
.dash
). Some applications may abstract the top-level domain away, but it is important to be aware that it exists.
To prevent front-running, name registration is split into a two phase process consisting of:
Pre-ordering the domain name
Registering the domain name
In the pre-order phase, the domain name is salted to obscure the actual domain name being registered (e.g. hash('alice.dash' + salt)
) and submitted to platform. This is done to prevent masternodes from seeing the names being registered and “stealing” them for later resale. Once the pre-order receives a sufficient number of confirmations, the registration can proceed.
In the registration phase, the domain name (e.g. alice.dash
) is once again submitted along with the salt used in the pre-order. The salt serves as proof that the registration is from the user that submitted the pre-order. This registration also references the identity being associated with the domain name to complete the identity-domain link.
Implementation#
DPNS names have several constraints as defined in the DPNS data contract. The constraints provide compatibility with DNS and protection from homograph attacks:
Maximum length - 63 characters
Character set -
0-9
,-
(hyphen), andA-Z
(case insensitive)Note: Use of
-
as a prefix/suffix to a name is not allowed (e.g.-name
orname-
). This constraint is defined by this JSON-Schema pattern in the DPNS data contract:^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$
Domain labels are converted to lowercase for case-insensitive uniqueness validation. Then, “o”, “i” and “l” replaced with “0” and “1” to mitigate homograph attacks. For example, “Alice” is normalized “a11ce”.
Additional validation rules related to the domain
document are enforced by the DPNS data triggers defined in rs-drive-abci.
Contract Diagram#
This is a visualization of the JSON data contract as UML class diagram for better understanding of the structure. The left side shows the domain
document and the right side shows the preorder
document: