example-zk-loan-application
Installation
SKILL.md
Midnight Network ZK Loan Application
A privacy-preserving loan dApp where applicants prove eligibility inside a ZK circuit without revealing credit score, income, or tenure on-chain. A trusted attestation provider signs credit data off-chain; the contract verifies the Schnorr signature in-circuit and writes only the loan outcome (status + authorized amount) to the ledger.
What this skill produces:
contract/—schnorr.compact+zkloan-credit-scorer.compact, witnesses, compile scriptszkloan-credit-scorer-attestation-api/— REST server that Schnorr-signs credit profileszkloan-credit-scorer-cli/— deploy, register providers, request/respond to loans (headless wallet)app/loan/(optional) — Next.js + 1AM wallet UI (copy patterns fromtemplates/leaderboard-dapp/)lib/zkloan.ts— deploy,requestLoan,respondToLoan, admin calls, ledger decodelib/midnight.ts— wallet session + patched indexer provider (copy fromreferences/midnight-session.md)public/zk/zkloan/— ZK proving assets synced from contract build
Shared references (canonical provider + troubleshooting — do not duplicate in prompts):
references/midnight-session.md—createConnectedSession, indexer patch, deploy/call helpersreferences/gotchas.md— preprod deploy hangs, GraphQLoffset: null, ZK asset pathsreferences/versions.json— pinned@midnight-ntwrk/*versions