# Data Architecture

### Overview

The [Xyxyx Text-Based Tokenization Architecture (XTBTA)](/xyxyx-text-based-tokenization-architecture-xtbta.md) introduces a structured, multi-layered approach to embedding both visual and semantic data within each [Text-Based Token](/text-based-tokens-tbts.md).

Rather than treating token content as a single flat layer, XTBTA separates human-facing presentation from system-readable metadata at the architectural level. This is achieved through an SVG-based data model that distinguishes between two complementary data types: **Token Text** and **Metadata Text**.

Each TBT is composed using dedicated SVG elements — `<text>` for visible, user-generated content, and `<desc>` for metadata meant for programmatic consumption. This layered structure enables the token to serve dual purposes: as a visually expressive artifact and as a carrier of structured, queryable information. By embedding both layers directly within the smart contract, XTBTA facilitates rich interaction across interfaces — from user-facing applications to backend indexing systems — without compromising decentralization or on-chain permanence.

***

### Data Layering

XTBTA employs a dual-input model comprising two distinct text functions for composing TBTs: [Token Text](/text-based-tokens-tbts.md#token-text) and [Metadata Text](/text-based-tokens-tbts.md#metadata-text), each targeting a specific layer of data representation within the on-chain SVG architecture.&#x20;

* The **Token Text** function allows users to input free-form text that is rendered visually within the SVG graphic of the token. This content is directly inserted into the SVG markup and becomes part of the token's visible, human-readable output — making it ideal for declarative content that should be perceivable at the presentation layer of the token.
* In contrast, the **Metadata Text** function is designed for system-readable content. It embeds a text record inside the SVG file but not as part of the visible image. Instead, it is included as structured data within the token’s `tokenURI` metadata field, stored either as raw text or in standardized formats like JSON. This allows developers and off-chain systems to parse and interpret token-specific attributes, logic, or additional semantic data. For example, **Metadata Text** can encapsulate a JSON object that mirrors or expands on the **Token Text** content, enabling machine-readable access to the token’s semantics without altering its visual representation.

As a result, TBTs can be leveraged in a wide range of interoperable applications — from human-facing interfaces to automated indexing, querying, or integration with external data pipelines.

***

### Data Structure

XTBTA composes each TBT using a layered SVG-based data structure that cleanly separates human-readable content from machine-readable metadata. This is achieved through the use of two distinct SVG elements — `<desc>` and `<text>` — each serving a specific role in the token's on-chain representation.

1. `<desc>`: The description element is for [Metadata Text](/text-based-tokens-tbts.md#metadata-text).
2. `<text>`: The text element is for [Token Text](/text-based-tokens-tbts.md#token-text).

**Example**

**SVG Output**

<figure><img src="/files/OOk4EF1R0WisgWzCFS3r" alt=""><figcaption></figcaption></figure>

**SVG File**

{% code overflow="wrap" %}

```svg
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><metadata>Built on Xyxyx<desc>
{
  "token_id": "TBILL-912796WQ4",
  "issuer": "J.T.",
  "instrument_type": "Treasury Bill",
  "term": "13 weeks",
  "cusip": "912796WQ4",
  "issue_date": "2025-05-01",
  "maturity_date": "2025-07-31",
  "discount_rate": "5.12%",
  "face_value_usd": 1000,
  "purchase_price_usd": 987.20,
  "timestamp": "2025-05-11T15:42:00Z"
}
</desc></metadata><rect width="100%" height="300px" fill="#ffffff" borderRadius="10px" rx="10" ry="10"></rect><text x="10" y="20" font-size="10px" fill="#000000"><tspan x="10" dy="0" font-family="'Arial', sans-serif" font-size="10px">TREASURY BILL RECORD</tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">----------------------------------------  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Issuer: J.T.</tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Instrument: 13-Week T-Bill  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">CUSIP: 912796WQ4  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Issue Date: 2025-05-01  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Maturity Date: 2025-07-31  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Discount Rate: 5.12%  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Face Value: $1,000  </tspan><tspan x="10" dy="1.2em" font-family="'Arial', sans-serif" font-size="10px">Purchase Price: $987.20</tspan></text></svg>
```

{% endcode %}

**Where**

`<desc>` :

```json
{
  "token_id": "TBILL-912796WQ4",
  "issuer": "J.T.",
  "instrument_type": "Treasury Bill",
  "term": "13 weeks",
  "cusip": "912796WQ4",
  "issue_date": "2025-05-01",
  "maturity_date": "2025-07-31",
  "discount_rate": "5.12%",
  "face_value_usd": 1000,
  "purchase_price_usd": 987.20,
  "timestamp": "2025-05-11T15:42:00Z"
}
```

***

`<text>` :

```
TREASURY BILL RECORD
----------------------------------------  
Issuer: J.T.
Instrument: 13-Week T-Bill  
CUSIP: 912796WQ4  
Issue Date: 2025-05-01  
Maturity Date: 2025-07-31  
Discount Rate: 5.12%  
Face Value: $1,000  
Purchase Price: $987.20  
```


---

# 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.xyxyx.pro/xyxyx-text-based-tokenization-architecture-xtbta/data-architecture.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.
