TrUAPI
Introduction
Section titled “Introduction”TrUAPI is the protocol every Polkadot Product uses to talk to the Host running it. It is the only interface a Product has to the rest of the world. Every chain interaction, storage write, outbound request, signing operation, and Proof of Personhood proof crosses this boundary, and the Host on the other side enforces the sandbox.
In the Polkadot Triangle, three Hosts run Products. TrUAPI is the contract by which a Product talks to whichever Host is loading it. Most Product developers will never call TrUAPI directly. The Product SDK (the @parity/product-sdk family of packages) wraps it in typed methods. The methods you call still go through TrUAPI, and the Host validates and routes everything.
This reference documents the protocol surface in three layers:
- Conceptual model: Why the Host-Product boundary exists, what derived sub-accounts mean, and how the sandbox enforces isolation. See Sandbox and Sub-Accounts.
- Operational properties: The protocol's versioning model and the packages that implement it. See Versioning and Packages.
- Method groups: Eleven groups covering the capabilities a Product reaches for. One page per group is linked in The Eleven Method Groups. A few host-lifecycle methods sit outside these groups; see the note below.
Two Audiences
Section titled “Two Audiences”TrUAPI has two distinct readerships, and the per-method pages are written to serve both at once:
- Product developers: You build Products that call the TrUAPI surface. You need to know what each method does, what permissions gate it, what it returns, and how the Product SDK wraps it.
- Host developers: You build Hosts that implement the TrUAPI surface. You need to know what each method must guarantee, how to validate the Product's call, and how to enforce the sandbox at every entry point.
A Product developer can usually rely on the Product SDK (the @parity/product-sdk family of packages) and never call TrUAPI directly. A Host developer is reading the same pages to know what the SDK calls underneath, and what their Host has to honor.
The Eleven Method Groups
Section titled “The Eleven Method Groups”| Group | Covers |
|---|---|
| TrUAPI Calls | The lifecycle calls Products use to identify themselves and the Host uses to introduce capabilities. |
| Permissions | Declaring, querying, and gating on Product capabilities. |
| Local Storage | The KvStore API for per-Product, per-device key-value persistence. |
| Account Management | Resolving per-Product sub-accounts and reading their state. |
| Signing | The mediated signing flow for building transactions and dispatching them through the paired App. |
| Chat | Room and bot registration, typed message publishing, custom message rendering. |
| Statement Store | Publishing and subscribing to gossip-distributed signed statements on People Chain. |
| Preimage | Off-chain content addressed by hash for on-chain operations to dereference. |
| Chain Interaction | Reading chain state and subscribing to changes through the Host. |
| Payment | Payment-flow primitives (general Balances transfers and the Pocket flow). |
| Entropy | Deterministic per-Product entropy derived from the user's root key (key-derivation, not randomness). |
High-Level Diagram
Section titled “High-Level Diagram”Where to Go Next
Section titled “Where to Go Next”-
Sandbox and Sub-Accounts
Why a Product gets a derived sub-account rather than the user's root identity, and why the Host API is the only egress.
-
Versioning
How TrUAPI versions evolve and what compatibility a Product can rely on across them.
-
Packages
The package map: which SDK package wraps which TrUAPI method group, and where the boundary between Product code and Host code lives.