# Decrypting

Decrypting is the process of converting your confidential FHERC20 balance back into a public ERC20 balance. This process has 2 steps:

1. Decrypting some amount of FHERC20
2. Claiming the decrypted amount as ERC20

{% hint style="info" %}
When converting from a confidential balance to a public balance, we must perform an on-chain decryption using `FHE.decrypt` . In this case, we must use `FHE.decrypt` on the amount of token that has been transferred.

This decryption request is picked up by CoFHE, which will perform the decryption and post the result back on-chain.

This asynchronous on-chain decryption is what forces "Decrypt" and "Claim" to be handled by two separate transactions.
{% endhint %}

### 1. Decrypting FHERC20 Balance

After selecting the FHERC20 token to decrypt and the amount to decrypt, we execute the Decrypt transaction. In [ConfidentialERC20.sol](/architecture/confidentialerc20.sol.md) the function `decrypt()` is used, which burns the FHERC20 and requests an on-chain FHE decryption of the amount burned. Once the on-chain FHE decryption is finalized, that amount is marked as "Claimable" and can be claimed as the underlying ERC20 in the upcoming step.

In Redact, this is the expected Decrypt flow:

<div data-full-width="false"><figure><img src="/files/VHyFjoTijKO2FlKdP24T" alt=""><figcaption><p>Decryption flow diagram. (1) Initial, (2) Pending, (3) Success</p></figcaption></figure></div>

TX: [https://sepolia.etherscan.io/tx/0x7a2...a71](https://sepolia.etherscan.io/tx/0x7a29ec13573d1c0f5f11c48a52d8a04d1578800f8f9a7ed7e04fa90ed12f8a71)

After the Decryption transaction has succeeded, you can note that in the wallet the public ERC20 balance has been replaced with two balances: The **public** balance, and the **claimable** balance.

You can claim these decrypted tokens either from the main page component, or from within the wallet using the **CLAIM** button

### 2. Claiming ERC20 Balance

After the successful on-chain FHE decryption has resolved, we are ready to claim the ERC20s. Claiming will add the claimable amount to your ERC20 balance, and in Redact it looks like this:

In order to encrypt (or wrap) your ERC20 tokens, they must first approve them for use in the ConfidentialERC20 smart contract. Only the amount to wrap must be approved.

In the Redact UI, this is step 2 of the wrapping process, and appears like so:

<div data-full-width="false"><figure><img src="/files/ERCTttcQ22lOzGl4Szbt" alt=""><figcaption><p>Approval flow diagram. (1) Initial, (2) Pending, (3) Success</p></figcaption></figure></div>

Tx: [https://sepolia.etherscan.io/tx/0x401...cc2](https://sepolia.etherscan.io/tx/0x40101268d1a87e51f89e979298e51732875bae2702885370bc166a99cec41cc2)&#x20;

{% hint style="info" %}
Notice that in the transaction above, it is public LINK that is being transferred during the claim flow.
{% endhint %}

If you would like to read more about claiming take a look here: [ConfidentialERC20.sol](/architecture/confidentialerc20.sol.md#claim-system)


---

# 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://docs.redact.money/using-redact/decrypting.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.
