HypeChain is a next-generation NFT marketplace that uses AI to verify product authenticity and generate professional marketing images before minting on the Solana blockchain.
- AI Product Verification: Uses GLM 4.6 vision model to analyze product authenticity
- Liveness Detection: Scores images to detect screenshots or AI-generated fakes
- Auto Marketing Images: Generates professional product photos with crypto-themed backgrounds
- Solana NFT Minting: Mints verified products as NFTs using Metaplex
- IPFS Storage: Decentralized storage via nft.storage
- On-Chain Marketplace: Anchor smart contract for buying/selling
- Node.js 18+ and pnpm
- Rust 1.75+ (for smart contract development)
- Anchor CLI 0.30.1
- Solana CLI 1.18+
- OpenRouter API key
- NFT.Storage API key
Backend:
cd backend
npm installFrontend:
cd frontend
pnpm installBackend (backend/.env):
PORT=3001
FRONTEND_URL=http://localhost:3000
# OpenRouter API (for AI verification & image generation)
OPENROUTER_API_KEY=your_key_here
# NFT.Storage (for IPFS uploads)
NFT_STORAGE_API_KEY=your_key_here
# Solana Configuration
SOLANA_RPC_URL=https://api.devnet.solana.com
SOLANA_NETWORK=devnet
# Server Wallet (for paying transaction fees)
SERVER_WALLET_PRIVATE_KEY=your_base58_private_key
# Smart Contract (deploy first, then add)
MARKETPLACE_PROGRAM_ID=your_program_idFrontend (frontend/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:3001cd contracts
# Build the program
anchor build
# Deploy to devnet
anchor deploy --provider.cluster devnet
# Copy the Program ID to your .env fileBackend (Terminal 1):
cd backend
npm run devServer runs on http://localhost:3001
Frontend (Terminal 2):
cd frontend
pnpm devApp runs on http://localhost:3000
Creates a new NFT listing with AI verification.
Request Body:
{
"userWallet": "SOLANA_PUBLIC_KEY",
"productImage": "data:image/jpeg;base64,...",
"optionalPriceSol": 0.5
}Response:
{
"success": true,
"nft_mint_address": "ABC123...",
"nft_image_url": "https://nftstorage.link/ipfs/...",
"product_name": "Nike Air Jordan 1 Chicago",
"listing_price_sol": 0.5
}- Validation: Validates wallet address and image format (max 5MB)
- AI Verification: Analyzes product with GLM 4.6
- Identifies brand, model, colorway
- Calculates liveness score (rejects if < 50)
- Image Generation: Creates marketing image with crypto background
- IPFS Upload: Uploads image and metadata
- NFT Minting: Mints NFT to user's wallet via Metaplex
- Marketplace Listing: Lists on-chain at specified price
┌─────────────────┐
│ Frontend │
│ Next.js 16 │
└────────┬────────┘
│
┌────▼─────┐
│ API │
│ Routes │
└────┬─────┘
│
┌────▼──────────────────────────┐
│ Services │
├───────────────────────────────┤
│ • OpenRouter (AI Verify) │
│ • OpenRouter (Image Gen) │
│ • IPFS (nft.storage) │
│ • Solana (Metaplex Umi) │
└────┬──────────────────────────┘
│
┌────▼─────────────┐
│ Solana Blockchain│
│ ┌──────────────┐│
│ │ NFT Mint ││
│ └──────────────┘│
│ ┌──────────────┐│
│ │ Marketplace ││
│ │ Contract ││
│ └──────────────┘│
└──────────────────┘
HackNYU 2025/
├── frontend/ # Next.js frontend
│ ├── src/
│ │ ├── app/ # Next.js pages
│ │ ├── components/ # React components
│ │ └── lib/ # Utilities
│ └── package.json
│
├── backend/ # Express.js API server
│ ├── src/
│ │ ├── index.js # Server entry point
│ │ ├── routes/
│ │ │ └── listing.js # API routes
│ │ ├── services/
│ │ │ ├── openrouter.js # AI services
│ │ │ ├── ipfs.js # IPFS uploads
│ │ │ └── solana.js # NFT minting
│ │ └── utils/
│ │ └── validation.js # Input validation
│ ├── package.json
│ └── .env
│
└── contracts/ # Solana smart contracts
├── programs/
│ └── hypechain-marketplace/
│ ├── src/
│ │ └── lib.rs # Anchor smart contract
│ ├── Cargo.toml
│ └── Xargo.toml
└── Anchor.toml
Lists an NFT for sale.
pub fn list_item(ctx: Context<ListItem>, price_sol: u64) -> Result<()>Accounts:
seller: Signernft_mint: NFT mint addressproduct_listing: PDA storing listing data
Removes a listing (seller only).
pub fn delist_item(ctx: Context<DelistItem>) -> Result<()>Purchases an NFT.
pub fn buy_item(ctx: Context<BuyItem>) -> Result<()>Actions:
- Transfers SOL to seller
- Transfers NFT to buyer
- Marks listing as sold
pub struct ProductListing {
pub seller: Pubkey,
pub nft_mint: Pubkey,
pub price_sol: u64,
pub is_listed: bool,
pub bump: u8,
}curl -X POST http://localhost:3000/api/create-listing \
-H "Content-Type: application/json" \
-d '{
"userWallet": "YOUR_SOLANA_ADDRESS",
"productImage": "data:image/jpeg;base64,/9j/4AAQ...",
"optionalPriceSol": 0.1
}'cd contracts
anchor testcd contracts
anchor buildanchor deploy --provider.cluster devnetanchor deploy --provider.cluster mainnet-beta@solana/web3.js- Solana blockchain interaction@metaplex-foundation/umi- NFT mintingnft.storage- IPFS storageopenai- OpenRouter API clientnext- React framework
anchor-lang- Solana program frameworkanchor-spl- Token program integration
-
OpenRouter: https://openrouter.ai/
- Sign up and create an API key
- Supports GLM 4.6 for vision and image generation
-
NFT.Storage: https://nft.storage/
- Free tier includes unlimited uploads
- Provides IPFS pinning
-
Solana RPC:
- Devnet:
https://api.devnet.solana.com(free) - Mainnet: Use QuickNode, Helius, or Alchemy
- Devnet:
- Devnet Testing: Always test on devnet first
- Transaction Fees: Server wallet pays for NFT minting (~0.01 SOL)
- Image Size: Max 5MB for base64 images
- Liveness Score: Minimum 50/100 to pass verification
- NFT Ownership: NFTs are minted directly to user's wallet
MIT License - see LICENSE file for details
Contributions welcome! Please open an issue or PR.
- Frontend UI for listing creation
- Browse marketplace page
- User profiles and collections
- Advanced filtering and search
- Auction functionality
- Mobile app (React Native)
For questions or issues:
- Open a GitHub issue
- Contact: [your-email]
Built for HackNYU 2025