Important
Network Notice: This application and its smart contracts are deployed on the Midnight PREPROD Network. Connect with the 1AM Wallet (mn_shield browser extension) set to the preprod network. Lace Wallet is not currently supported.
- Live Demo: https://private-infer.vercel.app/
- Product Pitch Deck: PrivateInfer Product Pitch
- Product X (Twitter): https://x.com/private_infer β (Profile is live with product bio and 3+ product demonstration posts)
- Demo Video: https://youtu.be/w2uHJ5s_E6I
| Document | Description |
|---|---|
| SETUP.md | Local development setup guide |
| USAGE.md | Application usage instructions |
| PROPOSAL.md | PrivateInfer architecture proposal |
| docs/ARCHITECTURE.md | Full system architecture β contracts, API, DB schema, ZK flows |
| LAUNCH_USERS.md | Verified launch & beta tester directory (70+ participants) |
| FEEDBACK.md | Beta tester raw feedback + implemented changes |
Industries dealing with sensitive data (Healthcare, Finance, Legal) cannot safely send it to public AI models. Doing so exposes confidential data, violates compliance laws (HIPAA), and destroys user trust.
PrivateInfer provides a trustless marketplace for secure, off-chain AI inference on the Midnight blockchain:
- Encrypted Inputs: The Query Maker submits sensitive, encrypted data β only a commitment hash ever touches the chain.
- Secure Processing: A decentralized AI Provider Node processes the data off-chain via Groq-powered inference inside a secure environment.
- Zero-Knowledge Proofs: The Provider submits a ZK-proof to the Midnight smart contract, mathematically guaranteeing the AI ran correctly β without revealing the data or result on the public ledger.
- Trustless Escrow: The smart contract automatically releases tDUST payment only after the proof is verified on-chain.
| Public State (On-Chain) | Private Witness (Off-Chain) | |
|---|---|---|
| Query | SHA-256 commitment hash only | Actual query text β never leaves client |
| Result | SHA-256 proof hash only | Decrypted AI response β stored in encrypted DB |
| Identity | Opaque public key bytes | Caller identity verified via ZK disclose() β not exposed |
| Escrow | tDUST balance visible | Transfer amount derived from on-chain state |
To get started quickly, follow these exact commands:
- Clone the repository:
git clone https://github.com/debansh001/PrivateInfer.git cd PrivateInfer - Install dependencies:
npm install
- Configure environment:
Create a
.env.localfile with yourDATABASE_URLand Midnight PREPROD variables (see SETUP.md). - Run database migrations:
npx prisma generate npx prisma db push
- Start the development server:
npm run dev
- Full Product Landing Page β Hero section, animated terminal widget, stats bar (70+ Beta Testers, 100% ZK Verified), How It Works (3-step flow), 6-card features grid, Provider CTA section, FAQ accordion, and a complete footer with nav links and copyright. Commit
94c8b69 - Admin Ops Dashboard β Replaced the single deploy button with a full 4-tab monitoring dashboard: Live Stats, Queries table (color-coded status badges), Providers table, and a Contract Deploy tab with Midnight SDK. Commit
94c8b69 - Real Wallet Connect Button β Header "Connect Wallet" now directly calls the wallet SDK (was previously just a navigation link). Shows connected address with live green pulse dot + disconnect button. Commit
54acd1b - Theme Toggle Fixed β Light/dark mode now works correctly. Split CSS into proper
:root(light) andhtml.dark(dark) blocks; fixed Tailwind v4@custom-variant darkselector fornext-themescompatibility. Commit94c8b69 - Logo Displayed β
public/logo.pngnow shown in both the header and footer (was previously a generic icon).
- Copy Button β Added one-click copy to the decrypted AI result output on
/query/[id]. Commit54acd1b - Processing Spinner β Query submission page now shows an animated spinner and "Please do not refresh" message during ZK proof generation. Commit
89416df - Explorer Warning Banner β The 1AM Explorer hint is now a prominent red
π¨ ATTENTIONbanner so users don't miss it. Commit89416df - Non-1AM Wallet Toast β When Lace Wallet or wrong network is detected, a toast notification now explains PREPROD-only support. Commit
54acd1b
| 1. Landing Page | 2. Creating a Secure Query |
|---|---|
![]() |
![]() |
| 3. Query Deployed Successfully | 4. AI Provider Dashboard |
|---|---|
![]() |
![]() |
| 5. Secure AI Result & Payment Release |
|---|
![]() |
Our Compact smart contract manages escrow lifecycle, enforces state transitions, and verifies ZK proofs for AI inference.
Deployed Contract Address (Midnight PREPROD):
c3e5cfedf63b54f2004755385a3ac638301c56d66b90002b883224c424222bae
| Circuit | Transaction |
|---|---|
| π’ Create Query | 516b7b87... |
| π‘ Submit Result & Proof | c7dfa24e... |
| π΅ Release Payment | 8ab94e92... |
For the full technical architecture, see docs/ARCHITECTURE.md.
graph TD
UI[Next.js Client UI] -->|Connects via| Wallet[1AM Wallet - mn_shield]
UI -->|Polls Metadata| DB[(Neon PostgreSQL)]
Wallet -->|Submits ZK Proofs| Midnight[Midnight PREPROD Network]
Midnight -->|Verifies Proofs| SC[Compact Smart Contract]
ProviderNode[AI Provider Node] -->|Reads Queue| Redis[(Upstash Redis)]
ProviderNode -->|Calls Groq API| Groq[Groq LLM]
ProviderNode -->|Stores Result| DB
ProviderNode -->|Submits ZKP| Midnight
sequenceDiagram
participant U as User (Query Maker)
participant SC as Midnight Smart Contract
participant P as AI Provider
U->>SC: 1. Deploy Query (Lock tDUST, Commit Hash)
SC-->>P: 2. Provider picks up job via Redis
P->>P: 3. Run AI Inference (Groq API)
P->>SC: 4. Submit ZK Proof & Result Hash
SC->>SC: 5. Verify Proof β RESULT_READY
U->>SC: 6. Verify Result & Release Payment
SC-->>P: 7. Transfer tDUST Escrow
PrivateInfer/
βββ contracts/ # Midnight Compact Smart Contracts
β βββ privateinfer.compact # Core ZK verification & escrow logic
β βββ managed/ # Compiled TS/WASM outputs
βββ docs/ # Documentation
β βββ ARCHITECTURE.md # Full system architecture
β βββ USERS.md # Verified beta testers directory (70 wallets)
βββ prisma/ # Database
β βββ schema.prisma # PostgreSQL models (Query, Provider, Result)
βββ scripts/
β βββ worker.ts # Off-chain AI inference worker (Groq)
βββ src/
β βββ app/
β β βββ page.tsx # Landing page (hero, FAQ, footer)
β β βββ admin/page.tsx # Admin ops dashboard (4 tabs)
β β βββ history/page.tsx # Query history for connected wallet β NEW
β β βββ query/new/ # Query submission UI
β β βββ query/[id]/ # Query status + ZK result UI
β β βββ provider/ # AI Provider dashboard
β β βββ api/ # REST API routes
β βββ components/
β β βββ Header.tsx # Sticky header with wallet connect + nav
β βββ contexts/
β β βββ WalletContext.tsx # Wallet state management
β βββ lib/ # Shared utilities (DB, Redis, crypto)
βββ public/
β βββ logo.png # PrivateInfer logo
β βββ zk/privateinfer/ # Compiled ZK proving/verifying keys
βββ FEEDBACK.md # Beta tester feedback + implemented changelog
βββ SETUP.md # Local development setup
βββ .github/workflows/ # CI/CD (Typecheck, Frontend, Contracts)
Jest unit tests cover core cryptographic logic β including the coinPublicKeyToBytes conversion that transforms 1AM Wallet public keys into Uint8Array buffers for use in ZK circuits.
npm install
npm test# TypeScript check
npm run typecheck
# Production build
npm run build70 verified beta testers participated across the Midnight PREPROD testing phase (September 12β22, 2026), recruited via Discord and Telegram. All testers used the 1AM Wallet on the Midnight PREPROD network. Each wallet address is verifiable on the 1AM Explorer.
| Resource | Description | Link |
|---|---|---|
| Feedback Form | Google Form used to collect structured tester feedback during the beta | forms.gle/nYS9vPbCfWTQgKk56 |
| Response Sheet | All 70 raw form responses with ratings, comments, timestamps, and wallet addresses | Google Sheets β |
| Verified Testers | Full directory of 70 testers β name, PREPROD wallet address, and 1AM Explorer verification link for each | LAUNCH_USERS.md |
| Feedback Changelog | Raw tester feedback with real wallet addresses + every implemented change linked to its git commit ID | FEEDBACK.md |
| Feedback | From | Commit |
|---|---|---|
| Added copy button to AI result output | Manash Koley | e3a4a9c |
| Processing spinner + "do not refresh" message | Rubina Mondal | e3a4a9c |
Explorer hint redesigned as red π¨ ATTENTION banner |
Faisal Islam | e3a4a9c |
| Light/dark theme toggle fully fixed | Habibullah Mir | 94c8b69 |
| Connect Wallet button actually connects (was just a link) | Multiple testers | 54acd1b |
| Lace Wallet error toast with PREPROD-only guidance | Priya Das | 54acd1b |
Query history page /history |
Fatima Khatun | 659cc93 |
During our Level 6 launch, we onboarded 20+ specialized users to test the platform on the Midnight PREPROD network.
Full directory of Level 6 Launch Users: LAUNCH_USERS.md (Includes 20+ verified Preprod wallet addresses and 1AM Explorer links)
| Feature | Status |
|---|---|
Query history page (/history) |
β Shipped |
| Auto-submit script for provider nodes | β³ Planned |
| AI model selection dropdown (Medical / Legal / General) | β³ Planned |
| Lace Wallet full support | β³ Planned |
| On-chain provider reputation / staking | π Research |
| Dynamic ZK-VM for full LLM execution trace | π Research |
| Multiparty Computation (MPC) inference | π Research |
A massive thank you to the Midnight Network team! The ability to seamlessly blend public state verification with private local execution using Compact is game-changing. This platform allowed us to build an enterprise-grade privacy product that would be completely impossible on traditional blockchains. Thank you for building the future of data protection! π








