โ ๏ธ Disclaimer: This project and all smart contracts are deployed and tested exclusively on the Midnight Network PREPROD environment. All blockchain references, explorer links, and transactions belong to the Preprod network.
- Live Preprod Demo: https://compactforge-midnight.vercel.app/ (Live CompactForge Application on Preprod)
- Product Pitch Deck : CompactForge Product Deck (Google Slide Link)
- Documentation: https://compactforge-midnight.vercel.app/docs (Complete documentation for the CompactForge project)
- Demo Video: Watch the CompactForge Demo on YouTube (Watch the full demo)
- X Profile Link: https://x.com/compactforgee (3+ posts in September on X)
- Setup Guide: SETUP.md (Step-by-step instructions for setting up the project)
- Usage Guide: USAGE.md (Instructions for using the project)
- Proposal: PROPOSAL.md (The original proposal document)
The Problem Building privacy-preserving smart contracts in Zero-Knowledge (ZK) is incredibly complex. For developers building on the Midnight Network using the Compact language, the friction doesn't stop at learning the language. Developers lack the fundamental Web2-style infrastructure they are used to:
- No automated CI/CD pipelines to compile and verify
.compactfiles on every commit. - No easy way to track Proving Times (benchmarks) across different commits to see if a code change made generating ZK proofs slower or faster.
- No unified dashboard to instantly deploy contracts and interact with them in the browser using the 1AM wallet.
The Solution: CompactForge CompactForge bridges the gap by giving every Midnight team a unified CI/CD and DevOps dashboard.
- Automated CI/CD: Our GitHub Actions automatically compile Compact circuits.
- Proof Benchmarking: CI runs time how long it takes to generate ZK proofs for each circuit and saves this directly to our Neon Postgres database.
- One-Click Deploy & Interact: Connect your 1AM wallet to seamlessly deploy contracts and call any circuit directly from the web dashboard.
Midnight brings privacy to smart contracts. To demonstrate this, CompactForge includes a fully featured token_ledger contract featuring 6 unique ZK circuits (mint, transfer, deposit, burn, pause, unpause).
- Public State (On-Chain): Data that is globally visible and verifiable by anyone. In our contract,
balances,totalSupply,ownerCount,admin, andpausedare public state variables. - Private Witness (Off-Chain): Secret data that never touches the blockchain. In our contract, the user's
localSecretKey()is a private witness. The ZK circuit proves that the caller holds the correct secret key to authorize a transfer or mint, without ever revealing the key itself on the public ledger.
The CompactForge landing page showcasing features and architecture.
The developer dashboard aggregating deployments, runs, and CI metrics.
Live GitHub Actions CI/CD history synced directly to the dashboard.
ZK Proof Generation benchmarking tracked across commits for performance optimization.
One-click smart contract deployment interface powered by the 1AM wallet.
Interactive terminal to generate ZK proofs and execute circuit methods on the Preprod network.
Comprehensive API reference and developer documentation built into the app.
The core of our testing and demonstration is the token_ledger.compact contract.
Midnight Midnight Preprod Network Deployments:
| Contract Name | Full Contract Address | Verify Link (Preprod) |
|---|---|---|
token_ledger.compact |
2eced748b5a7108afc0e47abd514547582e254560c75af4018c9aefc5c289da9 |
View on 1AM Explorer |
Sample Transactions (Midnight Preprod Network):
| Transaction Type | Full TxHash | Verify Link (Preprod) |
|---|---|---|
| Contract Deployment (Sept 2026 Update) | 7db1bc25cb1c2f998f02f95676b8d3c72fc031e1f761daf3f8170ff9345c3e38 |
View on 1AM Explorer |
| Initial Contract Deployment | 505092cdae10713eeb5a4f47af05da3414b92afa7a81a8c1b7153d47e68e090f |
View on 1AM Explorer |
| Sample ZK Deposit | a7eccdd4b6027d1a222ef43a40de1dce6cbf56ecadaa0d93093b7b9ffdc02406 |
View on 1AM Explorer |
The compiled ZK Proving and Verifying keys tracked securely.
Verified smart contract deployments on the Midnight Preprod Network.
Executing the deposit circuit to shield funds via Zero-Knowledge proofs.
graph TD
A[Developer] -->|git push| B(GitHub Repository)
B -->|Trigger| C{GitHub Actions}
C -->|Compile .compact| D[Generate ZK Keys & IR]
C -->|Run Tests| E[Vitest]
C -->|Webhook| F[(Neon Postgres DB)]
F -->|Store| G[Benchmark Times & CI Run Logs]
G --> H[CompactForge Dashboard]
sequenceDiagram
participant User
participant App as CompactForge Web
participant Wallet as 1AM Wallet Extension
participant Network as Midnight Preprod
User->>App: Click "Deploy Contract"
App->>Wallet: Request permissions & Shielded Keys
App->>App: createUnprovenDeployTx()
App->>Wallet: Prove ZK Circuit (Downloads Keys via API)
Wallet-->>App: Proven Transaction
App->>Network: submitTransaction()
Network-->>App: Contract Address
App-->>User: Deployment Success
User->>App: Select Circuit (e.g., Deposit)
App->>Wallet: Request ZK Proof Generation
Wallet-->>App: Proven Circuit Call
App->>Network: Broadcast Transaction
CompactForge/
โโโ src/
โ โโโ app/
โ โ โโโ api/ # Next.js API Routes (CI Webhooks, DB access)
โ โ โ โโโ contracts/ # Serves .bzkir, .prover, .verifier binaries locally
โ โ โโโ dashboard/ # Web dashboard pages (Next.js App Router)
โ โ โโโ docs/ # Documentation generated natively
โ โโโ components/ # React Components (DeployButton, InteractPanel, etc)
โ โโโ __tests__/ # Vitest Unit test suite
โโโ contracts/
โ โโโ token_ledger/
โ โโโ token_ledger.compact # The Midnight Compact source code
โ โโโ build/ # Generated WASM, Keys, and ZK IR
โโโ prisma/
โ โโโ schema.prisma # Database Schema (Neon Postgres)
โโโ .github/workflows/ # GitHub Actions CI/CD pipelines
The project utilizes vitest for robust unit testing covering utility functions, API endpoint validation, Contract metadata, and our custom ZK config provider URLs.
To run the tests:
npm run testTo run the CompactForge web application locally, follow these numbered steps:
- Clone the repository:
git clone https://github.com/sauravs296/compactforge-midnight.git cd compactforge-midnight - Install dependencies:
npm install
- Set up the database (optional for demo data):
npx prisma generate npm run db:seed
- Run the development server:
npm run dev
- Open your browser: Navigate to http://localhost:3000
We actively collect and act on feedback from real users and prior season judges. All feedback has been catalogued, prioritised, and resolved with full code traceability.
| Resource | Link |
|---|---|
| ๐ Beta Feedback Form | forms.gle/xCETdWhWyPPykJzz7 |
| ๐ Response Sheet (70 responses) | Google Sheets โ View Live |
| ๐ Detailed Feedback & Commit Traceability | FEEDBACK.md |
| ๐ฅ Verified Beta Users | docs/USERS.md |
Key improvements shipped this sprint: real WASM key-size benchmarking, localStorage-persisted ZK private state, global wallet context provider, CI webhook authentication, and auto-refreshing live dashboard.
We conducted a successful beta test with 70 real developers testing contract deployments on the Midnight Preprod Network using the 1AM wallet. Each wallet address is independently verifiable on the 1AM Explorer.
| Resource | Link |
|---|---|
| ๐ Full Verified User List | docs/USERS.md โ 70 wallets with 1AM Explorer verify links |
| ๐ Feedback Responses | Google Sheets |
| ๐ Root Reference | LAUNCH_USERS.md |
| ๐ On-chain Verify | explorer.1am.xyz (Preprod) |
This section documents all major improvements shipped during the September 2026 sprint, in direct response to prior season feedback and beta user testing.
| # | Item | Description | Commit |
|---|---|---|---|
| FB-02 | Remove Mock Compiler | CI pipeline reframed as Contract Validation; removed fake bin/compact script |
ed1305e |
| FB-03 | Real Benchmarks | scripts/wasm-benchmark.mjs reads actual .prover + .bzkir file sizes for real proof-time estimation |
fdcebf7 |
| FB-05 | callerAddress Fix | Security limitation acknowledged with explicit TODO; placeholder pending stdlib update | 51d0d6a |
| FB-06 | Global Wallet Context | WalletContext.tsx + ClientProviders.tsx ๏ฟฝ app-wide persistent wallet connection |
0963cd4 |
| FB-07 | Seed Data Script | prisma/seed.ts populates DB with realistic CI runs, benchmark curves, and deployments |
4d17cbe |
| FB-08 | LocalStorage Private State | ZK private state backed by localStorage ๏ฟฝ survives page refresh across sessions | 80e08fa |
| FB-09 | PROPOSAL.md Rewrite | Fixed emojis; rewrote as developer pain-story narrative with "Why Now?" section | 87d2049 |
| FB-10 | Live Dashboard Auto-Refresh | AutoRefresh polls every 10s; dashboard updates automatically on new CI data |
0465c71 |
| FB-12 | Webhook Authentication | GITHUB_WEBHOOK_SECRET header required on all POST endpoints |
c114566 |
| FB-13 | Badge Label Fix | CI badge renamed to "Contract Validation" for accuracy | 5b41593 |
| FB-14 | Removed Dummy Comment | Removed // Dummy private state provider comment from InteractPanel |
1b1f99a |
| FB-15 | 70 Beta Users | Structured beta with 70 developers; verified wallets in docs/USERS.md |
c4fff58 |
| # | Item | Description |
|---|---|---|
| FB-01 | forge_registry.compact |
Replace token_ledger with a ZK-based contract registry native to CompactForge |
| FB-04 | Multi-Contract Support | Bring-your-own-.compact file: repo registration, webhook config, multi-tenant dashboard |
| FB-11 | callerAddress() Integration |
Properly derive caller identity once Midnight stdlib ships publicKey() |
| FB-16 | Architecture Refactor | Split wallet.ts into providers.ts, contracts.ts, types.ts service layers |
Future Roadmap:
- Multi-Contract Support: Dynamically upload, compile, and manage any
.compactfile directly in the browser using WASM. - Advanced Analytics: Track gas fees, proving size optimization recommendations, and failure rate tracking for ZK circuits over time.
- Automated Auditing: CI/CD step that statically analyzes Compact contracts for common privacy leaks.
Real World Application: CompactForge sets the standard for how development teams building on Midnight will handle their release cycles. By standardizing CI/CD for ZK proofs, teams can build decentralized confidential ledgers, voting systems, and privacy-preserving identity systems with the confidence that every commit is mathematically verified and performance benchmarked before reaching production.
A huge thanks to the Midnight Team for organizing this hackathon! Building with Compact and exploring the frontier of Zero-Knowledge smart contracts has been an incredible experience.

