Skip to content

Instantly share code, notes, and snippets.

@devlongs
Last active December 18, 2025 11:54
Show Gist options
  • Select an option

  • Save devlongs/c21f09fe01ade27cab785b451d1b23e5 to your computer and use it in GitHub Desktop.

Select an option

Save devlongs/c21f09fe01ade27cab785b451d1b23e5 to your computer and use it in GitHub Desktop.

ChainVoice: Invoice Financing Platform - MVP Spec

Problem & Solution

Problem: SMBs wait 30-90 days for invoice payments, creating cash flow gaps.

Solution: Upload invoice → AI scores credit → Oracle verifies → Get cash in minutes. Investors earn 10-15% APY from real business payments.

Market: $3+ trillion in unpaid invoices globally.


Core Features (MVP Only)

For Businesses

  1. Upload invoice (PDF)
  2. Get instant credit score
  3. Receive 90-95% of invoice value immediately
  4. Pay back when customer pays invoice

For Investors

  1. Deposit USDT/USDC into liquidity pool
  2. Earn 10-15% APY automatically
  3. Withdraw anytime (if liquidity available)

Technical Architecture

Business → Upload Invoice → AI Score → Oracle Verify → Mint NFT → Pool Funds Business
Customer Pays → Settlement Contract → Distribute to Investors + Fees

Smart Contracts (3 Core)

1. InvoiceNFT.sol

  • Mint invoice as ERC-721 NFT
  • Metadata: amount, debtor, due date, status
  • Status: PENDING → FUNDED → PAID

2. LiquidityPool.sol

  • Single pool (ERC-4626)
  • Deposit USDT/USDC
  • Auto-fund verified invoices
  • Distribute payments to LPs

3. PaymentSettlement.sol

  • Accept payments from debtors
  • Auto-distribute: 90% to investors, 10% fees
  • Handle partial payments

Off-Chain Services

AI Credit Scoring (Simple)

  • Rule-based model:
    • Business age > 6 months: +20 points
    • No defaults: +30 points
    • Invoice < $10k: +20 points
    • Payment term < 60 days: +20 points
  • Score > 70 = approved

Invoice Oracle (Basic)

  • Verify invoice is valid PDF
  • Check basic fields (amount, date, debtor)
  • Anti-duplicate check
  • Return: APPROVED/REJECTED

MVP Scope (What We Build)

Must Have

  • ✅ 3 smart contracts (InvoiceNFT, Pool, Settlement)
  • ✅ Business dashboard: upload invoice, get funded
  • ✅ Investor dashboard: deposit, view earnings
  • ✅ Simple AI credit scoring (rule-based)
  • ✅ Basic oracle verification
  • ✅ Payment flow (simulate customer payment)
  • ✅ Mantle testnet deployment

User Flow (Simplified)

Business:

  1. Connect wallet
  2. Upload invoice PDF
  3. Wait 30 seconds (AI + oracle check)
  4. Receive 95% of invoice value in USDT
  5. Repay when customer pays

Investor:

  1. Connect wallet
  2. Deposit USDT into pool
  3. Earn yield automatically
  4. Withdraw anytime

Example:

  • Invoice: $10,000, 30 days
  • Business receives: $9,500 (5% discount)
  • Investor earns: $500 / $9,500 × (365/30) = 64% APY
  • Protocol fee: 20% of profit = $100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment