How to Start Building with AI on OP Mainnet

0. ORA OAO on OP Mainnet

a) Intro to OAO

OAO is ORA’s onchain AI oracle. OAO now enables anyone to use verifiable AI inference on OP Mainnet.

OAO uses opML to create a verifiable proof for ML (machine learning) computations that is feasible to be verified on the blockchain, opening up new possibilities for using AI and GenAI inference in blockchain ecosystems. ORA invented the opML framework, which is comparable to how optimistic rollups work on Ethereum, like OP Mainnet and other chains built on the Superchain with the OP Stack. Read more about how opML works here.

b) OAO on OP Mainnet

Last week, OAO integrated with OP Mainnet, in collaboration with Optimism, after first launching on Ethereum Mainnet last month.

For more information, check the broadcast recording on ORA OAO with Optimism.

OAO brings AI inference to blockchains right now in a way that is fast and affordable. Similarly, the Optimism ecosystem helps reduce the costs of Ethereum by using it for settlement and security as a Layer 1 and relying on rollups, like OP Mainnet, as a way to increase speed and decrease gas costs as a Layer 2. Together, OAO on OP Mainnet brings unprecedented speed and affordability to using AI inference onchain. When you start to combine this with DeFi, you can do some really amazing things with AI-powered smart contracts on OP Mainnet.

1. How to Get Onboarded & Familiar with OAO

a) First, watch this video

Video: How to interact and build with Onchain AI Oracle by ORA

To follow along and interact with the UI yourself to get a feel for how OAO works:

  • Go to

  • Use the drop-down menu to switch to OP Mainnet

  • Ensure you have some OP ETH to test with, or you can also do so at no cost with Sepolia ETH and by switching to the Sepolia Network

    • Get Sepolia ETH from this faucet
  • Choose a model, write a prompt, click Generate

    • Once the result has generated, you can also try Verifying it – clicking the Verify button will engage the fault/fraud proof challenge of the AI inference, finalizing the result onchain if it passes verification

In the second half of the video, you will get a walkthrough of how to write your first OP Mainnet contract, powered by AI.

If you prefer to read a walkthrough in your own time,

b) Now you can start interacting with the OAO contract on OP Mainnet!

  • Use the Example Interaction Contract (Prompt) as a template to interact with Llama2 or Stable Diffusion onchain

  • Here are the necessary contract addresses on OP Mainnet to start building dApps

    • OAO Proxy Contract: 0x0A0f4321214BB6C7811dD8a71cF587bdaF03f0A0

    • OAO Logic Contract: 0x293c8d0f9ce7609217de22698e2dcbcfb2bd3d9d

    • OAO Example Interaction Contract (Prompt): 0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD

  • Check if contract addresses change

2. Use Cases with AI on OP Mainnet

We previously shared a list of development ideas for Onchain AI, enabled by OAO. Covering over 10 tracks, including DeFi, NFTs, Gaming, Governance, and more, these projects will be more powerful with AI enabled by ORA’s Onchain AI Oracle.

In this article, we delve into several fully realized and operational use cases powered by OAO, illustrating how they stand to gain from OAO’s integration with Optimism.

a) ai/fi

Along with the OP Mainnet integration announcement, we have introduced a new concept called "ai/fi".

ai/fi is the combination of AI and DeFi.

With OAO on OP Mainnet, developers can rebuild features of existing DeFi protocols on OP Mainnet, with the power of AI. At the heart of this idea is building new protocols that are smarter and more powerful by replacing key components of traditional protocols with AI.

b) Guide to Build ai/fi

The process for rebuilding DeFi into ai/fi in general is as follows, and we will dive into the details in the next section:

  1. Find and fork an existing DeFi protocol

  2. Identify the computation component

  3. Replace the computation component with AI

Take for example an AI-powered Aggregation or Router Protocol for swapping, like 1inch.

A traditional DeFi protocol in this category operates by helping the trader to find the most efficient trading path (e.g. find the best trading path between ETH -> OP and ETH -> USDT -> OP), which allows the trader to maximize their profit.

However, these protocols are usually limited by the computational power of the EVM and do not take into account all the factors that affect trading (liquidity, pairs, MEV, slippage settings, or even the characteristics of the DEX protocol itself or security). As a result, they are practically ineffective in finding the true optimal path quickly.

In this case, the computation component is the component of the Aggregator or Router protocol that finds the optimal transaction path. We can replace it with AI to get even more powerful aggregation by evaluating all the parameters more efficiently. ORA’s OAO on OP Mainnet can maximize profit for traders intelligently, and is more superior than other protocols because of the increased computation power of LLMs like Llama2, compared to the EVM.

c) ai/fi Ideas

In addition to the AI-powered Aggregator/Router Protocol, we can revolutionize other DeFi applications.

In fact, most DeFi protocols can be converted into an ai/fi protocol. Some of the most exciting ideas include:

  • AI Onchain ETF (replacing the infrastructural process of managing an ETF with AI),

  • AI LP Management on Index Fund / DEX (automating the management of LPs with AI to maintain optimal liquidity and composition)

  • AI Yield Aggregator for Lending Protocols (rapidly adjusting lending to maximize yield across OP Mainnet’s lending protocols)

With AI’s power, DeFi protocols can be more efficient, more decentralized, more verifiable, and more intelligent. There is a lot of untapped potential across traditional DeFi protocols, which haven’t yet had access to the speed and cost-efficiency of calling AI inference with OAO on OP Mainnet. Before this integration, ai/fi would not have been possible.

d) Innovate Freely with AI on OP Mainnet

And it's not just DeFi. There are tons of opportunities to simplify and grow web3 products that are computationally heavy.

Lab 7007 is using ORA OAO’s AIGC (AI-Generated Content) models to build the trustless standard for AI NFTs with verifiable AI generated content tokens.

Humm is using OAO to build a protocol for AI ownership and monetization with verifiable AI personas.

InsORAnce is using OAO to achieve onchain insurance protocol powered by AI, using verifiable AI of ORA OAO to interpret coverage terms and assess claims.

Graviola is using OAO to autonomously produce NFTs using user-provided keywords and catalog them based on rarity and other metadata.

All of these teams can now benefit from OP Mainnet's fast speed and cheap fees to generate 100x of what they did before, creating a multiplier effect that AI makes blockchain and applications more intelligent.

There is a world of opportunity out there to use large LLMs like LLama2 to verifiably replace computation-heavy components of DeFi to be more optimized and more decentralized. Where will you strike gold, anon?

e) So, you’re building with OAO on OP Mainnet….

Where to go next?

  1. Join ORA’s discord for troubleshooting, brainstorming and help with any questions you may have:

    We will also feature your project in our ORA ecosystem github repo:

  2. Deploy on OP Mainnet and apply for Optimism’s Retro Funding Grants:

  3. Follow @OraProtocol and @Optimism on X for continued updates

About ORA

ORA is Ethereum’s trustless AI that enables AI and any-size compute on blockchains.

ORA breaks down the limitations of smart contracts by offering AI, richer data sources and arbitrary compute so developers can innovate freely.

ORA’s work has been trusted by Compound, Ethereum Foundation, Uniswap, Optimism and beyond. | |

Subscribe to ORA
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
This entry has been permanently stored onchain and signed by its creator.