Skip to content

sodium16/hackalgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Algo-Mint: Creator Revenue Tokenization on Algorand

Fractional ownership of creator future earnings. Trustless. On-chain. Fair.

🎯 The Problem

The Creator Economy Has a Liquidity Crisis:

  • Content creators generate $200B+ annually but lack upfront capital access
  • Current options: predatory creator loans (15-25% APR), exploitative label deals (20-50% cuts), or nothing
  • Payments lag 30-90 days; creators need liquidity now
  • Intermediaries extract 30-70% of creator value

Why This Matters: A musician with $100k in annual streaming revenue can't access $50k upfront without giving away 30-50% of their income permanently.


✨ The Solution: Algo-Mint

Algo-Mint tokenizes creator future earnings into fractional NFTs on Algorand.

Creators mint NFTs representing a percentage of their income stream. Investors buy these NFTs and receive automatic quarterly payoutsβ€”all enforced trustlessly by smart contracts.

How It Works in 60 Seconds

1. CREATOR MINTS
   └─ "I'll offer 5% of my income for 3 years"
   └─ Creates 10 NFTs, sells at 1 ALGO each
   └─ Raises 10 ALGO ($5 USD) instantly

2. INVESTORS BUY
   └─ Buy FENFTs (Future Earning NFTs) from gallery
   └─ Each NFT = fractional ownership stake
   └─ Ownership recorded on-chain

3. CREATOR REPORTS INCOME (Quarterly)
   └─ "I made $10,000 this quarter"
   └─ Smart contract calculates payout: 10,000 Γ— 5% = $500
   └─ Distributed: $500 Γ· 10 NFTs = $50 per NFT

4. INVESTORS CLAIM
   └─ One-click payout claim
   └─ Automatic settlement (no intermediary)
   └─ Zero hidden fees

5. (OPTIONAL) TRADE
   └─ Sell your FENFT on secondary market
   └─ Creator earns 10% royalty (incentivizes promotion)
   └─ New buyer starts accumulating payouts

πŸ—οΈ Architecture

Smart Contract

File: projects/hackalgo-contracts/smart_contracts/algomint/contract.py
Language: Algorand Python (PuyaPy)

Core Methods:

mint_future_nft(
  totalNfts: uint64,          # 10, 100, 1000 NFTs?
  totalPctBps: uint64,        # 5% = 500 BPS
  durationYears: uint64,      # 1, 3, 10 years?
  startQuarter: uint64,       # Q1, Q2, Q3, Q4?
  salePrice: uint64,          # 1 ALGO = 1_000_000 microAlgo
  mbrPayment: PaymentTxn       # Fund box storage
)
β†’ Creates N ARC-19 compliant NFTs with immutable terms

buy_nft(asset_id, opt_in_txn, payment_txn)
β†’ Investor opts into + purchases FENFT

report_income(quarter, amount_micro_algo, funding_txn)
β†’ Creator reports quarterly income, funds payout distribution

claim_payout(asset_id)
β†’ NFT holder claims accumulated quarterly payouts

get_pending_payout(asset_id, holder_address)
β†’ View available payout amount

get_terms()
β†’ Read contract config (creator, nft_count, %, duration, etc.)

Storage:

  • Global State (11 keys): Creator, NFT count, terms, initialization flag
  • Box Storage: Minted assets registry + per-NFT claim checkpoints

Frontend

Location: projects/hackalgo-frontend/
Stack: React 18 + TypeScript + Tailwind + daisyUI

Pages:

Page Purpose
Creator Mint NFTs, report quarterly income, trigger distributions
Gallery Browse all FENFTs, buy, view pending payouts, claim earnings
Portfolio Revenue analytics, historical performance, active offers
Trade P2P secondary market with automatic royalty routing

Key Hooks:

const {
  mint_future_nft,      // Creator initiates tokenization
  buy_nft,              // Investor purchases FENFT
  report_income,        // Creator reports quarterly income
  claim_payout,         // Claim accumulated earnings
  get_pending_payout,   // Check claimable amount
  listNfts              // Gallery listing
} = useAlgoMint()

πŸš€ Quick Start

Prerequisites

  • Node.js 16+
  • AlgoKit CLI
  • Algorand localnet (or testnet/mainnet)

1. Clone & Setup

git clone <your-repo-url>
cd hackalgo
algokit project bootstrap all

2. Start Localnet

algokit localnet start

(Auto-funds all test accounts with 1000 ALGO)

3. Deploy Smart Contract

cd projects/hackalgo-contracts
algokit project run build
algokit project deploy localnet

4. Start Frontend

cd ../hackalgo-frontend
npm run dev

Visit http://localhost:5173 πŸŽ‰


πŸ“Š Demo Walkthrough

Step 1: Creator Mints NFTs

  1. Go to Creator tab
  2. Connect wallet (use localnet/testnet account)
  3. Fill in:
    • Total NFTs: 10
    • Ownership %: 5% (for 3 years)
    • Sale price: 1 ALGO per NFT
  4. Click "Mint Future NFTs"
  5. Sign transaction
  6. βœ… 10 ARC-19 NFTs created + stored in contract boxes

