# Trait Templates

#### Understanding Traits

Traits are unique descriptors that, when combined, form the core identity of a Non-Fungible Token (NFT). They function as the driving force behind the versatility and value of NFTs.

#### The Purpose of Trait Templates

Trait Templates provide a standardized set of attributes and features that can be applied to NFTs to bestow them with exclusive properties. These templates act as building blocks, facilitating the construction of more intricate ERC-721 token structures.

By defining a collection of shared attributes and behaviors, developers can selectively combine different templates to generate tokens with a broad spectrum of functionality and customization options.

#### The Structure of a Trait Template

A Trait Template is structured as a JSON file, containing an array of traits that are subsequently added to the blockchain and assigned to NFTs. In essence, it is a package of data objects submitted collectively, simplifying the management of metadata for multiple NFTs simultaneously.

**Creating a Compatible Trait Template**

To create a Trait Template compatible with our platform, it must be a valid JSON file. Each trait is represented as an object with four fields:

1. `value`: This field represents the value of the trait, such as "Background 01" in the example above.
2. `trait_type`: This field defines the name of the trait, such as "Background" in the example above.
3. `render_order`: This field specifies the order in which the trait should be rendered. For example, if two traits have the same renderOrder value, they will be rendered in the order they appear in the JSON file.
4. `image_url`: This field provides a URL to an image that represents the trait, such as a background or an accessory.

Here's an example of a unique trait in JSON code:

```json
{
  "value": "Jersey 15, Stance 02",
  "trait_type": "Jersey"
  "render_order": "4"
  "image_url": "ar://PHVlm5NP_cmlKB9SPWymrnYxa4DOUs935yrCvlf1c_c",
  "original_minter_royalty_bips": "200",
  "artist_royalty_bips": "200",
  "artist_address": "0x956fefb316a11fa5b528f1fe0eee2b2e2e62ae60",
  "original_minter_address": "0x7b7ec6cfa269d17f8484fd031748d80929f96491",
},
```

You can add as many traits as needed for your collection, and there is no limit to the number of traits that can be included in a Trait Template.

Here's a snippet of a Trait Template JSON file:

```json
[
  // ... (previous traits)
{
  "value": "Jersey 15, Stance 02",
  "trait_type": "Jersey"
  "render_order": "4"
  "image_url": "ar://PHVlm5NP_cmlKB9SPWymrnYxa4DOUs935yrCvlf1c_c",
  "original_minter_royalty_bips": "200",
  "artist_royalty_bips": "200",
  "artist_address": "0x956fefb316a11fa5b528f1fe0eee2b2e2e62ae60",
  "original_minter_address": "0x7b7ec6cfa269d17f8484fd031748d80929f96491",
},
  // ... (other traits)
]

```

To mint a new NFT collection, the first step is to submit a Trait Template that includes all of the collection's traits. The Trait Template should be submitted as a JSON file. There is no limit to the number of traits it can contain.

{% hint style="info" %}
Please note that the collection owner needs to submit the Trait Templates before minting a new collection. When minting, you will indicate which trait templates should be used for the token.
{% endhint %}

Ready to create your own Trait Template? Get started here:

{% content-ref url="/pages/4JTpKGElXs3GAVCXE7MM" %}
[Create a New Trait Template](/degen-engine/guides/trait-templates/create-a-new-trait-template.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.playground.ooo/degen-engine/guides/trait-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
