Documentation

Guides and reference for OutLayer verifiable compute and agent custody.

Docs navigation

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 execution ID

    Rows with an attestation show a green shield-check next to the ID in the first column; click either. 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" button that runs the whole check in your browser, using Intel's DCAP quote-verification library compiled to WebAssembly:

  • Authenticity — the quote's signature chain is verified to the Intel SGX Root CA against Intel-issued collateral, and the platform's TCB status is reported. Collateral is fetched for the platform and the moment the execution ran, so past executions are judged by the material that was current at the time.
  • Identity — all five measurements (MRTD + RTMR0–3) are read from the verified quote and checked against the on-chain approved-build list via is_measurements_approved.
  • Binding — the Task Hash inside the signed quote commits to this execution's input, output, WASM, commit, caller and payment, so an 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.

Two places, one measurement set: the contract checks all five measurements when a worker registers, and the per-execution view checks the same five against the same on-chain list when you verify an attestation. The next section explains what each measurement covers.

OutLayer Verify: Proof That Does Not Depend on Us#

Everything above runs on a page we serve. For an internal review that is the wrong shape of evidence: a vendor's own website asserting the vendor's own trustworthiness is a claim, not an artifact. outlayer-verify is the same three checks as a standalone open-source binary your engineers run on their own machines, so the result does not depend on anything we say, host or sign.

What it does not need

  • No account with us, no API key, no configuration file, no key material.
  • No trust in our servers for the answer: Intel's root certificate is compiled into the binary, so a signature chain that does not end at Intel fails regardless of what we serve.
  • Nothing kept from the original call, for on-chain executions — the request and the response are read back out of the NEAR transaction.

It reaches three places: our public API for the attestation record and the archived Intel collateral, public NEAR RPC for the on-chain approved-build list, and a NEAR archival node for on-chain payloads. Only the first is ours, and the collateral it serves is Intel-signed — altering it breaks the chain, so we cannot influence the verdict through it. Use --collateral to supply your own copy if you would rather not take even that.

Install and run#

cargo install --git https://github.com/out-layer/outlayer-verify outlayer-verify

# a live production execution: Ref Finance calling a price oracle on OutLayer.
# No account, no key, no payment — this works for anyone, right now.
outlayer-verify job 221092 --network mainnet

# an execution you triggered on chain: payloads recovered from the transaction
outlayer-verify tx <near-tx-hash>

# an HTTPS call you made, with the request and response you kept
outlayer-verify call <call-id> --input '{"city":"Paris"}' --output '{"temp":21}'

# or let the tool make the call and prove it in one step
outlayer-verify run owner.near/agent --input '{"city":"Paris"}' --payment-key "$KEY"

The default output shows its working rather than a verdict: the record as published, the measurements and both halves of report_data read out of the quote after the signature was checked, which collateral was used and whether its validity window really covers the execution, and — for every comparison — both values. Exit codes make it usable in a pipeline: 0 proven, 1 a check failed, 2 the proof could not be completed, and --json emits the same values for a control that needs machine evidence.

For the audit file: --bundle proof.json writes one self-contained file holding the record, the Intel-signed collateral, the payloads and the chain's answer. outlayer-verify bundle proof.json --offline re-checks it with no network at all — so an execution stays provable to your auditor years later, and it does not depend on OutLayer, or this website, still existing. The verdict stored in the file is ignored on re-check; it is recomputed from the evidence.

What a passing verdict does not mean#

Worth reading before it reaches a risk register, because the gaps are the part a technical reviewer will find on their own:

  • It does not prove the approved build came from the published source. The attestation identifies which binary ran, not which source it was compiled from. Closing that gap needs a reproducible build and a published digest-to-commit map.
  • It does not say who may approve a build. The tool reports which contract it asked. Who controls that account, and under what governance, is a question to put to us — and one you should put to us.
  • HTTPS payloads are not recoverable. Only their hashes are stored, so if the caller did not keep the request and response, the bytes of that execution can never be checked again — by anyone, including us. Keep them, or make the call through run.
  • Verification is as of the execution's own timestamp. Intel collateral is valid only inside a window, and Intel serves only the current one, so executions are judged against the archived material that was current when they ran. Where no archived window covers an execution, the tool reports it as unproven rather than quietly passing.

Source and issues: github.com/out-layer/outlayer-verify — Apache-2.0, with the attestation format's test vectors taken from real production records. A FAIL on a record served by our API is a security finding: please send the evidence bundle to [email protected] before publishing it.

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