# Escrow dApp Example

**URL:** <https://forum.midnight.network/t/escrow-dapp-example/1048>\
**Category:** General\
**Tags:** learning\
**Created:** [February 25, 2026, 7:37pm UTC](https://forum.midnight.network/t/escrow-dapp-example/1048 "2026-02-25T19:37:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharpamnani](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/tusharpamnani/32/498_2.png) [@tusharpamnani](https://forum.midnight.network/u/tusharpamnani)\
**Post date:** [February 25, 2026, 7:37pm UTC](https://forum.midnight.network/t/escrow-dapp-example/1048/1 "2026-02-25T19:37:15Z")

</div>

![image](https://canada1.discourse-cdn.com/flex010/uploads/midnightnetwork/original/1X/4ff71b719b5a85603de2a72b03293df0e851b432.png)

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](https://github.com/tusharpamnani/midnight-escrow)

---

<div class="post-metadata">

**Author:** ![lolocoding](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/lolocoding/32/505_2.png) [@lolocoding](https://forum.midnight.network/u/lolocoding)\
**Post date:** [March 5, 2026, 10:44am UTC](https://forum.midnight.network/t/escrow-dapp-example/1048/2 "2026-03-05T10:44:41Z")

</div>

Congrats, @tusharpamnani on getting your [Escrow app](https://github.com/tusharpamnani/midnight-escrow) added to the [Awesome dApps list](https://github.com/midnightntwrk/midnight-awesome-dapps/pull/70) repo!! Excited to have you building in the ecosystem 🚀

---

<div class="post-metadata">

**Author:** ![tusharpamnani](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/tusharpamnani/32/498_2.png) [@tusharpamnani](https://forum.midnight.network/u/tusharpamnani)\
**Post date:** [March 5, 2026, 3:45pm UTC](https://forum.midnight.network/t/escrow-dapp-example/1048/3 "2026-03-05T15:45:30Z")

</div>

Thanks a lot @lolocoding !

---

<div class="post-metadata">

**Author:** ![Spy](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/spy/32/207_2.png) [@Spy](https://forum.midnight.network/u/Spy)\
**Post date:** [March 7, 2026, 3:23am UTC](https://forum.midnight.network/t/escrow-dapp-example/1048/4 "2026-03-07T03:23:06Z")

</div>

I just added mine & @Johnny5i too!

---

<div class="post-metadata">

**Author:** ![lolocoding](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/lolocoding/32/505_2.png) [@lolocoding](https://forum.midnight.network/u/lolocoding)\
**Post date:** [March 7, 2026, 9:02am UTC](https://forum.midnight.network/t/escrow-dapp-example/1048/5 "2026-03-07T09:02:26Z")

</div>

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