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

# How Unlink works

> The shielding model behind Unlink and what stays public or private at each step.

Unlink is a smart contract deployed on the blockchain itself. There is no bridge
and no separate chain. The SDK generates the zero-knowledge proofs and signs the
operations. From a builder's perspective you call `depositWithApproval()`,
`transfer()`, `withdraw()`, and `execute()`.

Balances inside the contract are held as a set of encrypted UTXO notes, and every
private operation is proven with a Groth16 zero-knowledge proof. The contract
verifies the proof without learning the sender, recipient, or amount of a private
transfer.

## The flow

1. **Deposit** moves ERC-20 tokens from a public EVM wallet into the Unlink
   contract, creating a private balance for a `unlink1` account.
2. **Transfer** moves value privately between `unlink1` accounts. Sender,
   recipient, and amount are hidden by the proof.
3. **Withdraw** moves tokens back out of the contract to any public EVM address.
4. **Execute** spends a private balance in external EVM calls, such as a DeFi
   action, and can return the result to a private balance.

The [Introduction](/) shows a diagram of this flow.

## What's private, what's public

<Info>
  |                | Deposit                                          | Transfer                                         | Withdraw                                         | Execute                                          |
  | -------------- | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
  | **Amount**     | <span className="privacy-public">Public</span>   | <span className="privacy-private">Private</span> | <span className="privacy-public">Public</span>   | <span className="privacy-public">Public</span>   |
  | **Sender**     | <span className="privacy-public">Public</span>   | <span className="privacy-private">Private</span> | <span className="privacy-private">Private</span> | <span className="privacy-private">Private</span> |
  | **Recipient**  | <span className="privacy-private">Private</span> | <span className="privacy-private">Private</span> | <span className="privacy-public">Public</span>   | <span className="privacy-public">Public</span>   |
  | **Token type** | <span className="privacy-public">Public</span>   | <span className="privacy-private">Private</span> | <span className="privacy-public">Public</span>   | <span className="privacy-public">Public</span>   |
</Info>

A deposit reveals who funded which `unlink1` account and how much. A withdrawal
reveals the destination address and amount, but not which private account funded
it. `execute()` has the same exposure as a withdrawal: the on-chain calls,
amounts, and target contracts are public, while the private account that funded
them stays hidden, and any tokens returned with deposit-back are private again.
Only transfers between `unlink1` accounts hide all four properties. Plan your
deposit and withdrawal amounts and timing accordingly. The
[private payment tutorial](/partner-integrations) walks through a flow that
minimizes linkability.

## Who pays gas

How gas is paid depends on the operation.

| Operation          | Who pays gas                                      |
| ------------------ | ------------------------------------------------- |
| Deposit            | The user, from their EVM wallet                   |
| Transfer, withdraw | Unlink, which relays the transaction for the user |
| Execute            | Unlink's paymaster, which sponsors the operation  |

A deposit is a normal on-chain transaction sent from the user's EVM wallet, so
that wallet needs native gas. Transfers and withdrawals are submitted by Unlink's
relayer, and `execute()` runs as a sponsored ERC-4337 UserOperation (see
[Execute](/execute#gas-is-sponsored)). The user needs no native gas token for
these private actions.

## Where Unlink runs

Pick a hosted deployment by `environment` name on the
[Supported chains](/supported-chains) page.
