User Guide
This guide explains how to use the three main Morpheus capabilities:
- Privacy Compute
- Privacy Oracle
- PriceFeed / DataFeed
It also explains how to inspect supported built-in providers and feed pairs.
Important production rule:
- End users should use Oracle and Compute through the on-chain Morpheus Oracle contracts plus callback fulfillment.
- The direct HTTP routes in this guide are for local development, operator workflows, and payload debugging.
- sync is operator-only. User contracts read synchronized on-chain feed records directly.
- Each request currently costs -equivalent.
- Neo N3 supports prepaid fee credits, including contract-sponsored payment.
- Neo X requires the exact fee in .
1. Concepts
Privacy Compute
Use Morpheus as an off-chain trusted coprocessor for expensive logic that is not practical on-chain.
Typical cases:
- ZKP preprocessing or witness hashing
- FHE planning and parameter estimation
- matrix / vector operations
- custom script execution in the TEE
Privacy Oracle
Use Morpheus when you need to fetch external data and optionally process it inside the TEE before returning a derived result.
Typical cases:
- fetch a private API using an encrypted secret
- run a script on sensitive API output
- return only a boolean / score / filtered result on-chain
PriceFeed / DataFeed
Use Morpheus datafeeds as operator-synchronized on-chain price storage that user contracts read directly.
Important properties:
- all feed pairs are normalized to
- Morpheus does not aggregate or medianize providers
- each provider is stored independently on-chain as
- prices are stored as scaled USD integers with global precision
- threshold checks are evaluated against the quantized on-chain integer price, not unbounded source decimals
- example storage pairs:
2. Privacy Compute Usage
These direct
HTTP examples are for development and operator testing. In production, the same payloads should be carried through the on-chain request + callback path.Built-in functions
List built-ins:
Or call the worker directly:
Built-in examples:
Call through web API:
Custom script compute
Example:
Important notes:
- script execution is time-limited
- invalid entry points are rejected
- use built-ins whenever possible for stable semantics
Confidential compute payloads
If you want the function name, script, or inputs to stay encrypted until they reach the TEE, fetch the Oracle public key first and encrypt a JSON payload patch.
Example confidential builtin call:
The worker decrypts that JSON object inside the TEE, merges it into the request, executes it, and returns the callback-ready result envelope.
3. Privacy Oracle Usage
These direct
HTTP examples are also development/operator paths. End-user dApps should submit the payload through the Oracle contract and wait for the callback result.There are two main paths.
A. Built-in provider mode
Use a built-in provider such as
. Optional providers like and remain available for project-specific Oracle fetch flows, but production PriceFeed sync defaults to .Example:
Request via web API:
B. Custom URL mode
Use a custom URL with optional encrypted secrets and optional script.
Example:
Request via web API:
Important notes:
- is the cleanest choice when only an auth secret must stay private
- , , or a JSON-object can carry confidential headers, provider params, compute input, function names, or scripts
- Morpheus confidential payloads are sealed with
- the encrypted envelope includes an ephemeral X25519 public key plus AES-GCM ciphertext/tag fields
Oracle public key
To encrypt user secrets locally, fetch the Oracle public key first:
or directly from worker:
Returned fields:
4. PriceFeed / DataFeed Usage
Query supported feed pairs
From web API:
From worker directly:
Current default pair catalog includes:
- Core crypto:
- Commodity / hard-asset:
- Equities / ETFs:
- FX:
- (inverted from )
- (inverted from )
With the global
scale, low-priced assets such as , , and can be represented directly without basket pair names.For the exact meaning of every canonical pair, including the real TwelveData source symbol and any inversion / scaling rule, read the canonical pair table in
.Important deprecation note:
- historical basket keys such as and can still exist on-chain because the datafeed registry is append-only
- treat those basket keys as deprecated historical state
- use and in all new code
Query current off-chain quotes
Single provider:
All available built-in providers for the pair:
This returns:
If multiple providers are requested, every successful quote is returned and every failed provider is listed in
. Production feed sync uses by default unless you explicitly override .Trigger an on-chain feed sync
This flow is operator-only. End users should not request
through the Oracle contract. If they do, the request is rejected and finalized with a failure callback.Web cron route:
Direct worker route:
Returned fields:
Each successful sync result contains:
On-chain storage model
For N3 and Neo X, providers are stored separately.
Examples:
This means contracts can choose:
- one specific provider pair
- all stored pairs
- all feed records
- a price format that is always a 1e6-scaled USD integer, for example =
New on-chain DataFeed read methods
Neo N3
Neo X
5. Mainnet Update Policy for Neo N3
For Neo N3 mainnet, automatic feed sync obeys two rules:
- the same price pair is updated only if the fresh quote moved by more than 0.1% versus the current on-chain stored value
- the same storage pair is updated at most once every 60 seconds
Precision caveat:
- because the chain stores quantized integers, a raw source move that is still too small to change the stored on-chain integer value cannot trigger an update, even if that raw source move is already greater than
- with the current scale, the standard catalog can use direct pairs such as and without basket naming
These rules apply per stored provider pair, for example:
So one provider can update while another provider is skipped.
6. Built-in Provider Support
Current built-in providers:
To inspect provider metadata:
or:
7. How to Add New Pairs Later
There are two levels.
Simple level: add symbols only
Set:
Example:
Advanced level: add provider-specific mapping
Set:
Example:
This is the correct place to add pairs whose provider symbols differ from the normalized
format.8. Practical Recommendations
- use when you need fetch + optional secret + optional compute
- use when you do not need an external fetch
- use for standardized public market data storage
- for contracts, prefer provider-scoped storage pairs like
- if you need all currently stored feed pairs, use /