Cycles Token (XTC) Update: Token Standard Changes

We’re migrating to the DIP20 standard to better align XTC with the DeFi ecosystem of the Internet Computer, using a known and familiar interface to future proof the token for new use cases!

Dank
Dank
4 min readOct 8, 2021

--

It’s time for another update to the Cycles Token (XTC) canister! Today we’re doing a level up to the Cycles Token (XTC) by migrating to a new Token Standard Interface, DIP20.

This new standard follows an ERC20-format for fungible tokens (but on the IC), and is a conjoint effort with other DeFi projects (e.g. DFinance) in better aligning standards, to make sure new DeFi projects on the IC can interoperate, swap, and have assets interact smoothly; and welcome new developers to the IC with a familiar interface.

Is this update breaking? No. We will maintain the previous standard methods during a deprecation period to allow everyone to migrate over. Read more below.

DIP20 Standard — Compatibility Update 🤝

Over the past few weeks, the team has been working closely with DFinance to align our efforts in a fungible token standard interface for the Internet Computer. This standard is called DIP20.

Our goal with this standard is to use a familiar and battle-tested interface (ERC-20 standard) so that new developers coming to the IC are familiar with the interfaces: as well as supercharge the ability for the IC Ecosystem to build DeFi applications with tokens that can easily interoperate.

There are also other tokens standards on the ecosystem that are already following ERC20’s example, which sets the ground well for DIP20 to coexist and interoperate with them.

The DIP20 Standard

DIP20 mimics the same functionalities of ERC20, but on the Internet Computer, and maintains the interface structure the same so that DeFi devs from other chains can jump onto the Internet Computer, and build & work with an interface they already know.

In contrast to XTC’s previous standard, this new standard brings a couple of new features common to ERC20….

Like Allowances! Where users can set an address to have an allowance, meaning a number of tokens which that address (the spender) can withdraw from the user’s balance (the owner).

As well as the TransferFrom method, which allows transfers on behalf of other identities/users.

These methods are essential for more intricate DeFi/Smart Contract use-cases where services can perform automatic and recurrent operations.

📜 The one difference: Events/Archive

One difference to its Ethereum counterpart, however, is that the Internet Computer doesn’t have events — the native Ethereum service that allows tokens to have transaction history.

As a result, we have built getTransaction & getTransactions, two methods that allow you to get a subset of the transaction history, directly into the token standard.

Additionally, we included some updates that focus on the ease of use of the standard. Among these are improvements to error handling, and an optional interface to give the developer the choice of additional methods that build on top of the token’s basic interface.

For a more in depth look at the token standard, you can visit the standard’s Github repo and/or our Cycles Token docs.

How does this Change XTC? 🤔

Many of the methods added from DIP20 have the exact same functionality as the previous XTC standard, and we have maintained the mint, burn, and canister development methods as extensions of this new interface.

If you take a look under the hood of XTC, or at our documentation, you’ll see that we have exposed all-new DIP20 methods, but kept the previous ones visible as a deprecated option.

What About the Old Methods? 👴

The old standard’s methods are considered deprecated, but will be available for some months as a temporary measure so that we don’t break any of the awesome applications that currently implement Cycles Token! 💗

We strongly encourage anyone making calls to the XTC canister to migrate to the new API methods as they will be the de-facto from now on.

We will share more details and notify you about the depreciation period soon. But, to start, we can say that the Dank team will update XTC’s API on this schedule:

  1. Temporary methods will be added to mimic the DIP20 standard, while the existing methods/interface stays in place but will be marked as deprecated (current status)
  2. The DIP20 final version methods will be added, the temporary mimic methods will be marked as deprecated, and the current methods will be removed.
  3. The temporary mimic methods will be removed, and the final DIP20 standard methods will be the only methods left.

If you have any questions or need assistance moving your application to use Cycles Token’s new API, hop in our discord, we’re always happy to help 🤙

Wrapping It Up 👋

Well, that’s all from us today. DeFi’s Pandora’s box is just around the corner from opening on the IC and we are doing our best to prepare!

If you have any questions regarding this update or need some help building awesome new things using Cycles Token (XTC), you can find us on our Discord or ping us on Twitter!

--

--

Dank
Dank

Open Internet Service on DFINITY’s Internet Computer.