Skip to content

Commit f1bd859

Browse files
committed
draft readme
1 parent 0e4301c commit f1bd859

1 file changed

Lines changed: 85 additions & 58 deletions

File tree

README.md

Lines changed: 85 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
**Example applications for [dstack](https://github.com/Dstack-TEE/dstack) - Deploy containerized apps to TEEs with end-to-end security in minutes**
1111

12-
[Getting Started](#getting-started)[Examples](#examples)[Contributing](CONTRIBUTING.md)[Documentation](#documentation)[Community](#community)
12+
[Use Cases](#use-cases)[Architecture Walkthrough](#architecture-walkthrough)[Dev Tools](#dev-scaffolding)[Documentation](#documentation)
1313

1414
</div>
1515

@@ -19,113 +19,140 @@
1919

2020
This repository contains ready-to-deploy examples demonstrating how to build and run applications on [dstack](https://github.com/Dstack-TEE/dstack), the developer-friendly SDK for deploying containerized apps in Trusted Execution Environments (TEE).
2121

22-
### What You'll Find Here
23-
24-
- **Security Features** - Remote attestation, verification, and privacy-preserving apps
25-
- **Secret Management** - Secure handling of credentials and sensitive data in TEE environments
26-
- **Networking Patterns** - HTTPS termination, custom domains, port forwarding in the cloud
27-
- **Best Practices** - Production-ready implementations following TEE security principles
22+
The examples are organized to follow the **TEE+EVM design patterns** from [ERC-733](https://erc733.org), walking through the key architectural layers: attestation, gateway/interoperability, key management, and on-chain interaction.
2823

2924
## Prerequisites
3025

31-
Before you begin, ensure you have:
32-
33-
- Access to a dstack environment
26+
- Access to a dstack environment (self-hosted or [Phala Cloud](https://cloud.phala.network))
3427
- Basic understanding of [TEE concepts](https://docs.phala.network/dstack)
35-
- Basic familiarity with Docker Compose configuration files
28+
- Basic familiarity with Docker Compose
3629
- Git for cloning the repository
3730

38-
You can deploy dstack on your own server, or use [Phala Cloud](https://cloud.phala.network).
39-
40-
## Getting Started
41-
42-
### Quick Start
43-
4431
```bash
45-
# Clone the repository
4632
git clone https://github.com/Dstack-TEE/dstack-examples.git
4733
cd dstack-examples
34+
```
4835

49-
# Choose an example
50-
cd attestation/configid-based
36+
---
5137

52-
# Copy the docker-compose.yaml content to your dstack deployment
53-
# Follow the example-specific README for deployment instructions
54-
```
38+
## Use Cases
5539

56-
## Examples
40+
Real-world applications that serve as **reference implementations** for ERC-733 TEE+EVM patterns.
41+
42+
| Example | Description | Status |
43+
|---------|-------------|--------|
44+
| [8004-agent](./8004-agent) | Trustless AI agent (ERC-8004) with on-chain attestation, LLM access via TLS | Coming Soon |
45+
| [oracle](./oracle) | TEE oracle returning JSON + signature + attestation bundle | Coming Soon |
46+
| [mcp-server](./mcp-server) | Attested MCP tool server behind gateway | Coming Soon |
47+
| [telegram-agent](./telegram-agent) | Telegram bot with TEE wallet and verified execution | Coming Soon |
48+
49+
---
50+
51+
## Architecture Walkthrough
52+
53+
These examples teach the **layered TEE+EVM architecture** from ERC-733. Work through them in order to understand how dstack applications are built.
54+
55+
### 1. Attestation Layer
56+
57+
The foundation: establish trust by verifying and committing the enclave's code measurement on-chain.
5758

58-
### Security & Attestation
5959
| Example | Description |
6060
|---------|-------------|
6161
| [attestation/configid-based](./attestation/configid-based) | ConfigID-based remote attestation verification |
62-
| [attestation/rtmr3-based](./attestation/rtmr3-based) | RTMR3-based attestation (legacy) |
62+
| [timelock-nts](./timelock-nts) | Timelock decryption using NTS (Network Time Security) |
63+
64+
**What you learn:** Code measurement, attestation documents, X.509 verification, secp256k1 enclave keys.
65+
66+
### 2. Gateway Layer
67+
68+
Interoperability: TLS termination inside the enclave, domain routing, external connectivity.
6369

64-
### Networking & Domains
6570
| Example | Description |
6671
|---------|-------------|
67-
| [custom-domain](./custom-domain) | Set up custom domain with automatic TLS certificate management via zt-https |
72+
| [custom-domain](./custom-domain) | Custom domain with automatic TLS via zt-https (model of dstack gateway) |
73+
74+
**What you learn:** TLS termination in enclave, DNS → TLS → route pattern, reverse proxy.
75+
76+
### 3. Keys & Replication Layer
77+
78+
Production reality: persistent keys across machines, crash recovery, upgrades.
79+
80+
| Example | Description | Status |
81+
|---------|-------------|--------|
82+
| [get-key-basic](./get-key-basic) | `dstack.get_key()` — same key identity across deployments | Coming Soon |
83+
84+
**What you learn:** KMS interaction, secrets replication, upgrade policies, dev-proofness.
85+
86+
### 4. On-Chain Interaction Layer
87+
88+
Blockchain integration: light client for reading chain state, coprocessor pattern for anchoring outputs.
89+
90+
| Example | Description |
91+
|---------|-------------|
92+
| [lightclient](./lightclient) | Ethereum light client (Helios) running in enclave |
93+
94+
**What you learn:** Light client in TEE, verifying on-chain state, coprocessor receipts.
95+
96+
---
97+
98+
## Dev Scaffolding
99+
100+
Development and debugging tools. **Not for production** — useful during development.
101+
102+
| Example | Description |
103+
|---------|-------------|
104+
| [webshell](./webshell) | Web-based shell access for debugging |
68105
| [ssh-over-gateway](./ssh-over-gateway) | SSH tunneling through dstack gateway |
69106
| [tcp-port-forwarding](./tcp-port-forwarding) | Arbitrary TCP port forwarding |
70-
| [tor-hidden-service](./tor-hidden-service) | Run Tor hidden services in TEEs |
71107

72-
### Development Tools
108+
---
109+
110+
## Tech Demos
111+
112+
Interesting demonstrations — cool tech but not yet fully developed use cases with clear security stories.
113+
73114
| Example | Description |
74115
|---------|-------------|
75-
| [launcher](./launcher) | Generic launcher pattern for Docker Compose apps |
76-
| [webshell](./webshell) | Web-based shell access for debugging |
77-
| [prelaunch-script](./prelaunch-script) | Pre-launch script patterns used by Phala Cloud |
116+
| [tor-hidden-service](./tor-hidden-service) | Run Tor hidden services in TEEs |
117+
118+
---
119+
120+
## Details
121+
122+
Implementation details and infrastructure patterns. Not primary use cases.
78123

79-
### Advanced Use Cases
80124
| Example | Description |
81125
|---------|-------------|
82-
| [lightclient](./lightclient) | Blockchain light client integration |
83-
| [timelock-nts](./timelock-nts) | Timelock decryption with NTS |
126+
| [launcher](./launcher) | Generic launcher pattern for Docker Compose apps |
127+
| [prelaunch-script](./prelaunch-script) | Pre-launch script patterns (Phala Cloud) |
84128
| [private-docker-image-deployment](./private-docker-image-deployment) | Using private Docker registries |
129+
| [attestation/rtmr3-based](./attestation/rtmr3-based) | RTMR3-based attestation (legacy) |
130+
131+
---
85132

86133
## Documentation
87134

88135
- **[dstack Documentation](https://docs.phala.network/dstack)** - Official platform documentation
89136
- **[Main Repository](https://github.com/Dstack-TEE/dstack)** - Core dstack framework
90-
- **[Security Guide](SECURITY.md)** - Security best practices
137+
- **[ERC-733](https://erc733.org)** - TEE+EVM design patterns standard
91138
- **[Contributing Guide](CONTRIBUTING.md)** - How to contribute
92139

93140
## Development
94141

95-
Use the `dev.sh` script for validation and development tasks:
96-
97142
```bash
98143
./dev.sh help # Show available commands
99144
./dev.sh validate <example> # Validate a specific example
100145
./dev.sh validate-all # Validate all examples
101-
./dev.sh security # Run security checks
102-
./dev.sh lint # Run linting checks
103-
./dev.sh check-all # Run all checks
104146
```
105147

106-
## Contributing
107-
108-
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
109-
110148
## Community
111149

112-
### Getting Help
113-
114150
- **Telegram**: [Join our community](https://t.me/+UO4bS4jflr45YmUx)
115151
- **Issues**: [GitHub Issues](https://github.com/Dstack-TEE/dstack-examples/issues)
116152

117-
### Reporting Issues
118-
119-
When reporting issues, please include:
120-
121-
1. Example name and version
122-
2. Steps to reproduce
123-
3. Expected vs actual behavior
124-
4. Relevant logs and error messages
125-
126153
## License
127154

128-
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
155+
Apache 2.0 see [LICENSE](LICENSE).
129156

130157
---
131158

0 commit comments

Comments
 (0)