# Architecture & Technology

### Overview

The DeAI TPA ecosystem is built as a **modular, decentralized architecture** that combines:

* AI execution
* Token-based payments
* Blockchain-based ownership and coordination

At its core, the system unifies **access, computation, and payment** into a single seamless flow.

***

### 🧩 System Architecture Layers

The architecture consists of four core layers:

***

#### 1. Application Layer (Users & AI Agents)

This layer includes:

* End users accessing AI services
* Developers building applications
* Autonomous AI agents interacting with other AI

Users and agents can:

* Call TPAs
* Send requests
* Receive outputs
* Execute payments

👉 This is where demand is generated

***

#### 2. TPA Execution Layer (Core Innovation)

The TPA layer acts as the **AI routing and execution system**.

Each TPA:

* Represents an AI model or service
* Receives incoming requests
* Routes them to the appropriate compute resource
* Returns results to the caller

Key functions:

* Standardized AI access
* Execution orchestration
* Service discovery

👉 This layer turns AI into **addressable infrastructure**

***

#### 3. Payment Layer (TPCoin Integration)

TPCoin powers all economic activity within the network:

* Payments are executed per request
* Microtransactions are processed in real time
* Value flows directly between users and providers

Key features:

* No subscriptions
* No prepaid balances
* No intermediaries

👉 Payment is embedded directly into execution

***

#### 4. Blockchain & Smart Contract Layer

This layer ensures:

* Ownership of TPAs
* Transaction validation
* Security and transparency

Core components include:

**TPA Storage Contract**

* Stores TPAs as tokenized assets
* Manages ownership and metadata
* Handles minting and registration

**TPA Proxy System**

* Routes interactions between users and TPAs
* Enables upgradeability and scalability
* Verifies execution and ownership

**Registry & Resolution Layer**

* Maps TPA addresses to their associated AI services
* Ensures discoverability and interoperability

👉 This layer provides **trust, ownership, and coordination**

***

### 🔐 Wallet & User Access (Simplified Onboarding)

To remove friction from Web3 adoption, the system includes a **built-in wallet layer**:

* Users can create a wallet directly within the platform
* No need for external tools like MetaMask or Coinbase Wallet
* Wallets are securely linked to user profiles

Key benefits:

* Seamless onboarding for non-crypto users
* Reduced technical barriers
* Immediate access to TPCoin and TPAs

👉 This bridges Web2 simplicity with Web3 infrastructure

***

### ⚙️ Execution Flow

The system operates through a unified flow:

1. A user or AI agent sends a request to a TPA
2. The TPA routes the request to the associated AI model
3. The model processes the task
4. Output is returned to the requester
5. Payment is automatically executed in TPCoin

👉 Execution and payment happen in a single step

***

### 🔒 Security & Infrastructure

The system is designed with a **multi-layered security approach**:

* Smart contracts deployed on secure blockchain infrastructure
* Distributed backend architecture with containerized services
* End-to-end validation of transactions and ownership

Cloud infrastructure follows industry best practices, leveraging secure environments such as Amazon Web Services.

👉 Ensures reliability, scalability, and protection of assets

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

## Working with TPA&#x20;

The technology behind TPA is seamless and adaptable. Minters and clients can interact with the TPA Engine in two ways:&#x20;

1. Making transactions on the blockchain
2. Interacting with Stage Meta's Restful API

Regardless of the chosen method, clients can purchase a TPA, activate their TPA, and access details such as the owner of a TPA, current plaque price, or the history of TPA prices.

To utilize TPA functions and retrieve data on the blockchain, one should call one of the proxy's smart contracts and identify the latest version of the proxy contract or the proxy with the least overhead. If clients wish to use web2 features, such as purchasing with a credit card, they should interact with our Restful API.

{% hint style="info" %}
More information is available at <https://dev.stagemeta.world>
{% endhint %}

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

### Summary of TPA Engine&#x20;

The TPA Engine is a robust platform for managing assets on the blockchain. The four types of smart contracts collaboratively facilitate secure ownership transfer, storage, and verification of TPAs and their associated data. Clients can engage with the system either by executing transactions on the blockchain or through the Stage Meta Restful API. With our user-friendly Stage Wallet, users can efficiently manage their tokens and fully enjoy the benefits of the TPA Engine.

## TPA Wallet

