Overview
TEE contracts execute as WebAssembly (WASM) components within a sandboxed Wasmtime runtime hosted by a T3N node. By default they have no access to the operating system, network, filesystem, clock, randomness, or any other system resource — only to what a strongly typed Host API, implemented with the WASM Component Model, explicitly exposes, and every interface is gated by its own authorisation check.If a capability is not defined in the Host API, the contract cannot do it.
Host interfaces
| Interface | What it does | Use it when | Gating | z-namespace |
|---|---|---|---|---|
kv-store | Read / write / delete entries in the contract’s namespaced key-value maps. Writes participate in the same atomic transaction as the rest of the call. | Persisting contract state. | Namespace is bound to the contract; no cross-contract reads. | ✅ |
tenant | Tenant-scoped lifecycle and metadata reads. | Multi-tenant contracts that need to know which tenant they’re running under. | Standard per-contract authorisation. | ✅ |
logging | Emit info / debug / error log lines. | Diagnostics. | None. | ✅ |
http | Outbound HTTP / HTTPS requests. Each call has a node-set timeout (30 seconds by default) and response-size cap (10 MiB by default); a longer or larger response fails the call. | Calling a third-party API from your contract. | Per-contract egress allowlist of host names. A listed host that resolves only to private, loopback or cloud-metadata addresses is still refused. | ✅ |
http-with-placeholders | Outbound HTTP where the host substitutes {{profile.<field>}} markers in headers / body from the calling user’s profile before sending. The plaintext value never enters WASM. | Sending user PII (email, phone) to an upstream API without giving the contract read access to it. | Egress allowlist (shared with http) plus a per-contract placeholder_allowlist naming which profile fields may be substituted. | ✅ |
signing | Four signing primitives: (1) cluster ECDSA — Keccak-256 + secp256k1 — via sign / sign-as-user; (2) per-wallet signing via sign-with-wallet for any wallet the calling DID owns; (3) SD-JWT Verifiable Credential issuance via sign-sd-jwt-vc (ES256 / P-256); (4) compact ES256 JWS via sign-jws, signed with a P-256 key the host derives from the cluster key for the calling contract, a purpose and a generation — so a contract can only ever sign with its own key — with jws-public-keys returning the public halves as a JWKS. sign-as-user hashes the raw bytes with Keccak-256 and returns a raw 65-byte r || s || v signature; the host adds no EIP-191 prefix, so the contract builds any personal-sign or EIP-712 pre-image itself. | Producing an Ethereum-compatible signature, signing a transaction on behalf of a user, issuing a Verifiable Credential, or signing a token a relying party verifies against your published keys. | Per-contract allowlist on sign-as-user and on sign-jws (sign-jws ships allowing only tee:session/contracts). jws-public-keys is public data. sign-with-wallet additionally verifies the wallet address is in the caller’s wallet set. | Coming soon |
outbox | Enqueue an HTTP request to be delivered after the current transaction commits. Delivery is at-most-once with an idempotency-key dedupe window, driven by a single leader. A header value may carry {{secret.<name>}} markers: the host checks at enqueue that the secret resolves for the contract, stores the marker as written, and fills the real value in only when the request is sent, so the secret never sits in the queued entry. status reports an entry as pending, committed or failed; committed and failed acks carry the upstream http-status where there is one (a failed ack only for a permanent 4xx). A secret that is missing, or no longer allowlisted for the contract, at send time fails the entry as secret-unavailable:<name> and nothing is sent. | Triggering an external side-effect (payment, webhook) that must not double-fire if the contract is replayed. | Per-contract allowlist of upstream hosts. A tenant (z:) contract’s request must also pass the same egress check as http against its caller’s grant. | Operator opt-in |
ap2 (ap2/mandate) | Removed in testnet-v1.0.10. Used to build and verify AP2 payment mandates; the host interface, its linker world, and the KV policy row backing it were all deleted from the runtime. A contract that still imports ap2/mandate will fail to instantiate. No replacement has shipped as of this release — if you were relying on AP2 mandates, reach out on the developer Telegram. | — | — | — |
vp | Sign and submit Verifiable Presentations (OID4VP). Verifier accepts SD-JWT + Key Binding envelopes against a trusted-issuer registry. | Issuing or verifying W3C-style Verifiable Credentials. | Trusted issuers maintained by the cluster operator. | Coming soon |
did-registry | Link an authenticator (email, OIDC subject, …) to a Decentralised Identifier on chain. | Onboarding a user with a new login method. | Standard per-contract authorisation. | Coming soon |
agent-auth | Update which TEE contracts / functions an agent is authorised to invoke. | Managing delegated agent permissions. | Standard per-contract authorisation. | Coming soon |
user-profile | Encrypt and store user profile data. | Persisting PII alongside a DID. | Standard per-contract authorisation. | Coming soon |
user-removal | Remove all data associated with a user. | GDPR / account deletion flows. | Admin-only by default. | Coming soon |
contracts-call | Synchronously call another contract’s exported function. The inner call executes inside the same transaction as the outer call. If the inner contract fails or traps, the shared transaction is dropped, not only the inner writes, so the outer contract must return its own error to roll back; a refusal before the inner contract runs (not allowlisted, unknown target, depth, reentrancy) leaves the outer transaction intact. Every invoke the gate judges is also recorded as its own row in the organisation activity log. | Composing contracts (e.g. a workflow contract calling a payment contract). | Default-deny per-pair (caller, target) allowlist with allowed_functions and max_depth. Typed errors: not-allowlisted (no row, or function not listed), reentrant (target already on the call stack, or a contract calling itself), depth-exceeded, target-unknown, inner-failed, inner-trapped. When the callee is a tenant contract, its outbound HTTP is held to the original caller’s grant. | Operator-gated |
stash | Drain the binary blob attached to the current multipart request into content-addressed storage and hand the contract a reference to it. | Accepting a file or large payload uploaded alongside the contract call. | Per-contract allowlist; default deny. Single-use per request — a second call returns AlreadyConsumed. | System-only |
agent-registry | Register or update the agent URI for a DID. | Publishing where a user’s agent is reachable. | Standard per-contract authorisation. | System-only |
authorisation | Ask the host whether a given action / host is currently permitted. | Pre-flighting a sensitive operation before doing the work. | None (pure read). | System-only |
otp | Verify a one-time password and track its status. | Email / SMS code verification flows. | Standard per-contract authorisation. | System-only |
config/read | Read a cluster-level configuration value by key (typed read-u64 / read-string). | Reading a non-secret cluster knob set by the operator. | None — configs are public metadata. | System-only |
provider-config | Read operator-managed provider configuration and, if the contract is on the matching secret row’s allowlist, the merged secret bag. | Calling an external provider (KYC, OAuth) whose API key the operator has configured. | Per-contract allowlist on each secret row. | System-only |
time / clock | Read wall-clock and monotonic time. | Any time-dependent logic — there is no other source of time inside WASM. | None. | System-only |
node-config | Read node-level configuration values exposed to contracts. | Reading host-published runtime knobs. | None. | System-only |
Tenant contracts and
outbox / contracts-call. A tenant (z:) contract can link only the interfaces in the node’s auth.tenant_host_interfaces list, an operator setting. At testnet-v1.0.12 the default list includes contracts-call but not outbox. Opening outbox to tenants takes two operator settings (outbox in that list, and z:* under host_iface_allowlists.outbox), and contracts-call refuses every call with not-allowlisted until an operator adds the allowlist row for that exact (caller, target) pair. There is no self-serve way to enable either.