Unshield: Reclaiming Public Tokens
The Unshield operation is the process of converting your private ZRC-20 tokens back into their original, public ERC-20 form. This allows you to seamlessly move your assets from the ZeroLayer privacy ecosystem back to the public blockchain to interact with other DeFi protocols, exchanges, or wallets.
💰 Protocol Fee: Unshield operations incur a 0.25% protocol fee, which is automatically deducted from the withdrawal amount.
The Unshielding Process
Unshielding is essentially the reverse of the Shield operation. You prove ownership of your private notes and, in exchange, the ZeroLayer smart contract releases the corresponding public tokens to your chosen address.
- Select Amount and Recipient: In the ZeroLayer application, you specify the amount of a private token you wish to unshield. You also provide the public Ethereum address (
0x...) where you want to receive the public ERC-20 tokens. - Generate Proof: Your browser generates a zero-knowledge proof. This proof validates that you own the private notes you are spending without revealing any information about their history.
- Send the Transaction: You authorize the transaction, which is sent to the ZeroLayer smart contract for verification.
What Happens Under the Hood
The Unshield operation is a special type of private transfer where the "recipient" is a publicly known, un-ownable burn address.
- Spending Private Notes: Just like in a regular transfer, the zero-knowledge proof reveals the nullifiers of the private notes you are spending, marking them as used forever.
- Proving the Withdrawal: The proof also publicly declares the amount of tokens being unshielded.
- Burning the Private Note: A new output note is created, but it is sent to a special, system-wide "burn address." This effectively destroys the private version of the token, ensuring that the total supply remains consistent.
- Releasing Public Tokens: Once the smart contract has verified the proof and confirmed that the private note has been burned, it releases the equivalent amount of the underlying public ERC-20 token from its reserves and sends it to the recipient address you specified.
This carefully designed process ensures that the privacy of your remaining shielded balance is maintained while allowing you to securely and verifiably exit the privacy pool at any time.