# Custom Data

Custom data is not a separate contract. It's a string field within the Domains struct in the [TLD contract](https://docs.punk.domains/contracts/tld-contract/) (Explained by punk domains):

```solidity
struct Domain {
	string name;
	uint256 tokenId;
	address holder;
	string data; // <-- CUSTOM DATA
}
```

The purpose of custom data is to hold an arbitrary amount of various data (stored as a stringified JSON object).

Because the custom data field is unstructured, the Punk Domains community has to define a common standard for structuring JSON data in order to avoid parsing issues.

### [#](https://docs.punk.domains/contracts/custom-data/#custom-data-standard)Custom data standard

This section holds the official standard for structuring the custom data JSON object. Note that the standard may change over time, but we'll try to make sure that changes are always backward compatible.

**Custom data JSON structure** (example for `astro.smol`):

```json
{
  "imgAddress": "url-or-nft-address", // either an HTTP url (e.g. "http://hey.com/me.jpg") or an NFT address (0xa12B3...)
  "imgTokenId": 0, // in case of NFT address, tokenID is mandatory, otherwise it is not
  "imgChainId": 137, // the chain where NFT exists on
  
  "url": "https://smol.domains",
  "emails": ["user@example.com"], // possible to add multiple emails
  "twitter": ["smoldomains"], // possible to add multiple twitter handles
  
  "subdomains": {
    "sandbox": { // sandbox.techie.smol - in case I want to have a username with different data (like PFP) in the Sandbox metaverse
      "address": "0x123...",
      "pfpTokenAddress": "0x098...",
      "pfpTokenId": 22 // PFP ownership needs to be verified on front-end
    }
  },
  
  "chainAddresses": { // if user wants to define different addresses on different chains (only one address per chain)
    "10": "0xa5b6...",
    "100": "0xc8d9...",
    "42161": "0xe2f3...",
  }
}
```

Note that **comments should be excluded** from your custom data. They are present in the above example just to provide some more information on the structure.

[<br>](https://docs.punk.domains/contracts/tld-contract/)


---

# 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.smol.domains/integreation-docs/custom-data.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.
