Escrow dApp Example

I built a privacy-preserving Escrow smart contract using Compact and a TypeScript CLI.

This project demonstrates how two parties (Buyer and Seller) can securely transact using zk proofs, where funds are released only when predefined conditions (a secret + identity verification) are satisfied.

It serves as a complete reference implementation of a real-world escrow workflow on Midnight.


Smart Contract (Compact)

The contract enables:

  • Buyer to create and fund an escrow

  • Seller to accept the escrow

  • Conditional release of funds using a secret

  • Refund functionality if conditions are not met

Core properties:

  • Zero-knowledge proof verification of the release secret

  • Identity verification without exposing unnecessary data

  • Privacy-preserving transaction flow


Stable Identity System

The project implements a deterministic escrow identity layer using escrow-identity.json, separate from the Midnight wallet address.

This ensures:

  • Persistent seller identity across sessions

  • Separation of wallet address and escrow identity

  • Secure role-based interaction


CLI Application

The interactive CLI supports:

  • Wallet restore (Alice / Bob simulation)

  • Deploy new escrow contract

  • Join existing escrow

  • Create escrow (Buyer)

  • Accept escrow (Seller)

  • Release funds with secret + nonce

  • Refund escrow (Buyer fallback)

  • Identity display

  • Proof server integration

All actions execute real Midnight transactions.

Check it out: GitHub - tusharpamnani/midnight-escrow

5 Likes

Congrats, @tusharpamnani on getting your Escrow app added to the Awesome dApps list repo!! Excited to have you building in the ecosystem :rocket:

3 Likes

Thanks a lot @lolocoding !

I just added mine & @Johnny5i too!

I just responded to your PR, @Spy! I believe you need to make your PR public still? The link is 404ing.