Run a TEE-attested seller
A seller running on Intel TDX hardware can prove it cryptographically to every buyer, before any payment. This guide takes your seller config (see Become a provider) and runs it as Antseed's TEE seller image on a dstack (Phala) confidential VM, with attestation by the antseed-verifier SDK, so buyers that require verification will route to you.
How it works
- Your seller loads the SDK's prover at startup and advertises the capability
verifier.antseed-verifierin its discovery metadata. - A buyer challenges you on the reserved route
/_antseed/attest/antseed-verifierwith a fresh nonce. The prover mints an Intel TDX quote bound to that nonce, your peer ID and the encrypted connection the buyer is on, signs the evidence bundle with your identity key, and returns it. - The buyer verifies the quote against Intel's DCAP certificate chain locally, and checks that its measurements match an approved TEE seller build. Attestation runs before provider matching, payment and metering. It is free and unmetered, and limited to 10 attestations per buyer per minute.
If the prover fails to load at startup, the seller exits rather than advertising a capability it can't answer.
Prerequisites
- A dstack confidential VM host with Intel TDX where you can deploy an app with KMS and encrypted environment variables, such as Phala Cloud. If your deployment exposes app ports only through its TLS gateway, without a public IP or UDP, the seller also needs a public entry point: run
antseed seller forward --to <app-id>-6882.<cluster>.phala.network --peer <peerId>on any small machine with a public IP, setseller.publicAddressto its<ip>:6882, and raiseseller.maxInboundConnectionsPerIp, since every buyer then arrives from the gateway's address. The forwarder sees only ciphertext. To run on Google Cloud instead, see Google Confidential Space. - Your seller's identity key and peer ID, and API keys for its upstreams.
- The signaling (TCP) and DHT (UDP) ports reachable from the internet. For public TCP
14532→ container6882, configure host forwarding and setseller.publicAddressto<public-ip>:14532; the seller announces both TCP ports in the DHT so metadata stays discoverable when the public address names a different host. Buyers attest over encrypted TCP; the connection binding is not available over WebRTC. - Node.js 20+ and a checkout of the Antseed repository on your own machine, to generate the compose file.
Server requirements
| Minimum | Recommended for production | |
|---|---|---|
| dstack (Phala Cloud) | tdx.small: 1 vCPU, 2 GiB | tdx.medium: 2 vCPUs, 4 GiB, or larger |
| Google Confidential Space | c3-standard-4: 4 vCPUs, 16 GiB | The same |
| Disk (dstack) | 20 GB | 40 GB or more |
A confidential VM's memory also holds its own OS and container runtime, so the seller gets less of it than on a plain server of the same size. The seller's memory follows the size and number of requests in flight: a request stays in memory while it is served, and one request can be as large as 64 MiB. A tdx.small seller with steady traffic can run out of memory and restart, so use tdx.medium or larger once you serve real traffic.
On Confidential Space the seller's payment channels and metering are held in the VM's memory as well, since the VM has no disk the seller can write to, so its memory has to hold both.
The disk holds the seller's payment channels and metering history, which grows with traffic. See Become a provider for a seller outside a TEE.
Approved seller builds
Buyers accept a seller node that runs Antseed's official TEE seller image as a dstack (Phala) confidential VM app. The image runs on a distroless runtime with no shell, package manager, runtime plugin installs or dashboard, so its operator has no way into it. From the quote and the evidence the seller sends with it, the buyer checks that:
- MRTD and RTMR0–2 (firmware, VM shape, kernel and boot configuration) are a released dstack production OS listed in the verifier SDK, or the seller sent its VM config and full event log and a local lite check of those against the quote returns an approved OS image hash. No hosted verifier is required;
- the app compose, which the buyer authenticates against the compose hash replayed from the dstack event log, runs an approved image: one that the Publish TEE seller image workflow built from this repository's main branch, which the seller proves with the image's signed build record (the buyer checks it offline against Sigstore's public trust root);
- the compose follows the TEE seller rules: one service, no command or entrypoint override, only the seller data volume and the dstack socket mounted, no pre-launch or init scripts, and the seller config inline, named after the SHA-256 of its content (
compose.mjswrites it) so that a config change always recreates the seller container. Only secrets (the identity key, API keys and optionally the RPC URL) come in as encrypted variables, so every setting that decides where prompts go is readable, and every upstream is HTTPS, with path rewrites that stay on it.
Any seller deploying an approved image this way passes, with no per-seller approval. Buyers also see the upstream hosts the seller config sends prompts to. deploy/tee-seller has the image, a compose generator and the deployment steps. Buyers can accept extra OS releases, OS image hashes or seller images locally with ANTSEED_VERIFIER_NODE_BUILDS (JSON { "os": [{ name, mrtd, rtmr0, rtmr1, rtmr2 }], "osImages": [{ name, hash }], "images": [{ version, digest }] }). osImages hashes are 64 lowercase hex and identify the dstack OS, not the seller container image.
1. Write your seller config
Write the seller config as for any seller (see Seller configuration), with these limits so buyers accept it:
- providers use the
openai,anthropic,typesafe,venice-videooralibaba-videoplugin; - every
baseUrlis HTTPS, and everypathRewritevalue is a path on that upstream (starting with/); - each provider sets
apiKeyEnvto a variable name ending in_API_KEY(not starting withANTSEED_,POSTHOG_orCDP_); - no setting that loads code or configures another role:
seller.agentDir(agent tool modules),plugins,buyer,verifierandrelayerare rejected.
Buyers read the whole config, so don't put keys in URLs.
2. Generate the compose file
Use the digest of an image the Publish TEE seller image workflow built (its run summary shows it, or see ghcr.io/antseed/tee-seller on GitHub), then:
node deploy/tee-seller/compose.mjs \
--image ghcr.io/antseed/tee-seller@sha256:<digest> \
--peer <peerId, without 0x> \
--config config.json > docker-compose.json
It writes a compose file (JSON, which compose also reads) with the image pinned by digest, your config inline, and each secret as an encrypted variable, and it prints the encrypted variables to allow. Add --rpc-url-secret to pass ANTSEED_BASE_RPC_URL as a secret.
3. Deploy it on dstack
Deploy docker-compose.json as a dstack app with KMS enabled, on the dstack 0.6.1 OS image and a CPU instance type (tdx.small to tdx.8xlarge on Phala Cloud), the OS releases and VM shapes buyers accept:
- set the printed variables as encrypted environment variables:
ANTSEED_IDENTITY_HEX(your identity key, hex) and your API keys, and allow exactly those; - add no pre-launch or init script. Public logs may be on: the image runs the seller in content-free mode, so its logs and databases hold no prompts or answers, nor upstream error text about a request, only metadata such as status codes, token counts and buyer peer IDs.
With Phala Cloud's phala CLI:
phala deploy --compose docker-compose.json --kms phala --image dstack-0.6.1 \
--instance-type tdx.small --no-pre-launch-script --env <each printed secret>
tdx.small is enough to start with. For a seller with steady traffic, pass --instance-type tdx.medium or larger. See Server requirements.
The CLI always writes an empty init_script into the app compose. Buyers on verifier 0.1.5 or later accept it while it stays empty; earlier ones reject any init_script and report app compose option init_script is not allowed.
The image starts antseed seller start with the verifier's prover, which mints its quotes through the dstack guest agent. Existing seller images keep passing on the measurement table. The lite OS path needs an updated seller image whose prover sends vmConfig and rawEventLog with the quote. Any change to the compose file (image, config, prices) gives a new compose hash, which buyers check against the same rules, so redeploying needs no approval.
4. Confirm you're advertising
From any other machine:
antseed network peer <peerId>
The output includes Verifiers: antseed-verifier (default).
antseed network browse also shows a Verifier column once any peer advertises one.
5. Attest your inference provider too (optional)
The two gating capabilities, seller-node-tee-genuine and seller-bound, cover your node. If your downstream inference provider also runs confidential hardware, the prover can relay its evidence so buyers see it. seller-provider-tee-genuine, seller-provider-gpu-cc (NVIDIA Confidential Computing) and seller-provider-measured-image are reported for buyer policy.
Pass the settings to compose.mjs with --env, which writes them into the compose file where buyers can read them:
ANTSEED_VERIFIER_PROVIDER_EVIDENCE_URL: an endpoint that returns the provider's evidence for a nonce ({nonce}→ hex);ANTSEED_VERIFIER_PROVIDER_TEE_FIELD: the JSON field holding the provider's quote;ANTSEED_VERIFIER_PROVIDER_BINDING_SCHEME: the frozen report_data binding scheme the provider's quote uses,antseed-rd-v1(Antseed's canonical scheme) ornonce-pubkey-sha256-v1(used by some third-party providers), withANTSEED_VERIFIER_PROVIDER_BINDING_PUBKEY_FIELDnaming the field that holds its pubkey;- optionally
ANTSEED_VERIFIER_PROVIDER_GPU_FIELD: the per-GPU NVIDIA CC evidence field, which enablesseller-provider-gpu-cc.
node deploy/tee-seller/compose.mjs --image ghcr.io/antseed/tee-seller@sha256:<digest> \
--peer <peerId> --config config.json \
--env 'ANTSEED_VERIFIER_PROVIDER_EVIDENCE_URL=https://provider.example/evidence?nonce={nonce}' \
--env ANTSEED_VERIFIER_PROVIDER_TEE_FIELD=quote \
--env ANTSEED_VERIFIER_PROVIDER_BINDING_SCHEME=antseed-rd-v1 \
--env ANTSEED_VERIFIER_PROVIDER_BINDING_PUBKEY_FIELD=e2e_pubkey > docker-compose.json
Buyers count the provider's quote (and show Full TEE) only when the provider is where your node sends prompts: your config has one upstream origin, and your node fetched the quote from that same origin. The fetch doesn't follow redirects, and the node reports the origin it used (images with verifier 0.1.6 or later). A second upstream, such as a fallback to a non-TEE API, evidence from another host, or an older image fails seller-provider-tee-genuine with the reason. Your node's own attestation is unaffected.
The SDK is provider-agnostic: no vendor hosts or schemas are built in, so pointing it at a different confidential-inference backend is configuration only. For a worked example against a live third-party TDX provider, see the SDK's end-to-end guide.
For an ACI-compatible provider, use the aci adapter:
node deploy/tee-seller/compose.mjs --image ghcr.io/antseed/tee-seller@sha256:<digest> \
--peer <peerId> --config config.json \
--env ANTSEED_VERIFIER_PROVIDER_ADAPTER=aci \
--env ANTSEED_VERIFIER_PROVIDER_ACI_URL=https://provider.example/v1/aci/attestation > docker-compose.json
ANTSEED_VERIFIER_PROVIDER_ACI_URL is allowed as a literal compose setting; the legacy fallback ACI_ATTESTATION_URL is not. Use a keyless endpoint: a separate hidden ACI_API_KEY is rejected unless the seller config names it as a provider's apiKeyEnv.
6. Test the full loop as a buyer
From a second machine (no special hardware needed):
antseed buyer start --verifiers antseed-verifier --require-verifier --peer <peerId>
Send any request through the buyer proxy. The buyer log shows Verified <peerId>... via antseed-verifier.
If attestation fails under --require-verifier, the request is refused with a 502 that names the failed claims. That refusal is the guarantee your buyers rely on.
Move an existing seller to the TEE image
Buyers on the current verifier accept only the approved image, deployed as above. A seller that attests from its own build or a plain TDX VM (see Developing the prover outside dstack), or from a dstack compose that breaks the rules, fails seller-node-tee-genuine for them; older buyers accept it until they update. To move it:
- Keep your identity. Deploy with the same identity key (
ANTSEED_IDENTITY_HEX, or the 64 hex characters inidentity.keyin your data directory, if you didn't encrypt it) and setANTSEED_TEE_PEER_IDto the same peer ID. Your registration, stake, reputation and earnings stay with it. - Bring your config within the rules of step 1: move every key out of URLs into an
_API_KEYsecret, dropseller.agentDir,pluginsand anybuyer,verifierorrelayersection, and stop settingANTSEED_DEBUG, which buyers reject. Setseller.publicAddressto the new address (on Phala, the forwarder's); buyers find the seller there through the DHT. - Settle before you switch. The image starts with an empty data directory, and nothing can be copied into it: on Google, the state bucket only takes snapshots the image wrote. A buyer that comes back resumes its channel with the new node, since its next payment authorization covers all it owes. What a buyer that doesn't come back still owes is collected only if the old node settled it, and a node doesn't settle when it stops. So a day ahead, restart the old node with
ANTSEED_SETTLEMENT_IDLE_MS=60000, so that it settles each channel a minute after its last request (amounts belowpayments.minSettleDeltaare skipped), then stop it at a quiet time. - Stop the old node before the new one starts. Two nodes with one identity would both serve its buyers' channels.
- Check the new node as in step 4 and step 6.
Upgrade to a new image
Buyers accept an image as soon as the workflow builds it, through its build record, if they run verifier 0.1.3 or later; earlier buyers accept only the images listed in their verifier. To move to a new one:
-
dstack: regenerate the compose file with the new digest and update the existing app in place, keeping its app ID, so that its data volume and encrypted variables stay. Redeploying needs no approval.
-
Google Confidential Space: the workload identity provider releases secrets and the state bucket only to the image digest in its condition, so allow the new digest first, then restart the VM on it:
Terminalgcloud iam workload-identity-pools providers update-oidc attestation --location=global \
--workload-identity-pool=antseed-tee \
--attribute-condition="assertion.swname == 'CONFIDENTIAL_SPACE' && 'STABLE' in assertion.submods.confidential_space.support_attributes && assertion.submods.container.image_digest in ['sha256:<old digest>', 'sha256:<new digest>']"
gcloud compute instances add-metadata antseed-tee-seller --zone=<zone> \
--metadata=tee-image-reference=ghcr.io/antseed/tee-seller@sha256:<new digest>
gcloud compute instances stop antseed-tee-seller --zone=<zone>
gcloud compute instances start antseed-tee-seller --zone=<zone>The new image restores the state the old one saved. If the old one stopped without its last save, the new one waits up to 2 minutes for its lease, and at most the last 30 seconds of payment updates are lost. Once it serves, remove the old digest from the condition.
Troubleshooting
| Symptom | Cause |
|---|---|
seller-node-tee-genuine fails with "not an approved TEE seller build" | The detail names the reason: an OS the measurement table doesn't list and no local lite check (a new dstack release needs adding, or an updated seller image that sends vmConfig and rawEventLog), an image without a build record from the workflow on main (use one it built; the seller fetches the record from ghcr.io, like the image), or a compose rule the file breaks (regenerate it with compose.mjs) |
seller-node-tee-genuine fails with "no connection binding" | The buyer reached the seller over WebRTC; make the signaling TCP port reachable |
seller-bound missing from verdicts | ANTSEED_VERIFIER_SIGNING_KEY unset, or its address doesn't match ANTSEED_TEE_PEER_ID |
| Buyer reports TCB failures | Host platform needs microcode/TCB updates; buyers running ANTSEED_VERIFIER_STRICT_TCB=true accept only UpToDate |
On Google Confidential Space, the seller's startup lines (prefixed [tee-seller], in Cloud Logging) name the problem:
| Log line | Cause |
|---|---|
set ANTSEED_GCP_STATE to the gs://<bucket>/<prefix> … | No state location; the image doesn't start without one |
bucket listing answered HTTP 404 | The bucket in ANTSEED_GCP_STATE doesn't exist |
sts.googleapis.com answered HTTP …, or HTTP 403 from Secret Manager or Cloud Storage | The workload identity provider's condition doesn't name the running image's digest (see Upgrade to a new image), or the pool lacks access to that secret or bucket |
another seller instance holds …/lease until …; waiting | Another VM serves this seller, or the previous one stopped without releasing its lease; this one starts when it is released or expires, within 2 minutes |
… was not written by this seller identity | The state prefix holds another seller's state; give each seller its own prefix |
Google Confidential Space
The same image also runs on Google Confidential Space: a Google-built OS that runs one container on an Intel TDX VM with no operator access. There the seller sends Google's signed attestation token instead of a quote, and buyers check that it shows Intel TDX, a production image with debugging off, an approved image digest and this round's binding. The operator's settings appear in the token, so buyers check the seller config and its upstreams against the same rules; secrets come from Secret Manager, released only to the attested image. Buyers rely on Google's attestation service here, where on dstack they check the Intel quote themselves.
Confidential Space keeps no data across a VM restart, so the image keeps the seller's payment channels and metering in Cloud Storage under a location you must name (ANTSEED_GCP_STATE): restored on boot, saved while they change (payments every 30 seconds, metering every 5 minutes) and once more when the seller stops, encrypted with a key derived from the seller identity. Like its logs, which may go to Cloud Logging, they hold no prompts or responses. The setup steps are in deploy/tee-seller.
Developing the prover outside dstack
To work on the prover itself, you can run it on any Intel TDX VM (for example a GCP c3 confidential VM): install the SDK into ~/.antseed/plugins from a source checkout (pnpm --filter @antseed/antseed-verifier build, then npm pack and npm install --prefix ~/.antseed/plugins the tarball), set ANTSEED_TEE_PEER_ID and ANTSEED_VERIFIER_SIGNING_KEY, and start sudo -E antseed seller start --verifiers antseed-verifier (quotes come from configfs-tsm, which needs root). Buyers see a genuine quote but don't accept such a node: it is not an approved image under the compose rules.
See also
- Verify a seller's TEE: the buyer side of this handshake.
- AIP-3: Pluggable Verifier SDKs: the protocol specification.
- Don't Trust the TEE Label: why this exists.