Inspiration
Borrowing against real estate in traditional finance requires handing over sensitive personal records, financial history, and home appraisals to central intermediaries. Bringing real estate on-chain usually worsens this privacy problem by publishing physical home addresses and property specs directly to public ledgers.
We built VeilCred to solve this: allowing homeowners to prove their property equity satisfies loan collateral requirements without ever revealing where they live, what their home looks like, or its exact market valuation.
What It Does
VeilCred enables borrowers to assess their home equity locally in their browser and generate a zero-knowledge proof of collateral eligibility:
- Local Intake: The user enters property details into a client-side interface with zero server logging or telemetry.
- Client-Side AI Inference: An automated real estate valuation model runs locally inside the browser.
- Zero-Knowledge Proof Generation: A background Web Worker uses EZKL to synthesize a SNARK proof confirming: > Appraised Value >= Loan Threshold
- Private Settlement on Midnight: The proof is submitted to Midnight Compact smart contracts, which enforce loan-to-value (LTV) limits (<= 75%) and lock the collateral record without learning raw property attributes.
How We Built It
We structured VeilCred across four core layers:
- AI Valuation Engine (
ai-engine/): Built and trained a ZK-friendly neural network in PyTorch using linear layers and ReLU activations, exported it to ONNX, and calibrated INT8 fixed-point scaling. - ZKML Circuit Pipeline (
zk-circuits/): Compiled the ONNX graph into arithmetic circuits using EZKL (k = 15 log-rows), generating the proving and verification keys with Halo2/KZG on the BN254 curve. - Midnight Compact Contracts (
contracts/): Developed zero-knowledge smart contracts (AppraisalVerifier.compact,LoanCollateralPool.compact, andNullifierRegistry.compact) with domain-separated Poseidon nullifiers to prevent replay attacks and double-borrowing. - Client Frontend & Web Worker (
frontend/): Created a React/TypeScript interface that offloads proof generation to a dedicated Web Worker, streaming cryptographic keys via IndexedDB caching and connecting to the Midnight Lace wallet.
Challenges We Ran Into
- Quantization Accuracy: Converting floating-point AI models to fixed-point integers often hurts accuracy. We calibrated scaling factors across 15,000 validation vectors to achieve a Mean Absolute Percentage Error (MAPE) of 0.125%, well below our 0.5% ceiling.
- Browser Memory Limits: Prover parameters can cause browser out-of-memory errors. Optimizing circuit size (k = 15) kept peak memory usage to 257 MB with an average proof latency of 0.143 seconds.
- Replay Protection: We implemented domain-separated Poseidon nullifiers to prevent borrowers from using a single valid valuation proof across multiple lending pools.
Accomplishments That We're Proud Of
- Sub-second (0.143 seconds) client-side ZKML proof generation running entirely inside a browser Web Worker.
- 100% test coverage across 17 cryptographic security and fidelity test suites.
- Precision-safe on-chain arithmetic that avoids integer truncation errors during collateral validation.
- A standalone auditor CLI tool (
verify_standalone.py) for independent proof verification.
What We Learned
- Designing lightweight neural networks optimized for zero-knowledge arithmetic circuits.
- Managing private state, nullifiers, and public commitments in Midnight Compact.
- Managing multi-threaded WebAssembly memory streaming in modern web browsers.
What's Next for VeilCred
- Deploying contracts to the live Midnight Testnet and partnering with pilot DeFi lending pools.
- Integrating zTLS / TLSNotary to verify property records directly from government portals without revealing borrower identity.
- Expanding the AI valuation model to support commercial real estate and dynamic risk tiers.
Built With
- Python & PyTorch (Valuation Modeling)
- ONNX (Model Serialization & Calibration)
- EZKL & Halo2 / KZG (ZKML Proving Engine)
- Midnight Compact (Privacy Smart Contracts)
- React & TypeScript (Frontend Interface)
- WebAssembly (Wasm) & Web Workers (Client-Side Proving)
- TailwindCSS & Vite (UI & Bundling)
- PyTest & Vitest (Automated Testing)
Built With
- ezkl
- halo2
- midnight-compact
- midnight-network
- midnight.js
- next.js
- onnx
- onnx-runtime
- python
- pytorch
- tailwind.css
- typescript
- vite
- wasm
- zero-knowledge-proof


Log in or sign up for Devpost to join the conversation.