Generate deterministic 256-bit keys from your application’s root key in the TEE. Keys are unique to your application ID, and the same input parameters always produce the same key.Documentation Index
Fetch the complete documentation index at: https://docs.phala.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Your application must be running in the Phala Cloud TEE environment with access to the dstack socket. In yourdocker-compose.yml:
Quick Start
index.js
Parameters
path(required): Unique identifier for the key. Use forward slashes to organize:app-name/feature/version
Key Properties
- Application-specific: Keys are derived from your app’s unique master key (tied to app ID)
- Deterministic: Same
pathalways generates the same key - Isolated: Different applications cannot derive each other’s keys
- 32 bytes: Raw key material suitable for various cryptographic operations
Common Use Cases
The 32-byte key can be used as:- AES-256 encryption key
- HMAC secret
- Random number generator seed
- Input for key derivation functions (KDF)
- Signing key for custom protocols
Best Practices
- Use descriptive paths:
app-name/feature/version - Never log or expose keys outside TEE
- Use different paths for different purposes
- Version your keys in the path (e.g.,
/v1,/v2)

