A full-stack, production-ready tokenized invoice financing platform built on Cardano, enabling businesses to tokenize invoices, raise liquidity from investors, and enforce repayments transparently β with on-chain logic, verified users, KYC, wallet binding, admin review, and transaction history.
- Overview
- Key Features
- System Architecture
- Tech Stack
- Smart Contract Design
- Off-Chain & Frontend
- Backend & Authentication
- KYC & Compliance Flow
- Wallet Binding & Access Control
- Transaction History
- Admin Portal
- Security Considerations
- Local Development Setup
- Environment Configuration
- Database Schema (High Level)
- Usage Flow
- Limitations & Future Improvements
- License
Invoice Finance allows verified businesses to:
- tokenize invoices on Cardano,
- receive funding from investors,
- repay principal + profit on-chain,
- and maintain real-world accountability via KYC and wallet binding.
Unlike simple DeFi demos, this platform integrates:
- real user identity verification
- admin oversight
- transaction auditability
- wallet-to-account enforcement
- Invoice tokenization (NFT-based)
- Pool funding by investors
- Repayment with profit
- Claim creation, voting, and execution
- Email + password login
- Email verification (SMTP)
- KYC document upload
- Admin KYC approval
- Wallet binding to verified user account
- First wallet auto-bind
- Subsequent wallet access blocked
- UI warnings for incorrect wallets
- dApp-level transaction history
- Wallet-based transaction lookup
- Admin wallet β user β KYC mapping
- Admin authentication
- KYC review & approval
- Secure document viewer
- Wallet lookup & defaulter tracing
ββββββββββββββ ββββββββββββββββββ
β Frontend ββββββΊβ PHP Backend β
β (HTML/JS) β β (Auth, KYC) β
βββββββ¬βββββββ βββββββββ¬βββββββββ
β β
βΌ βΌ
ββββββββββββββ ββββββββββββββββββ
β Lucid JS β β MySQL DB β
β (Offchain) β β (Users, KYC) β
βββββββ¬βββββββ βββββββββ¬βββββββββ
β β
βΌ βΌ
ββββββββββββββββββββββββββββββββββββ
β Cardano Blockchain β
β (Plutus Smart Contracts) β
ββββββββββββββββββββββββββββββββββββ
- Haskell
- Plutus V2
- Lucid
- Blockfrost API
- HTML
- CSS
- Vanilla JavaScript
- PHP
- MySQL
- PHPMailer (SMTP)
- XAMPP / PHP built-in server
- phpMyAdmin
-
Invoice validator enforces:
- funding rules
- repayment conditions
- investor payouts
- invoice state transitions
-
NFTs represent unique invoices
-
Datum tracks:
- issuer
- investors
- repayment terms
- repayment status
All enforcement is on-chain, not trust-based.
- Wallet connection via Lucid
- Invoice creation & funding UI
- Claim voting & execution
- Modal-based UX feedback
- Wallet access enforcement
- Secure session-based auth
- Password hashing (
password_hash) - CSRF protection
- Email verification via SMTP
- User β wallet mapping
-
User registers (email + password)
-
Email verification required
-
User submits:
- full name
- phone number
- country
- business name (optional)
- ID document
-
Admin reviews submission
-
Status set to:
approvedrejectedpending
Only approved users access the dApp.
-
First wallet used β automatically bound
-
Wallet address hashed and stored
-
Subsequent wallet connections:
- blocked
- user warned via modal
-
Prevents:
- identity hopping
- wallet switching to evade obligations
-
All dApp-initiated transactions are logged
-
Includes:
- funding
- repayments
- claims
- executions
-
Searchable by wallet address
-
Admin-only correlation to:
- user account
- KYC details
This enables defaulter tracking without violating blockchain privacy.
Accessible at:
/admin/login.php
- Review KYC submissions
- View uploaded documents securely
- Approve / reject users
- Lookup wallet addresses
- Trace wallet β user β contact details
Admin actions are fully separated from user accounts.
- No wallet = no access
- No KYC = no access
- Wallet binding enforced
- CSRF protection
- Prepared SQL statements
- Secure document serving
- No private keys ever stored
-
Clone repo
-
Start MySQL and Apache
-
Configure database
-
Update
config.php -
Run via:
http://localhost/Invoice-Finance
Key values in config.php:
DB_HOST
DB_NAME
DB_USER
DB_PASS
APP_URL
MAIL_HOST
MAIL_PORT
MAIL_USERNAME
MAIL_PASSWORD
MAIL_FROM_EMAILusersadminskyc_submissionsuser_walletsinvoice_transactionsemail_verifications
- User registers
- Verifies email
- Completes KYC
- Admin approves
- User connects wallet
- Wallet bound
- Invoice financing enabled
- Transactions logged
- Admin oversight active
- Chain-wide transaction indexing (optional)
- Cron-based tx confirmation checks
- Risk scoring & default flags
- Multi-wallet support (optional)
- Custom domain email sender
- UI dashboard analytics
MIT License Free to use, modify, and extend.