ConfidentialWrapper contracts. From a single interface you can wrap assets to make them private, unwrap them to reclaim plain ERC-20, and reveal your encrypted balances with a single wallet signature.
What the Portfolio Scans
When you open the portfolio, HideMe scans:- Public ERC-20 balances — your plain token holdings for all assets that have a registered wrapper.
- Encrypted cToken balances — your FHE-encrypted balances in every
ConfidentialWrapperdeployed throughWrapperFactory.
??? until you choose to decrypt.
Three Main Actions
Make Private
Wrap a standard ERC-20 into an encrypted cToken. Your balance moves on-chain but becomes invisible.
Make Public
Unwrap an encrypted cToken back to plain ERC-20 via a 2-step async process involving KMS threshold decryption.
Decrypt All
Reveal all your encrypted balances at once with a single EIP-712 wallet signature — no transactions required.
Make Private (Wrap)
Wrapping converts a standard ERC-20 into an encrypted cToken balance stored in the correspondingConfidentialWrapper.
Approve the wrapper
Call
approve(wrapperAddress, amount) on the ERC-20 contract to allow the wrapper to pull your tokens.Decimal adjustment
All cTokens use 6 decimals regardless of the underlying asset. The wrapper automatically scales the amount:| Underlying decimals | Example | Adjustment |
|---|---|---|
| 18 (e.g. WETH) | Wrap 1e18 wei | Stored as 1_000_000 (1.0 cWETH) |
| 6 (e.g. USDC) | Wrap 1_000_000 | Stored as 1_000_000 (1.0 cUSDC) |
| Less than 6 | Wrap 1 | Multiplied up to 6 decimals |
You can wrap multiple ERC-20s in a single session. The portfolio page supports batch wrapping — approving and wrapping several assets before leaving the page.
Make Public (Unwrap)
Unwrapping is a 2-step asynchronous process because the contract must request a public decryption from the Zama KMS network to verify you have sufficient balance before releasing the underlying ERC-20.Step 1 — Request unwrap
- The contract computes
FHE.le(amount, balance)to create an encrypted booleancanUnwrap. FHE.makePubliclyDecryptable(canUnwrap)submits a decryption request to the Zama Gateway Chain.- Your account is immediately marked
isRestricted = true.
Step 2 — Finalize (relayer)
FHE.checkSignatures() verifies the proof on-chain. If canUnwrap == true, your cToken balance is reduced and the underlying ERC-20 is transferred back to your wallet.
Cancellation after timeout
If the KMS decryption proof is not submitted within 1 day, you can cancel the stuck request yourself:UNWRAP_TIMEOUT = 1 days has elapsed. Cancelling clears the restriction without transferring any tokens.
Decrypt All
To reveal your encrypted balances you sign an EIP-712 message — no on-chain transaction is needed. ThedecryptMultipleBalances() function handles all cToken addresses in a single round trip to the Zama KMS:
Generate a keypair
The SDK generates a temporary public/private keypair used to re-encrypt your balances for local decryption.
Build and sign the EIP-712 message
The signed message grants the KMS permission to re-encrypt your ciphertexts using the temporary public key, scoped to the specified contract addresses and a 10-day validity window.
Request decryption from KMS
fhevm.userDecrypt() sends all handle/contract pairs and the signature to the Zama relayer. The KMS re-encrypts each balance under your temporary key.