Step 2: Investor Purchases

  1. Switch wallet (or use different account) β†’ Gallery tab
  2. See "10 FENFTs Available for Sale"
  3. Click "Buy" on asset #1001
  4. Sign:
    • Opt-in transaction (join NFT)
    • Payment transaction (1 ALGO β†’ creator)
  5. βœ… NFT transferred to your wallet

Step 3: Creator Reports Income

  1. Switch back to creator wallet β†’ Creator tab
  2. Fill in:
    • Quarter: Q1 2026
    • Income: $10,000 (in USD or ALGO equivalent)
  3. Enter payout amount: $500 (5% of $10,000)
  4. Click "Report Income β†’ Distribute"
  5. Sign transaction (funds payout pool)
  6. βœ… Payout per NFT = $500 Γ· 10 = $50 each

Step 4: Investor Claims Payout

  1. Switch investor wallet β†’ Gallery tab
  2. See "Pending: $50.00" for your NFT
  3. Click "Claim Payout"
  4. Sign transaction
  5. βœ… $50 (in microAlgos) sent to your wallet
  6. Payout checkpoint updated for next quarter

Step 5: View Analytics

  1. Go to Portfolio tab
  2. See:
    • Total platform revenue: $10,000
    • Average yield: 5% annually
    • Revenue distribution by quarter
    • Live activity feed (MINT β†’ BUY β†’ REPORT β†’ CLAIM)

πŸ” Security & Compliance

