> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Deposit to a Zone

## Overview

Funds enter a zone by depositing them from Tempo Mainnet into the zone's contract. The deposit is
submitted on Mainnet against the L1 client, and the corresponding balance appears inside the zone once
the zone imports its Tempo block. An encrypted deposit additionally hides the recipient from the public
chain.

[See the Zone Bridging specification](https://docs.tempo.xyz/protocol/zones/bridging)

:::warning
Tempo Zones are in early development and available on Tempo Testnet only. Expect breaking changes and
do not use them in production.
:::

## Recipes

These recipes assume you have [set up a Tempo client](/tempo) for Mainnet and
[connected to a zone](/tempo/guides/zones/connect).

### Deposit to a Zone

Deposit a TIP-20 token from your Mainnet balance into a zone with
[`zone.depositSync`](/tempo/actions/zone.deposit). The deposit runs on Mainnet, so it is sent with the
L1 client and targets the zone by `zoneId`.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const { receipt } = await client.zone.depositSync({
  amount: 100_000000n,
  token: '0x20c0000000000000000000000000000000000001',
  zoneId: 7,
})
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/tempo/viem.config.ts:setup]
```
:::

### Make an Encrypted Deposit

Hide the recipient of a deposit from the public chain with
[`zone.encryptedDepositSync`](/tempo/actions/zone.encryptedDeposit). Only the amount and sender remain
visible on Mainnet, while the recipient is decryptable only by the zone operator.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const { receipt } = await client.zone.encryptedDepositSync({
  amount: 100_000000n,
  token: '0x20c0000000000000000000000000000000000001',
  zoneId: 7,
})
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/tempo/viem.config.ts:setup]
```
:::

### Confirm Zone Import

After depositing, call [`zone.waitForTempoBlock`](/tempo/actions/zone.waitForTempoBlock) with the
deposit receipt's block number. The action runs against the zone client and resolves once the zone has
imported that Tempo block.

:::code-group
```ts twoslash [example.ts]
import { client } from './zones.config'

const info = await client.zone.waitForTempoBlock({
  tempoBlockNumber: 123456n,
})

console.log('Imported Tempo block:', info.tempoBlockNumber)
// @log: Imported Tempo block: 123456n
```

```ts twoslash [zones.config.ts] filename="zones.config.ts"
// [!include ~/snippets/tempo/zones.config.ts:setup]
```
:::

## Best Practices

### Deposit on Mainnet, Read on the Zone

Deposits are L1 actions sent with your Mainnet client, while imported-block and balance reads are zone
actions sent with your zone client. Keep both clients configured so you can submit a deposit and then
confirm it landed.

### Prefer Encrypted Deposits for Privacy

If hiding the recipient matters, use `zone.encryptedDeposit` so the destination is not exposed on the
public chain. A plain deposit reveals the recipient on Mainnet.

### Prepare Private Details Before Broadcasting

If another wallet or service will broadcast the deposit, use
[`zone.encryptedDeposit.prepare`](/tempo/actions/zone.encryptedDeposit#prepared-usage) to encrypt the
private recipient and memo first. The broadcaster can pass the returned payload directly to
[`zone.encryptedDeposit`](/tempo/actions/zone.encryptedDeposit) without learning the private details.
Validate the public transaction details before broadcasting a prepared payload from another party.

### Track the Deposit Block Number

`zone.waitForTempoBlock` is keyed by the Mainnet block number of the deposit. Capture it from the
deposit receipt so you can wait for the zone to import it.

## See More

<Cards>
  <Card icon="lucide:plug" title="Connect to a Zone" description="Authenticate a Viem client with a zone before reading state." to="/tempo/guides/zones/connect" />

  <Card icon="lucide:arrow-up-from-line" title="Withdraw from a Zone" description="Move stablecoins from a zone back to Tempo Mainnet." to="/tempo/guides/zones/withdraw" />

  <Card icon="lucide:square-function" title="zone.deposit" description="Deposit a TIP-20 token from Mainnet into a zone." to="/tempo/actions/zone.deposit" />

  <Card icon="lucide:book-open" title="Tempo Docs: Zone Bridging" description="How deposits and withdrawals move between Mainnet and zones." to="https://docs.tempo.xyz/protocol/zones/bridging" />
</Cards>
