A decentralized application (DApp) that bridges Web2 community engagement with Web3 ownership. This project automates the minting of "Proof of Subscription" ERC721 NFTs for YouTube channel members, securely vaulting them on-chain until the user links their Web3 wallet.
This project is built using a hybrid on-chain/off-chain architecture:
- The Smart Contract (Solidity): An ERC721 contract deployed on the Sepolia Testnet. It implements a secure "Vault" pattern. NFTs are initially minted to the contract itself (
mintToVault) and mapped to a user's Web2 identity (YouTube ID). Once authenticated, users can claim their vaulted assets directly to their wallets (claimForSubscriber). - The Off-Chain Oracle (Python): A robust backend script (
oracle.py) that acts as a trusted minter. It handles:- Decentralized storage integration via Pinata API.
- Automated routing of assets into specific IPFS Groups (
Poscr-ImgandPoscr-Metadata). - Timestamp-based data structuring for local metadata backups and IPFS file naming.
- Automated transaction construction, signing, and broadcasting to the Sepolia network using
web3.py.
To run the backend oracle, you will need Python 3 installed along with the following libraries:
pip install web3 python-dotenv requests
You will also need to create a .env file in the root directory (ensure this is added to your .gitignore!):
SEPOLIA_RPC_URL="your_rpc_provider_url"
CONTRACT_ADDRESS="your_deployed_sepolia_contract"
PRIVATE_KEY="your_wallet_private_key"
PINATA_API_KEY="your_pinata_key"
PINATA_API_SECRET="your_pinata_secret"
- Place your target image in the
src/img/directory. - Update the
IMAGE_PATHandTEST_YOUTUBE_IDinoracle.pyas needed. - Execute the oracle script:
python oracle.py
Pipeline Execution Flow:
- The image is uploaded to the Pinata
Poscr-Imggroup. - JSON metadata is generated, saved locally to
out/metadata/, and uploaded to the PinataPoscr-Metadatagroup. - Both files utilize a strict
[type]_[youtube-id]_[timestamp]naming convention. - A smart contract transaction is fired off to the Sepolia network, securely minting the NFT to the contract vault.
- Phase 1: Solidity Smart Contract Deployment (Sepolia)
- Phase 2: Python Off-Chain Oracle & IPFS Automation
- Phase 3: Next.js Frontend Dashboard (Wallet Connection & UI)
- Phase 4: Web2 Identity Verification (Google OAuth integration)