# Converting ERC20 to ICRC

The sequence diagram details the process involved in converting the wrapped ICRC on the EVM chains back to ICRC on IC is shown below:

<figure><img src="/files/Byyk6WCSvJ1kFMwNV41m" alt=""><figcaption><p>ERC20 => ICRC sequence diagram</p></figcaption></figure>

The detailed breakdown of each step in the sequence is as follows:

1. **User Interaction**:
   * The user initiates the bridging process by calling the `bridge(target_ic, amount, recipient)` function on the BitoBridge Helper smart contract.
   * The BitoBridge Helper confirms the request by sending an 'ok' response back to the user.
2. **Event Emission**:
   * The BitoBridge Helper emits an event `Bridge(target_ic, amount, recipient, from)` which is picked up by the RPC Nodes.
3. **Event Listening and Processing**:
   * The Minter continuously listens for events from RPC nodes. This listening process runs in a loop, with checks occurring every three minutes.
   * Once an event is detected, BitoBridge Minter gets the information.
4. **BitoBridge Minter Activation**:
   * Upon receiving the event data, the BitoBridge Minter processes the details and interacts with the BitoBridge Hub to initiate the token bridging process.
5. **BitoBridge Hub to ICRC Ledger**:
   * The BitoBridge Hub sends a request to the ICRC Ledger to bridge tokens to IC specified in the initial user request.
   * This involves the BitoBridge Hub requesting the ICRC Ledger to transfer tokens to the user's account on IC.
6. **Token Transfer and Confirmation**:
   * The ICRC Ledger processes the transfer request and updates the block index, which is crucial for tracking the transaction on the blockchain.
   * The ICRC Ledger confirms the successful transfer by sending the updated block index back to the BitoBridge Hub.


---

# 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://bitobridge-doc.bitomni.io/converting-erc20-to-icrc.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.
