Skip to content

๐Ÿ›ก๏ธ Using TDX (Experimental) โ€‹

โš ๏ธ EXPERIMENTAL FEATURE

TDX support is currently experimental and should NOT be used in production. This feature is provided for testing and development purposes only. Expect instabilities, limited compatibility, and potential outages.

Intel TDX (Trust Domain Extensions) is the next generation of TEE technology. This guide shows you how to enable TDX in your iApp and understand the differences from the default SGX implementation.

What is TDX? โ€‹

TDX (Trust Domain Extensions) is Intel's newer confidential computing technology, different from the default SGX implementation.

SGX vs TDX Differences โ€‹

SGX (Current Default):

  • โœ… Production ready and stable
  • โœ… Widely supported by iExec workers
  • โŒ Memory limitations in TEE environment

TDX (Experimental):

  • โœ… Potentially better for memory-intensive workloads
  • โŒ Experimental and unstable
  • โŒ Limited worker availability
  • โŒ Not production ready
FeatureIntel SGXIntel TDX
Release Year20152023
Enclave ScopeApplication levelVirtual machine level
Code Adaptation RequiredYes - needs redesign of app's logicNo - supports lift-and-shift of full systems
Memory SizeLimitedExtensive (multi-GB+)
Integration ComplexityHigher (more dev work)Lower (VM legacy code)
Best Fit ForLightweight, high-assurance modules (e.g. wallets, crypto key ops, small AI models)Heavier AI workloads, legacy apps, databases

Enabling TDX in iApp Generator โ€‹

Environment Variable Method โ€‹

Enable TDX for deployment and execution:

bash
# Set the experimental flag
export EXPERIMENTAL_TDX_APP=true

# Deploy and run with TDX
iapp deploy
iapp run <app-address>

Environment Variable Declaration

The syntax for setting environment variables differs between operating systems:

  • Mac/Linux: export EXPERIMENTAL_TDX_APP=true
  • Windows: set EXPERIMENTAL_TDX_APP=true

Per-Command Method โ€‹

Enable TDX for specific commands:

bash
# Deploy TDX-enabled iApp
EXPERIMENTAL_TDX_APP=true iapp deploy

# Run with TDX
EXPERIMENTAL_TDX_APP=true iapp run <app-address>

# Debug TDX execution
EXPERIMENTAL_TDX_APP=true iapp debug <taskId>

Verification โ€‹

Check if TDX is enabled:

bash
# Your deployed iApp should show TDX-related tags
iexec app show <app-address>

โ€‹

โš ๏ธ To use the iExec DataProtector SDK with TDX support, you must configure the SDK with the right SMS endpoint.

jsx
const dataProtector = new IExecDataProtector(web3Provider, {
  iexecOptions: {
    smsURL: 'https://sms.labs.iex.ec',
  },
});

โš ๏ธYou need to change the default worker pool in your protected Data declaration

jsx
await dataProtector.core.processProtectedData({
  protectedData: protectedData.address,
  workerpool: 'tdx-labs.pools.iexec.eth',
  app: '0x1919ceb0c6e60f3B497936308B58F9a6aDf071eC',
});

Protected Data Compatibility โ€‹

Protected Data Requirements

TDX iApp may require TDX-compatible protected data. Check compatibility before using protected data with TDX iApp.

Important: The exact process for creating TDX-compatible protected data may differ from standard protected data creation. Consult the latest DataProtector documentation for TDX-specific requirements.

Development Workflow โ€‹

1. Local Testing โ€‹

bash
# Test locally (same as regular iApp)
iapp test --protectedData "mock_name"

# TDX only affects remote deployment/execution

2. Deployment โ€‹

bash
# Deploy TDX iApp
EXPERIMENTAL_TDX_APP=true iapp deploy

3. Execution โ€‹

bash
# Run with TDX
EXPERIMENTAL_TDX_APP=true iapp run <app-address>

Current Limitations โ€‹

Production Warnings

  • ๐Ÿšซ NOT for production use
  • ๐Ÿšซ Limited worker availability
  • ๐Ÿšซ Unstable execution environment
  • ๐Ÿšซ Breaking changes without notice

When to Use TDX โ€‹

Consider TDX only for:

  • ๐Ÿ”ฌ Research/development purposes
  • ๐Ÿงช Testing future capabilities

Use SGX for:

  • ๐Ÿš€ All production applications
  • โšก Reliable execution requirements

What's Next? โ€‹

For production applications, use the standard SGX guides: