OutLayer Documentation

Why Trust OutLayer?

OutLayer runs your code inside Intel TDX confidential VMs where even the operator cannot access your secrets or tamper with execution. Here's how to verify this yourself.

Trust Architecture#

OutLayer's security rests on three independently verifiable pillars:

1. Hardware (Intel TDX)

Confidential VMs with hardware-encrypted memory. Host OS cannot read worker memory.

2. Open Source Code

All worker code is public on GitHub with Sigstore-certified release binaries.

3. On-Chain Verification

NEAR smart contract verifies TDX quotes and stores approved measurements on-chain.

Whatever hardware a worker runs on, these three pillars hold. The next two sections show that the cryptographic guarantee is the same across both deployment methods, and how to verify any individual execution yourself.

Two Ways Workers Run#

OutLayer workers are deployed in two ways. Both are genuine Intel TDX — they differ only in who hosts the hardware and which portal renders the human-readable attestation.

Self-hosted TDX

A self-hosted bare-metal dstack node. Human-verifiable attestation is rendered at workers.outlayer.ai.

Phala Cloud

Managed dstack hosted by Phala Cloud. Human-verifiable attestation is rendered at trust.phala.com.

In both cases the worker runs in an Intel TDX confidential VM via dstack and emits a TDX quote that binds the worker's public key in report_data (the raw key for ed25519, or its SHA-256 for post-quantum ml-dsa-65) plus all 5 measurements. Both register on the same on-chain register-contract (worker.outlayer.near on mainnet, worker.outlayer.testnet on testnet), which verifies the Intel TDX quote signature (Intel DCAP) and checks the 5 measurements against an admin allowlist.

Workers complement each other — location doesn't matter. Workers from both deployment methods join the same pool; the coordinator dispatches each task to whichever worker is free, regardless of whether it runs on a self-hosted TDX node or on Phala Cloud. You don't pick a host, and you don't need to — every execution carries its own TDX attestation, so the result is equally verifiable no matter which worker produced it.

Verifying Each Deployment#

Side by side, the two deployment methods are cryptographically identical. Only the last two rows differ.

AspectSelf-hosted TDXPhala Cloud
Identical across both — the trust model
TEE hardwareIntel TDX (Xeon)Intel TDX (Xeon)
Runtimedstack confidential VMdstack confidential VM
AttestationIntel TDX quote (DCAP)Intel TDX quote (DCAP)
Quote signatureIntel-signed, verified via Intel DCAPIntel-signed, verified via Intel DCAP
MeasurementsMRTD + RTMR0–3 (5 registers)MRTD + RTMR0–3 (5 registers)
On-chain registrationworker.outlayer.{near,testnet} — same register-contract, 5-measurement allowlistworker.outlayer.{near,testnet} — same register-contract, 5-measurement allowlist
Secret custodyNEAR MPC keystore (CKD)NEAR MPC keystore (CKD)
Differs — who operates the infrastructure (each component itself TDX-attested)
Who hosts the hardwareBare-metal nodePhala Cloud
Deploy-time KMSSelf-hosted dstack-kms (in TEE)Phala's dstack KMS
Network gateway (TLS-in-TEE)gateway.dstack.outlayer.aiPhala gateway
Platform (FMSPC collateral)Self-hosted node's FMSPCPhala platform FMSPC
Attestation portalworkers.outlayer.aitrust.phala.com

Takeaway: Every row that matters for the cryptographic guarantee — the TDX hardware, the Intel-signed quote, the 5 measurements, the on-chain register-contract, and NEAR-MPC secret custody — is identical on both. What differs is purely operational (who runs the hardware, KMS, and gateway), and each of those is itself a TDX-attested component with its own on-chain-approved measurements — not a trusted third party. Verify the self-hosted node at workers.outlayer.ai and Phala Cloud at trust.phala.com.

Verify Any Execution#

Beyond verifying that a worker is genuine, you can verify any individual execution — for both NEAR blockchain and HTTPS calls — directly from the dashboard.

  1. 1

    Open Executions

    Go to Executions (the page is titled Job History).

  2. 2

    Click the shield-check icon

    In the TEE column, click the shield-check icon (hover tooltip View attestation report) on any row. This works for both NEAR blockchain and HTTPS executions.

  3. 3

    Read the TEE Attestation report

    The TEE Attestation report opens, showing the worker measurement, source code, hashes, and the raw quote (detailed below).

What the Report Shows#

FieldWhat It Proves
Worker Measurement (RTMR3)The TEE environment hash. Ties the run to a registered worker.
Source CodeLink to the exact repo@commit that was executed.
WASM Hash / Input Hash / Output HashContent-addressable hashes of the binary, the input, and the output.
TDX QuoteThe raw Intel-signed quote, plus a verify button (below).

The report includes a "Verify Quote (RTMR3 + Task Hash)" button. Client-side, it extracts RTMR3 (the worker measurement) and the Task Hash from REPORTDATA and checks them. The Task Hash commits to this execution's input, output, WASM, and commit — so the Intel-signed quote cannot be reused for a different run.

Input/Output verification: For NEAR jobs, click "Load & Verify from Blockchain" — it fetches the transaction, re-hashes the input/output, and compares against the report. For HTTPS jobs, paste the request/response to verify them against the hashes.

For NEAR jobs, a Direct Link opens a shareable standalone page at /attestation/{jobId}.

Takeaway: Anyone can open any execution, read the worker measurement, find the exact sources, and confirm the action ran inside a TEE.

Not to be conflated: This per-execution view surfaces RTMR3 + the task-hash binding. The full 5-measurement check (MRTD + RTMR0–3) happens once at worker registration on-chain, not per execution. See the next section for the full measurement set.

5-Measurement TDX Verification#

Intel TDX produces 5 cryptographic measurements that together uniquely identify the TEE environment. The register-contract (worker.outlayer.near) verifies all 5 at worker registration, for both deployment methods:

MeasurementWhat It MeasuresSize
MRTDTD (Trust Domain) measurement — code + configuration48 bytes (96 hex chars)
RTMR0Firmware measurement48 bytes (96 hex chars)
RTMR1OS/kernel measurement48 bytes (96 hex chars)
RTMR2Application measurement48 bytes (96 hex chars)
RTMR3Runtime measurement48 bytes (96 hex chars)

Why all 5 matter: Checking only RTMR3 (as some systems do) is not sufficient. A development dstack image with SSH access enabled would have a different MRTD/RTMR0/RTMR1 but could share the same RTMR3. By checking all 5 measurements, OutLayer ensures the entire environment — from firmware to application — matches the approved configuration.

Check Approved Measurements On-Chain#

# View all approved measurement sets
near view worker.outlayer.near get_approved_measurements

# Check if specific measurements are approved
near view worker.outlayer.near is_measurements_approved '{
  "measurements": {
    "mrtd": "abc123...",
    "rtmr0": "def456...",
    "rtmr1": "ghi789...",
    "rtmr2": "jkl012...",
    "rtmr3": "mno345..."
  }
}'

GitHub Releases & Sigstore#

OutLayer publishes releases on GitHub with Sigstore certification. Sigstore provides cryptographic proof that a binary was built from specific source code.

What Sigstore proves: The release binary was built by GitHub Actions CI from the exact source code at that git tag. No one — not even the project maintainers — can substitute a different binary without the Sigstore signature failing.

How to Verify a Release#

  1. Go to github.com/fastnear/near-outlayer/releases
  2. Find the release matching the version running in the TEE
  3. Check the Sigstore certification badge on the release
  4. Review the source code at that release tag
  5. Optionally: rebuild from source and compare the hash

Worker Registration Flow#

Every worker — self-hosted or on Phala Cloud — must prove its TEE identity before it can execute code or access secrets:

  1. 1

    Generate Keypair in TEE

    Worker generates an ed25519 keypair inside the TDX confidential VM. The private key never leaves TEE memory.

  2. 2

    Generate TDX Quote

    TDX hardware produces a cryptographic quote with the worker's public key in report_dataand all 5 measurements. The quote is signed by Intel.

  3. 3

    On-Chain Verification

    Worker calls register_worker_key() on the register-contract (worker.outlayer.near). The contract verifies the Intel signature, extracts all 5 measurements, checks them against the approved list, and confirms the public key matches report_data.

  4. 4

    Scoped Access Key

    The contract adds the worker's public key as an access key scoped to specific methods only: resolve_execution, submit_execution_output_and_resolve, resume_topup, resume_delete_payment_key.

Ephemeral Worker Keys & Blockchain Trail#

Worker signing keys are ephemeral — they are generated fresh inside the TEE on every restart and never saved to disk or exported. When a worker restarts, it generates a completely new keypair and re-registers on the blockchain.

Why this matters: Every worker registration leaves a permanent trail on the blockchain. The operator cannot secretly spin up a worker, request a key, or access secrets without it being visible on-chain. If an admin tried to run unauthorized code, it would fail the 5-measurement check during registration — and even if they used legitimate code, the registration transaction would be publicly visible.

Additionally, every worker's WASM code is tracked through GitHub — you can verify exactly which code a worker executed by checking the source repository and commit hash. This means even a backdoor cannot be introduced without leaving a visible trace in the git history.

Deterministic Keystore Secrets (CKD)#

The keystore worker uses Confidential Key Derivation (CKD) via NEAR's MPC network to derive a deterministic master secret. This means that when the keystore restarts or upgrades, it recovers the same master secret — all previously encrypted secrets remain accessible.

  1. 1

    TEE Startup

    Keystore generates a new ephemeral keypair in TEE memory and submits TDX attestation to the DAO contract.

  2. 2

    DAO Approval

    DAO members (dao.outlayer.near) vote to approve the keystore's public key, confirming its TEE attestation.

  3. 3

    MPC Key Derivation

    After approval, keystore requests its master secret from the NEAR MPC network using BLS12-381 key exchange. The derived secret is deterministic — same DAO account + same derivation path always produces the same secret.

  4. 4

    Secret Recovery

    The master secret exists only in TEE memory (never persisted to disk). All per-project keys are derived from it using HMAC-SHA256. On restart, the same master secret is re-derived, so all secrets are automatically recoverable.

What the Operator Cannot Do#

Even if the operator is malicious or compromised, Intel TDX hardware prevents:

ActionProtection
Extract decrypted secretsTEE memory encryption — host OS cannot read worker memory
Modify execution resultsResults signed with TEE-generated key registered on-chain
Run different codeAll 5 TDX measurements must match approved set
Forge attestation reportsTDX quotes signed by Intel's private key (hardware-embedded)
Register unauthorized workerRegister-contract verifies TDX quote before adding access key; every registration is visible on-chain

What the operator CAN do: Refuse to execute code (censorship) or shut down infrastructure (availability). These are mitigated by the ability to run multiple independent operators — workers are stateless and can be redeployed anywhere.

Related Documentation