PromptHash

AI Prompt Marketplace


Overview

PromptHash is a dynamic, AI-powered marketplace connecting prompt creators with users seeking inspiration, productivity, and cutting-edge solutions. Our platform enables users to explore, create, buy, and sell high-quality AI prompts across various categories.


Vision

To become the go-to resource where creators and users converge β€” leveraging advanced AI models, privacy-focused blockchain infrastructure, and intuitive design β€” to spark transformative ideas across industries.


Key Features

  • πŸ” Browse & Discover – Explore curated collections of AI prompts from top creators
  • πŸ’° Buy & Sell Prompts – Monetize your expertise or find the perfect prompt
  • πŸ”’ Blockchain Security – Built on Avalanche Blockchain
  • πŸ’¬ Conversational AI – Maintain chat sessions with context awareness
  • πŸ›οΈ Governance – Community-driven platform development
  • ✨ Prompt Engineering – Tools to improve and optimize AI prompts
  • πŸ‘¨β€πŸ’» Creator Profiles – Dedicated space for top prompt creators
  • πŸ–ΌοΈ Multi-Format Support – Generate images, text, and code with ease

πŸš€ How We Use Avalanche Blockchain

For Non-Technical Users

Avalanche is our digital ledger and payment system β€” a secure, decentralized database recording all prompt transactions and automating payments.

It ensures:

  • Secure Ownership – Every prompt becomes a unique NFT on Avalanche
  • Automatic Payments – Instant, secure transfers via smart contracts
  • Transparent History – All transactions are public and immutable
  • No Middlemen – Peer-to-peer transactions without bank fees
  • Global Access – Anyone with internet can participate

For Technical Users

Avalanche serves as our decentralized database and payment infrastructure through the following implementation:

🧠 Smart Contract Architecture

  • ERC-721 NFT Contract: PromptHash.sol deployed at 0x76744225486abccBFAEb0b597bDD676A2e6B90B0
  • Upgradeable Contract: Uses OpenZeppelin’s UUPS pattern
  • Gas Optimization: Built on Avalanche C-Chain

βš™οΈ Core Functions

// Create new prompts as NFTs
function createPrompt(string memory _imageUrl, string memory _description) external returns (uint256)

// List prompts for sale
function listPromptForSale(uint256 _tokenId, uint256 _price) external

// Purchase prompts with automatic fee distribution
function buyPrompt(uint256 _tokenId) external payable nonReentrant

// Retrieve all prompts
function getAllPrompts() external view returns (uint256[] memory, Prompt[] memory)

🌐 Network Configuration

  • Primary Network: Avalanche C-Chain (Mainnet)
  • Test Network: Avalanche Fuji Testnet
  • RPC Endpoint: https://api.avax.network/ext/bc/C/rpc
  • Block Explorer: snowtrace.io

🧩 Technical Stack Integration

  • Frontend: Wagmi + RainbowKit
  • Smart Contract Interaction: Ethers.js
  • Transaction Management: Auto gas estimation & confirmation
  • Fee Structure: 1% platform fee (configurable wallet)

πŸ—ƒοΈ Data Storage Pattern

  • On-Chain: Metadata, ownership, transaction history
  • Off-Chain: Image URLs & descriptions (IPFS-ready)
  • Hybrid Approach: Blockchain security + scalable storage

🧭 Features & Overview

  • Discover & Explore: Browse curated AI prompts across categories
  • Sell & Share: Monetize your best prompts
  • Interactive Chat: AI-driven recommendations & insights
  • Responsive UI: Next.js + Tailwind CSS
  • API Integration: RESTful API endpoints

πŸ› οΈ Categories

Category Description
πŸ“Έ Image Prompts For visual content generation
πŸ“ Text & Writing Creative writing, copywriting
πŸ“Š Marketing Copy Advertising, email, and conversion content
πŸ’‘ Creative Ideas Brainstorming and ideation
πŸš€ Productivity Workflow optimization
πŸ’» Code Generation Programming and development assistance

🧰 Tech Stack

Layer Tools
Frontend Next.js, React, Tailwind CSS
Backend FastAPI
AI Integration Google Gemini AI API
Authentication Wallet Connect
Server Uvicorn
Blockchain Avalanche
Smart Contracts Solidity + OpenZeppelin
Web3 Integration Ethers.js, Wagmi, RainbowKit

βš™οΈ Prerequisites

  • Python 3.12.0
  • Secret AI API Key
  • Node.js 18+
  • Web browser with wallet extension
  • MetaMask or any EVM-compatible wallet

πŸ”— API Endpoints

Models

GET /api/models – Retrieve available AI models

Chat

GET /api/chat – Chat with an AI model Parameters:

  • prompt – User’s input
  • model (optional) – AI model name

Prompt Improvement

POST /api/improve-prompt – Enhance a prompt Body:

{
  "prompt": "Create an image of a futuristic city"
}

Health Check

GET /api/health – Check API status


πŸ’‘ Usage Examples

Chat with AI Model

import requests

API_KEY = "your_api_key_here"
BASE_URL = "http://localhost:8000"
headers = {"X-API-Key": API_KEY}

response = requests.get(
    f"{BASE_URL}/api/chat",
    params={"prompt": "Explain the benefits of Secret Network for AI applications", "model": "deepseek-r1:70b"},
    headers=headers
)

print(response.json())

Improve a Prompt

import requests

API_KEY = "your_api_key_here"
BASE_URL = "http://localhost:8000"
headers = {"X-API-Key": API_KEY, "Content-Type": "application/json"}

data = {"prompt": "Create an image of a futuristic city"}

response = requests.post(f"{BASE_URL}/api/improve-prompt", json=data, headers=headers)

print(response.json())

πŸ“ Project Structure

PromptHash/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ web3/
β”‚   β”‚   β”œβ”€β”€ PromptHash.sol
β”‚   β”‚   β”œβ”€β”€ PromptHash.js
β”‚   β”‚   └── metadata.json
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ lib/
β”‚   └── app/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ security.py
β”‚   └── routers/
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ package.json
└── README.md

πŸ“¦ Dependencies

  • FastAPI – API framework
  • Uvicorn – ASGI server
  • React / Next.js / Tailwind – Frontend stack
  • Lucide – UI icons
  • Ethers.js – Smart contract interaction
  • Wagmi + RainbowKit – Wallet integration
  • OpenZeppelin – Secure Solidity libraries

For the complete list, refer to requirements.txt and package.json.


🧊 Why Avalanche?

  • ⚑ Speed – Sub-second transaction finality
  • πŸ’Έ Cost – Transactions under $1
  • 🌍 Scalability – High throughput
  • πŸ”§ EVM Compatibility – Ethereum-ready
  • 🌱 Eco-Friendly – Energy-efficient PoS
  • πŸ§‘β€πŸ’» Developer Friendly – Excellent docs & tooling

🌐 Getting Started with Avalanche

  1. Install MetaMask or another EVM wallet
  2. Add the Avalanche Network:
   Network Name: Avalanche C-Chain
   RPC URL: https://api.avax.network/ext/bc/C/rpc
   Chain ID: 43114
   Symbol: AVAX
   Explorer: https://snowtrace.io/
  1. Get test AVAX from the Avalanche Faucet
  2. Connect your wallet and start creating prompts

Built With

Share this project:

Updates