Ontology Developer Center
DISCOVERCOMMUNITYSUPPORT
  • Introduction
  • Discover Ontology
  • Getting Started
  • Glossary
  • Decentralized Identity and Data
    • ONT ID
      • Decentralized Identifiers
        • Method Specification for Ontology
        • Method Specification for Ethereum
        • Method Specification for BSC
      • Verifiable Credentials
        • Anonymous Credentials
      • ONT Login
        • Scenarios
        • Protocol Specification
        • Front-end JavaScript SDK
          • Integration and Usage
          • API Reference
        • Front-end UI SDK
          • Integration and Usage
          • API Reference
        • Back-end Go SDK
          • Integration and Usage
          • API Reference
        • Back-end Java SDK
          • Integration and Usage
          • API Reference
      • ONT TAG
        • Workflow
        • API Reference
      • Mercury
      • OScore
    • DDXF
      • Components and Interfaces
      • GREP
      • Overall Scheme
      • Solutions
        • Marketplace
          • Deployment
          • Scenarios
          • SaaS Tenant
          • Java SDK
        • Data Storage
          • Deployment
          • Java SDK
        • Resource Auditor
        • Offline Judge
      • Use Cases
        • E-Shops
  • ONTOLOGY ELEMENTS
    • Smart Contracts
      • Types of smart contracts
    • Token Protocols
    • Consensus Mechanism
    • Ontology Oracle
      • Oracle Process Flow
  • GUIDES & TUTORIALS
    • Development Guides
      • dApp Development
        • Using the dAPI
        • Data Synchronization
      • Smart Contract Development
        • EVM Contract
          • Development Environment and Tools
          • Wallet Setup
          • Contract Development
          • How to Deploy a Smart Contract with GetBlock
        • NeoVM Contract
          • Development tools and environment
          • Launching the IDE
          • Writing and editing program logic
          • Deploying and testing on private net
        • WASM Contract
          • Development Environment
          • Project Initiation - Hello World
          • Creating your own project
          • Development using SmartX
          • Runtime API
          • Contract Fundamentals
          • Inter-contract Interaction
          • Developing Contracts in C++
        • Publish Contract Source Code
    • Integration Guides
      • dApp Integration
        • dAPI Integration
          • Chrome Plugin
          • Mobile wallet dApp
          • QR code mechanism
          • Wake call mechanism
        • Cocos 2D-x
        • Unity 3D applications
      • Mobile Wallet Integration
        • SDK integration
        • dAPI Integration
          • In-wallet applications
          • QR code mechanism
          • Wake call mechanism
        • Stake
      • Using ONT ID
      • Exchange Integration
        • Exchange Docking Guide
        • Exchange API
      • Ontology for dApp Stores
    • EVM & Token Decimals Upgrade
  • ONTOLOGY NODE
    • Abstract
    • Node Deployment
      • Standard Node
      • Rosetta Node
    • Interacting with a Public Node
  • DEVELOPER TOOLS
    • dApp Development Framework
      • Punica CLI
      • Punica boxes
      • Solo Chain
    • IDE
    • APIs
      • HTTP API
        • Restful
        • WebSocket
        • Remote Procedure Call (RPC)
      • Explorer v2 API
        • Block
        • Address
        • Contract
        • Token
        • Transactions
        • ONT ID
        • Summary
        • Node
      • Native Token API
        • ONT Contract API
        • ONG Contract API
      • ONT ID Contract API
      • Web3 API
      • OScore Open API
      • Rosetta Node API
        • Data API
        • Construction API
      • DToken Contract API
      • DDXF
        • Marketplace Contract API
        • Storage API
      • Governance API
    • Digital Wallet
      • Chrome Plugin provider
      • Chrome Plugin dAPI
      • Mobile version provider
      • Mobile version dAPI
    • SDKs
    • Signing Server
      • Installation
      • API reference
  • COMMUNITY
    • Ecosystem Programs
    • Community Libraries
    • Community Events
    • Community Channels
    • Core Contributors
  • SUPPORT
    • FAQ
      • Basic blockchain concepts
      • Ontology Nodes
      • Ontology token protocols
      • Smart contracts
      • SDKs and APIs
    • Contact Us
Powered by GitBook
On this page
  • Ontology Oracle Framework
  • Off-chain (Oracle Operator and Data Source)
  • On-chain (Oracle Contract)
  • Oracle data and workflow

Was this helpful?

  1. ONTOLOGY ELEMENTS

Ontology Oracle

Oracle network and mechanism

PreviousConsensus MechanismNextOracle Process Flow

Last updated 5 years ago

Was this helpful?

More and more dApps now depend on outside world triggers. Here's a hypothetical scenario: A flight is scheduled to arrive at 10:00 AM. An insurance smart contract has been set in place which will be triggered if the flight is delayed, and all the beneficiaries of the insurance policy should receive 100 tokens as compensation.

A scenario such as this one involves many variables, and a dApp that implements a smart contract such as this will require a lot of outside world data such as flight information, insurance policy related data, relevant account information to actually carry out the transaction, etc.

dApps are becoming richer and are trying to encapsulate as much functionality as possible. As a result, more and more real world data needs to be processed, such as logistic information, stock prices, weather data, sports statistics and scores, etc.

Ontology Oracle is designed to deal with this issue of smart contracts not being able to interact with the outside world. It essentially plays the role of data transporter, making it possible for smart contracts to fetch outside world data.

Ontology Oracle Framework

With reference to the illustration above, the infrastructure consists of two major parts-

  1. On-chain

  2. Off-chain

Off-chain (Oracle Operator and Data Source)

The Oracle node and the data source are two parts of the Oracle network that exist off-chain. The nodes are linked to the Ontology network and listen for requests from the Oracle contracts. All nodes process the data requests independently. These nodes will support more blockchain networks in the future.

The operation carried out by the nodes consists of two important tasks:

  • Data crawling

  • Data analysis

The node fetches data from the data sources via external APIs and after processing and analyzing the response writes the data into the Oracle contract after serializing it into the format specified by the user.

On-chain (Oracle Contract)

The Oracle contract primarily collects and stores the data sent by the node, making it available for other smart contracts to invoke and access.

Oracle data and workflow

The data flow within the Oracle network, as illustrated above, can be described as follows:

  1. The client issues data requirements using an Oracle data request to the Oracle contract

  2. Oracle contract updates the received information in a ledger that functions like a database

  3. An Oracle node picks up on this request and fetches this data using the RPC interface

  4. The node fetches data from external data sources using HTTP API

  5. The node serializes the received data based on the client request obtained earlier and invokes the Oracle contract to transmit the data

  6. Other smart contracts on client side can then invoke this Oracle contract to access this data

Oracle infrastructure
Oracle network data flow