Skip to content

Matik86/onchain-mibbo

Repository files navigation

Base

Website mibboverse.com Blog Farcaster Twitter Mibboverse

Onchain Mibbo

A minimal example of the architecture used to implement the Onchain Mibbo functionality.

This repo combines Solidity smart contract with a Python backend.


System Workflow⚙️

Users can describe themselves in natural language, and the system will automatically:

  1. Generate a unique character (name, description, traits) using a request to the СhatGPT.
  2. Create images based on the AI response.
  3. Upload metadata to IPFS.
  4. Store metadata on-chain using the smart contract.
  5. Allow the user to mint their NFT.
  6. Enable NFT upgrades (since two versions of metadata are pre-stored on-chain)

Repository Structure🗂

  • contracts/MibboFactory.sol — Solidity smart contract.
  • main.py — main Python logic (user input → AI → images → IPFS → blockchain).
  • ai_response.py — helper functions for working with AI.
  • image.py — class of functions for generating and processing images.
  • ipfs.py — helper functions for IPFS uploads.
  • onchain/client.py — set of basic functions for interacting with the blockchain.
  • onchain/admin.py and onchain/ntf_interface.py — set of functions and classes for interacting with the specific smart contract(MibboFactory.sol)
  • config/APIs.py — API keys and external integrations (OpenAI, Pinata).
  • onchain/onchain_config.py — blockchain settings (RPC, contract address, keys).
  • requirements.txt — Python dependencies.

Requirements🔗

  • Python 3.9+
  • Node.js + npm (for smart contract deployment with Hardhat/Foundry)
  • Wallet with Base Sepolia ETH balance.
  • Installed dependencies:
    pip install -r requirements.txt

Workflow▶️

  1. Deploy the contract

    • Use Hardhat or Remix to deploy MibboFactory.sol
    • Save the deployed address in onchain/onchain_config.py and also another data
  2. Write down all the necessary data to get started.

    • onchain/onchain_config.pyadmin private key and user private key
    • config/APIs.py — API keys(OpenAI, Pinata).
  3. Run the App

     python main.py
    
  4. Select an Action

    Choose action: Upgrade⬆️ (u) or Find your Mibbo🌀 (f):
    • u — If you already have a Mibbo NFT and you want to upgrade it.
    • f — To Find your Mibbo🌀✨(create and mint)

FAQ🧾

What does this code do?

It generates an NFT character based on a user’s self-description using AI, uploads metadata to IPFS, stores it on-chain, and allows minting/upgrading the NFT.

Is this the final version of the code that will be used in the App?

No, this is just a minimal example of the basic logic behind the creation of Onchain Mibbo.

Still have questions?

You may ask👇

About

A minimal example of the architecture used to implement the Onchain Mibbo functionality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published