Inspiration
It started with a small, personal question: every time an ad loads, an invisible auction decides what I see, who pays for it, and who wins. But advertisers and publishers have commercial limits they cannot safely reveal to one another: a real budget ceiling, a minimum acceptable price, and information about inventory quality.
That led to the core question behind Blind Bazaar: can AI negotiate a deal without becoming the party everyone has to trust? We wanted the agents to handle the conversation, while Midnight independently proves that the final agreement follows each party’s private rules.
What it does
Blind Bazaar is a privacy-preserving AI ad-inventory auction. An advertiser agent negotiates with one or two publisher agents using live Groq-powered LLM conversations. The public transcript shows offers and the agreed CPM, but each participant has private constraints that are not shown to the other participants, browser, proof receipt, or ledger.
When agents agree on a deal, the backend calls a real Midnight Compact contract through Midnight.js. The contract generates two zero-knowledge proof transactions:
verifyDealFairnessproves the agreed CPM is at or below the advertiser’s private maximum and at or above the publisher’s private floor.verifyDeliveryproves a private delivery-quality value meets the publicly agreed quality threshold.
The browser receives only the verification verdicts, contract address, and transaction IDs. It can also download a privacy-safe proof receipt containing public metadata only.
The current demo is hosted publicly on Google Cloud, but the contract runs on a VM-local Midnight development network. The proof flow is real; it is not a mainnet deployment and it does not move real money. The displayed $0.05 demo reward is intentionally a UI-only placeholder.
How we built it
We split the project into two layers and agreed on the interface between them before integrating.
The application layer runs the Express server, Groq negotiation agents, Server-Sent Events, live auction UI, transcript history, and Midnight proof-status UI. The contract layer contains the Compact contract, witness definitions, Midnight.js deployment and verification scripts, wallet setup, and a local Midnight node, indexer, and proof server running in Docker.
We started from standard framework and Midnight SDK scaffolding, then built the Blind Bazaar-specific negotiation, contract integration, proof flow, UI, and cloud deployment during the hackathon.
We initially used a mock verification interface while both layers were built in parallel. Once the contract path was ready, we swapped the bridge to the real Midnight verifier without rewriting the UI or negotiation loop. The finished flow is:
Browser UI
↓ live negotiation events
Express + Groq agents
↓ accepted deal
Midnight.js verifier + local wallet
↓ ZK proof requests
Midnight node + indexer + proof server
↓
BBoard Compact contract
On the cryptography side, the advertiser maximum CPM, publisher floor CPM, and delivery-quality value are Compact witnesses. They are supplied locally during proof generation rather than as public circuit inputs.
verifyDealFairness receives the negotiated price and proves:
publisherFloorCPM ≤ price ≤ advertiserMaxCPM
verifyDelivery proves:
actualQuality ≥ promisedQuality
Only the boolean outcomes and limited ledger state are disclosed. The chain verifies the proof without learning the hidden values.
There is also a verifyCredential circuit scaffold. It currently checks only that a 32-byte credential value is non-empty; it is not yet a production identity system and is not the centerpiece of the live proof path.
Challenges we ran into
The hardest part was not making one component work in isolation; it was making every layer agree.
We handled Compact language/toolchain compatibility, generated binding paths, Midnight.js runtime dependencies, wallet restoration and DUST setup, proof-server readiness, Docker networking, and disk-space failures during deployment. We also had to keep the local Midnight services private while exposing only the web application publicly through Google Cloud, Caddy, HTTPS, and DuckDNS.
The product challenge was equally important: how do we show that a proof is meaningful without exposing the private values that make it useful? We iterated on the UI until it made the boundary clear: users can watch the AI negotiate, then see Midnight verify the outcome, without seeing the private witness values.
Accomplishments that we're proud of
We are proud that this is not just an AI chat mockup with a blockchain label.
Blind Bazaar has:
- live AI negotiation between advertiser and publisher agents;
- a real Compact contract with fairness and delivery circuits;
- real Midnight.js proof transactions;
- a deployed contract on a local Midnight development network;
- live proof progress streamed into the browser;
- public contract and transaction identifiers after verification;
- privacy-safe downloadable proof receipts;
- a public HTTPS demo hosted on Google Cloud.
The most important result is the separation of responsibilities: the AI proposes and negotiates; Midnight proves whether the deal satisfies private rules.
What we learned
We learned that privacy-preserving AI systems need a precise boundary between what a model can suggest and what a system may actually accept.
Compact and Midnight.js rewarded methodical debugging: toolchain versions, generated artifacts, wallet state, proof-server health, and network configuration all matter. We also learned that agreeing on an interface contract before implementation made integration dramatically easier. It let us replace a mock verifier with the real Midnight path while preserving the rest of the app.
Most importantly, we learned that “private AI” needs careful claims. In this demo, the protected settlement constraints are private witnesses and are not exposed to the browser or ledger. The Groq model is used for negotiation; it is not being presented as confidential inference.
What's next for Blind Bazaar
The next step is real private settlement: a shielded-token escrow or payment circuit that pays the winning publisher instead of displaying a demo reward.
We would also add:
- a real credential or reputation mechanism to replace the current placeholder credential check;
- an attested source of delivery-quality data instead of the demo-supplied quality witness;
- deployment to a public Midnight network;
- stable contract addresses and independent verification;
- participant wallets and permissions;
- safeguards such as rate limits and production monitoring.
Beyond advertising, the same model applies to B2B procurement, vendor selection, insurance, and other negotiations where parties need to prove rules were followed without revealing their pricing strategy or sensitive operating data.
Built With
- api
- caddy
- cloud
- compact
- compose
- contract
- docker
- events
- express.js
- groq
- html
- javascript
- midnight.js
- node.js
- server-sent
- smart
- typescript
Log in or sign up for Devpost to join the conversation.