Step-by-Step Guide: Burning and Minting ICRC Tokens with Bitfinity for EVM Compatibility
Discover how Bitfinity's EVM-client plugin seamlessly bridges tokens between ICRC and EVM chains. Learn the key methods and steps to effortlessly move your assets across these token standards.

With the Bitfinity EVM, we have to understand what is exactly happening behind the scenes. How is this ‘New net new me’ type of transition going? How does the bridging of the old to the new happen and more importantly, how can we use the Bitfinity bridge to cross over to the EVM?
In this article, we explain how Bitfinity bridges token standards and what the tricks behind the scenes are...

ICRC-2 standard
But first, let us look at the ICRC-2 standard, or token standard of Bitfinity that is still being used. The asynchronous tokens follow the ICRC-2 standard that is considered to be like ERC-20’s agile sibling.
We know that the ERC-20 standard is built for more sequential operations and can be used for more. But as the ICRC-2 standard was being created for parallel processing, which means multiple transactions happen simultaneously without the need for previous steps and could be faster.
With several platforms providing support to more than just the ICRC-2 standards, such as ICP’s ICRC-1 tokens as well, we can see that there is a kind of adoption going on.

To learn more about token standards, please refer to our extensive article ‘How not all tokens are created equal’ or why it is that we need different token standards to perform different actions.

Bitfinity EVM
The Bitfinity Network EVM supports the execution of smart contracts written in Solidity, a vital feature that enables the functionality of the token bridge. With its ‘complicated’ architecture that includes EVM API canisters, the EVM Executor canister, Signature Verifier canisters, and the Blockchain canister, that work cohesively to process transactions and update the global EVM state.
The Bitfinity Network EVM incorporates advanced optimizations, such as signature verification and transaction batching, which enhance its speed and efficiency, making it an excellent choice for projects bridging tokens between ICRC and EVM chains.
To explore how the Bitfinity Network EVM operates and why it is important, read the full article: How the Bitfinity Network EVM Works and Why It Matters.

How Does Bitfinity Bridge ICRC-2 Assets to the EVM?
First Step in Bridging ICRC-2 to EVM?
The initial step is to approve something called the "Bridge Cannister". You can think of this as giving the green light to a special contract/cannister that will help connect the ICRC-2 blockchain to the EVM. An approval that is necessary to kick off the whole bridging process.
After the Bridge Cannister is Approved
Once you've approved the Bridge Cannister, the next move is to ping the bridge smart contract, which has all the instructions for shuttling assets between ICRC-2 and EVM.
How Does the Actual Bridging of Assets Occur?
After the bridge smart contract gets the signal, it sets off a special event - an event that gives the command to create, or "mint", the equivalent assets on the EVM blockchain that match what you started with on ICRC-2.
The bridging process starts with a "Sign Mint Order Operation" on the Bridge Canister side. This operation initiates the request to move assets from the ICRC-2 blockchain to the Ethereum Virtual Machine (EVM).
Next, an "Operation" takes place, which involves calling the bridge contract on the Bitfinity EVM. This contract contains the instructions for minting the tokens on the EVM side, representing the assets being bridged from ICRC-2.
Once the bridge contract is called, it triggers an "Event" that sets the minting process in motion. This event confirms that the mint order is successful and the assets are ready to be created on the EVM side.
Finally, an "Operation" on the Bitfinity EVM side completes the minting process and confirms the successful bridging of the assets. The newly minted tokens on the EVM blockchain are now equivalent to the original assets from the ICRC-2 blockchain.

Bridging Tokens Between ICRC and EVM Chains with Bitfinity Evm-client Plugin
The Bitfinity Evm-client plugin enables seamless token bridging between ICRC and EVM chains. Below are the key steps and methods related to ICRC and EVM token standards.
How do I get the ID256 of a token?
ICRC Tokens
Use the Id256Factory to get the ID256 from the token's principal: For ICRC
Token Example
import {Id256Factory} from "@infinityswapofficial/evm-client";
tokenInId256 = Id256Factory.fromPrincipal(Principal_of_token)
EVM Tokens
For EVM tokens, use the token address and chain ID: For EVM
Token Example
import {Id256Factory} from "@infinityswapofficial/evm-client";
const chain_id = 355113
tokenInId256 = Id256Factory.fromAddress(new AddressWithChainID(erc20TokenAddress, chain_id))
How do I burn ICRC tokens?
To burn ICRC tokens and initiate an ERC20 mint order, use the burn_icrc2_tokens method:
const operation_id = bridge.generateOperationId();
const signedMintOrder = await bridge.burn_icrc2_tokens(TOKEN_PRINCIPAL,amount, operation_id);
The operation_id uniquely identifies the burn operation. It can be generated using bridge.generateOperationId() or created manually.
How do I mint ERC20 tokens?
To mint ERC20 tokens on the EVM chain after burning ICRC tokens, call the mintOrder method:
const signedMintOrder = await bridge.mintOrder(signedMintOrder);
How do I burn ERC20 tokens?
To burn ERC20 tokens, use the burn_erc_20_tokens method:
const burnTxHash = await bridge.burn_erc_20_tokens(ercToken, 1000000, 0);
How do I mint ICRC tokens after burning ERC20 tokens?
To mint ICRC tokens after burning ERC20 tokens, use the mint_icrc_tokens method:
const mintResult = await bridge.mint_icrc_tokens(operation_id,Principal.fromText(canisterIds.token.local));
How can I get the base token principal from a wrapped ERC20 token address?
To get the base token principal from a wrapped ERC20 token address, call the get_base_token method:
const baseTokenPrincipal = await bridge.get_base_token(ercToken.getAddress());
And so with these methods, you can easily bridge tokens between the ICRC and EVM standards. Let's bridge this together.

Conclusion
Bitfinity's EVM-client plugin is a powerful tool for bridging tokens between ICRC and EVM chains. By understanding the key methods and steps involved, such as getting token ID256, burning and minting ICRC and ERC20 tokens, and retrieving base token principals from wrapped ERC20 addresses, users can easily move their assets across these token standards.
Understanding the technical aspects of the Bitfinity Network EVM allows users of the Bitfinity Evm-client plugin to better appreciate the underlying technology driving the token bridging and providing this new offering with many benefits compared to other EVM implementation.

Connect with Bitfinity Network
Bitfinity Wallet | Bitfinity Network | Twitter | Telegram | Discord | Github

*Important Disclaimer: The information provided on this website is for general informational purposes only and should not be considered financial or investment advice. While we strive for accuracy, Bitfinity makes no representations or warranties regarding the completeness, accuracy, or reliability of the content and is not responsible for any errors or omissions, or for any outcomes resulting from the use of this information. The content may include opinions and forward-looking statements that involve risks and uncertainties, and any reliance on this information is at your own risk.
External links are provided for convenience, and we recommend verifying information before taking any action. Bitfinity is not liable for any direct or indirect losses or damages arising from the use of this information.
Comments ()