All projects

PrivaCRE

Privacy-preserving credit scoring for DeFi using Chainlink CRE, World ID, and AI-powered analysis.

Privacy CRE & AI World Tenderly

What it is

What is PrivaCRE?

PrivaCRE (Privacy-Preserving Credit Scoring) is a revolutionary DeFi protocol that brings real-world credit scoring to blockchain lending while maintaining complete user privacy. It solves the fundamental problem of over-collateralization in DeFi by enabling under-collateralized loans based on verifiable creditworthiness.

How Does It Work?

PrivaCRE uses a three-layer architecture:

Layer 1: Identity & Data Access

  • Users verify their identity using World ID (Worldcoin) to ensure sybil resistance - one human, one credit score
  • Bank account data is securely accessed through Plaid API integration
  • Wallet connection via RainbowKit/Wagmi for on-chain identity

Layer 2: Secure Computation (Chainlink CRE)

  • User's financial data is fetched from Plaid within Chainlink's Compute Runtime Environment (CRE)
  • All personally identifiable information (PII) is stripped out using zero-knowledge techniques
  • Groq AI analyzes anonymized transaction patterns, payment history, and cash flow
  • A privacy-preserving credit score (0-100) is generated without exposing raw data
  • The score is stored on-chain via smart contract interaction

Layer 3: DeFi Integration

  • Credit scores unlock tiered lending rates with dynamic collateral requirements
  • High scores (90+) enable loans with as low as 105% collateral (vs 150% standard DeFi)
  • Scores are portable across chains using Chainlink CCIP
  • Smart contracts on Ethereum/Tenderly manage vault operations and liquidations

What Problem Does It Solve?

Problem 1: Over-Collateralization in DeFi
Current DeFi lending requires 150%+ collateral to borrow, making it inaccessible to most people. PrivaCRE enables under-collateralized lending (105-125%) based on proven creditworthiness.

Problem 2: Privacy in Credit Scoring
Traditional credit bureaus expose sensitive financial data to multiple parties, creating privacy risks. PrivaCRE processes all data within Chainlink's secure enclave, ensuring zero data exposure.

Problem 3: Sybil Attacks
Without identity verification, users could create multiple credit scores to game the system. World ID integration ensures one human = one score.

Problem 4: DeFi Accessibility
DeFi is currently only accessible to crypto-wealthy users who can afford over-collateralization. PrivaCRE opens DeFi lending to billions of people with good credit but limited crypto holdings.

How it Works

Technology Stack

Frontend:

  • Next.js 15.5.12 (React 19)
  • TypeScript for type safety
  • TailwindCSS + Framer Motion for UI/animations
  • RainbowKit + Wagmi for wallet connectivity
  • GSAP for advanced animations

Blockchain & Smart Contracts:

  • Solidity 0.8.x for smart contracts
  • Hardhat for development and testing
  • Ethers.js v6 for blockchain interactions
  • Tenderly Virtual TestNet for deployment
  • OpenZeppelin contracts for security standards

Chainlink Integration:

  • Chainlink CRE (Compute Runtime Environment) - Core secure computation layer
  • CRE CLI for workflow development and simulation
  • TypeScript-based CRE workflow (PrivaCRE/my-workflow/main.ts)
  • Secrets management via CRE secrets.yaml
  • On-chain result publishing via smart contracts

External APIs & Services:

  • Plaid API - Secure bank account connectivity and transaction data
  • Groq AI - Fast LLM inference for credit analysis (Llama 3.1 70B)
  • World ID (Worldcoin) - Sybil-resistant identity verification
  • Tenderly - Virtual TestNet and transaction monitoring

Privacy & Security:

  • Zero-knowledge data sanitization
  • PII removal before AI analysis
  • Secure enclave execution (CRE)
  • On-chain nullifier storage for sybil resistance

Architecture Flow

User → World ID Verification → Wallet Connection
  ↓
Dashboard → Start Credit Analysis
  ↓
Frontend API → Chainlink CRE Workflow Trigger
  ↓
CRE Workflow:
  1. Fetch bank data from Plaid API
  2. Sanitize data (remove PII)
  3. Analyze with Groq AI
  4. Generate credit score
  5. Store on-chain via smart contract
  ↓
User receives credit score → Unlocks lending tiers
  ↓
Lending Page → Deposit collateral → Receive loan

Smart Contracts

PrivaVault.sol - Main lending vault contract

  • Manages user deposits and loans
  • Stores credit scores on-chain
  • Implements tiered collateral ratios
  • Handles liquidations and interest

CrestVault.sol - Alternative vault implementation

  • Similar functionality with different parameters
  • Used for testing and comparison

CRE Workflow Implementation

Location: PrivaCRE/my-workflow/main.ts

Key Features:

  • Fetches real bank data via Plaid API
  • Sanitizes transaction data to remove PII
  • Calls Groq AI for credit analysis
  • Publishes results on-chain
  • Handles errors and retries
  • Logs all operations for debugging

Simulation: Successfully tested via CRE CLI

cd PrivaCRE/my-workflow
cre workflow simulate

Links

Created by

  • Arpit Singh