Skip to content

Latest commit

 

History

History
130 lines (82 loc) · 4.98 KB

HIP-0013.md

File metadata and controls

130 lines (82 loc) · 4.98 KB

HIP-0013 : Standard for Profile Data via TXT Records

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

Abstract

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.

Motivation

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.

TXT Record Standard: Profile Data

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.

(1) Profile Attribute: Email

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>

Valid Email Examples

TXT profile email=hello@niami.io
TXT profile email=hello@niami

(2) Profile Attribute: Phone

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>

Valid Phone Examples

TXT profile phone=+15368886253
TXT profile phone=+47538886253

(3) Profile Attribute: Avatar

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>

Valid Avatar Examples

TXT profile avatar=https://mywebsite.com/avatar.png
TXT profile avatar=https://siasky.net/MABn4I5M6yPT0aCjIMU2OjlTWmKysaqoCeP0gSJw5moVrg

(4) Profile Attribute: Service

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.

Valid Service Examples

TXT profile service=com.twitter niami
TXT profile service=com.github 0xstefan
TXT profile service=io.keybase pinheadmz
TXT profile service=hnschat. skmo

Recommended Implementation

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>

Valid Profile Example with the semicolon delimiter

TXT profile email=hello@example.com;phone=+15368886253;avatar=https://mywebsite.com/avatar.png;service=com.github 0xstefan

Security Concerns

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.

Example

<a href="javascript:alert('Hello World!');">Execute JavaScript</a>

References

RFC 1464 Standards

Common image file types by mozilla

EIP-634: Storage of text records in ENS

Official ITU E.164 recommendation