<!-- tempo-docs-context -->
> Source: [/docs/guide/private-zones](https://tempo.com/developers/docs/guide/private-zones.md)
> Section: [Zones](https://tempo.com/developers/docs/zones.md). Connect to a Zone and work with private balances, deposits, and withdrawals. Zones is live on Mainnet; see the introduction to set up a Zone. Earlier testnet sandbox guides describe a separate integration.
> Earlier testnet sandbox: use [Zones](https://tempo.com/developers/docs/zones.md) for current Mainnet deployments.
> [Documentation index](https://tempo.com/developers/llms.txt) · [Docs skill](https://tempo.com/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.com/developers/llms.txt) and Markdown pages directly.

<span id="build-with-tempo-zones" />

# Testnet Sandbox

Try deposits, transfers, swaps, and withdrawals with test funds on Zone A and Zone B.

## Overview

The testnet sandbox is an earlier Tempo Zones deployment with two example Zones, Zone A and Zone B. It's a separate integration from current deployments. Use it to try Zone flows with test funds, and build your application against [Tempo Zones](https://tempo.com/developers/docs/zones).

A Zone keeps a private ledger of stablecoin balances and account activity. A portal (`ZonePortal`) on public Tempo holds its backing assets. The deposit, withdrawal, and cross-Zone guides show each flow settle in stages, from accepted transaction to credited balance.

The public Tempo portal holds backing assets while a Zone operator runs the private account ledger. Deposits, withdrawals, and signed settlement commitments connect the two chains.

<span id="connect-your-application" />

<span id="connect-to-the-sandbox" />

<span id="before-you-start" />

<span id="try-the-testnet-guides" />

## Sandbox Guides

The guides use two example Zones on Tempo Testnet. Deposits and withdrawals start in Zone A. Zone B is the destination for cross-Zone transfers and swaps. The examples use the test tokens `OUSD` and `betaUSD`.

Each demo signs you in with a passkey and gets you test funds. It then signs an [authorization token](https://tempo.com/developers/docs/zones/connect#authorize-access) for your Zone account and handles the RPC connection. To call the sandbox from your own code, start with Connect to the Sandbox.

<span id="choose-the-right-guide" />

[Connect to the Sandbox](https://tempo.com/developers/docs/guide/private-zones/connect-to-a-zone): Use for setting up a Zone client, authorizing your account, and making a first RPC request.

[Deposit OUSD](https://tempo.com/developers/docs/guide/private-zones/deposit-to-a-zone): Use for moving test funds from Tempo into a private balance.

[Send Within a Zone](https://tempo.com/developers/docs/guide/private-zones/send-tokens-within-a-zone): Use for a private transfer between accounts in Zone A.

[Send Across Zones](https://tempo.com/developers/docs/guide/private-zones/send-tokens-across-zones): Use for moving test funds from Zone A to Zone B through Tempo.

[Swap Across Zones](https://tempo.com/developers/docs/guide/private-zones/swap-across-zones): Use for combining a withdrawal, a swap on Tempo, and a deposit into another Zone.

[Withdraw OUSD](https://tempo.com/developers/docs/guide/private-zones/withdraw-from-a-zone): Use for withdrawing test funds from Zone A back to your Tempo balance.

<span id="testnet-compatibility" />

<span id="about-the-testnet-sandbox" />

## Sandbox Compatibility

The sandbox runs the legacy Zone A and Zone B interfaces in `viem/tempo`. Its code doesn't carry over to current deployments. It differs in these ways:

* **Deposits:** The sandbox accepts plaintext and encrypted deposits. Current portals accept only encrypted deposits with a Tempo refund recipient.
* **Transfers:** The sandbox allows direct TIP-20 transfers inside a Zone. The current permissioned runtime disables `transfer`, `transferFrom`, and their memo variants.
* **Routed Withdrawals:** The sandbox router takes a plaintext destination recipient in its callback payload. Current routers require an encrypted deposit payload and a Tempo refund recipient.
* **Callback Interface:** The sandbox router uses an older callback signature than current routers.
* **SDK Version:** The sandbox examples use `viem@2.54.6`, which matches the deployed portal and outbox (`ZoneOutbox`) interfaces. New deployments use the current SDK.
* **Chain IDs:** The chain IDs `4217000006` and `4217000007` belong to the sandbox. Other deployments have their own.

For another Zone, get the endpoint, access credentials, chain configuration, and supported SDK version from its operator.

## Sandbox Router Deployment

Use this `SwapAndDepositRouter` deployment for the Zone A and Zone B sandbox on **Tempo Moderato testnet**. It supports both same-token transfers and swaps. The [shared demo configuration](https://github.com/tempoxyz/docs/blob/main/src/lib/private-zones.ts) supplies these addresses to the interactive guides.

| Contract | Moderato address |
| --- | --- |
| `SwapAndDepositRouter` | [`0xf9b794e0dca9bc12ac90067df792d7aad33436e4`](https://explore.testnet.tempo.xyz/address/0xf9b794e0dca9bc12ac90067df792d7aad33436e4) |
| `ZoneFactory` | `0x7Cc496Dc634b718289c192b59CF90262C5228545` |
| `StablecoinDEX` | `0xDEc0000000000000000000000000000000000000` |
| Zone A portal (Zone ID `6`) | `0x7069DeC4E64Fd07334A0933eDe836C17259c9B23` |
| Zone B portal (Zone ID `7`) | `0x3F5296303400B56271b476F5A0B9cBF74350D6Ac` |

The deployed router receives `onWithdrawalReceived(bytes32,address,uint128,bytes)` callbacks, with selector `0xbfea9490`. The Zone messenger invokes this callback. Your application passes the router address and callback data in the source Zone's withdrawal request. In the [swap](https://tempo.com/developers/docs/guide/private-zones/swap-across-zones#code-example) and [same-token transfer](https://tempo.com/developers/docs/guide/private-zones/send-tokens-across-zones#code-example) examples, the six-field `(bool,address,address,address,bytes32,uint128)` payload selects a plaintext destination recipient.

:::warning
Older demo copies use `0x7ebaa4E28fbD892f5B0F152d40173034adE94714`. That deployment expects `onWithdrawalReceived(address,address,uint128,bytes)` (`0x0e9110a5`) and points to a different factory. It's incompatible with these sandbox portals. Use the router in the deployment table for both transfers and swaps. Match the ABI and payload to the deployed contracts, and don't combine versions.
:::

### Check the Full Routed Result

Before sending funds, check the router's `zoneFactory()` and `stablecoinDEX()` against the table. Confirm that the factory recognizes the portals. Confirm that the target portal enables the output token. A swap also needs a fresh DEX quote and a minimum output bound.

A successful source Zone withdrawal receipt confirms submission only. Wait for the portal's `WithdrawalProcessed` event on Tempo and check `callbackSuccess`. Then confirm the destination balance. A rejected callback can still produce a successful processing receipt on Tempo. In that case, the principal returns to the source Zone's `fallbackRecipient`, so check that balance as well.

Two sandbox transactions show the routed flow end to end. One is a [1 PathUSD transfer from Zone A to Zone B](https://explore.testnet.tempo.xyz/tx/0x8ab7e4fbbbd1e26a8400b111c5726fd05c04359be7a858d62e134a6d600807d9). The other is a [1 PathUSD swap into 0.994035 AlphaUSD, deposited back into Zone A](https://explore.testnet.tempo.xyz/tx/0x7d95a62c3e94e1f1382c287967d1d7bb13cfc3a3e3b54b5cd32dad240b8b7ec5). Both credited their destination balances. They use the sandbox's plaintext recipient flow.

## Related

[Tempo Zones](https://tempo.com/developers/docs/zones): Covers current Mainnet Zones to use for your integration.

[Connect to a Zone](https://tempo.com/developers/docs/zones/connect): Use for connecting your application to a current Zone deployment.

[How Zones Work](https://tempo.com/developers/docs/protocol/zones): Covers the current Zone protocol design, from portals to settlement.

[RPC Reference](https://tempo.com/developers/docs/protocol/zones/rpc): Covers the authorization token format and the methods it scopes.
