Overview
This document outlines the process for generating and storing AI-generated images for a long-form generative AI NFT project. The project will use a centralized server for image generation, while leveraging decentralized storage using IPFS and IPNS.
Components
- Generative NFT Contract
- One IPFS-hosted image files for each NFT
- Single IPFS-hosted manifest file containing URIs for all images
- IPNS Name that points to the manifest file
- Service that coordinates all post-mint actions
Steps
1. Service Watches for NFT Events
The Service continuously monitors the NFT contract for minting events. This can be achieved using event listeners or webhooks, depending on the blockchain platform in use.
2. User Mints Generative NFT
When a user mints an NFT:
- The NFT contract polls the manifest file (via its IPNS name) to get the URI of the AI-generated image.
- If the image is available it’s displayed. If the images is not available, it displays a loading screen and continues to poll.
3. Service Triggers Image Generation
Once the Service detects a minting event:
- It retrieves the necessary NFT data (e.g., metadata, user address, NFT ID).
- It triggers the generation of an AI image based on the NFT data.