---
# System prepended metadata

title: 'Z-Imburse Docs: Z-Imburse Escrow'
tags: [ZImburseAuditDocs]

---

# Z-Imburse Docs: ZImburseEscrow
[Z-Imburse Escrows](https://github.com/Mach-34/z-imburse/tree/main/contracts/z_imburse_escrow) are the engine for how organizations and their participants interact with each other to perform reimbursements.

The general functionality is:
 1. An admin creates a new escrow group
 2. Out of band (i.e. by DM/email/etc) the admin is given a participant's aztec address
 3. The admin creates an entitlement to reimburse with specific parameters and permits the participant to use the entitlement onchain
 4. The participant produces an email receipt satisfying the parameters to claim the reimbursement

:::info
Due to time constraints, the scope of the Z-Imburse verifier types is limited to Linode hosting receipts. 

We are implementing a system for selecting ~256 bytes out of the email body for United flight receipts with [interstitial partial hashes](https://github.com/zkemail/zkemail.nr/blob/main/lib/src/partial_hash.nr#L123) built at each point. The aztec function circuit would perform these checks in one function call, verify a recursive proof from a server, and stitch together partial hashes from the client and server proofs to eventually reach the signed body hash. This functionality was not achieved by the audit deadline and has been excluded from the scope.
:::

## Table of Contents
[EntitlementNote](https://hackmd.io/@IQZ-5dJ4QGGu4K6oX71X7w/HkYwMgAg1l)
[EntitlementSet](https://hackmd.io/@IQZ-5dJ4QGGu4K6oX71X7w/HJOpMlAl1e)
[Interacting with the Contracts](https://hackmd.io/@IQZ-5dJ4QGGu4K6oX71X7w/Syxo7x0gkx)

## Unit Testing
[TXE unit tests exist for `ZImburseEscrow`](https://github.com/Mach-34/z-imburse/blob/main/contracts/z_imburse_registry/src/test/escrow.nr) performing basic base and edge case testing to verify the expected behavior of the contracts.

As mentioned in ["Interacting with the Contracts"](https://hackmd.io/@IQZ-5dJ4QGGu4K6oX71X7w/Syxo7x0gkx#Calling-the-Registry), trying to import contracts from eachother causes cyclic dependencies. Since we need to import the `ZImburseRegistry` into the unit test for `ZImburseEscrow`, and `ZImburseRegistry` already imports `ZImburse Escrow`, we simply put all the unit tests in `ZImburseRegistry`. It may make more sense to make a separate test crate in the workspace in the future.

:::info
Right now we have a gitignored Linode email that contains some sensitive data stored at `email_inputs.nr` in the [test utils folder](https://github.com/Mach-34/z-imburse/tree/main/contracts/z_imburse_registry/src/test/utils). We're deciding the best way to get a satisfying input into the unit test, but if you encounter the need for a satisfying email before we fix this please reach out and we will just send the email to you
:::