# Shielding Tokens (Wrapping)

Shielding converts regular ERC-20 or ETH into confidential tokens (cTokens). This is how users obtain encrypted balances while preserving ERC-20-like functionality.

Although technically a “wrap,” **shielding** better conveys the privacy aspect.

## **How Shielding Works: Step-by-Step** <a href="#how-shielding-works-step-by-step" id="how-shielding-works-step-by-step"></a>

1. **Check if** **a wrapper exists** for your token
   * Each token has a dedicated wrapper contract.
   * If it exists → use it.
   * If not → anyone can deploy one (see Section 6).
2. **Approve the wrapper** (for ERC-20 only)
   * Grant the wrapper permission to transfer your tokens
   * `token.approve(wrapperAddress, amount)`
3. **Call the shield function**
   * `wrapper.wrap(recipientAddress, amount)`
   * For ETH: Include the amount as `msg.value`
   * For ERC-20: Tokens are transferred from you
4. **Pay shield fee**
   * Fees are paid in the original token (eg, USDC, ETH…), not in cTokens. This ensures accurate protocol revenue accounting and avoids circular dependencies.
   * The fee is calculated as a percentage (basis points) of the amount
   * All [fees](/wiki/zaiffer/protocol-fees.md) are sent to the protocol fee recipient address (configured in the FeeManager contract). This address is publicly visible on-chain.
5. **Receive confidential tokens**
   * Wrapper mints cTokens to your address
   * Your balance is encrypted as `euint64`
   * Amount is immediately usable for confidential transfers

**Shield Flow Diagram:**

<div data-with-frame="true"><figure><img src="/files/euStGkq0THB11cE3GIck" alt=""><figcaption></figcaption></figure></div>


---

# 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://zaiffer.gitbook.io/wiki/zaiffer/shielding-tokens-wrapping.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.
