Tezos Token Standards Simply Explained

What is a token standard? How do FA 1.2 and FA 2.0 work and differ?

Adam Shinder
Tezos Israel

--

Tezos, like many other Layer 1 blockchains such as Ethereum or Binance Smart Chain, has its own token standards. A token standard is exactly what it sounds like, a standard set of instructions that a token must follow to be compatible with wallets, decentralized finance applications, and essentially all facets of a blockchain. The most prevalent and widespread token standard is Ethereum’s ERC-20 which is used for fungible tokens on Ethereum. This means that two tokens minted from the same originating contract are interchangeable (fungible) with one another. Other token standards like ERC-721 or ERC-1155 are often used for non-fungible tokens, aka NFTs. This means that each token is unique and unlike the token minted before or after it. ERC-20 is the standard for Ethereum based tokens that have simple, intrinsic functionality such as store of value and easy transaction capabilities, but each application and company can utilize them in different ways. Famous examples of ERC-20 tokens include LINK (Chainlink), USDT (Tether), SHIB (Shiba Inu), OMG (OmiseGo), MKR (Maker) and BAT (Basic Attention Token).

A token standard is a crucial feature of any layer one that wishes to gain developer traction. When developers build dApp’s, they want, and need, the ability to mint and utilize tokens easily and securely. Without a standard, each developer would attach different data with different called entry points and functions. It would get messy, fast. Unified compatibility is achieved through these token standards. Additionally, having these standards allows tokens to be minted faster, and the process is much more direct.

In addition to the benefits listed above, the smart contract that mints and stores these tokens must be secure because this smart contract acts as a ledger for the token and records the balances of a given token associated with a given wallet. For example, I have 100 hDAO tokens in my wallet because the originating smart contract has my public address stored with an association to my 100 hDAO tokens. If a token is using a non-standard token smart contract to mint and record those token transactions, then there are potential vulnerabilities. Potentially, tokens can be “siphoned” out of wallets by changing the number of tokens listed to my wallet on the contract. For this reason, token standards are needed to further ensure the security of the tokens.

What information goes into a token in these standards?

The ERC-20 standard that was mentioned before stores the following data:

For an ERC-721 or ERC-1155, the token data will contain an identifier (ID) for each token as each one minted is unique, in addition to slight variations.

Tezos Standards

Now that we understand token standards, why they are needed and the sort of information that it contains, let’s go over some standards built for Tezos based tokens. We’ll be going over the FA2 standard for single and multi-asset fungible or non-fungible tokens, and the FA1.2 standard for fungible tokens. FA stands for financial applications. You will notice that the standards have a “TZIP” next to them, which is the proposal number that introduced that standard. TZIP stands for Tezos Improvement Process, and as explained in the Gitlab, “A TZIP is a design document providing information to the Tezos community, describing a feature for Tezos, interoperability standards, or an update to its processes or environment. The TZIP process complements (but is subsidiary to) Tezos’ formal on-chain governance process”.

NOTES:

  • Optional means that the rule isn’t required to be functional, but it is added the majority of the time.
  • The lists below also include entry points that can be called which are distinguishable by the word “returns”.
  • This is for a beginning understanding, and the syntax of the function names aren’t always how it should be called in development. Please refer to the developer documentation and resources when developing tokens.
  • There are additional functionalities to these token standards, but these are the general, standard overviews. For example, you could have a FA 1.2 token with metadata, but it wouldn’t be an NFT because it is not indexed.

FA 1.2 — Fungible Assets (Proposed in TZIP-7)

The FA 1.2 standard is the first token standard on Tezos. It is the fungible token standard that is very similar to the ERC-20 Ethereum standard.

The rules/functions of FA 1.2 are as follows:

As you can tell from comparing FA 1.2 to ERC-20, the main difference is that the transferFrom function of ERC20 has merged with transfer on FA 1.2. Additionally, there are some implementation differences, but generally, the Tezos fungible token standard is quite routine.

FA 1.2 only supports single-assets, while metadata and storage isn’t specified in the standard and batch transfers aren’t supported. FA 2.0 solves these problems and more. Some examples of FA 1.2 tokens are tzBTC and USDtz.

To learn more about how to interact with and deploy FA 1.2 contracts and tokens, here’s a few helpful resources.

FA 1.2 Token Tutorial

FA 1.2 Ligo and Taquito Tutorial, OpenTezos

FA 2.0 — Non-Fungible Assets and more (Proposed in TZIP-12)

FA 2.0 tokens are often used for non-fungible tokens, but they have a wide range of usability, including fungible tokens. Sticking with the Ethereum standards comparisons, FA 2.0 is an umbrella standard that can support ERC-20 or ERC-721 while also being able to support ERC-1155 token types. A single FA 2.0 contract can also support hybrid implementations and multi-assets support, where multiple token types can co-exist. For example, in a fractionalized NFT contract or with some of the token supply being non-transferable. Additionally, the FA 2.0 standard specifies metadata (which was proposed in TZIP-16) and contracts have the capacity to support batch transfers or atomic swaps. A good example of FA 2.0 tokens are NFTs minted on HicEtNunc or other Tezos based NFT marketplaces. Bender Labs wrapped tokens like wLINK and wAAVE are also FA 2.0.

The rules/functions of FA 2.0 are as follows:

To learn more about how to interact with FA 2.0 contracts and tokens, here’s a few helpful resources.

tzNFT Tutorial

Deploy Your Own FA2 Token Easily

FA2 Permissions, Entry Points and Data Structure

TZIP-17, FA2 Dev Resource

General Token Standard Resources:

Madfish, Do we need a new Tezos token standard?

TQ Tezos, Token Standards

Open Tezos, Token Standards

To mint and interact with tokens as an intermediate+ Tezos developer, check out OpenMinter.

Thank you so much for learning with us at Tezos Israel! Feel free to message me with any questions on Twitter at @adshinder. Follow Tezos Israel on Twitter to keep up with what we’re building and how we are advancing the Tezos ecosystem!

--

--