Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New HIP: TXT Record Naming Standards #46

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
116 changes: 116 additions & 0 deletions HIP-xxx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# HIP-xxx : TXT Record Naming Standard for Profile Data

```
Number: HIP-xxx
Title: TXT Record Naming Standard for Profile Data
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](https://datatracker.ietf.org/doc/html/rfc1464) standard.

## 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 social profiles information to a Domain.

This Standard can also be used to provide contact information for domain listings according to [HIP-XXXX](https://github.com/handshake-org/HIPs/pull/46/files/18bed187abbbcf2846f4fea78df1f7f8f1348608?short_path=1d2937e#diff-1d2937eacaeeb0fe53fcad8e70f406714fb6359c5fef0f47b1aef97e1cdfcbed).

## 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 is important to note, that it's impossible to validate the data via HSD. Therefore TXT records must be validated by the site owner or app that is rendering the TXT records.
0xStefan marked this conversation as resolved.
Show resolved Hide resolved

The general syntax for profile data is:

**TXT** `profile <attribute name>=<attribute value>`

There are currently five supported attributes: **[email](#email)**, **[phone](#phone)**, **[avatar](#avatar)** and **[social](#social)**. All attributes are optional but at least one attribute needs to be present, for a Domain to count as a profile.

### <a id="email"></a> (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
```

### <a id="phone"></a> (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.

Ideally the phone number is provided with a plus icon (+) and the country code.

```
TXT profile phone=<phone-number>
```

#### Valid Phone Examples

```
TXT profile phone=+1(536)8886253
TXT profile phone=+15368886253
TXT profile phone=+1536-888-6253
TXT profile phone=1536-888-6253
```

### <a id="avatar"></a> (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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this limited to be only http:// and https:// hence the "must"?

I think this should also accept something like ftp:// or decentralized storage protocols like ipfs://, ipns://, sia://, ar:// or maybe anything that follows RFC3986 standard

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about ftp://. When would you need that?
With the others I totally agree but would IMO only add them after they receive full support in most major browsers.


Allowed image formats are: APNG, AVIF, GIF, JPEG, PNG, SVG, WebP according to [Common image file types](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types).

```
TXT profile avatar=<URL>
```

#### Valid Avatar Examples

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

### <a id="social"></a> (4) Profile Attribute: Social

The social attribute is optional. It enables a domain owner to provide social media usernames for the domain. The expected value is the name of the social platform followed by a username.

The name of the social platform can be gathered by taking the hostname (e.g. www.twitter.com), then removing the www. and the TLD (.com). If the social platform is hosted on a handshake Domain, the handshake Domain is used as the name for the social platform.

Site owners and apps using that data can decide which social platforms they want to support and how to display them.

```
TXT profile social=<social-media-name username>
```

#### Valid Social Username Examples

```
TXT profile social=twitter 0xstefan
TXT profile social=github 0xstefan
TXT profile social=discord 0xstefan#4697
TXT profile social=hnschat 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>`
pinheadmz marked this conversation as resolved.
Show resolved Hide resolved

## References

[RFC 1464 Standards](https://datatracker.ietf.org/doc/html/rfc1464)

[Common image file types by mozilla](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types)
81 changes: 81 additions & 0 deletions HIP-xxxx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# HIP-xxxx : TXT Record Naming Standard for Domain Listings

```
Number: HIP-xxxx
Title: TXT Record Naming Standard for Domain Listings
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 domain listings — following the [RFC 1464](https://datatracker.ietf.org/doc/html/rfc1464) standard.

## Motivation

If a domain is not listed on an open marketplace like Namebase or Shakedex, it's hard to know if a domain is for sale by the owner or not. Furthermore a domain seller has no reliable way to provide that information.

## TXT Record Standard: Domain Listing

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 is important to note, that it's impossible to validate the data via HSD. Therefore TXT records must be validated by the site or app that is rendering the TXT records.

The general syntax for domain listings is:

**TXT** `listing <attribute name>=<attribute value>`

There are currently two supported attributes: **[price](#price)** and **[url](#url)**.

### <a id="price"></a> (1) Listing Attribute: Price (mandatory)

The listing price attribute is mandatory to create a domain listing. It enables a domain owner to provide a listing price for the domain. The expected value is the unit as a string, followed by the amount as a number. If the number contains decimals, a dot must be used as a seperator.

```
TXT listing price=<unit number>
```

#### Valid Listing Price Examples

```
TXT listing price=HNS 1000
0xStefan marked this conversation as resolved.
Show resolved Hide resolved
TXT listing price=USD 50
TXT listing price=EUR 999.99
TXT listing price=BTC 0.000224
```

The value can also be 0 or null:

```
TXT listing price=0
TXT listing price=
```

Which means the domain is for sale and offers are accepted.

### <a id="url"></a> (2) Listing Attribute: URL (optional)

The listing url attribute is optional. It enables a domain owner to provide a url, where visitors can find more information about the domain. It can also be used to point visitors to a parking website or a private marketplace. The expected value is a fully qualified URL that must start with http:// or https://.

```
TXT listing url=<URL>
```

#### Valid Listing Url Examples

```
TXT listing url=https://www.learnmore.com/about/my/domain
TXT listing url=https://learnmoreaboutmydomain/
```

0xStefan marked this conversation as resolved.
Show resolved Hide resolved
## Security Concerns

There is a slight chance of Cross Site Scripting (XSS). 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](https://datatracker.ietf.org/doc/html/rfc1464)