๐ŸŒUsing Witnet Custom Feeds

One of the core capabilities of the Wit/Oracle Framework is to enable smart contracts to securely retrieve and transform data extracted from Graph-QL servers, REST API endpoints, JSON-RPC providers, or in general any content accessible via HTTP/GET, HTTP/POST or even HTTP/HEAD requests.

Witnet securely collects data using cryptographic, crowd-attestation and Proof-of-Stake consensus mechanisms. Every oracle data query and its outcome, whether successful or not, is permanently and publicly recorded on the Witnet blockchain.

Wit/Oracle queries from smart contracts rely on formally verified Radon Requests. These Witnet-compliant requests define the public sources for retrieving data and outline the methods for transforming, filtering, and aggregating the data collected from each source.

Multiple data provisioning models are possible depending on who initiates the oracle query and who executes the EVM transaction processing the result:

Data Provisioning Model
Data Requester
Description

Active PULL

Smart contract

Some blocks after the data is queried, the consuming contract calls the WitOracle legacy contract to read and process the query result, if available. Query outcomes are publicly stored in the WitOracle contract and can be erased only by those who requested them.

Passive PULL

Smart contract

The consuming contract is called immediately once the outcome of the data query is returned by the Wit/Oracle bridging framework. The consuming contract is in charge of preserving valuable data on-chain.

Passive PUSH

Off-chain environment

The data requester conducts a free dry run of some data query (i.e. Radon Request), to decide if it's worth paying for a Data Request Transaction in Witnet and posting the result on-chain afterward.


Create and Validate a New Custom Feed

This examples creates a Cross-Chain Custom Feed that retrieves supply information about Witnet:

Querying Resolution for a Custom Feed

Pushing Resolutions of a Custom Feed

In Witnet, oracle query results need to be pushed on-chain only when using the Passive-Push data consumption model. If data is pulled from a smart contract, the Wit/Oracle bridging infrastructure handles reporting the query outcome on-chain.

Process Data Query Results

Active-Pull Consumer
Passive-Pull Consumer
Passive-Push Consumer

Learn more about Witnet Custom Data Feeds

Follow the rabbit hole deep and learn how to harness the true potential of Custom Data Feeds in Witnet:

๐ŸŒWitnet Custom Feeds

Last updated

Was this helpful?