# Using ICRC\_2: how to

**URL:** <https://forum.dfinity.org/t/using-icrc-2-how-to/31263>\
**Category:** Developers\
**Created:** [May 28, 2024, 2:38pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263 "2024-05-28T14:38:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marcpp/32/14921_2.png) [@marcpp](https://forum.dfinity.org/u/marcpp)\
**Post date:** [May 28, 2024, 2:38pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/1 "2024-05-28T14:38:20Z")

</div>

Hi all,

I’ve been reading up on ICRC-1 and ICRC-2 and I have to say I’m still a bit confused as to what I need to do in order to use ICRC-2.

The [documentation](https://internetcomputer.org/docs/current/tutorials/hackathon-prep-course/integrating-with-tokens#making-payments-with-icrc-2) says:

> To interact with ICRC-2 locally, you will need to deploy the ICRC-1 ledger canister locally. You can learn how to do that [here](https://internetcomputer.org/docs/current/tutorials/developer-journey/level-4/4.2-icrc-tokens#deploying-a-icrc-1-ledger-locally).

But when I try to deploy `icrc1_ledger_canister` locally, it get asked to provide a token symbol, whereas I don’t want to create a token, only make ICP recurring payments…

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/2/2/22c5d052a9d39740b65710318a430318f3ff3d66.png)

What am I missing here?

Also:

- Do I need to locally deploy the `icp_ledger_canister` as well?
- When I deploy my app in production, I won’t need those canisters, right? (as they already exist on the IC ? but then do I need to provide their id?)

Any information welcome 😃

Cheers!

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [May 28, 2024, 3:55pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/2 "2024-05-28T15:55:58Z")

</div>

To confirm, you only want to make reoccurring payments of ICP, not launch your own token on ICP (or make reoccurring payments of your own token on ICP)?

---

<div class="post-metadata">

**Author:** ![marcpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marcpp/32/14921_2.png) [@marcpp](https://forum.dfinity.org/u/marcpp)\
**Post date:** [May 28, 2024, 4:07pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/3 "2024-05-28T16:07:04Z")

</div>

Exactly! Only ICP, no new token.

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [May 28, 2024, 6:06pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/4 "2024-05-28T18:06:54Z")

</div>

Got it, what programming language are you using? I can send good examples on how to implement.

Yes, you will not need to deploy a new ICRC-1 canister with the ICRC-2 extensions.

---

<div class="post-metadata">

**Author:** ![asjn3e](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/asjn3e/32/22792_2.png) [@asjn3e](https://forum.dfinity.org/u/asjn3e)\
**Post date:** [May 28, 2024, 6:39pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/5 "2024-05-28T18:39:01Z")

</div>

You got it right, On the Mainnet, all of those token canisters are deployed and there is no need to redeploy any token canister(in your case ICP icrc2 canister). You can simply provide the icp canister id which is “ryjl3-tyaaa-aaaaa-aaaba-cai” and start making calls to it.  
But on your local environment since those token canisters are not deployed(They don’t exist in your PC), you have to deploy your token casniter.  
If you dont want to deploy a token locally or it’s complicated, you can also test your app on Mainnet without paying any cycles for canister deployment, simply by using playground environment which allows you to deploy a temporary canister for only 20 minutes to the main net IC.

---

<div class="post-metadata">

**Author:** ![marcpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marcpp/32/14921_2.png) [@marcpp](https://forum.dfinity.org/u/marcpp)\
**Post date:** [May 28, 2024, 7:00pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/6 "2024-05-28T19:00:03Z")

</div>

I’m using Motoko. Thanks a lot 🙏

---

<div class="post-metadata">

**Author:** ![marcpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marcpp/32/14921_2.png) [@marcpp](https://forum.dfinity.org/u/marcpp)\
**Post date:** [May 28, 2024, 7:15pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/7 "2024-05-28T19:15:52Z")

</div>

> [@asjn3e](#):
>
> You can simply provide the icp canister id

So does that mean the [ICRC2 methods](https://github.com/dfinity/ICRC-1/tree/main/standards/ICRC-2) are available on that canister?

> [@asjn3e](#):
>
> If you dont want to deploy a token locally or it’s complicated, you can also test your app on Mainnet without paying any cycles for canister deployment, simply by using playground environment which allows you to deploy a temporary canister for only 20 minutes to the main net IC.

Ah, I didn’t know that, thanks! I’ll definitely try it.

Do you know about any documentation on how to answer those questions?

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/e/1/e104cd366b53d58251be25a466e021b8b7f9bb6d.png)  
I guess I should be using values found in this command…

```auto
dfx deploy --specified-id ryjl3-tyaaa-aaaaa-aaaba-cai icp_ledger_canister --argument "
  (variant {
    Init = record {
      minting_account = \"$MINTER_ACCOUNT_ID\";
      initial_values = vec {
        record {
          \"$DEFAULT_ACCOUNT_ID\";
          record {
            e8s = 10_000_000_000 : nat64;
          };
        };
      };
      send_whitelist = vec {};
      transfer_fee = opt record {
        e8s = 10_000 : nat64;
      };
      token_symbol = opt \"LICP\";
      token_name = opt \"Local ICP\";
    }
  })
"

```

…or maybe using this command will automatically add the canister to my dfx.json file?

---

<div class="post-metadata">

**Author:** ![asjn3e](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/asjn3e/32/22792_2.png) [@asjn3e](https://forum.dfinity.org/u/asjn3e)\
**Post date:** [May 28, 2024, 7:24pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/8 "2024-05-28T19:24:59Z")

</div>

> So does that mean the [ICRC2 methods](https://github.com/dfinity/ICRC-1/tree/main/standards/ICRC-2) are available on that canister?

Yes, all the ICRC1 as well as ICRC2 methods are available on ICP token canister.

---

<div class="post-metadata">

**Author:** ![asjn3e](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/asjn3e/32/22792_2.png) [@asjn3e](https://forum.dfinity.org/u/asjn3e)\
**Post date:** [May 28, 2024, 7:29pm UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/9 "2024-05-28T19:29:42Z")

</div>

So by running the command you’ve shared, it will create a token canister on your local machine with the canister id “ryjl3-tyaaa-aaaaa-aaaba-cai”, which is the same canister id as ICP on main net IC.  
If that is your intention is to simulate ICP token on your local machine you can run the same command that you’ve shared.  
As soon as you run that command, you will have a token on your local network called LICP(local ICP) with “ryjl3-tyaaa-aaaaa-aaaba-cai” as ID, and you can use this token for testing purposes.  
Having said that, all the ICRC1 and 2 methods will be included in that.

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [May 30, 2024, 4:43am UTC](https://forum.dfinity.org/t/using-icrc-2-how-to/31263/10 "2024-05-30T04:43:56Z")

</div>

Hello @marcpp,

You should connect with @appic on their DCA solution. Here is their [code base](https://github.com/Appic-Solutions/Auto_Investment/blob/main/AppicRoot/src/Appic_root/main.mo).

@asjn3e is a core developer and seems to have walked through some of the code!
