Use Cases
This page focuses on directly usable Privacy Oracle and Privacy Compute patterns. The goal is simple: users should be able to pick a data source or built-in function, copy a payload, encrypt sensitive fields if needed, and start using Morpheus without first learning a custom runtime.
How Users Participate
1. Built-in Data Sources
For Privacy Oracle, the easiest starting point is to use a built-in source. These are already integrated into the worker and can be mixed with encrypted params, custom JS, or callback-based contract fulfillment.
| Source | Type | When To Use | Starter Payload |
|---|---|---|---|
| twelvedata | Built-in | Production default for market / FX / commodity / equity / ETF quotes. | { "provider": "twelvedata", "symbol": "NEO-USD", "json_path": "price", "target_chain": "neo_n3" } |
| binance-spot | Built-in | Good for direct crypto spot reads in custom Oracle flows. | { "provider": "binance-spot", "symbol": "BTC-USD", "target_chain": "neo_n3" } |
| coinbase-spot | Built-in | Useful when you want Coinbase spot references in a callback flow. | { "provider": "coinbase-spot", "symbol": "ETH-USD", "target_chain": "neo_n3" } |
| custom URL | User supplied | Any REST API. Combine with encrypted headers, encrypted token, custom JS, or WASM. | { "url": "https://postman-echo.com/get?symbol=NEO", "json_path": "args.symbol", "target_chain": "neo_n3" } |
2. Privacy Oracle Ready Cases
These are the fastest paths for users who want to participate immediately through the Oracle contract and callback model.
Private Premium API Access
Problem: You need paid API data, but you cannot leak the API key to node operators or contract logs.
Direct path: Fetch the Oracle public key, encrypt the token or headers, then send the request through the Oracle contract. The key is only unsealed inside the TEE.
{
"url": "https://api.example.com/private-price",
"method": "GET",
"encrypted_token": "<sealed bearer token>",
"token_header": "Authorization",
"json_path": "price",
"target_chain": "neo_n3"
}Return Only A Boolean
Problem: You want to check a sensitive off-chain condition, but you do not want the raw profile / account data to ever appear on-chain.
Direct path: Send encrypted credentials plus a tiny custom reduction function. The worker fetches the data, evaluates the condition inside the enclave, and returns only `true/false`.
{
"url": "https://api.example.com/private-profile",
"encrypted_params": "<sealed auth headers and script>",
"script": "function process(data) { return data.followers > 10000; }",
"entry_point": "process",
"target_chain": "neo_n3"
}Built-in Provider + Confidential Params
Problem: You want the convenience of a built-in provider, but you still need to hide fields like `json_path`, provider params, or function name.
Direct path: Use `encrypted_payload` or `encrypted_params` to patch the request inside the TEE before the built-in provider call executes.
{
"provider": "twelvedata",
"symbol": "BTC-USD",
"encrypted_payload": "<sealed { \"json_path\": \"price\", \"target_chain\": \"neo_n3\" }>"
}Custom Reduction On Public Data
Problem: The upstream API is public, but you want a custom transformed output instead of forwarding the raw response.
Direct path: Use a normal Oracle request with custom JS or WASM to reduce the response into the exact scalar your contract wants.
{
"provider": "twelvedata",
"symbol": "SOL-USD",
"script": "function process(data) { return Number(data.price) > 100; }",
"entry_point": "process",
"target_chain": "neo_n3"
}3. Built-in Compute Ready Cases
If the user does not need an external data fetch and only needs secure off-chain computation, use mode = "builtin". These methods are already shipped in the worker and do not require user-supplied scripts.
privacy.mask
Mask sensitive strings before returning them.
{
"mode": "builtin",
"function": "privacy.mask",
"input": { "value": "13812345678", "unmasked_left": 3, "unmasked_right": 4 },
"target_chain": "neo_n3"
}math.modexp
Useful for big integer cryptography, RSA helpers, VDF-style workloads, and challenge-response math.
{
"mode": "builtin",
"function": "math.modexp",
"input": { "base": "123456789", "exponent": "987654321", "modulus": "2147483647" },
"target_chain": "neo_n3"
}vector.cosine_similarity
Compare embeddings or user vectors without deploying your own script runtime.
{
"mode": "builtin",
"function": "vector.cosine_similarity",
"input": { "left": [0.12, 0.91, 0.33], "right": [0.15, 0.87, 0.31] },
"target_chain": "neo_n3"
}zkp.public_signal_hash
Hash large public-signal arrays off-chain and return one digest for cheap contract verification.
{
"mode": "builtin",
"function": "zkp.public_signal_hash",
"input": { "circuit_id": "credit_v1", "signals": ["1", "2", "3"] },
"target_chain": "neo_n3"
}fhe.noise_budget_estimate
Plan FHE workloads before you commit to expensive proving or encrypted inference pipelines.
{
"mode": "builtin",
"function": "fhe.noise_budget_estimate",
"input": { "multiplicative_depth": 4, "scale_bits": 40, "modulus_bits": 218 },
"target_chain": "neo_n3"
}hash.sha256 / hash.keccak256 / merkle.root
Good for proof preprocessing, settlement digests, commitment schemes, and callback minimization.
{
"mode": "builtin",
"function": "merkle.root",
"input": { "leaves": ["a", "b", "c"] },
"target_chain": "neo_n3"
}4. Best First Steps For New Users
Zero-Code Oracle Test
Use the universal callback consumer on Neo N3 mainnet, submit a built-in provider request, and inspect the callback result without deploying your own contract first.
Encrypted Built-in Compute
Keep the function name and input private by sealing a full JSON patch into encrypted_payload, then let the TEE resolve and execute it.
Custom URL + Tiny JS
Start with a public URL, then add a tiny reduction function that returns a scalar or boolean. This is the easiest path from “public fetch” to “TEE logic”.