Depository - Relay

Overview

The Depository is deployed on every chain that Relay supports — as a smart contract on EVM and Solana chains, and as an MPC-controlled address on Bitcoin. It serves as the entry point for user funds — accepting deposits and releasing withdrawals when authorized by the Allocator. There are currently 80+ Depository contracts deployed, one per supported chain. Each contract is non-upgradable, meaning its logic cannot be changed after deployment. See Contract Addresses for the full list.

How It Works

The Depository has two core responsibilities:

  1. Accept deposits — Users send funds to the Depository, tagged with an orderId that ties the deposit to a specific solver commitment.
  2. Execute withdrawals — When a solver presents a valid proof from the Allocator, the Depository releases funds.

The Depository does not track orders, verify fills, or manage balances. It is intentionally minimal — a secure vault that holds funds and releases them only when presented with a valid cryptographic proof.

Deposits

Deposits are designed to be as gas-efficient as possible. On EVM chains, native-token deposits can be close to a raw ETH transfer (~21,000 gas). ERC20 deposits are more expensive because they also perform a token transferFrom.

EVM Chains

The EVM Depository supports two deposit methods:

Both methods emit events that the Oracle monitors to verify deposits.

Solana

The Solana Depository is an Anchor program that supports:

Funds are held in a program-derived address (PDA) vault.

Bitcoin

On Bitcoin, the Depository is an MPC-controlled address rather than a smart contract. Deposits are standard Bitcoin transactions to this address, and withdrawals are authorized by the Allocator via ECDSA (secp256k1) MPC signatures.

Withdrawals

Withdrawals are triggered by solvers who have accumulated balances on the Hub. The process:

  1. Solver requests a withdrawal from the Allocator.
  2. Allocator generates a signed CallRequest (EVM) or TransferRequest (Solana).
  3. Solver submits the signed request to the Depository’s execute function.
  4. Depository verifies the signature against the registered allocator address.
  5. Funds are transferred to the solver.

Each withdrawal request includes a nonce and expiration to prevent replay attacks and stale proofs.

Only the registered Allocator can authorize withdrawals. The Allocator address is set at deployment and can only be changed by the contract owner (a security council multisig).

Security

The Depository is designed with minimal trust assumptions:

Contract References

For full API documentation of the Depository contracts: