# Prebuilt ICRC wasm or write my own implementation for a token

**URL:** <https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231>\
**Category:** Developers\
**Created:** [May 28, 2025, 2:08pm UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231 "2025-05-28T14:08:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BustyBeardo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bustybeardo/32/16506_2.png) [@BustyBeardo](https://forum.dfinity.org/u/BustyBeardo)\
**Post date:** [May 28, 2025, 2:08pm UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231/1 "2025-05-28T14:08:57Z")

</div>

Hey everyone,

I’m in the process of launching a token on the Internet Computer using the ICRC ledger, and I’m facing an important architectural decision:

Should I use a **prebuilt WASM** for the ICRC token standard, or should I go with a **custom implementation**?

Here’s the context:  
I want the token to be **flexible and upgradeable in the future** , especially with potential upgrades to newer ICRC standards like ICRC-4, ICRC-5, etc. My thinking is that having my **own implementation** might make this easier, especially if I want to introduce additional features over time.

For example, I’m considering:

- Rewarding early adopters with free tokens
- Implementing an XP system where users earn XP and receive monthly token distributions based on their XP
- Potentially more gamified or community-driven mechanics later on

I’m not sure how much **flexibility the prebuilt WASM** actually offers.

- Can you extend or customize it before launch?
- Is it possible to integrate custom logic like XP-based distributions with the prebuilt contract?
- Or would it be better to fork the code and build in what I need from the start?

Am I overthinking this, or is going custom the right move if I care about long-term adaptability and unique token logic?

Would love to hear from those who’ve worked with the ICRC standards or launched similar projects!

Also if anyone has links to rust code that implement up-to icrc 3 that would be great. (Obvs dfinity one exists but is a little confusing since it is all separated and doesn’t feel complete)

Thanks 🙏

---

<div class="post-metadata">

**Author:** ![baolongt](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@baolongt](https://forum.dfinity.org/u/baolongt)\
**Post date:** [May 28, 2025, 3:01pm UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231/2 "2025-05-28T15:01:03Z")

</div>

If I were you, I will create a new canister for distribute token instead modify this complex [repo](https://github.com/dfinity/ic/tree/master/rs/ledger_suite/icrc1/ledger)

you can see in this [candid](https://github.com/dfinity/ic/blob/master/rs/ledger_suite/icrc1/ledger/ledger.did), it included icrc 1, 2, 3. Enough to be used by dapp

If you need future upgrade, why not create a new ledger and airdrop 1:1 to user

---

<div class="post-metadata">

**Author:** ![marc0olo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marc0olo/32/17290_2.png) [@marc0olo](https://forum.dfinity.org/u/marc0olo)\
**Post date:** [May 28, 2025, 3:25pm UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231/3 "2025-05-28T15:25:35Z")

</div>

> [@BustyBeardo](#):
>
> Should I use a **prebuilt WASM** for the ICRC token standard, or should I go with a **custom implementation**?

I would recommend to use the prebuilt WASM. this is the one which is actively maintained by DFINITY and getting regular updates (e.g. support for ICRC-103 has been implemented in the [latest release](https://github.com/dfinity/ic/releases/tag/ledger-suite-icrc-2025-05-22), announcement on this is pending).

as long as you are the controller of the canister, you can always upgrade and add other features later on if needed. and in case you are using the a pre-built reference implementation, the chance for getting help is probably higher than if you implemented the core functionality on your own.

I also want to highlight the importance of implementing ICRC-3 along with ICRC-1 and ICRC-2. if ICRC-3 is not implemented, the tx history of a ledger is not visible (at least not in a standardized way). this means that an index canister or the Rosetta API won’t be able to index ledger data.

> [@BustyBeardo](#):
>
> I’m not sure how much **flexibility the prebuilt WASM** actually offers.
> 
> - Can you extend or customize it before launch?

what exactly do you mean with extending / customizing? there are some configuration options you will have on deployment. but if you need custom logic on the ledger itself which is not part of the reference implementation, this requires code changes / additions and will result in a different WASM for deployment.

> [@BustyBeardo](#):
>
> - Is it possible to integrate custom logic like XP-based distributions with the prebuilt contract?

yes, actually the `minting_account` defined in ICRC-1 is a separate account which can also be a canister which implements any kind of custom logic.

> [@BustyBeardo](#):
>
> - Or would it be better to fork the code and build in what I need from the start?

I don’t think so, it depends on specific requirements though. if it is just about having custom minting logic / token distribution, this can be implemented on a separate canister.

> [@baolongt](#):
>
> If you need future upgrade, why not create a new ledger and airdrop 1:1 to user

migrating to a completely new ledger for whatever reason is also an option.

there does not yet exist a best practice how to perform such a migration though.

---

<div class="post-metadata">

**Author:** ![BustyBeardo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bustybeardo/32/16506_2.png) [@BustyBeardo](https://forum.dfinity.org/u/BustyBeardo)\
**Post date:** [May 28, 2025, 4:05pm UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231/4 "2025-05-28T16:05:56Z")

</div>

So if I use the WASM which is actively maintained by DFINITY I could redeploy over the current ICRC-3 version with any new updates and fixes provided without having to do any migrations etc?

But I wouldn’t later be able to upgrade to ICRC-4/5 without doing migrations?

Also, if I set up a canister that could distribute tokens automatically as rewards for XP for example could I also make that canister a minting account or can you only have one minting account. How would that work?

---

<div class="post-metadata">

**Author:** ![marc0olo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marc0olo/32/17290_2.png) [@marc0olo](https://forum.dfinity.org/u/marc0olo)\
**Post date:** [May 28, 2025, 4:36pm UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231/5 "2025-05-28T16:36:42Z")

</div>

> [@BustyBeardo](#):
>
> So if I use the WASM which is actively maintained by DFINITY I could redeploy over the current ICRC-3 version with any new updates and fixes provided without having to do any migrations etc?
> 
> But I wouldn’t later be able to upgrade to ICRC-4/5 without doing migrations?

in general, unless you remove the controllers to blackhole the canisters (which is not recommended right now), you will be able to perform any kind of upgrade to the ledger.

however, upgrades to add new functionality or to modify/add new data structures should ALWAYS be well tested.

in such cases it might be helpful being able to pause/unpause the ledger which will be possible in the future once [ICRC-124](https://github.com/dfinity/ICRC/pull/135) is implemented.

in general, the term “migration” be applied for two different scenarios:

1. migrate to a new ledger version (code upgrade for the canister)
2. migrate all balances (and possibly the history) to another (new) canister with the new implementation

when speaking about the missing best practices, I was referring to the second scenario.

so bottom line:

- upgrades are always possible as long as you are the controller, but you should know how to do it and test it accordingly.
- migrations are mainly needed if data structures are modified/added

> [@BustyBeardo](#):
>
> Also, if I set up a canister that could distribute tokens automatically as rewards for XP for example could I also make that canister a minting account or can you only have one minting account. How would that work?

an ICRC-1 ledger only defines 1 minting account and that must be set to the canister that implements that logic, yes.

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [May 30, 2025, 11:51am UTC](https://forum.dfinity.org/t/prebuilt-icrc-wasm-or-write-my-own-implementation-for-a-token/49231/6 "2025-05-30T11:51:05Z")

</div>

I’m happy to support you in using Pan Industrial’s suite of ledger code. We have event hooks and interceptors that make doing custom token behaviors much easier to implement than with Dfinity’s ledger.

> **[Mops • Motoko Package Manager](https://mops.one/icrc-fungible)**

I haven’t implemented icrc 103 or 124 yet but they are on the list and I can bump them up if someone needs them urgently. They will be drop in once I have them.

Last I check it wa also compatible with dfinity’s index canister and Rosetta, but I likely need to check that with the new releases(I’m actually it sure how Rosetta is going to handle 124 🫤.

So if you want motoko and custom features with just a couple lines of code it is a good option.
