CredX is a next-generation decentralized micro-lending platform built on the Algorand Network. It bridges the gap between Web2 identity and Web3 finance, enabling under-collateralized and collateralized loans using Bitcoin (aBTC) as collateral.
A privacy-preserving "Proof of Personhood" system that verifies unique humanity without KYC.
- Multi-Signal Entropy: Generates a unique
uniquePersonIDby combining:- Biometric Liveness: Simulated face scan hash.
- Device Fingerprinting: Hardware and browser signatures.
- Behavioral Analysis: Mouse movement and interaction patterns.
- Sybil Resistance: Assigns a "Sybil Score" (1-5) to prevent bot attacks.
A Hybrid Compute model that assesses borrower risk off-chain and verifies it on-chain.
- Wallet Analysis: Scans transaction history, liquidation events, and asset holding duration.
- Score Generation: Calculates a credit score (300-850) that dynamically sets:
- Max LTV (Loan-to-Value): Higher scores get better leverage.
- Interest Rates: Lower risk = lower rates.
- Cryptographic Attestation: The API signs the score, and the
MicroLendersmart contract verifies the signature before approving loans.
An on-chain reputation system to deter default and malicious behavior.
- RedFlagNFT (Soulbound): A frozen ASA NFT automatically minted to a borrower's wallet if they default on a loan.
- Permanent Scar: Other protocols can query the
RedFlagNFTcontract to deny service to bad actors. - Duplicate Prevention: The DID registry blocks multiple wallets from registering with the same face/device hash.
Leveraging Algorand's pure proof-of-stake for trustless finance.
- ASAs (Algorand Standard Assets): Native on-chain assets for collateral (aBTC) and token management.
- AVM (Algorand Virtual Machine): Secure smart contract execution via PyTeal.
- Atomic Transfers: Trustless multi-party transactions in a single block for deposits and repayments.
- Algorand Indexer: Real-time transaction lookup for credit scoring and fraud detection.
- Frontend: Next.js (App Router), React, TypeScript.
- Smart Contracts: PyTeal (Python → TEAL bytecode on AVM).
- Web3 Integration: algosdk, PeraWallet Connect.
- Network: Algorand Testnet.
| Contract | Type | Description |
|---|---|---|
| MicroLender | Application (PyTeal) | Main lending logic, collateral management. |
| DIDRegistry | Application (PyTeal) | Stores unique identity hashes and scores. |
| RedFlagNFT | Application (PyTeal) | Soulbound freeze-locked ASA for defaulters. |
| PriceOracle | Application (PyTeal) | Price oracle feeds. |
| aBTC | ASA | Mock Bitcoin asset for testing. |
Note: App IDs and ASA IDs are generated during deployment. Run
contracts/algorand/deploy.pyto deploy and get IDs.
-
Clone the repository:
git clone <repo-url> cd credx
-
Install dependencies:
npm install
-
Deploy smart contracts (optional, requires Algorand Testnet account):
pip install py-algorand-sdk pyteal cd contracts/algorand export ALGORAND_MNEMONIC="your 25-word mnemonic" python deploy.py
-
Run the development server:
npm run dev
-
Open in browser: Navigate to https://cred-henna.vercel.app/.
- Connect Wallet: Use Pera Wallet connected to Algorand Testnet.
- Verify Identity: Go to "Borrow" → Complete the 5-step DID verification.
- Get Credit Score: Click "Analyze Score" to generate your AI risk profile.
- Borrow: Lock Mock aBTC and borrow ALGO.
- Repay: Repay the loan to unlock your collateral.