βœ… Smart Contract Security

  • Creator-only income reporting (signed transactions required)
  • Immutable supply cap (can't mint additional NFTs after initialization)
  • Time-bounded offerings (3-year default expiration)
  • Automatic payout enforcement (no manual withdrawal risk)
  • Box storage for scalability (supports 100+ NFT holders)

βœ… Standards Compliance

  • ARC-19: NFT metadata standard
  • ARC-4: Application Binary Interface
  • ARC-56: App specification format
  • AVM: Runs on Algorand Virtual Machine (auditable bytecode)

βœ… No Rug-Pull Risk

  • Smart contract is immutable once deployed
  • Creator cannot withdraw payout funds (locked for distribution)
  • All terms encoded in contract state
  • Verifiable on-chain history

πŸ“ˆ Use Cases

Musicians 🎡

  • Album revenue share: "5% of streaming income for 2 years"
  • Tour funding: "10% of ticket sales for 1 year"
  • Album pre-sales: Raise capital before release

Content Creators πŸŽ₯

  • YouTube revenue: "3% of ad revenue + sponsorships for 3 years"
  • Podcast sponsors: "50% of sponsor fees for 18 months"
  • Patreon funding: Guarantee monthly income

Visual Artists 🎨

  • NFT collection royalties: "7% of secondary sales for 5 years"
  • Licensing income: "2% of usage fees for 3 years"
  • Commission revenue: "10% of future commissions"

Athletes πŸ†

  • Endorsement deals: "4% of sponsorship income for 4 years"
  • Merchandise: "6% of merch sales royalties for 5 years"
  • Image rights: Monetize likeness usage

🎯 Key Features

Feature Benefit
Fractionalization 1 creator β†’ 10-1000 investor owners
Automation Quarterly payouts happen automatically
Transparency All transactions on-chain, fully auditable
Flexibility Creators set %, duration, price
Secondary Market Early investors can trade positions
Creator Royalties 10% fee on secondary trades
Zero Intermediaries Smart contracts enforce rules
Real-Time Settlement Payouts processed instantly (no lag)

πŸ§ͺ Testing Checklist

  • Mint NFTs (contract state updated)
  • Buy NFTs (opt-in + payment flow)
  • Report income (global state updated)
  • Claim payouts (individual payout claims work)
  • View pending payouts (accurate calculation)
  • Secondary market trading (works locally)
  • Portfolio analytics (revenue visualization)
  • Wallet switching (multi-account testing)
  • Box storage (handles 100+ NFTs)
  • Testnet deployment (no errors)

🚨 Known Limitations & Future Work

Current Hackathon Version

  • Secondary market is demo/mock (uses local state, not real trading)
  • Income reporting assumes creator honesty (no oracle integration)
  • USD pricing is manual conversion (no price feed)
  • No KYC/AML verification
  • Single contract per creator (not pooled)

Post-Hackathon Roadmap

  • Chainlink/Pyth oracle integration for real income verification
  • Decentralized disputes (DAO voting on income claims)
  • Mobile app (React Native)
  • Mainnet launch with liquidity incentives
  • Creator verification badges
  • Multi-signature governance for contract upgrades
  • Zero-knowledge proofs for private income reporting

πŸ“ Project Structure

hackalgo/
β”œβ”€β”€ projects/
β”‚   β”œβ”€β”€ hackalgo-contracts/
β”‚   β”‚   β”œβ”€β”€ smart_contracts/algomint/
β”‚   β”‚   β”‚   β”œβ”€β”€ contract.py          # Main smart contract
β”‚   β”‚   β”‚   β”œβ”€β”€ contract.json        # ARC-56 spec
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ tests/
β”‚   β”‚   β”œβ”€β”€ algokit.toml
β”‚   β”‚   └── pyproject.toml
β”‚   β”‚
β”‚   └── hackalgo-frontend/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ hooks/useAlgoMint.ts  # Contract interaction hook
β”‚       β”‚   β”œβ”€β”€ pages/
β”‚       β”‚   β”‚   β”œβ”€β”€ CreatorPage.tsx
β”‚       β”‚   β”‚   β”œβ”€β”€ GalleryPage.tsx
β”‚       β”‚   β”‚   β”œβ”€β”€ PortfolioPage.tsx
β”‚       β”‚   β”‚   └── TradePage.tsx
β”‚       β”‚   β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ App.tsx
β”‚       β”‚   └── main.tsx
β”‚       β”œβ”€β”€ index.html
β”‚       β”œβ”€β”€ package.json
β”‚       β”œβ”€β”€ vite.config.ts
β”‚       └── tailwind.config.js
β”‚
β”œβ”€β”€ algokit.toml              # Root workspace config
└── README.md                 # This file

πŸ”— Deployment

Localnet (Development)

algokit project deploy localnet

Auto-detects contract, deploys to localnet, returns app ID.

Testnet (Public Testing)

export DEPLOYER_MNEMONIC="your 25-word testnet mnemonic"
algokit project deploy testnet

Requires testnet ALGO: https://bank.testnet.algorand.network/

Mainnet (Production)

export DEPLOYER_MNEMONIC="your 25-word mainnet mnemonic"
algokit project deploy mainnet

⚠️ Use with caution. Verify contract logic before deploying with real funds.


πŸ’¬ How to Interact

Via Frontend (Recommended for Hackathon)

  1. Open http://localhost:5173
  2. Connect Pera Wallet (or testnet/localnet wallet)
  3. Navigate: Creator β†’ Gallery β†’ Portfolio β†’ Trade
  4. Sign transactions as prompted

Via CLI (Advanced)

# Check contract state
algokit app state read --app-id <APP_ID>

# View box storage
algokit app box-read --app-id <APP_ID> --name "minted_assets"

# Call method directly (via algokit.toml)
algokit project run method -m mint_future_nft --args ...

πŸ“Š Example Metrics

After 1 Creator, 3 Investors, 2 Quarters:

Total NFTs Created:     10
Total Revenue:          $20,000 (reported across 2 quarters)
Total Payouts:          $1,000 (5% of $20,000)
Avg Yield per NFT:      5% annually
Platform Fee:           2% (on distributions)
Creator Royalties:      $0 (no secondary trades yet)
Active Investors:       3
Contract Balance:       ~2 ALGO (for MBR + future payouts)

πŸŽ“ Learning Outcomes

What We Built:

  • βœ… Production-grade Algorand smart contract (Python)
  • βœ… Full-stack dApp (React + TypeScript)
  • βœ… Wallet integration (TxnLab use-wallet)
  • βœ… Box storage for scalability
  • βœ… ARC-19 NFT compliance
  • βœ… Real-world problem solving

Skills Demonstrated:

  • Smart contract development
  • Blockchain design patterns
  • Full-stack Web3 development
  • Algorand ecosystem expertise
  • UI/UX for financial dApps
  • DevOps & deployment

🀝 Contributing

Hackathon contributions welcome!

Areas for Enhancement:

  1. Secondary Market: Implement AMM or order book
  2. Analytics: Add Dune Dashboard integration
  3. Mobile: React Native wrapper
  4. Testing: Additional edge cases & stress tests
  5. Docs: API documentation, architecture diagrams

πŸ“ž Support

Questions?

  • Check /docs for architecture diagrams
  • Review contract comments in contract.py
  • Test locally first before testnet

Bugs?

  • Create an issue with:
    • Steps to reproduce
    • Expected vs. actual behavior
    • Transaction ID (if applicable)

πŸ† Hackathon Info

  • Event: Hack Sprint
  • Track: Blockchain / Creator Economy
  • Network: Algorand (AVM)
  • Smart Contract: PuyaPy
  • Frontend: React 18 + TypeScript
  • Duration: 24 hours

πŸŽ‰ What Makes This Special

  1. Novel Use Case: First trustless creator revenue tokenization on Algorand
  2. End-to-End: Smart contract + frontend + production-ready
  3. Real-World: Solves actual problem for creators
  4. Scalable: Box storage + fractional ownership design
  5. Auditable: All terms on-chain, fully transparent

Live Testnet: https://algo-mint.vercel.app/ GitHub: https://github.com/sodium16/hackalgo Demo Video: https://drive.google.com/file/d/1jz9DNhD8g6X_GznQeJNH-cWKbkjyyCJi/view?usp=drive_link


Built with ❀️ on Algorand | Trustless Creator Finance

About

Turn creator future earnings into tradable NFTs on Algorand

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors