Project Name: FreeAiNFTs - gasless subscription to AI NFTs
Project Track: AI
Team Name: MoTo team
Team Member(s): @mto
HackerEarth Project Link: MoTo team - HackaTRON Season 5 - Submission | HackerEarth Hackathons
Project Goal: To create a platform on BTT Chain Testnet where users can subscribe for free (gasless) to specific types of NFT generated by OpenAI.
“Free AI NFTs” is a gasless (FREE) NFT subscription dapp for AI-generated NFTs on BTT Chain Testnet.
Detailed breakdown of main components:
- User wallets & EIP-712 Signatures: Users will need to have a Metamask wallet to interact with the web app & sending to the backend a EIP-712 signature for free subscription.
EIP-712 signatures ensure that user actions are secure and cannot be tampered with.
- Backend wallet relayer: A backend wallet acts as a relayer to sponsor the gas fees on behalf of the users. The backend server is responsible for submitting transactions to the BTT Chain Testnet.
- Subscription management: Users should be able to choose their subscription preferences, including the category of NFTs they want to receive. This information needs to be stored in the smart contract.
- NFT Generation & Minting: Based on the subscription preferences, the smart contract triggers the AI to generate the NFTs and then mint them. The NFTs are transfered to the subscribers wallets.
All NFTs are generated using Open AI api.
- User Experience: A web interface with user-friendly design that allows users to easily subscribe and view own NFTs.
How does it work?
Part 1 – Subscription
- To make NFT subscription FREE, we use EIP-712 signatures: users sign and submit signatures (free action), which are sent to a server where they are checked for validity and, if successful, a special dedicated wallet (with a balance) sends a transaction (paying for it) and registers the user who sent the signature.
Part 2 – Generating and sending NFTs
- All NFTs are generated using OpenAI API.
- The process of generating and sending NFTs is also FREE for users, since there are dedicated wallets on the server (relayers) that do this by sending transactions to a smart contract and paying with their native tokens, not users. To ensure that NFTs are automatically sent after a certain time interval, CRON tasks were launched on the server.
“Free Ai NFTs” PDF presentation:
FreeAiNFTs.pdf (43.3 KB)
Project Website: http://184.108.40.206:5000/
Project Test Instructions:
- Open dapp in your browser;
- Connect your Metamask wallet;
- Change network to BTT Chain Testnet;
- Select one of the subscriptions from the list (NFT batch). At the moment there are 2 of them: one with a maximum number of subscribers of 15, the other - 12.
- If you have not subscribed, on the subscription details page you will see a form where you need to write a prompt (preference, topic) for the NFTs you want to receive. For example: dog, cat, car, flowers, etc.
- Click on “Subscribe with this preference”. Your Metamask wallet will open with a request to sign and send a signature. This is a FREE action and does not require gas or native coins. By sending the signature, you will automatically subscribe to receive NFTs with the specified topic. You can find out in detail why it is FREE by reading the section above “How does it work?”
- You will receive FREE NFT every certain time interval. At the moment the interval is ~1 hour. This may be changed in the future.
Video: FreeAiNFTs - gasless subscription to AI NFTs on Vimeo
Smart Contract links:
- MinimalForwarder: Contract Address 0x50b15a0482eE655e0Eae022D2f1682b8fbfD684A | BTTC
- FreeAiNFTs subscription nr. 1: Contract Address 0x13A30842F84dAd18468c36B723165e4bF278b6D3 | BTTC
- FreeAiNFTs subscription nr. 2: Contract Address 0x2075dC380713D4255F7c0aE1CB688aDF8184B6FF | BTTC
[DONE] Deployment of smart contracts on the BTTC Testnet;
[DONE] Running the server & CRON tasks;
[DONE] Integration with OpenAI API;
[DONE] Creating the dApp interface;
[TO DO] Adding the ability to select the style of generated NFTs. Eg: Fantasy, Low Poly, 3D Animation, Vector Art, Oil Painting etc.
[TO DO] Creating an admin panel;
[TO DO] Creation of a notification system for users about receiving new NFTs.