Built-in Compute Functions
Morpheus Compute exposes built-in heavy functions through
.Request Shape
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.
Returns a planning estimate for Groth16 proving workloads.
Returns a planning estimate for PLONK proving workloads.
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 Phala worker profiles can replace the internal implementation with real external ZKP / FHE engines while preserving the API surface.