EXTENDED SERVICE v1.0.2

Enclave Compute

Morpheus Enclave Compute allows developers to execute complex, non-deterministic, or proprietary logic inside a Trusted Execution Environment. The network supports multiple runtimes, ensuring that inputs and intermediate states are never visible to the public blockchain.

Supported Runtimes

Javascript (QuickJS)

High-level scripting for data aggregation, custom API parsing, and business logic.

WebAssembly (WASM)

Performance-critical tasks like ZKP witness generation or complex mathematical models.

Built-in Capabilities

The TEE environment provides a global morpheus object with optimized cryptographic and utility functions:

  • Hashing: SHA-256 and Keccak-256 for integrity checks.
  • Verification: High-performance RSA signature verification.
  • Planning: ZKP and FHE planning helpers for witness, proof, batching, and rotation workflows.
  • Linear Algebra: Optimized matrix and vector operations.
  • Privacy: Masking and noise helpers for privacy-preserving post-processing.

Handling Confidential Arguments

When you dispatch a compute job, the encrypted blob you sealed locally is decrypted by the TEE core and merged into the final compute payload. For custom JS compute, your entry point receives input and helpers, not a live network client.

javascriptCustom Compute Script
function process(input, helpers) {
    const values = Array.isArray(input.values) ? input.values : [];
    const total = values.reduce((sum, value) => sum + Number(value || 0), 0);
    return {
        total,
        count: values.length,
        generated_at: helpers.getCurrentTimestamp(),
    };
}

Security Model

Compute tasks are strictly time-bounded (default 30s timeout) and executed in a stateless enclave instance. Any data required for the next execution cycle must be stored back on the blockchain via the callback mechanism.

Untrusted Scripts

Direct JS execution requires MORPHEUS_ENABLE_UNTRUSTED_SCRIPTS=true. Production deployments should prefer built-in functions or WASM when stronger isolation and tighter runtime control are required.

Previous Privacy OracleNextData Matrix
REVISION 1.0.2LAST UPDATED: 2026-03-11