Link Credit is a hackathon project built for Chainlink CRE: Chainlink Hackathon
It introduces privacy-aware, identity-aware credit signals into DeFi lending, so users are not forced into purely one-size-fits-all collateral rules.
- Demo
- Problem
- Key Building Blocks
- End-to-End Flow
- Architecture
- Credit Scoring Logic
- Boost Composition
- Why CRE Matters Here
- Core Features
- Repository Map
- Run Guide
- Appendix
YouTube walkthrough: https://youtu.be/c6gPOyzxN7I
Most DeFi lending is over-collateralized by design. That protects protocols, but ignores two important facts:
- users have different real-world repayment behavior
- without Sybil resistance, one person can create many wallets and game credit logic
This project addresses both.
- Plaid: a financial data network used here (sandbox mode) to fetch user-permissioned account balances and transaction history.
- World ID: proof-of-personhood using zero-knowledge proofs; used here to enforce "one real person, one scoring identity" and reduce Sybil abuse.
- Chainlink CRE: workflow execution layer that orchestrates token exchange, data fetch, scoring, and on-chain writes.
- User connects wallet and completes Plaid Link authorization first.
- API creates Plaid link token and forwards workflow trigger payload.
- CRE workflow exchanges
public_token, fetches balances + transactions, computes score, and writesscoreBpson-chain. - User completes World ID verification.
- Lending layer reads both signals and applies the final boost.
Frontend (React)
- Wallet connect
- World ID verification
- Plaid Link auth
- Score + lending UI
|
v
API (Hono / Worker-compatible)
- Plaid link token creation
- Workflow trigger endpoints
- Encrypted token storage
|
v
Chainlink CRE Workflow
- Plaid token exchange
- Plaid balances/transactions fetch
- Rule score + AI calibration
- On-chain score write
|
v
Contracts (Credit Oracle + Aave-based lending integration)
- World ID-aware credit identity checks
- Score storage (`scoreBps`)
- Credit boost applied to lending parameters
Scoring is deterministic-first with bounded AI calibration:
S_rule = 0.30*S_buf + 0.25*S_net + 0.20*S_inc + 0.15*S_spend + 0.10*S_risk
S = clamp(S_rule + delta_ai, 0, 100), where delta_ai in [-10, 10]
S_buf: balance safety bufferS_net: net cashflow qualityS_inc: income stabilityS_spend: spending disciplineS_risk: risk event penalty (for example overdraft / NSF-like patterns)
Final on-chain value:
scoreBps = S * 100
Why AI adjustment is bounded:
- deterministic score remains the anchor for reproducibility
- AI handles edge cases without taking over the model
delta_airange is constrained to reduce drift and manipulation risk
- Plaid boost: derived from the credit score pipeline above (rule formula + bounded AI adjustment).
- World ID boost: fixed +10% if the user is verified.
- Final boost: additive.
finalBoost = plaidBoost + worldIdBoost
where:
worldIdBoost = 10%if verified, otherwise0%plaidBoostis computed fromscoreBps
The lending side applies protocol safety limits when needed.
CRE is the practical bridge between off-chain financial signals and on-chain risk logic:
- orchestrates multi-step external API workflow
- keeps scoring flow in one auditable execution pipeline
- writes final output back to contracts used by the lending path
This avoids building a heavy centralized backend for core scoring orchestration.
- World ID-based Sybil resistance gating
- Plaid sandbox integration for financial signals
- Hybrid rule + AI credit scoring
- On-chain score publication to oracle contract
- Credit-aware lending boost in an Aave-based flow
packages/frontend— dApp UIpackages/api— link-token + trigger APIpackages/workflow— CRE credit scoring workflowpackages/worldid-workflow— CRE workflow for World ID-related flowpackages/contracts— contracts and deployment artifacts
Setup and end-to-end execution steps are in: INTEGRATION.md
Chainlink CRE
Direct links to code using Chainlink CRE APIs:
- packages/workflow/src/main.ts#L1-L17 - Import CRE SDK:
HTTPCapability,CronCapability,consensusIdenticalAggregation,EVMClient, etc. - packages/workflow/src/main.ts#L224-L227 - Register HTTP and Cron triggers using
handler()from CRE SDK - packages/workflow/src/main.ts#L83-L97 - Plaid token exchange using
httpClient.sendRequest()withconsensusIdenticalAggregation() - packages/workflow/src/main.ts#L99-L108 - Plaid data fetch using
httpClient.sendRequest()with consensus - packages/workflow/src/main.ts#L115-L121 - OpenAI API call using
httpClient.sendRequest()with consensus - packages/workflow/src/main.ts#L240-L242 - Read secrets from Vault DON using
runtime.readSecret() - packages/workflow/src/main.ts#L450-L484 - Write credit score on-chain using
EVMClientandruntime.report() - packages/contracts/src/CreditOracle.sol#L37-L51 - Receive CRE reports via
onReport()callback (IReceiver interface) - packages/worldid-workflow/src/main.ts - Second CRE workflow for World ID verification
- packages/contracts/src/WorldIDRegistry.sol#L37-L51 - Receive World ID verification reports
- packages/workflow/workflow.yaml - CRE workflow configuration (triggers, artifacts)
- packages/workflow/config.staging.json - Chain selector and contract addresses
Chainlink Price Feeds
- packages/contracts/script/DeployCreditMarket.s.sol#L57-L67 - Configure Chainlink ETH/USD and BTC/USD price feeds for Aave Oracle
All contracts are deployed on Tenderly Virtual TestNet (Sepolia-based): https://dashboard.tenderly.co/explorer/vnet/edaa3140-d48d-4bf8-873f-b9472d772a85
Complete workflow execution guide with step-by-step instructions: INTEGRATION.md
- Isolated testing environment without affecting Sepolia mainnet state
- Instant transaction confirmation for faster development iterations
- State manipulation for testing edge cases (low balance, high debt scenarios)
- Detailed debugging with stack traces and state diffs
