Data Flow & Processing
Overview of Data Flow
The data flow in FLUXNET involves three main components:
Consumer Contract: The smart contract on the blockchain that requires external data.
Oracle Contract: An intermediary smart contract that manages data requests and responses between the consumer contract and off-chain sources.
Off-Chain Program: A service that listens for data requests from the oracle contract, fetches the required data from external sources, and returns it to the oracle contract.
Step-by-Step Data Flow
1. Data Request Initiation
Consumer Contract: Initiates a data request by calling a function on the Oracle Contract, specifying the type of data needed.
2. Event Emission
Oracle Contract: Emits an event signaling a new data request.
Off-Chain Program: Monitors the blockchain for these events to detect incoming requests.
3. Data Retrieval
Off-Chain Program: Upon detecting the event, it fetches the requested data from external sources (e.g., APIs, databases).
Ensures data accuracy and integrity during retrieval.
4. Data Submission
Off-Chain Program: Sends the retrieved data back to the Oracle Contract, often including cryptographic proofs for verification.
5. Data Delivery to Consumer
Oracle Contract: Verifies the data and updates the Consumer Contract with the new information.
Consumer Contract: Utilizes the data within its logic, proceeding with operations like executing trades, updating states, or triggering events.
Key Features of FLUXNET Data Processing
Pull-Based Oracle Design
On-Demand Data Retrieval: Data is fetched only when requested by the consumer contract.
Efficiency: Reduces unnecessary on-chain transactions, lowering gas costs.
Low Latency Data Delivery
Real-Time Access: Provides data within seconds, suitable for applications requiring immediate information.
Optimized Workflow: Streamlined steps minimize delays between request and fulfillment.
Data Verification and Security
Cryptographic Proofs: Ensures data integrity and authenticity.
Trustless Environment: Eliminates the need to trust a single data provider.
Last updated