FortuneTeller is a Farcaster frame application that calculates onchain fortune for the users. Users answer specific questions to the wizard. Then the wizard casts its spells and tells the fortune.
The purpose of FortuneTeller is to demonstrate how ORA's AI Oracle works. The codebase is NOT audited. Use it at your own risk.
FortuneTeller frame uses ORA's Onchain AI Oracle to generate Onchain Fortune for the users.
- Once the user answers all the questions, fortune request is generated and sent to the FortuneTeller contract
- The request is passed to the Onchain AI Oracle
- Onchain AI Oracle uses Llama3 model to generate fortune in a textual representation. This is then passed to StableDiffusion model in order to generate visual representation of the fortune.
- Users can mint an AI generated NFT for their fortune.
By using Onchain AI Oracle, we can verify that the fortune is actually told by Llama3 AI model and that the image is generated by StableDiffusion.
ORA's Onchain AI Oracle uses opML technology to prove AI inference results.
Farcaster protocol enables interactive and fun experience for the users.
FortuneTeller contracts are deployed on Base to allow fast and affordable blockchain transactions. FortuneTeller frame uses @coinbase/onchainkit to build frames with an ease.
- Run the development server:
yarn dev - Use ngrok to expose your local frame
- Test the frame with https://warpcast.com/~/developers/frames
If you don't want to use ngrok, you can test the frame using local debugger from frames.js.
We encourage community to build on top of this repository and explore new use cases.
Some of the steps that could be done in the future:
- Add proxy pattern to enable upgradability of application in the future
- Integrate ORA's rng oracle, to enable more random fortune telling
- create a dashboard for minted NFTs
For further readings check:
- Onchain AI Oracle tutorial - understand how to utilise verifiable AI in your dapps.
- Farcaster docs - an interactive Next.js tutorial.
- Base Onchain Kit - a framework that can help with building frames
