> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avnu.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Gasless swaps and transfers from a shielded balance on Starknet's privacy pool

Starknet's privacy pool holds funds in a shielded balance, so amounts and balances stay off the public ledger. avnu's paymaster lets users interact with that pool **without compromising their privacy**: actions are proven client-side with zk-proofs, and the relayer submits the transaction on-chain, so you never expose a public account to pay gas and link yourself back to your private balance.

<Info>
  **Preview.** Private transactions rely on `@avnu/avnu-sdk >= 4.2.0` (privacy service) and a proving backend — a **STRK20-capable wallet** or the **Starknet privacy SDK**. The API surface may still change. Questions? [Reach out on Telegram](https://t.me/avnu_developers).
</Info>

## How it works

A private transaction never moves tokens from a public account. Instead, it goes through three steps:

1. **Private balance.** Tokens you deposit into the privacy pool are held as shielded *notes*, so balances and amounts stay off the public ledger.
2. **Proof.** Each action (withdraw, transfer, swap) becomes a proof built client-side — by the privacy SDK or by a STRK20-capable wallet — against a recent `provingBlockId`.
3. **Execution.** The paymaster bundles the proof into a single on-chain transaction through its forwarder contract, and can pay the gas on your behalf.

## Fees

Every private transaction carries two costs: the **gas fee** that goes to the network, and the **pool fee** that goes to the privacy pool. Private transactions run in the `sponsored_private` fee mode: the relayer pays the gas, and the user pays only the pool fee — from their private balance, in the token of their choice (`poolFeeToken`), converted from the base STRK amount by the paymaster's price oracle.

Sponsoring requires a paymaster API key from the [Portal](https://portal.avnu.fi), the same setup as [gasfree](/docs/paymaster/gasfree).

## Transaction types

| Type                          | When                                                                                                     | Example                    |
| ----------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------- |
| **`apply_action`**            | No user call needed                                                                                      | Withdraw, **private swap** |
| **`invoke_and_apply_action`** | A user call is required (such as an `approve`), wrapped in `execute_from_outside` and signed by the user | Deposit                    |

## Prerequisites

Before you start, make sure you have:

* **`@avnu/avnu-sdk >= 4.2.0`**, which ships the privacy service: `executePrivateSwap`, `createStrk20WalletProver`, `buildPrivateSwapFee`, `submitPrivateSwap` (the paymaster client is built in, targeting `starknet.paymaster.avnu.fi` by default — override with `AvnuOptions.paymasterBaseUrl`, e.g. `sepolia.paymaster.avnu.fi` for testing)
* a **proving backend**: a STRK20-capable wallet ([starknet.js >= 10.4](https://github.com/starknet-io/starknet.js/releases/tag/v10.4.0), `WalletAccountV6` — Ready and Xverse today), or the Starknet privacy SDK
* a **funded private balance** for the token you want to sell, so deposit into the pool first

## Next steps

<Card title="Private Swap via avnu" icon="shield-halved" href="/docs/privacy/private-swap">
  Execute a sponsored, gasless private swap step by step
</Card>
