VeilCred enables homeowners to unlock decentralized finance (DeFi) liquidity against their real estate equity without exposing sensitive property data, street addresses, appraisal figures, or personal identities to public blockchains.
By combining local client-side AI valuations (ONNX), Zero-Knowledge Machine Learning proofs (Halo2 / EZKL), and Midnight Network confidential smart contracts (Compact), VeilCred allows borrowers to prove collateral eligibility (Appraised Value โฅ Loan Threshold) and qualify for up to 75% LTV credit tiersโcompletely in zero-knowledge.
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. Property Intake โ โโโโ> โ 2. Local AI & ZKML โ โโโโ> โ 3. Midnight Compact โ
โ Zero-telemetry specsโ โ In-browser Halo2 ZK โ โ Private state & loan โ
โ kept on your device โ โ KZG proof on BN254 โ โ outcome unlocked โ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
| Dimension | Traditional Home Equity Loans | VeilCred (ZK-Appraise) |
|---|---|---|
| Property Privacy | Street address, parcel deeds & photos made public | ๐ 100% Private โ raw specs never leave your browser |
| Financial Privacy | Full appraisal dollars and loan amounts exposed on-chain | ๐ Zero-Knowledge โ only eligibility tiers recorded |
| Identity Linkage | Wallet address directly bound to physical property title | ๐ Unlinkable Identity โ derived UserPublicKey + PIN |
| Attestation | Centralized, slow manual paper trail | โก Cryptographic โ Jubjub Schnorr attestations & Merkle proofs |
| Double-Spend Risk | Subject to manual title searches | โก Mathematical โ Poseidon nullifiers prevent re-pledging |
sequenceDiagram
autonumber
actor User as Homeowner (Client)
participant Model as Local ONNX Model
participant Prover as EZKL Prover (Wasm)
participant Oracle as Licensed Appraiser
participant Midnight as Midnight Compact Ledger
Note over User,Model: 1. Zero-Telemetry Valuation
User->>Model: Ingest Specs (Sqft, Age, Rooms, Location Score)
Model-->>User: Compute Estimated Valuation (y_val) locally
Note over User,Prover: 2. Client-Side ZK Proving
User->>Prover: Generate Halo2 / KZG SNARK Proof (ฯ)
Prover-->>User: Output Proof (ฯ) proving: Appraised Value โฅ Threshold
Note over User,Oracle: 3. Cryptographic Attestation
User->>Oracle: Submit Appraisal Hash + Derived Identity (userPk)
Oracle-->>User: Issue Jubjub Schnorr Signature (ฯ)
Note over User,Midnight: 4. Private Settlement & Verification
User->>Midnight: Submit requestAppraisalVerification(Threshold, PIN, Witness, ฯ)
Midnight->>Midnight: 1. In-circuit Schnorr & Merkle root verification
Midnight->>Midnight: 2. Enforce Poseidon nullifier (anti-double-pledge)
Midnight->>Midnight: 3. Grant collateral tier in private ledger state
Midnight-->>User: Collateral confirmed & loan entitlement issued
VeilCred dynamically classifies collateral into automated credit tiers based on verified property value:
| Tier Level | Valuation Floor | Max Eligible Loan | LTV Ceiling | Approval Mode |
|---|---|---|---|---|
| ๐ฅ Tier 1 (Platinum) | โฅ $1,000,000 | $750,000 | 75% | Instant Approval |
| ๐ฅ Tier 2 (Gold) | โฅ $750,000 | $525,000 | 70% | Instant Approval |
| ๐ฅ Tier 3 (Silver) | โฅ $500,000 | $325,000 | 65% | Standard Protocol Review |
| ๐๏ธ Tier 4 (Bronze) | โฅ $300,000 | $180,000 | 60% | Standard Protocol Review |
The VeilCred DApp is designed for maximum speed, privacy, and visual excellence:
- ๐ก๏ธ Zero-Telemetry Property Intake: Enter living area, structural age, bedroom/bathroom counts, and socioeconomic indices without transmitting data to any backend server.
- ๐งฎ Real-Time Loan Calculator: Interactive sliders compute real-time LTV ratios, maximum borrowing capacity, and monthly payment estimates.
- โก Multi-Engine Prover Architecture:
- In-Browser Web Worker (Wasm): Generates Halo2/KZG SNARK proofs client-side without UI freezing.
- Local Native Daemon: High-speed desktop proof acceleration adapter.
- Dev Simulator: Instant cryptographic simulation mode for rapid offline testing.
- ๐ผ Midnight Lace Wallet Integration: Seamless one-click wallet connectivity for confidential contract execution.
- ๐ฎ Dark Glassmorphism Interface: Smooth gradient mesh background, responsive mobile layouts, and animated state progression badges.
| Data Element | Type | Storage / Processing | Public Visibility |
|---|---|---|---|
| Property Specs & Address | Private Input | Client Browser Only | โ Zero-Knowledge (Never leaves device) |
| Exact Valuation Figure | Private Witness | Client & Appraiser Secret | โ Hidden in SNARK Proof |
| Applicant Secret Key & PIN | Secret Witness | Client Wallet Session | โ Never Broadcast |
| Appraiser Jubjub Signature | Schnorr Signature | Private Witness Input | โ Verified In-Circuit |
| Appraisal Commitment | Hash Commitment | Merkle Tree (MerkleTree<16, Bytes<32>>) |
โ Hash Only (Unlinkable) |
| Appraisal Nullifier | Spend Nullifier | Nullifier Set (Set<Bytes<32>>) |
โ One-Time Spend Marker |
| Derived User Public Key | Domain Identifier | Ledger Map Index | โ Unlinkable to Primary Wallet |
| Loan Status & Tier | Outcome Struct | Public Ledger State | โ Authorized Tier & Status |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FRONTEND & CLIENT โ
โ React 18 โข TypeScript โข Vite โข TailwindCSS โข WebAssembly Workers โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ZKML PROVING ENGINE โ
โ EZKL โข Halo2 (KZG Commitments) โข BN254 Curve โข INT8 Quantization โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI VALUATION ENGINE โ
โ PyTorch 2.x โข ONNX Runtime โข California Housing Feature Model โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MIDNIGHT NETWORK LEDGER โ
โ Compact 0.26 โข Jubjub Curves โข Poseidon Sponges โข Midnight.js โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Node.js:
v18.0.0or higher - Python:
3.10or3.11
git clone https://github.com/vishaltn74-dev/zk-appraise.git
cd zk-appraise
# Install root dependencies
npm installcd frontend
npm install
npm run devOpen http://localhost:5173 (or http://localhost:3000) in your browser to experience the VeilCred interface.
# From repository root
npm test# Setup Python environment
python -m venv .venv
# Activate: .venv\Scripts\Activate.ps1 (Windows) or source .venv/bin/activate (Linux/Mac)
pip install -r ai-engine/requirements.txt
pip install -e .
# Train model and export ONNX graph
python ai-engine/train_valuation_model.pyzk-appraise/
โโโ frontend/ # React 18 / Vite DApp & Web Worker Prover
โ โโโ src/
โ โ โโโ components/ # Hero, PropertyIntakeForm, LoanCalculator, SiteNav
โ โ โโโ hooks/ # useMidnightContract state machine hook
โ โ โโโ services/ # contractBridge, proofService, prover adapters
โ โ โโโ workers/ # prover.worker.ts (Wasm proof synthesis)
โ โโโ public/wasm/ # Bundled EZKL WebAssembly runtime
โ
โโโ contracts/ # Midnight Compact privacy smart contracts
โ โโโ appraiser_verifier.compact # Full appraisal attestation & loan state machine
โ โโโ src/
โ โ โโโ AppraisalVerifier.compact # Modular proof verification circuit
โ โ โโโ LoanCollateralPool.compact# Private borrower records & disbursement
โ โ โโโ NullifierRegistry.compact # Replay & double-pledge prevention
โ โโโ tests/
โ โโโ collateral_pool.test.ts # Vitest contract simulation suite
โ
โโโ zk-circuits/ # ZKML circuit definitions & compiled artifacts
โ โโโ src/
โ โ โโโ model_gen.py # PyTorch model topology & ONNX exporter
โ โ โโโ circuit_builder.py # EZKL settings calibration & Halo2 keygen
โ โ โโโ export_abi.py # Verification ABI & verification key exporter
โ โ โโโ verify_standalone.py # Standalone auditor CLI verifier
โ โโโ model.onnx # Serialized ONNX computational graph
โ โโโ CIRCUIT_MANIFEST.md # Production circuit manifest & frozen VK hash
โ
โโโ ai-engine/ # Python ML training & dataset loader
โ โโโ train_valuation_model.py # Deterministic model training & ONNX export
โ โโโ dataset_loader.py # Feature extractor & validation pipeline
โ โโโ model_config.py # Canonical model configuration
โ
โโโ docs-pitch/ # Architecture blueprints & execution plans
โโโ PLAN.md # Comprehensive engineering project plan
โโโ AGENTS.md # Multi-agent role specifications
This project is licensed under the MIT License โ see the LICENSE file for details.
Built with ๐ for the Midnight Network Ecosystem.