Radix Oracle Architecture
The Morpher Oracle on Radix is designed as a pull-based oracle system that provides secure, verifiable price data for blockchain applications. This page explains the overall architecture and components of the system.
System Components
Key Components
-
Off-Chain Data Sources
- Exchange APIs: Direct connections to cryptocurrency exchanges like Gate.io
- Market Data Providers: Services that aggregate and normalize market data
- Price Aggregators: Systems that combine multiple price sources for reliability
-
Oracle Infrastructure
- Oracle Backend: The core service that:
- Collects and validates data from multiple sources
- Processes subscription requests
- Signs price data with the Oracle’s private key
- Verifies NFT ownership and public key validity
- Oracle Database: Stores historical price data and subscription information
- Oracle Backend: The core service that:
-
DApp Infrastructure
- DApp Backend: A service operated by the DApp developer that:
- Securely stores the DApp’s private key
- Creates and signs requests to the Oracle Backend
- Forwards signed price data to the Frontend
- Private Key Storage: Secure storage for the DApp’s private key
- Frontend/User: The user interface and wallet connection that:
- Initiates transactions requiring price data
- Constructs transaction manifests with signed data
- Submits transactions to the Radix network
- DApp Backend: A service operated by the DApp developer that:
-
On-Chain Components
- Oracle Component: The smart contract that:
- Verifies signatures from the Oracle Backend
- Validates data authenticity
- Provides verified price data to other smart contracts
- Smart Contract: The DApp’s on-chain logic that:
- Calls the Oracle Component to verify signed data
- Validates data freshness for its specific use case
- Uses verified price data for its business logic
- Applies additional validation rules as needed
- Subscription NFT: A non-fungible token that:
- Represents a paid subscription to the Oracle service
- Stores the subscriber’s public key
- Controls access to Oracle services
- Oracle Component: The smart contract that:
Security Model
The Morpher Oracle employs a multi-layered security approach:
-
Data Signing: All price data is cryptographically signed by the Oracle, ensuring data integrity and authenticity.
-
Subscription Verification: Access to Oracle services requires ownership of a subscription NFT, preventing unauthorized usage.
-
On-Chain Verification: Signatures are verified on-chain before data is used in transactions, preventing manipulation.
-
Timestamp Validation: Price data includes timestamps that are checked on-chain to ensure data freshness.
-
Market Status Checks: The system validates that price data is consistent with the current market status (open/closed).
This architecture ensures that price data is:
- Authentic (signed by the Oracle)
- Fresh (recent timestamps)
- Authorized (linked to a valid subscription)
- Verifiable (signature checked on-chain)
In the next section, we’ll explore the Pull Oracle Flow in detail.