plugins/plugin-tee/README.md
Trusted Execution Environment (TEE) integration plugin for elizaOS, providing secure key management and remote attestation capabilities.
import { teePlugin, TEEService } from "@elizaos/plugin-tee";
import { AgentRuntime } from "@elizaos/core";
// Register the plugin
const runtime = new AgentRuntime({
plugins: [teePlugin],
});
// Or use the service directly
const service = await TEEService.start(runtime);
const solanaKeys = await service.deriveEd25519Keypair(
"salt",
"solana",
agentId,
);
const evmKeys = await service.deriveEcdsaKeypair("salt", "evm", agentId);
| Variable | Description | Required | Default |
|---|---|---|---|
TEE_MODE | Operation mode: LOCAL, DOCKER, PRODUCTION | Yes | - |
WALLET_SECRET_SALT | Secret salt for deterministic key derivation | Yes | - |
TEE_VENDOR | TEE vendor to use | No | phala |
localhost:8090host.docker.internal:8090| Action | Description |
|---|---|
REMOTE_ATTESTATION | Generate and upload a remote attestation quote to prove TEE execution |
| Provider | Description |
|---|---|
phala-derive-key | Derive Solana and EVM keypairs with attestation |
phala-remote-attestation | Generate remote attestation quotes |
| Service | Description |
|---|---|
TEEService | Main service for key derivation and management |
class TEEService {
// Derive Ed25519 keypair for Solana
async deriveEd25519Keypair(
path: string,
subject: string,
agentId: UUID,
): Promise<{ keypair: Keypair; attestation: RemoteAttestationQuote }>;
// Derive ECDSA keypair for EVM
async deriveEcdsaKeypair(
path: string,
subject: string,
agentId: UUID,
): Promise<{
keypair: PrivateKeyAccount;
attestation: RemoteAttestationQuote;
}>;
// Derive raw key for custom use cases
async rawDeriveKey(path: string, subject: string): Promise<DeriveKeyResponse>;
}
class PhalaRemoteAttestationProvider {
// Generate attestation quote
async generateAttestation(
reportData: string,
hashAlgorithm?: TdxQuoteHashAlgorithm,
): Promise<RemoteAttestationQuote>;
}
plugins/plugin-tee/
āāā typescript/ # TypeScript implementation
ā āāā src/
ā ā āāā actions/ # Remote attestation action
ā ā āāā providers/ # Key derivation & attestation providers
ā ā āāā services/ # TEE service
ā ā āāā types/ # Type definitions
ā ā āāā vendors/ # Vendor implementations
ā ā āāā index.ts # Main entry point
ā āāā __tests__/ # Unit tests
āāā package.json # NPM manifest
āāā README.md # This file
bun run build
bun run test
# TypeScript
bun run format:check