NFT collection generation plugin for Eliza OS that enables NFT creation, collection management, and verification on the Solana blockchain.
This plugin provides comprehensive NFT functionality, including collection creation, NFT minting, and verification, with automatic image generation and metadata management.
- Automated NFT collection creation
- AI-powered image generation for NFTs
- Collection logo generation
- Metadata creation and management
- AWS S3 integration for asset storage
- Solana blockchain integration
- NFT verification system
- Automatic nonce management
- Comprehensive error handling
pnpm install @elizaos/plugin-nft-generation
The plugin requires environment variables or runtime settings:
# Solana Configuration
SOLANA_PUBLIC_KEY=your-wallet-public-key
SOLANA_PRIVATE_KEY=your-wallet-private-key
SOLANA_ADMIN_PUBLIC_KEY=admin-public-key
SOLANA_ADMIN_PRIVATE_KEY=admin-private-key
SOLANA_VERIFY_TOKEN=verification-token
SOLANA_CLUSTER=devnet # or mainnet-beta
# AWS Configuration
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=aws-region
AWS_S3_BUCKET=bucket-name
Creates a new NFT collection with an AI-generated logo.
const result = await createCollection({
runtime: runtimeInstance,
collectionName: "MyCollection",
fee: 0.01, // Optional: royalty fee percentage
});
Mints a new NFT in an existing collection.
const nft = await createNFT({
runtime: runtimeInstance,
collectionName: "MyCollection",
collectionAddress: "collection123",
collectionAdminPublicKey: "admin123",
collectionFee: 0.01,
tokenId: 1,
});
Verifies an NFT as part of a collection.
const verification = await verifyNFT({
runtime: runtimeInstance,
collectionAddress: "collection123",
NFTAddress: "nft123",
});
Creates a new collection with generated logo.
Mints a new NFT with generated artwork.
Generates metadata for an NFT.
Verifies an NFT's collection membership.
The plugin provides a streamlined process for generating and verifying NFT collections:
import { createCollection, createNFT, verifyNFT } from "./handlers";
const runtime = initializeRuntime(); // Replace with actual IAgentRuntime initialization
(async () => {
// Step 1: Create Collection
const collectionResult = await createCollection({
runtime,
collectionName: "MyUniqueCollection",
});
console.log("Collection created:", collectionResult);
// Step 2: Create an NFT in the Collection
const nftResult = await createNFT({
runtime,
collectionName: "MyUniqueCollection",
collectionAddress: collectionResult.address,
collectionAdminPublicKey:
collectionResult.collectionInfo.adminPublicKey,
collectionFee: 0.01,
tokenId: 1,
});
console.log("NFT created:", nftResult);
// Step 3: Verify the NFT
const verificationResult = await verifyNFT({
runtime,
collectionAddress: collectionResult.address,
NFTAddress: nftResult.address,
});
console.log("NFT verified:", verificationResult);
})();
Here are some examples of user prompts to trigger NFT collection generation:
- "Generate a collection named MyCollection."
- "Create a new NFT collection."
- "Compile an NFT collection for me."
- "Build a sci-fi themed collection."
To test locally using a Trusted Execution Environment (TEE) simulator:
- Pull the simulator Docker image:
docker pull phalanetwork/tappd-simulator:latest
- Run the simulator:
docker run --rm -p 8090:8090 phalanetwork/tappd-simulator:latest
- Update your environment variable for the simulator:
DSTACK_SIMULATOR_ENDPOINT="http://localhost:8090"
-
Key Management
- Store private keys securely
- Use environment variables
- Implement key rotation
- Monitor wallet activity
-
Asset Security
- Secure S3 bucket configuration
- Implement proper CORS policies
- Use secure URLs for metadata
- Regular backup of assets
-
Transaction Safety
- Validate all inputs
- Implement fee limits
- Double-check collection ownership
- Monitor transaction status
-
Error Handling
- Log all operations
- Handle timeouts gracefully
- Validate metadata
- Provide clear error messages
- @elizaos/core: workspace:*
- @elizaos/plugin-image-generation: workspace:*
- @elizaos/plugin-node: workspace:*
- @metaplex-foundation/mpl-token-metadata: ^3.3.0
- @solana/web3.js: 1.95.5
- express: 4.21.1
- node-cache: 5.1.2
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
This plugin integrates with:
- Solana Blockchain
- Metaplex Protocol
- AWS S3 for asset storage
Special thanks to:
- The Solana ecosystem and all the open-source contributors who make these integrations possible.
- The Eliza community for their contributions and feedback.
For more information about Solana blockchain capabilities:
This plugin is part of the Eliza project. See the main project repository for license information.