Inspiration

Pet owners often have to share an entire vaccination certificate when a business only needs to verify one fact, such as whether a rabies vaccine is valid through the end of a boarding stay. We wanted to explore whether zero-knowledge proofs could make that interaction more private and still trustworthy.

That led us to a simple idea: the veterinarian should issue the credential, the pet owner should keep the medical details private, and the boarding facility should only learn whether its requirement was satisfied.

What We Built

Private Pet Vaccine Pass is a mobile-first Midnight DApp with three roles:

  • Veterinarian: issues a private rabies-vaccination credential and registers only its cryptographic commitment on Midnight.
  • Pet Owner: stores the credential locally and generates a zero-knowledge proof when asked to prove that the vaccine is valid through a specific date.
  • Verifier / Boarding Facility: creates a dated verification request and checks the resulting proof receipt on Midnight.

The verifier never receives the pet's microchip ID, exact expiration date, credential secret, or complete vaccination record.

How We Built It

We built the frontend with React, TypeScript, Vite, and PWA APIs, with separate mobile experiences for the Owner and Verifier roles.

The Midnight Compact contract implements three main operations:

initializeVet(vetCommitment)
issueCredential(commitment)
proveValidRabies(requiredThroughDate, challenge, commitment)

The private credential contains values such as the pet's microchip ID, vaccine type, expiration date, and a random secret.

The contract proves that:

credential commitment is legitimately issued
AND
the private credential recomputes to that commitment
AND
the hidden vaccine type is rabies
AND
the hidden expiration date >= the verifier's required date

Only the minimum public information needed for verification is written to Midnight.

We also built QR-based flows so the veterinarian can transfer the private credential directly to the owner's device and the verifier can send a fresh challenge and required date to the owner.

The project runs on Midnight Preprod using Compact, the Midnight JavaScript SDK, Midnight Wallet SDK, and the Midnight proof server.

Challenges

One of the biggest challenges was making the blockchain flow feel like a normal mobile application. A traditional wallet-based workflow was too cumbersome for pet owners and boarding employees, so we built a development transaction relay that handles wallet and DUST complexity while preserving real Midnight proof generation and transactions.

Another challenge was deciding what should be public and what should remain private. The verifier's requested-through date and random challenge must be public so the verifier can recognize the claim being proved, while the actual vaccination expiration date must remain private.

We also ran into issues keeping Compact-generated proof artifacts synchronized. The circuit source, ZKIR, proving keys, verifier keys, generated runtime code, and deployed contract must all match exactly. We updated the build process to synchronize these artifacts atomically and prevent stale service-worker caches from serving old versions.

Finally, building two independently installable PWAs from one origin required route-specific manifests, metadata, icons, scopes, and launch URLs so the Owner and Verifier experiences behaved like separate mobile apps.

What We Learned

The biggest lesson was that zero-knowledge design is not simply about hiding data. It is about carefully defining exactly what needs to be proven and exactly what the verifier actually needs to know.

For example, if the private expiration date is (E) and the boarding facility requires vaccination coverage through date (R), the proof only needs to establish:

E >= R

The verifier does not need to learn (E).

We also learned that privacy and usability are closely connected. A cryptographically private system is not very useful if ordinary users have to understand wallets, addresses, gas-like resources, proof servers, and blockchain transactions. Designing the QR-based, role-specific mobile workflow became just as important as the Compact contract itself.

Finally, we learned how Midnight combines private local data, zero-knowledge proofs, and public blockchain state to create a shared trust layer without requiring every participant to share the underlying private record.

What's Next

Next, we would like to add credential revocation, multiple vaccine types, multiple pets, encrypted credential storage, production-grade transaction sponsorship, and stronger binding between the proof and the physical pet present at check-in, potentially through a privacy-preserving microchip verification flow.

The larger vision is a reusable private pet health passport where owners can prove only the facts a veterinarian, airline, daycare, boarding facility, or event organizer actually needs.

Built With

Share this project:

Updates