A modern dApp that empowers NFT collectors to become co-creators by minting AI-powered derivative NFTs using Neural Style Transfer. Built with Next.js, TypeScript, and TensorFlow.js.
- Neural Style Transfer: Apply the style of one NFT to another using ML models running entirely in your browser
- Derivative NFT Minting: Create unique, verifiable derivative artworks on-chain
- CosmWasm Integration: Built for Terra/CosmWasm blockchain with Keplr wallet support
- IPFS Storage: Decentralized storage for your derivative artworks
- Modern UI: Beautiful, responsive interface built with Tailwind CSS
- Type-Safe: Full TypeScript implementation for reliability
- No Backend Required: Everything runs client-side for true decentralization
- Connect Wallet: Connect your Keplr wallet to access your NFT collection
- Select NFTs: Choose a content NFT (base image) and a style NFT (artistic style)
- Customize: Adjust parameters like image sizes and stylization strength
- Generate: Neural Style Transfer creates a unique derivative artwork
- Mint: Save your creation as an on-chain derivative NFT with IPFS storage
The smart contract stores:
- Links to the original source NFTs (
token_id) - Generation method and parameters
- Provenance chain for complete traceability
This ensures:
- ✅ Traceback to original artworks
- ✅ Proof of ownership at minting time
- ✅ Deterministic recreation from sources
- ✅ Uniqueness (no duplicate derivatives)
- Framework: Next.js 14 (App Router)
- Language: TypeScript 5.6
- Styling: Tailwind CSS 3.4
- ML/AI: TensorFlow.js 4.21
- Blockchain: CosmJS, CosmWasm
- Storage: IPFS (via Infura)
- Wallet: Keplr Integration
# Clone the repository
git clone https://github.com/topsecretagent007/DNFT-Mint-Site.git
cd DNFT-Mint-Site
# Install dependencies
npm install
# or
yarn install
# or
pnpm installCreate a .env.local file in the root directory:
# Contract Configuration
NEXT_PUBLIC_CONTRACT_ADDRESS=your_contract_address_here
# Network Configuration
NEXT_PUBLIC_CHAIN_ID=phoenix-1
NEXT_PUBLIC_RPC_URL=https://rpc.phoenix-1.terra.dev
# IPFS Configuration
NEXT_PUBLIC_IPFS_HOST=ipfs.infura.io
NEXT_PUBLIC_IPFS_PORT=5001
NEXT_PUBLIC_IPFS_PROTOCOL=https# Run development server
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 in your browser.
# Create optimized production build
npm run build
npm run start
# or
yarn build
yarn start
# or
pnpm build
pnpm startdNFT-web-app/
├── app/ # Next.js app router
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Main page
│ └── globals.css # Global styles
├── components/ # React components
│ ├── Hero.tsx # Hero section
│ ├── InfoSection.tsx # Info section
│ ├── StyleTransferWorkshop.tsx # Main workshop
│ ├── ImageSelector.tsx # NFT image selector
│ ├── WalletConnect.tsx # Wallet connection
│ └── MintSuccessModal.tsx # Success modal
├── hooks/ # Custom React hooks
│ ├── useWallet.ts # Wallet state management
│ ├── useStyleTransfer.ts # Style transfer logic
│ └── useNFTs.ts # NFT operations
├── utils/ # Utility functions
│ ├── constants.ts # App constants
│ ├── ipfs.ts # IPFS upload
│ ├── styleTransfer.ts # ML engine
│ └── wallet.ts # Blockchain interaction
├── types/ # TypeScript types
│ └── index.ts # Type definitions
├── public/ # Static assets
│ ├── images/ # Demo images
│ └── saved_model_*/ # TensorFlow models
└── package.json # Dependencies
This app uses two neural networks:
-
Style Network: Extracts 100-dimensional style representation
- MobileNet (Fast, 9.6MB)
- Inception (High Quality, 36.3MB)
-
Transform Network: Applies style to content image
- Separable Conv2D (Fast, 2.4MB)
- Original (High Quality, 7.9MB)
All processing happens in your browser using TensorFlow.js with WebGL acceleration.
The dApp uses a custom CW721-compatible contract with metadata extensions:
{
"mint": {
"token_id": "content_nft+style_nft",
"owner": "terra1...",
"extension": {
"external_url": "https://ipfs.io/ipfs/...",
"derivative": {
"method": "styletransfer",
"params": "mobilenet:separable:100:256:256",
"source_ids": ["content_nft", "style_nft"]
}
}
}
}The app starts in demo mode with sample images. Connect your Keplr wallet to:
- Access your actual NFT collection
- Mint derivative NFTs on-chain
- Store artworks on IPFS
- GitHub: https://github.com/topsecretagent007/DNFT-Mint-Site.git
- Telegram: @topsecretagent_007