Enclave Money Protocol
Understanding the inner workings of Enclave
Last updated
Understanding the inner workings of Enclave
Last updated
Vaults are custom paymaster contracts (ERC 4337) that manage funds and fulfill requests for accessing funds on the desired target network. When a user wants to transact on a network where they don't have funds without bridging, they can borrow funds from the vault. This requires users to have an equal amount of funds or more on the vaults on the other chains. In order to access these funds the user's wallet submits a signature signed by the vault manager (or authorized signer for the paymaster).
The paymaster verifies signatures and communicates settlement plans to the middleware for settlement based on the amount lent to the user for powering the user's desired action.
For example: If a user has 100 USDC on Arbitrum, 100 USDC on Optimism and 100 USDC on Base they can withdraw upto 300 USDC* on any supported network. If the user wants to buy an NFT on Base worth 250 USDC, they can withdraw 250 USDC from the vault. 100 USDC withdrawn from the vault is deducted from the user's balance on Base and the remaining 150 USDC is lent by the vault to the user. Once the user's transaction is executed the cross chain settlement process is initiated which deducts 50 USDC and 100 USDC from the user's balances on Arbitrum and Optimism.
The messaging layer is used for transaction settlement. When a user's transaction is sponsored, the transaction needs to be settled by deducting from the user's balance on the chains where they do have funds. This settlement plan (mapping of chainId to debit amount) is encoded within the paymaster signature. When the required funds are transferred to the user, a message is sent to each chain in the settlement plan. The corresponding vault on the receiving chain receives this message and deducts the user's balance accordingly. Enclave uses Socket for managing cross-chain settlement (https://socket.tech).
Bridging protocols are used to rebalance vault liquidity between chains. The rebalancer services is responsible for managing bridging and liquidity between networks. Enclave uses Socket's Bungee (https://bungee.exchange) protocol for rebalancing liquidity between chains.
Funds are rebalanced across the different chains based on transaction demand.
Intent solver marketplace is a network of solvers and a decentralised intent-pool that serves as an orderbook for matching user intents and solver bids. Enclave's current auction house is a single solver maintained by Enclave that places bids on user intents. This system will be upgraded over time by onboarding multiple solvers, decentralizing the intent pool, incorporating economic incentives (ex. staking / AVS) and optimizing for the following:
Resilience - No single point of failure
Availability - User intents must be matched with a solver bid
Latency - User intents must be solved within a threshold time period
Solvers failing to meet the tenets of the system will be met with economic penalties (ex. slashing)
Enclave maintains sophisticated low latency indexing infrastructure to support all the components of the system mentioned earlier. Managing virtual balances for cross chain assets supported by Enclave demands accurate and real-time synchronization of transaction states on all supported networks.
Enclave indexes all transfers, vault deposits, vault withdrawals and sponsored transactions to build a comprehensive real-time index and balance state for ensuring the secure and efficient functioning of the components that constitute the Enclave Money protocol.