Skip to content

Commit 133ac59

Browse files
committed
simplify trust centere xplanation in readme
1 parent be0113c commit 133ac59

1 file changed

Lines changed: 14 additions & 80 deletions

File tree

tutorial/01-attestation-oracle/README.md

Lines changed: 14 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -66,61 +66,19 @@ phala deploy -n tee-oracle -c docker-compose.yaml
6666

6767
## Verification
6868

69-
To trust the oracle's output, verify:
69+
The quote contains measured values. Compare them against reference values you trust:
7070

71-
1. **Quote is valid** — Hardware signature, OS integrity, compose hash
72-
2. **report_data matches**`sha256(statement) == reportDataHash` in quote
73-
3. **TLS fingerprint is correct** — Matches the real CoinGecko certificate
71+
| Measured (from quote) | Reference | Source |
72+
|-----------------------|-----------|--------|
73+
| Intel signature | Intel root CA | Built into dcap-qvl |
74+
| MRTD, RTMR0-2 | Calculated from OS image | Download from [meta-dstack releases](https://github.com/Dstack-TEE/meta-dstack/releases) |
75+
| compose-hash (RTMR3) | `sha256(app-compose.json)` | Build from your docker-compose.yaml |
76+
| report_data | `sha256(statement)` | Hash the statement yourself |
77+
| tlsFingerprint | Certificate fingerprint | Fetch from api.coingecko.com |
7478

75-
### Step 1: Verify the Quote
79+
### Step 1: Validate Quote and Compare Measurements
7680

77-
The TDX quote proves the statement came from verified TEE code. Choose a verification method:
78-
79-
#### Option A: Hosted (no setup)
80-
81-
Visit [trust.phala.network](https://trust.phala.network) and enter your app's domain. It shows verification status for all Phala Cloud apps.
82-
83-
#### Option B: Local script (recommended)
84-
85-
Use the self-contained verification script from [attestation/configid-based](../../attestation/configid-based):
86-
87-
```bash
88-
cd attestation/configid-based
89-
90-
# Download verification tools (dcap-qvl, dstack-mr, OS image)
91-
./attest.sh download
92-
93-
# Calculate expected measurements from your compose file
94-
./attest.sh compose
95-
./attest.sh calc-mrs
96-
97-
# Verify a running app's quote
98-
./attest.sh verify
99-
```
100-
101-
This compares:
102-
- **mr_config_id**: Contains your compose hash (SHA-256 padded to 96 chars)
103-
- **MRTD/RTMR0-2**: Match expected values from [dstack OS release](https://github.com/Dstack-TEE/meta-dstack/releases)
104-
- **Hardware signature**: Validated by Intel DCAP-QVL
105-
106-
#### Option C: Programmatic (trust-center API)
107-
108-
For integration into your own verification flow:
109-
110-
```bash
111-
git clone https://github.com/Phala-Network/trust-center.git
112-
cd trust-center && bun install
113-
cd packages/verifier && bun run dev
114-
115-
# Then call the API
116-
curl -X POST http://localhost:3000/verify \
117-
-H "Content-Type: application/json" \
118-
-d '{"appId": "<app-id>", "domain": "your-app.phala.network"}'
119-
```
120-
121-
#### Option D: Python script (verify_full.py)
122-
123-
A standalone Python script included in this tutorial:
81+
Use the included Python script:
12482

12583
```bash
12684
# Install verification tools
@@ -155,33 +113,22 @@ Output:
155113

156114
---
157115

158-
> **How verification proves code correspondence**
116+
> **About compose-hash**
159117
>
160118
> Your `docker-compose.yaml` gets wrapped into an `app-compose.json` manifest:
161119
> ```json
162120
> {
163121
> "docker_compose_file": "<your compose content>",
164122
> "pre_launch_script": "#!/bin/bash\n...",
165123
> "kms_enabled": true,
166-
> "gateway_enabled": true,
167124
> ...
168125
> }
169126
> ```
170-
> The SHA-256 of this manifest becomes the **compose-hash**, which is embedded in `mr_config_id` in the TDX quote.
171-
>
172-
> **Important:** The `pre_launch_script` is included in the hash. Phala Cloud injects its own prelaunch script (for SSH setup, environment config, etc.). To fully audit, you need the complete `app-compose.json` — fetch it via `phala cvms attestation <app>` or from trust-center's output. See [prelaunch-script](../../prelaunch-script) for the Phala Cloud script source.
173-
>
174-
> To verify a remote app matches your local code:
175-
> 1. Build `app-compose.json` from your docker-compose (attest.sh `compose` does this)
176-
> 2. Calculate `sha256(app-compose.json)` → your expected compose-hash
177-
> 3. Get the remote app's quote and extract `mr_config_id`
178-
> 4. Compare: if `mr_config_id` starts with your compose-hash, the app is running your code
127+
> The SHA-256 of this manifest is the **compose-hash** in RTMR3.
179128
>
180-
> **trust-center vs attest.sh:**
181-
> - **attest.sh**: You provide compose file + OS version. Fully local — downloads binaries (dcap-qvl, dstack-mr) and OS image from GitHub, calculates measurements, compares with quote. Works against any dstack instance.
182-
> - **trust-center**: You provide appId/domain. Hybrid — fetches app metadata from Phala Cloud API (`cloud-api.phala.network`) and quote from the app's RPC endpoint, but runs verification (dcap-qvl, dstack-mr) locally. Downloads OS images from GitHub. Easier discovery but relies on Phala Cloud API for app lookup.
129+
> **Important:** The `pre_launch_script` is included in the hash. Phala Cloud injects its own prelaunch script. To audit, fetch the complete `app-compose.json` via `phala cvms attestation <app>`. See [prelaunch-script](../../prelaunch-script) for the Phala Cloud script source.
183130
>
184-
> See [attestation/configid-based](../../attestation/configid-based) for the standalone verification script.
131+
> For standalone verification that builds app-compose.json locally: [attestation/configid-based](../../attestation/configid-based)
185132
186133
### Step 2: Verify report_data Binding
187134
@@ -212,19 +159,6 @@ cat response.json | jq -r '.statement.tlsFingerprint'
212159

213160
---
214161

215-
## What This Proves
216-
217-
When all three checks pass:
218-
219-
1. **The code is correct** — Trust-center verified the docker-compose.yaml hash matches what's deployed
220-
2. **The TEE is authentic** — Intel hardware signed the quote
221-
3. **The statement is genuine** — report_data binds the exact statement to the quote
222-
4. **The data source is real** — TLS fingerprint proves connection to the actual API server
223-
224-
This is the complete verification chain for a TEE oracle.
225-
226-
---
227-
228162
## Next Steps
229163

230164
- [02-persistence-and-kms](../02-persistence-and-kms): Derive persistent keys across restarts

0 commit comments

Comments
 (0)