This document provides a high-level introduction to dstack, covering its purpose, architecture, and core components. For hands-on deployment instructions, see Getting Started. For detailed component documentation, see Core Infrastructure Services. For security details, see Security Model and Trust Boundaries.
Sources: README.md19-41
dstack is an open framework for confidential AI that enables deploying applications with cryptographic privacy guarantees using Intel TDX (Trust Domain Extensions) and NVIDIA Confidential Computing. It provides a complete infrastructure stack for running Docker containers inside Confidential Virtual Machines (CVMs) with hardware-rooted security.
Key characteristics:
docker-compose.yaml files without code changesSources: README.md19-41 docs/deployment.md1-11
Traditional cloud deployments require users to trust providers with:
This trust model breaks down for:
dstack's solution: Hardware-enforced isolation where:
Sources: README.md19-24 docs/deployment.md7-11
Architecture Analysis:
This diagram shows the complete dstack deployment topology. The dstack-vmm service runs on bare-metal TDX hardware and orchestrates multiple Confidential Virtual Machines (CVMs). Each CVM runs a guest-agent instance that provides attestation and key derivation APIs. The dstack-kms enforces authorization policies by querying either auth-simple (config-based) or auth-eth (smart contract-based) before releasing keys. The dstack-gateway handles TLS termination and routes traffic to app CVMs. All TDX quotes are verified against Intel's Provisioning Certificate Service.
Sources: Cargo.toml16-55 docs/deployment.md6-11 High-Level Diagrams (Diagram 1)
The dstack-vmm service runs on bare-metal TDX hosts and manages the lifecycle of Confidential Virtual Machines.
Key responsibilities:
docker-compose.yaml files directly (no conversion needed)Configuration: `vmm/vmm.toml` specifies KMS URLs, Gateway URLs, CID pool ranges, and port mappings.
Sources: docs/deployment.md119-169 Cargo.toml27
The dstack-kms service runs inside its own CVM and provides cryptographic key management with hardware-rooted security.
Key responsibilities:
Authorization flow:
GetAppKey() RPCPOST /bootAuth/app on auth server with AppBootInfo(isAllowed: bool, reason: string)Configuration: `kms/kms.toml` specifies auth webhook URL, RPC address, and onboarding settings.
Sources: docs/deployment.md172-282 Cargo.toml17-18 High-Level Diagrams (Diagram 2)
The dstack-gateway service runs in its own CVM and handles TLS termination, certificate management, and traffic routing.
Key responsibilities:
Certificate management: The certbot service runs inside the Gateway CVM and automatically:
Configuration: `gateway/gateway.toml` specifies public domain, WireGuard settings, and upstream KMS URLs.
Sources: docs/deployment.md289-373 Cargo.toml29-32 High-Level Diagrams (Diagram 6)
The guest-agent service runs inside every CVM and provides local APIs for attestation, key derivation, and signing.
Key responsibilities:
DstackGuest, Tappd (legacy), Worker (public)/var/run/dstack.sockAPI surfaces:
/var/run/dstack.sock for local app accessGetKey, GetQuote, GetTlsKey, Sign, VerifySources: docs/deployment.md69-75 Cargo.toml25-26 High-Level Diagrams (Diagram 4)
Authorization servers implement the webhook interface that KMS calls to validate boot requests.
Available implementations:
| Server | Type | Configuration | Use Case |
|---|---|---|---|
auth-simple | Config-based | JSON file | Dev/testing, simple whitelists |
auth-eth | Smart contract | Ethereum RPC | Production, decentralized governance |
Webhook interface:
GET / - Health checkPOST /bootAuth/app - Validate app boot with AppBootInfoPOST /bootAuth/kms - Validate KMS boot with AppBootInfoAppBootInfo structure:
Sources: docs/deployment.md176-217 docs/onchain-governance.md7-11 kms/auth-eth/foundry-cast-cheatsheet.md166-183
dstack implements a zero-trust architecture with multiple security layers:
Security guarantees:
Sources: README.md31-40 docs/deployment.md96-103 High-Level Diagrams (Diagram 2)
Deployment stages:
docker-compose.yaml via VMM web console or CLISources: docs/deployment.md487-511 High-Level Diagrams (Diagram 3)
The dstack codebase is organized as a Cargo workspace with the following major components:
Workspace organization:
vmm, kms, gateway, guest-agent)tdx-attest, ra-tls, ra-rpc, cc-eventlog)certbot, ct_monitor, supervisor, dstack-util)sdk/rust, Python/JS/Go are external)kms/rpc, guest-agent/rpc, gateway/rpc, vmm/rpc)Sources: Cargo.toml15-55
Applications interact with the guest agent through multi-language SDKs:
SDK features:
| Language | Package | Unix Socket | HTTP | Blockchain Helpers |
|---|---|---|---|---|
| Python | dstack-sdk | ✓ | ✓ | Ethereum, Solana |
| TypeScript | @phala/dstack-sdk | ✓ | ✓ | - |
| Rust | dstack-sdk | ✓ | ✓ | - |
| Go | github.com/Dstack-TEE/dstack/sdk/go | ✓ | ✓ | - |
RPC services:
Sources: README.md80-89 Cargo.toml46-47 High-Level Diagrams (Diagram 4)
For production deployments, authorization policies are enforced by Ethereum smart contracts:
Contract hierarchy:
Authorization flow:
POST /bootAuth/app on auth-eth webhook serverisAppAllowed(AppBootInfo) on DstackKms contractSources: docs/onchain-governance.md1-58 kms/auth-eth/foundry-cast-cheatsheet.md1-50 High-Level Diagrams (Diagram 5)
dstack supports two deployment modes:
All components run directly on the host for local testing:
Use case: Local development, testing, debugging
Sources: docs/deployment.md27-92
Security-hardened deployment with all guarantees enabled:
Requirements:
Sources: docs/deployment.md95-373
For hands-on deployment:
For component documentation:
For security topics:
For smart contract governance:
For application development:
Sources: Table of Contents JSON structure
Refresh this wiki
This wiki was recently refreshed. Please wait 7 days to refresh again.