Optimistic Machine Learning (OPML)

Introduction

The Optimistic Machine Learning (OPML) framework connects off-chain machine learning computations with smart contracts. Results are provably correct and can be disputed on-chain to ensure trust and accountability, enabling efficient AI-driven decision-making in decentralized applications. OPML is a core component of the AI Oracle, playing a critical role in validating inference results.

Workflow

  1. Initiate Request: The user contract sends an inference request to AI Oracle by calling the requestCallback function.

  2. opML Request: AI Oracle creates an opML request based on the user contract request.

  3. Event Emission: AI Oracle emits a requestCallback event collected by the opML node.

  4. ML Inference: The opML node performs the AI model computation.

  5. Result Submission: The opML node uploads the result on-chain.

  6. Callback Execution: The result is dispatched to the user's smart contract via a callback function.

AI Oracle and opML Architecture

Challenge Process

  1. Challenge Window: Begins after the result is submitted on-chain (step 5 above).

  2. Verification: opML validators or any network participant can check the results and challenge the output if it is incorrect.

  3. Result Update: If a challenge is successful, the incorrect result is updated on-chain.

  4. Finality: After the challenge period, the result is finalized onchain and made immutable.

Last updated

Was this helpful?