ARC-16: Convention for declaring traits of an ASA's Source

This is a convention for declaring traits in an ASA's (NFT) metadata.

AuthorKeegan Thompson
Discussions-Tohttps://github.com/algorandfoundation/ARCs/issues/62
StatusFinal
TypeStandards Track
CategoryARC
Created2022-01-04

Standard for declaring traits inside non-fungible ASA’s metadata

Abstract

The goal is to establish a standard for how traits are declared inside a non-fungible ASA’s (NFT) metadata, for example as specified in (ARC-3) or (ARC-69).

Specification

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC-2119.

Comments like this are non-normative.

If the property traits is provided anywhere in the metadata of an asset, it MUST adhere to the schema below. If the asset is a part of a larger collection and that collection has traits, all the available traits for the collection MUST be listed as a property of the traits object. If the asset does not have a particular trait, it’s value MUST be “none”.

The JSON schema for traits is as follows:

{
  "title": "Traits for Non-Fungible Token",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "description": "Traits (attributes) that can be used to calculate things like rarity. Values may be strings or numbers"
    }
  }
}

Examples

Example of an NFT that has traits
{
  "name": "NFT With Traits",
  "description": "NFT with traits",
  "image": "https://s3.amazonaws.com/your-bucket/images/two.png",
  "image_integrity": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",
  "properties": {
    "creator": "Tim Smith",
    "created_at": "January 2, 2022",
    "traits": {
      "background": "red",
      "shirt_color": "blue",
      "glasses": "none",
      "tattoos": 4,
    }
  }
}
Example of an NFT that has no traits
{
  "name": "NFT Without Traits",
  "description": "NFT without traits",
  "image": "https://s3.amazonaws.com/your-bucket/images/one.png",
  "image_integrity": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",
  "properties": {
    "creator": "John Smith",
    "created_at": "January 1, 2022",
  }
}

Rationale

A standard for traits is needed so programs know what to expect in order to calculate things like rarity.

Backwards Compatibility

If an asset has metadata without the field traits, each value of properties should be considered a trait.

Security Considerations

None.

Copyright and related rights waived via CCO.

Citation

Please cite this document as:

Keegan Thompson, "ARC-16: Convention for declaring traits of an ASA's," Algorand Requests for Comments, no. 16, January 2022. [Online serial]. Available: https://algorandfoundation.github.io/ARCS/arc-16.