To simplify the management of cryptocurrencies for our users, we provide the option to create a blockchain wallet. By signing in to our website or one of our partner platforms that support TPA Wallet, you can create your own blockchain wallet, accessible only through two-factor authentication using your email.

Blockchain technology offers numerous advantages over traditional wallets, including enhanced security, transparency, and immutability. With a blockchain wallet, you can rest assured knowing that your digital assets are safeguarded by advanced encryption protocols and distributed ledger technology.

To set up your TPA Wallet, you must follow a straightforward process that requires providing personal information and enabling two-factor authentication. Once your wallet is established, you can send and receive crypto, view your transaction history, and manage your account settings.

You can always withdraw your crypto from your TPA Wallet or transfer it to another wallet, such as MetaMask. You can conveniently use your private key to import your TPA Wallet. Please note that fees may apply to certain transactions or services, so ensure to check for any applicable charges before using your TPA Wallet.

## TPA Domains

ENS (Ethereum Name Service) is a smart contract system that allows users to register human-readable names for Ethereum addresses, thereby simplifying the process of sending and receiving cryptocurrency. ENS names can represent any valid Ethereum address, including personal wallets and contract addresses, all of which are stored on the Ethereum blockchain. When you purchase a TPA, a resolver smart contract is deployed for your TPA, providing you with a valid Ethereum address in the ENS system.

## Architecture

The TPA Domains system is composed of two main components: the registry and resolvers. The TPA Domain registry consists of a single smart contract that keeps track of all domains and their subdomains. It stores three crucial pieces of information about each: the owner of the domain, the resolver for the domain, and the caching time-to-live for all records under the domain. The domain owner can be either an external account or a smart contract, while a registrar is a smart contract that owns a domain and issues subdomains of that domain to users based on rules defined in the contract.

Owners of TPA domains in the Stage Meta registry have the authority to set the resolver and TTL for the domain. The TPA Domain registry solely maps from a name to its corresponding resolver.

Resolvers are responsible for translating names into addresses. Any contract implementing the relevant standards can act as a resolver in ENS, with general-purpose resolver implementations available for users with more specific requirements. Each record type - cryptocurrency address, IPFS content hash, etc. - defines a method or methods that a resolver must implement to provide records of that kind. New record types can be created at any time through the EIP standardization process without requiring changes to the TPA Domain registry or existing resolvers to support them.

Resolving a name in ENS is a two-step process: firstly, the registry identifies which resolver is responsible for the name, and then that resolver is queried to answer the user's request.

## Namehash

Resource constraints in smart contracts mean that interacting with human-readable names could be made more efficient. As a result, Stage Meta TPA operates solely with fixed-length 256-bit cryptographic hashes. Namehash is a process used to derive the hash from a name while preserving its hierarchical properties.&#x20;

For example, the name hash of 'AAA-000.TPA' is 0x787192fc5378cc32aa956ddfdedbf26b24e8d78e40109add0eea2c1a012c3dec; this is the representation of names used exclusively inside TPA Domains.

Namehash is a recursive process capable of generating a unique hash for any valid domain name. It is possible to derive the name hash of any subdomain without knowledge or handling of the original human-readable name, starting with the name hash of any domain - for instance, 'AAA-000.TPA'. This function allows TPA Domain to operate as a hierarchical system without having to deal with human-readable text strings internally.

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

## **DeAI TPA Architect & How It Works**

The **DeAI TPA Architect** serves as a scalable, self-training AI protocol. It’s fully decentralized, any developer can contribute modules, and even non-technical users can help train it. As more DeAI TPAs are activated and new websites are onboarded, the model continually refines itself.

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

### **How It Works – High-Level Overview**

1. **Look up and Buy a DeAI TPA:** Select from a fixed pool of 17,576,000 unique 3-letter/3-digit codes (e.g., ABC-123) and register using TPCoin.
2. **Connect to the DeAI Model:** In the activation panel, link your URL. The AI scans your site and instantly generates a 3D immersive version.
3. **Launch Your Immersive Site:** Preview your 3D site with editable AI-generated prompts, then go live across supported platforms, mobile, desktop, Apple Vision Pro, Meta Quest, or any TPA-compatible 3D immersive browser.

These steps complete a decentralized, protocol-driven pipeline, transforming traditional web content into 3D immersive experiences, all powered by a continuously learning, community-enhanced AI layer, secured and fueled by TPCoin.


---

# 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.thetpa.ai/ai-teleport-plaque-address/deai-tpa-technology/architecture-and-technology.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.
