# Vault Architecture

<figure><img src="https://1813598319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg7CuDjZTqivGehboo0kG%2Fuploads%2FXwL5KbpnOtF2j2US1L67%2FVault%20Architecture.png?alt=media&#x26;token=1daabfd8-0a5b-4ba0-9abb-f5ff79246779" alt=""><figcaption></figcaption></figure>

Zipper’s **vault system is designed for efficiency and cost-effectiveness**, ensuring every zAsset remains fully **1:1 backed** while minimizing gas costs across different blockchain networks. Unlike a traditional pooled vault model, Zipper **utilizes a distributed deposit system**, where user deposits are managed across multiple addresses before being consolidated into a **main vault**.

***

### **Deposit Addresses vs. Main Vaults**

Zipper operates with **two distinct types of vault addresses** to manage assets efficiently:

1. **Deposit Addresses** - User-specific addresses used for receiving deposits before consolidation.
2. **Main Vaults** - Primary storage locations where assets are consolidated after deposits.

***

### **How Funds Move in Zipper**

#### **Step 1: Deposits are Sent to Users' Deposit Addresses**

* When a user **zips an asset**, they send it to their **designated deposit address**, which is unique to them.
* These deposit addresses **are not uniquely generated for every deposit**, meaning users deposit to the same assigned address each time if depositing the same asset or on the same network as a previous deposit.
* **Deposit addresses are not shared between users**, ensuring funds remain separate and **avoiding commingling.**
* Although deposit addresses are distinct from the main vault, they are still **secured under the same private key model** as the main vault.

#### **Step 2: Backend Workers Monitor for Optimal Gas Fees**

* Instead of immediately consolidating all deposits into the main vault, **Zipper’s backend infrastructure monitors gas prices on the originating chain.**
* When network conditions are favorable, deposits are **batched and consolidated** into the **main vault** to minimize unnecessary gas costs.

#### **Step 3: Main Vaults Store the Bulk of Zipped Assets**

* Each **supported token** has **one primary vault per blockchain**.
* The **main vault is used for fulfilling unzips**, ensuring **sufficient liquidity is available when users withdraw assets**.
* Even if a token exists in multiple deposit addresses, the total amount across **deposit addresses + main vault = 1:1 backing for all zAssets** on Fabric.

#### **Step 4: Unzipping Assets & Covering Withdrawals**

* When a user **unzips** an asset, Zipper first attempts to **release funds from the main vault**.
* If the main vault does not have enough funds to immediately process the request (before gas-efficient consolidation has occurred), Zipper **automatically fetches the required funds from existing deposit addresses** to fulfill the withdrawal.
* This mechanism ensures **all withdrawals are processed seamlessly, regardless of vault balance distribution at any given time.**

***

### **Key Vault Architecture Takeaways**

✅ **1:1 Backing Across All Addresses** - Assets in deposit addresses and main vaults **collectively ensure every zAsset remains fully backed.**\
✅ **One Main Vault Per Token, Multiple Deposit Addresses** - Each **token has its own dedicated vault**, but deposit addresses can handle multiple tokens from the same blockchain.\
✅ **No Commingling of User Funds** - Deposit addresses are **assigned per user**, ensuring **clear separation of assets** before consolidation.\
✅ **Dynamic Fund Consolidation** - Zipper’s architecture is designed to **minimize gas fees** by batching deposit transfers during **low-fee windows**.\
✅ **Efficient Withdrawal Processing** - If the main vault is temporarily underfunded due to unprocessed consolidations, Zipper **automatically retrieves assets from deposit addresses** to fulfill withdrawals without delay.
