Built-in Compute Functions
Morpheus Compute exposes built-in heavy functions through
.Current production architecture:
- control-plane ingress and orchestration stay outside the TEE
- confidential execution happens on the Oracle CVM
- mainnet and testnet share the same compute runtime and differ only by network metadata
- DataFeed publication does not share this execution lane
Request Shape
Script Registry References
If the inline script would make the request payload too large, you can store the script body in a Neo N3 contract getter and send only a small reference:
Rules:
- current supported chain for is
- the contract getter must be read-only and return either or
- the fetched script still passes the normal script-policy validator and timeout limits
- this reduces notification / payload pressure without bypassing the existing execution sandbox
Available Built-ins
Hashes any JSON-serializable input.
Keccak-256 digest for EVM-oriented preprocessing and cross-checks.
Verifies an RSA-SHA256 signature off-chain. RSA signature verification is computationally extremely expensive to execute natively within EVM or Neo N3 smart contracts. Takes
(PEM text), (hex string), and (string). Returns .Big integer modular exponentiation for cryptographic preprocessing.
Evaluates a polynomial of arbitrary degree ($c_n x^n + \dots + c_1 x + c_0$) off-chain. Especially useful when degrees are very large and gas costs would exceed block limits. Takes
(array of numbers from highest degree to constant $c_0$), (number to evaluate at), and an optional .Dense matrix multiplication.
Vector similarity scoring.
Builds a SHA-256 Merkle root from a list of leaves.
Normalizes and hashes a public signal set.
Builds a deterministic digest of a proof object and optional verifying key context.
Builds a deterministic digest of witness material before proving.
Verifies a Groth16 proof against a verifying key and normalized public signals.
Returns a planning estimate for Groth16 proving workloads.
Returns a planning estimate for PLONK proving workloads.
Validates zERC20 single-withdraw public inputs and can optionally verify a Groth16 proof for the same statement. This helper is independent from the paymaster service. Applications may use it to preflight privacy-transaction proofs before submission or before requesting sponsorship.
Returns a batching/packing plan based on slot and ciphertext counts.
Returns a coarse planning estimate for FHE noise budget based on depth and modulus settings.
Returns a rotation/key-switch planning summary for vector index usage.
Masks a sensitive string, leaving edge characters visible (e.g. for partial logging in TEE). Takes
, (default 2), and (default 2).Adds simulated Laplace noise to a numeric value for differential privacy use cases. Takes
and (default 1.0).Notes
These built-ins are the first production-facing layer of Morpheus Compute. They are intentionally designed so that later Oracle runtime profiles can replace the internal implementation with real external ZKP / FHE engines while preserving the API surface.
Current runtime hardening also enforces:
- compute input size limits
- script / wasm result size limits
- worker timeouts for JS and WASM execution