project screenshot 1
project screenshot 2
project screenshot 3

Multi Generative PFP

It's a multichained dapp where users can mint an NFT for 0.001 ETH on Ethereum, Arbitrum or Avalanche C-Chain. Users who have registered on ENS can see their's domain name instead of wallet address.

Multi Generative PFP

Created At

ETHOnline 2024

Project Description

Generative PFP is an innovative project that brings the world of NFTs and dynamic profile picture generation together, creating a unique and engaging experience for users in the Ethereum ecosystem. This project was built for the EthOnline 2024 Hackathon and focuses on leveraging generative art techniques to create fully customizable, algorithmically generated profile pictures (PFPs) as NFTs.

Key Features: Generative Art Engine: The core of the project is an art generation engine that uses pre-defined traits, colors, and elements to produce distinctive profile pictures. Each PFP is uniquely generated based on a combination of different attributes such as facial expressions, accessories, backgrounds, and color palettes. This ensures no two PFPs are identical, making each one a rare digital collectible.

On-Chain Minting: Users can mint their generative PFP directly on-chain, ensuring immutability and ownership through Ethereum’s smart contracts. Each PFP is minted as an ERC-721 compliant NFT, allowing seamless integration with popular NFT marketplaces and wallets.

User Customization: Unlike traditional static PFP NFTs, Generative PFP allows users to customize and tweak the traits before minting. This creates a more personalized user experience where participants have partial control over their PFP’s attributes while still relying on generative randomness for the final design.

Decentralized Metadata Storage: All metadata and artwork are stored using decentralized storage solutions like IPFS (InterPlanetary File System). This ensures that the PFP assets are not only secure but also truly decentralized, maintaining the ethos of Web3.

Smart Contract Integration: The project uses Solidity smart contracts for minting, managing, and transferring the NFTs. It also implements a token-gated mechanism, where users need to stake tokens or meet specific criteria to unlock certain exclusive PFP traits.

Community and Governance: In the future roadmap, we aim to implement community-driven governance, allowing PFP holders to vote on new trait releases, updates to the generation engine, and possible future collaborations or features. This gives users a voice in the development and expansion of the project.

Interoperability: Generative PFPs are designed to be interoperable across different chains and platforms. The project is currently deployed on the Ethereum mainnet, but future versions will integrate with Layer 2 solutions and multi-chain frameworks to reduce gas fees and increase scalability.

Use Cases: NFT Collectibles: Users can mint and trade their unique PFPs as collectibles, with rarity determined by the random combination of traits. Identity in the Metaverse: These generative PFPs can serve as digital avatars in the metaverse, representing the identity of users in decentralized social networks and virtual worlds. Social Media Integration: Users can integrate their generative PFPs into platforms that support NFT-based profile pictures, further enhancing the ownership and expression of their digital identity. Tech Stack: Frontend: Built using React.js with Next.js for the user interface, allowing for seamless and dynamic trait selection and NFT minting experience. Backend: The backend is powered by Node.js and integrates directly with the Ethereum blockchain for smart contract interaction. Smart Contracts: Written in Solidity and deployed using Hardhat for testing, deployment, and contract management. IPFS: Used for decentralized storage of PFP assets and metadata. Generative PFP aims to push the boundaries of digital identity, NFTs, and user customization in the Web3 space. By combining algorithmic art generation with user participation and decentralized storage, this project paves the way for a new breed of dynamic and personal digital collectibles.

How it's Made

Building Generative PFP was an exciting technical challenge that combined several cutting-edge technologies and development frameworks in both frontend and backend to create a seamless, dynamic NFT generation and minting experience. Here’s an in-depth look at the process:

Frontend: React.js with Next.js: The frontend of the project is built using React.js with Next.js for server-side rendering, which allows for a dynamic and responsive user interface. This framework was chosen because it simplifies routing and state management, making the UI fast and scalable. Next.js also enhances SEO and load times by rendering the pages on the server before sending them to the client, which is critical when displaying NFT-related content.

Backend: Node.js with Express: The backend is powered by Node.js and Express, which handles user interactions with the blockchain, trait selection, and NFT metadata generation. Using Node.js ensures that the backend can handle multiple requests concurrently, which is vital during high-traffic events like NFT minting.

IPFS (InterPlanetary File System): For decentralized storage, all PFP images and metadata are uploaded to IPFS. This ensures that the assets are immutable and stored in a decentralized manner, adhering to the principles of Web3. IPFS's decentralized nature guarantees that even if the central server is down, the NFTs remain accessible, which enhances both security and permanence for the artwork.

Pinata: Pinata is used as the IPFS pinning service, ensuring that the metadata and images remain persistent and easily retrievable. It simplifies IPFS management, helping ensure our files are reliably hosted, which is critical for an NFT project like Generative PFP where users need access to their assets at all times.

Smart Contracts: Solidity: The smart contracts for minting the NFTs are written in Solidity and deployed on Ethereum. These contracts implement the ERC-721 standard for NFTs, ensuring full compatibility with popular NFT platforms like OpenSea and other wallets. The contracts handle the generation of metadata, randomization of traits, and linking each unique PFP to the user’s wallet.

Hardhat: For developing, testing, and deploying smart contracts, we used Hardhat. Hardhat's extensive plugin system helped in optimizing the gas fees, testing the contracts rigorously, and deploying them to the Ethereum mainnet seamlessly. Hardhat also allowed for continuous testing during development, ensuring our contract interactions were smooth and bug-free.

Randomization and Trait Generation: Custom Trait Algorithm: One of the core challenges was generating unique, randomized PFPs while maintaining rarity. We wrote a custom algorithm that pulls from a predefined set of traits (e.g., background, accessories, colors) to ensure that each PFP is unique. The algorithm also factors in rarity scores, so some traits appear less frequently, creating more valuable NFTs.

The hacky part here is using a weighted random function that ensures certain rare traits are only assigned to a small subset of NFTs while keeping the generation process efficient.

Blockchain Integration: Ethers.js: For blockchain interaction, we used Ethers.js in the frontend. Ethers.js allows users to easily connect their wallets (like MetaMask) to the dApp, sign transactions, and mint their NFTs directly from the browser. It simplifies communication with the Ethereum blockchain, enabling smooth integration between the user interface and the smart contracts. Key Integrations and Partner Technologies: OpenZeppelin Libraries: We integrated OpenZeppelin libraries for security and to implement standardized contracts. Using OpenZeppelin’s pre-built contracts ensured that our ERC-721 tokens were secure and followed best practices, which saved time and reduced the risk of vulnerabilities.

Alchemy: We leveraged Alchemy for Ethereum API access. Alchemy’s infrastructure provided us with reliable and scalable access to Ethereum, helping us manage transactions and monitor the status of smart contract deployments efficiently. It also assisted in debugging transactions and reducing deployment friction, which was critical in a fast-paced hackathon environment.

Hacky and Notable Elements: Gas Optimization Techniques: Given Ethereum’s notorious gas fees, we used Hardhat Gas Reporter and optimized the smart contracts by reducing unnecessary state changes and keeping metadata storage off-chain using IPFS. These optimizations helped lower the gas fees for users during the minting process, which is crucial in a project focused on user engagement.

Conclusion: Building Generative PFP for the EthOnline 2024 Hackathon was a deeply rewarding experience. By combining React, Solidity, IPFS, and other blockchain tools, we created a fully decentralized, user-friendly, and customizable NFT platform. The integration of hacky elements like pre-mint trait preview and optimization for gas fees demonstrates the innovative approach we took to enhance user experience in the growing NFT space.

background image mobile

Join the mailing list

Get the latest news and updates