A user-friendly Streamlit web app to mint NFTs on the Base network with IPFS metadata storage via Pinata.
- 🖼️ Image Upload: Support for PNG, JPG, JPEG, GIF, WEBP
- 📝 Metadata Creation: OpenSea-compatible metadata with custom attributes
- 🌐 IPFS Storage: Automatic upload to IPFS via Pinata
- ⛓️ Base Network: Deploy on Base Mainnet or Sepolia Testnet
- 💰 Gas Optimization: Efficient transaction handling
- 🎯 User-Friendly: Clean Streamlit interface
- Python 3.8 or higher
- MetaMask wallet with Base network configured
- Pinata account
- ETH on Base network for gas fees
- Clone the repository
git clone https://github.com/yourusername/nft-minter-base.git
cd nft-minter-base- Install dependencies
pip install -r requirements.txt- Create and configure your
.envfile
CONTRACT_ADDRESS=0xYourContractAddress
PRIVATE_KEY=your_private_key_here
PINATA_API_KEY=your_pinata_api_key
PINATA_SECRET_KEY=your_pinata_secret_keystreamlit run nftmint.pyThe app will open in your browser at http://localhost:8501
streamlit==1.32.0
web3==6.15.1
python-dotenv==1.0.1
Pillow==10.2.0
requests==2.31.0Use Remix IDE to deploy the MyNFT.sol contract:
- Copy the contract code from
MyNFT.sol - Compile with Solidity 0.8.20+
- Connect MetaMask to Base network
- Deploy with your address as
initialOwner - Copy the deployed contract address
Base Mainnet:
- Network Name:
Base - RPC URL:
https://mainnet.base.org - Chain ID:
8453 - Currency Symbol:
ETH - Block Explorer:
https://basescan.org
Base Sepolia Testnet:
- Network Name:
Base Sepolia - RPC URL:
https://sepolia.base.org - Chain ID:
84532 - Currency Symbol:
ETH - Block Explorer:
https://sepolia.basescan.org
- Create a free account at pinata.cloud
- Go to API Keys section
- Generate a new API Key
- Copy both API Key and Secret Key to your
.envfile
- Upload Image: Click "Choose an image" and select your NFT artwork
- Fill Metadata:
- NFT Name (required)
- Description (required)
- Recipient Address (optional - defaults to your wallet)
- Add Attributes (optional): Click "Add Attributes" to include OpenSea traits
- Click "Create NFT": Wait for the process to complete
1. Upload image → IPFS
2. Create metadata → IPFS
3. Mint NFT → Base Blockchain
4. View on OpenSea
- NEVER commit your
.envfile to Git - NEVER share your private key
- Use a separate wallet for minting (not your main wallet)
- Test on Sepolia testnet before using mainnet
- Keep your Pinata API keys secure
After minting, your NFTs will be visible on:
OpenSea Mainnet:
https://opensea.io/assets/base/{CONTRACT_ADDRESS}/{TOKEN_ID}
OpenSea Testnet:
https://testnets.opensea.io/assets/base-sepolia/{CONTRACT_ADDRESS}/{TOKEN_ID}
Note: It may take a few minutes for NFTs to appear on OpenSea
"Invalid private key" error
- Ensure your private key is in the correct format (no 0x prefix in .env)
- Check for extra spaces or newlines
"Insufficient payment" error
- Make sure you have enough ETH for gas fees
- On Base, gas fees are typically very low ($0.01-0.10)
"Unable to connect to Base" error
- Check your internet connection
- Verify RPC URL is correct
- Try switching networks in the app
IPFS upload fails
- Verify Pinata API keys are correct
- Check Pinata account is active
- Ensure you haven't exceeded free tier limits
Gas estimation failed
- Your wallet may not have enough ETH
- The contract may not be deployed correctly
- Public minting might not be active on the contract
This project is licensed under the MIT License.
- Add batch minting support
- Implement whitelist functionality
- Add collection statistics dashboard
- Support for multiple file formats
- Integration with other IPFS providers
Made with ❤️ by dnapog.base.eth