Number: HIP-0013
Title: Standard for Profile Data via TXT Records
Type: Standards
Status: Draft
Authors: 0xStefan <https://twitter.com/0xStefan>
Created: 2022-02-22
A proposal to create a standard for the labels of string attributes in TXT records for profile data — following the RFC 1464 standard. Parts of this standard where inspired by EIP-634.
Handshake domains can also be used as usernames. Domains are used to sign in to websites and to identify users in the Handshake ecosystem. Therefore it's useful to be able to attach profile information like an email, phone, avatar or service to a Domain.
This Standard can also be used to provide contact information for domain listings according to HIP-0010.
For the above to work we need standards so any website or app can properly render the TXT records. The records should be flexible, short and easy to understand. It's important to note, that all values should be checked by the application before serving them to the user.
The general syntax for profile data is:
TXT profile <attribute name>=<attribute value>
There are currently five supported attributes: email, phone, avatar and service. All attributes are optional but at least one attribute needs to be present, for a Domain to count as a profile.
Although each <attribute name>=<attribute value> pair can be provided as individual records, please consider using the recommended implementation.
The email attribute is optional. It enables a domain owner to provide an email for the domain. The expected value is an email address.
TXT profile email=<email-address>
TXT profile email=hello@niami.io
TXT profile email=hello@niami
The phone attribute is optional. It enables a domain owner to provide a phone number for the domain. The expected value is a phone number as an E.164 string (a number up to fifteen digits in length starting with a '+'). Regex: ^\+[1-9]\d{1,14}$
TXT profile phone=<phone-number>
TXT profile phone=+15368886253
TXT profile phone=+47538886253
The avatar attribute is optional. It enables a domain owner to provide an avatar for the domain. The expected value is a fully qualified URL that must start with http:// or https:// that points to an image file.
Allowed image formats are: APNG, AVIF, GIF, JPEG, PNG, SVG, WebP according to Common image file types.
TXT profile avatar=<URL>
TXT profile avatar=https://mywebsite.com/avatar.png
TXT profile avatar=https://siasky.net/MABn4I5M6yPT0aCjIMU2OjlTWmKysaqoCeP0gSJw5moVrg
The service attribute is optional. It enables a domain owner to provide a username to a service. The expected value is a service key followed by a username.
TXT profile service=<service-key username>
The service key is made up of a reverse dot notation for a namespace the service owns, ex: com.twitter, com.namebase, io.github. Service keys must contain at least one dot. So if a service is hosted on a Handshake TLD, the service key has to end with a dot.
TXT profile service=com.twitter niami
TXT profile service=com.github 0xstefan
TXT profile service=io.keybase pinheadmz
TXT profile service=hnschat. skmo
To save blockchain / urkel tree space it's encouraged to use only one TXT record for the profile. A semicolon is then used to seperate each <attribute name>=<attribute value> pair.
TXT profile mail=<email-address>;phone=<phone-number>;avatar=<URL>;service=<service-key username>
TXT profile email=hello@example.com;phone=+15368886253;avatar=https://mywebsite.com/avatar.png;service=com.github 0xstefan
There is a slight chance of Cross Site Scripting (XSS) when using URL's in attributes. Therefore a site owner should always verify the provided URL data before adding it to the DOM.
<a href="javascript:alert('Hello World!');">Execute JavaScript</a>
Common image file types by mozilla