What inspired us

Traditional digital ticketing systems are usually built around centralized databases. Every ticket check can depend on a backend that stores information about users, tickets, and usage history.

We wanted to explore a different model.

What if ticket verification could use blockchain technology while still keeping privacy at the center of the design?

That's where Midnight became particularly interesting to us. Midnight's privacy-focused architecture makes it possible to explore applications where verification and privacy can coexist instead of forcing developers to choose between transparency and confidentiality.

PrivatePass was born from that idea: a digital ticket should prove what it needs to prove—without revealing more than necessary.

How we built it

PrivatePass consists of two main parts:

🔹 The application layer

We built the PrivatePass application and ticketing experience using a modern web development stack.

The project provides a foundation for managing and interacting with digital tickets while keeping the user experience simple.

🔹 The Midnight smart contract layer

The core blockchain integration was built using Midnight Compact and the Midnight JavaScript SDK.

We created a Compact smart contract that maintains ticket information on the Midnight network.

The current contract exposes a registerTicket circuit that allows a ticket identifier to be registered on-chain:

export ledger ticketId: Opaque<"string">;

export circuit registerTicket( customTicketId: Opaque<"string"> ): [] { ticketId = disclose(customTicketId); }

We also built the surrounding Midnight infrastructure required to run and interact with the contract locally, including:

A local Midnight node Midnight Indexer Midnight Proof Server Wallet setup and synchronization Contract deployment tooling A command-line interface for interacting with the deployed contract

The contract was successfully compiled and deployed to a local Midnight development network.

The technical journey

One of the biggest things we learned during this project was that building privacy-preserving blockchain applications involves much more than simply writing a smart contract.

We worked through:

Compiling Midnight Compact contracts Understanding generated contract interfaces Setting up a local Midnight development environment Running Docker services for the node, indexer, and proof server Wallet synchronization and local state management Contract deployment Connecting to deployed contracts through Midnight.js Debugging generated runtime and contract-state interactions

One particularly interesting challenge came after successfully deploying the contract.

The generated contract interface correctly exposed our registerTicket circuit, but transaction execution encountered a runtime state mismatch involving the Midnight SDK's contract-state assembly path.

This led us deep into the generated Compact runtime and SDK internals to understand how circuit calls, StateValue, and contract state are assembled before a transaction is submitted.

Even though debugging that integration pushed us outside the comfortable boundaries of normal application development, it became one of the most valuable learning experiences of the project.

Challenges we faced ⚙️ Local blockchain infrastructure

Running a complete local Midnight environment required coordinating multiple services and ensuring that the node, indexer, and proof server were all healthy and ready before contract interactions began.

🧩 Understanding generated contract interfaces

The generated TypeScript interfaces revealed important details about how Compact circuits are represented at runtime. We had to distinguish between the developer-facing circuit parameters and the internal state representations used by the runtime.

🔍 Debugging runtime state

The most challenging issue was a contract-state runtime mismatch during transaction assembly. The contract itself compiled and deployed successfully, but the SDK runtime encountered an issue while assembling the next contract state for a transaction.

Tracing that problem required investigating generated JavaScript, TypeScript declarations, and Midnight SDK internals.

What we learned

PrivatePass taught us that privacy-focused blockchain development is a fascinating combination of:

Smart contract development Cryptography and zero-knowledge concepts Distributed systems Developer tooling State management Debugging across generated runtimes

Most importantly, we learned that privacy should not have to be an afterthought.

The next generation of applications can give users useful services while asking for—and revealing—less information.

What's next for PrivatePass? 🚀

Our next steps are to expand PrivatePass into a complete private ticket lifecycle:

🎟️ Register tickets securely ✅ Verify whether a ticket is valid 🔄 Track whether a ticket has already been used 🚫 Prevent duplicate ticket usage 🔐 Explore zero-knowledge proofs for privacy-preserving verification 🌐 Connect the experience to a production-ready Midnight network

PrivatePass is our exploration of a simple but powerful idea:

You should be able to prove that your ticket is valid without giving away everything about yourself.

Built With

Share this project:

Updates