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
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).
Approve the wrapper (for ERC-20 only)
Grant the wrapper permission to transfer your tokens
token.approve(wrapperAddress, amount)
Call the shield function
wrapper.wrap(recipientAddress, amount)For ETH: Include the amount as
msg.valueFor ERC-20: Tokens are transferred from you
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 are sent to the protocol fee recipient address (configured in the FeeManager contract). This address is publicly visible on-chain.
Receive confidential tokens
Wrapper mints cTokens to your address
Your balance is encrypted as
euint64Amount is immediately usable for confidential transfers
Shield Flow Diagram:

Last updated