Upgrading old ICRC1 token to the ICRC ledger suite

Is it safe to upgrade an older ICRC1 ledger WASM to the modern ICRC ledger suite?
Goal: Change name and add logo image to ICRC1 metadata

We are trying to update the token logo and description. The plan was to simply modify metadata without changing the WASM by using dfx with UpgradeArgs and --upgrade-unchanged

To do this, we need to provide the currently installed WASM.
ICPSwap informed us that this is the WASM used to deploy CLOUD token.
https://download.dfinity.systems/ic/f89cf257a4e88a5e2f6f29ab50ad4a49b0cb514d/canisters/ic-icrc1-ledger.wasm.gz

Hash: 75178691fce3ed6181ca2a4bf17f26c0ca12a88fda2c7a8eb867ae5281a4d1fd

But the hash of this WASM does not match the CLOUD ledger canister module hash. Hence, we are a bit in the unknown when it comes to the current version, although can guess depending on the time.

According to the canister upgrade history, CLOUD was created on June 10, 2023.

The CLOUD ICRC1 token was deployed with and currently runs WASM hash:

8ddd17ccaab8bd6adf337acb38f89b0db6db3c976f5768bb9a7ced5cef7bd481

We looked at many hashes of ic-icrc1-ledger.wasm releases from before CLOUD token was created, but did not find a match.

Given we don’t have the exact WASM, we believe it is necessary to upgrade the WASM to achieve our goal.

Internet Computer Docs regarding ICRC1 tokens used to say to use WASM based on the commit version of IC

For example: f89cf257a4e88a5e2f6f29ab50ad4a49b0cb514d https://download.dfinity.systems/ic/f89cf257a4e88a5e2f6f29ab50ad4a49b0cb514d/canisters/ic-icrc1-ledger.wasm.gz

Now the docs say to use the latest ICRC ledger suite release.

So long as we are upgrading the WASM, it seems best practice would be to upgrade to the latest icrc1-suite-ledger release.

There are currently 3 icrc-ledger-suite releases.

These releases must be installed oldest to newest.

We performed these upgrades locally in a development environment and it seemed successful.
But would like clarification and assurance that our approach is correct.

Code and instructions available here:

Helpful resource:

Viewed the canister history by using this playground

2 Likes

I’m not 100% sure, but last time I checked there were no changes to the ICRC ledger that were not backwards compatible. Therefore I would assume that it is safe to just use the latest wasm directly

4 Likes

Hi everyone,

I’m looking for some help with updating a token I deployed on the Internet Computer.

Context:

  • I have the seed phrase for a wallet created using PlugWallet.
  • I used this wallet with the ICP Swap platform to deploy an ICRC token.
  • Now I want to update the token’s metadata – specifically, to add a logo – without affecting token balances or data.

What I need to do:

  • Somehow connect or convert my PlugWallet identity to a DFX developer identity, so I can upgrade the canister using the DFX CLI.
  • Safely redeploy or upgrade the token canister, keeping all the current data and state intact.

Questions:

  1. Is there a way to import a PlugWallet (seed phrase or identity) into DFX?
  2. What’s the safest way to upgrade the ICRC token canister to update metadata without losing state?
  3. Has anyone done this after using ICP Swap to deploy a token?

Any help, tools, or tips would be appreciated!

Module Hash:

c393527a9068184267e1f845188bae58b13e0140b119c36145a0eff2cf9610bd

Thanks in advance :folded_hands:

I’ve never tried it, but you should be able to do the following according to the docs:

dfx identity import --seed-file path/to/file-with-seed-phrase.txt

Both DFX and Plug use the same key algorithm and derivation path, so it should result in the same principal.

You can verify this with:
dfx identity get-principal

Regarding question #2, have a look here. If you’re looking to only change the metadata, an option would be to upgrade to the same wasm module as the canister is currently running, but you would need to figure out which wasm/git commit the module hash you posted corresponds to. My quick search didn’t turn up any hits other than this thread, but the forum post linked above has some other pointers that could help figuring it out.

1 Like

I tried to import the Plug wallet seed phrase, but it failed with the following error:
“Failed to create mnemonic from phrase: invalid word in phrase.”

The Plug wallet seed phrase contains 12 words.

Just gave it a try on my end, created a new Plug wallet, which resulted in the following seed phrase:

brain pluck volume actress domain evolve trade focus wheat brave helmet dismiss

Stored this in a txt file and then imported it:

dfx identity import plug-identity --seed-file phrase.txt

Then after confirming by entering my mac OS keychain password, I can switch to it and indeed see the same principal as seen in Plug:

dfx identity use plug-identity
dfx identity get-principal # muw7v-dvooi-6op3z-7niox-mk4gg-widqt-skakg-5g6as-bpvz4-ppmmb-uqe

Are you sure the file has exactly one space between each word and no leading or trailing spaces? Are you sure all words are in lower case? Are you sure all words are correctly spelled?

There are only 2048 different words in a seed phrase, you can find all possible words and their spelling here: BIP 39 Wordlist – Blockplate

1 Like

All good now — just a typo with the seed phrase. Once I entered the correct one, the identity loaded fine. Now onto the harder part: checking the installed ledger version, updating the metadata, and especially adding the token logo.

Hey Mathias,

Thanks again for the guidance earlier — much appreciated.

We’ve tracked down the exact WASM version our token ledger is running:

IC_VERSION=2e3589427cd9648d4edaebc1b96b5daf8fdd94d8

And here’s the canister we’re working with:

wqihv-qyaaa-aaaak-afjoa-cai

Token: WindogeXP (XP)
Links: X | Site

Our main goal is to update the token metadata, especially to add the token logo, without changing the actual logic. From what you mentioned, it sounds like we can upgrade using the same WASM module version to make these changes.

We’d love some help figuring out the best way to test this full process safely - ideally end-to-end - before we apply the changes on the live canister.

If there’s a recommended flow or best practices for testing metadata upgrades like this, we’d be grateful for any pointers.

Thanks again for all the support!

Finally I’ve found and test the dfx command I need to use to update the metadata only.

However, I’m currently stuck trying to find the correct Ledger WASM module.

Can someone help?

Ledger Canister ID: wqihv-qyaaa-aaaak-afjoa-cai