Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proof of Subscription (PoSub) 🎥 🔗

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.

🏗️ Architecture

This project is built using a hybrid on-chain/off-chain architecture:

  1. 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).
  2. 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-Img and Poscr-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.

⚙️ Prerequisites

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"

🚀 Usage

  1. Place your target image in the src/img/ directory.
  2. Update the IMAGE_PATH and TEST_YOUTUBE_ID in oracle.py as needed.
  3. Execute the oracle script:
python oracle.py

Pipeline Execution Flow:

  • The image is uploaded to the Pinata Poscr-Img group.
  • JSON metadata is generated, saved locally to out/metadata/, and uploaded to the Pinata Poscr-Metadata group.
  • 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.

🗺️ Roadmap (Next Steps)

  • 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)

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages