# Depositing

This walkthrough shows how to deposit funds into a TONado Cash pool using the `tonado` CLI. (A web UI exists in development under [`apps/dapp`](https://github.com/tonadocash/monorepo/tree/main/apps/dapp) but the CLI is the canonical reference.)

## What you'll need

* A TON wallet you control, with its 24-word mnemonic.
* At least `denomination + ~0.2 TON` available in that wallet (the extra covers gas for the deposit transaction; the unused portion is refunded).
* The `tonado` CLI installed. See [Install and build](/for-developers/install-and-build.md) for the one-time setup.
* A pool that accepts the asset and amount you want to deposit. See [Pools and denominations](/using-tonado-cash/pools-and-denominations.md) for the list.

## Step 1: pick the pool you want to deposit into

List the deployed pools for the network you're using:

```bash
tonado pools list --network testnet
```

Each pool is identified by `(asset, denomination)`. You can only deposit the **exact** denomination of the pool; partial amounts are rejected, and amounts above the denomination are refunded to you minus gas.

For this walkthrough we use the 1 TON pool on testnet.

## Step 2: make the deposit

```bash
tonado deposit native 1 \
  --mnemonic "<your 24-word mnemonic>" \
  --network testnet
```

The CLI does the following locally, on your machine:

1. Generates two 31-byte random values: `nullifier` and `secret`. Together these are your deposit secret. They never leave your device.
2. Computes a *commitment*: `commitment = Poseidon(nullifier, secret)`. This is a one-way hash; the commitment reveals nothing about the underlying secret.
3. Signs an internal message to your wallet, which sends a deposit message to the pool contract with the commitment attached.
4. Prints your **deposit note**.

The note looks like:

```
Save this note privately. It is required to withdraw.

tonado-ton-1-testnet-0xa8b2...c4ef

Pool:       EQAbc...
Commitment: 0x9fa3...
Tx seqno:   42
```

> **Save the note immediately.** The note encodes your `nullifier` and `secret` plus pool metadata. **If you lose it, the deposit is permanently unrecoverable.** No one (not the protocol, not the relayer, not the team) can help you recover from a lost note.

## Step 3: wait for the deposit to land

TON transactions settle in about 5 seconds. The deposit is recognized once the pool emits its `LOG_DEPOSIT` event and the indexer picks it up.

You can check the on-chain status:

```bash
tonado note check "tonado-ton-1-testnet-0xa8b2...c4ef"
```

Expected output:

```
Asset:    ton
Amount:   1
Pool:     EQAbc...
Spent:    NO
```

`Spent: NO` means the note is alive and ready to withdraw. (`Spent: YES` would mean the note has already been used in a withdrawal.)

## What just happened on-chain

Your wallet sent an internal message to the pool with op code `OP_DEPOSIT_NATIVE` (`0xded05701`). The pool:

1. Confirmed the attached value is at least the pool's denomination.
2. Confirmed the commitment hasn't been seen before.
3. Confirmed the new Merkle root submitted by your wallet matches `insert(prevRoot, commitment)`, proven by a Groth16 SNARK attached to the deposit message. (See [Architecture](/protocol-reference/architecture.md) and [the off-chain root post-mortem](/protocol-reference/off-chain-root.md) for why this proof is necessary.)
4. Stored the commitment and updated its Merkle tree to include your leaf.
5. Emitted `LOG_DEPOSIT` so the indexers can pick it up.
6. Refunded any excess TON you attached.

## Privacy hygiene from here

* **Don't immediately withdraw.** If you deposit and withdraw within a few minutes, timing correlation makes the link trivial regardless of cryptography. Wait at minimum hours, ideally days, with other deposits accumulating in between.
* **Don't tell anyone you deposited.** Privacy is a function of your anonymity set, and your anonymity set shrinks every time you share information.
* **When you withdraw, pick a wallet that has no on-chain connection to your depositor wallet.** A brand-new wallet is best. See [Withdrawing](/using-tonado-cash/withdraw-walkthrough.md).

## Depositing Jettons (TEP-74 tokens)

If you're depositing a Jetton instead of native TON, the command is:

```bash
tonado deposit jetton "<jetton-master-address>" <amount> \
  --mnemonic "<your 24-word mnemonic>" \
  --network mainnet
```

The flow is the same conceptually but routes through your jetton wallet → the pool's jetton wallet → a `transfer_notification` to the pool. The pool validates that the sender is its bound jetton wallet (this is the critical TON-specific check that prevents counterfeit-jetton attacks; see [Threat model](/protocol-reference/threat-model.md)).

For a Jetton pool to be usable, it must already be deployed and registered. Check [`packages/core/src/deployments.ts`](https://github.com/tonadocash/monorepo/blob/main/packages/core/src/deployments.ts) or query `tonado pools list` to see which Jetton pools exist.

## Next

You've deposited. Now [save your note safely](/using-tonado-cash/managing-your-note.md), and when you're ready, head to [Withdrawing](/using-tonado-cash/withdraw-walkthrough.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonadocash.com/using-tonado-cash/deposit-walkthrough.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
