Tezos (Part 5): Token Standards

Protofire.io
Protofire Blog
Published in
6 min readApr 10, 2020

Overviewing pros and cons, this blog post explores existing standards in Tezos and compares them to Ethereum’s ERC-20 in terms of supported token types and implementations, security, etc.

Getting started | Part 1 | Part 2 | Part 3 | Part 4 | Part 5

What are token standards?

Blockchains make use of digital tokens, which can be bought, sold, or exchanged, representing all kinds of digital assets. The functionality and wallet compatibility of a digital token is defined by a standard. Understanding the difference between the token standards can help you to decide which option is a better fit for your blockchain project.

Token standards facilitate tokenization of applications in a blockchain. Tokenizing assets is one of the main value propositions of the Ethereum blockchain. Smart contracts need crypto tokens to function. Gas, paid in the form of ETH tokens, fuels transactions on the Ethereum network.

ERC-20 has become one the most prominent standards used for almost all smart contracts on Ethereum for token implementation. The ERC-20 standard enables developers to create tokens in a simpler and quicker way, as well as provides better integration with wallets and exchanges. What about standards and tokens in Tezos?

This blog post explores existing token standards in Tezos, their evolution, pros, and cons. The article also compares Tezos standards with ERC-20 across such parameters as supported token types and implementations, resistance to common attack scenarios, etc.

Token standards in Tezos

In Tezos, token standards are written in the Tezos Interoperability Proposal (TZIP) format. To better understand the current state of token standards in Tezos, we are going to look at the evolution of the following three proposals:.

Henceforward, we will call each proposal by its Financial Application (FA) number.

FA1 (Abstract Ledger)

On March 12, 2019, FA1 (Abstract Ledger) was created from the need for a minimal abstract ledger that can be used as a component in applications, which required some notion of a fungible asset. Initially, this proposal did not have a defined interface.

FA1 provides a couple of improvements for Tezos:

  • satisfies the need for minimal abstraction
  • associates identities with balances

However, FA1 also has some limitations:

  • intentionally lacks certain characteristics (e.g., decimals, symbols, names, fallback addresses, and monetary supply management) often desired when implementing a contract
  • doesn’t specify how other contracts with user funds should operate
  • doesn’t provide any specific mechanism for contracts to record incoming transactions

Smart contracts in FA1 should have the entry points shown below.

FA1.2 (Approvable Ledger)

On June 20, 2019, FA1.2 (Approvable Ledger), a new standard, was created to enable interactions with the smart contract. FA1.2 implements token transfer operations and approvals for spending tokens from other accounts. It was a closer version of the ERC-20 as a usable specification in the Tezos ecosystem.

FA1.2 provides the following advantages:

  • associates identities with balances
  • implements token transfer operations
  • implements approvals to spend tokens from other accounts

FA1.2 is resistant to the ERC-20 attack vector vulnerability.

Smart contracts in FA1.2 should have the entry points shown below.

FA2 (Multi-Asset Interface)

On January 24, 2020, FA2 (Multi-Asset Interface) was created to prevent Tezos developers from being dependent on standards specific to token types. Specifically, FA2 proposes a unified token contract interface, which supports a higher range of token types and implementations.

FA2 is independent of the token type and supports both single- and multi-token contracts via a single standard. All entry points work with batch operations, allowing multiple transfers of different tokens and/or token types to be executed in a single atomic transaction. This standard requires developers to handle common considerations, such as defining the contract’s token type (e.g., non-fungible vs. fungible vs. semi-fungible), administration and whitelisting, contract upgradability, and supply operations (e.g., mint/burn).

FA2 provides the following benefits:

  • offers a standard for a unified token contract interface
  • supports a wide range of token types and implementations
  • provides token transfer semantics
  • supports various transfer permission policies
  • resistant to the ERC-20 attack vector vulnerability

Smart contracts in FA2 should have the entry points shown below.

FA2 supports multiple standards, such as ERC-20, ERC-721, ERC-1155, but ERC-20 (fungible tokens) and ERC-721 (non-fungible tokens) are the most commonly used.

Comparing ERC-20 and Tezos standards

To better understand the similarities and differences of ERC-20 and the standards available in Tezos, the following table provides a summary of details discussed previously.

All Tezos Interoperability Proposals (TZIPs) can be found in the TZIP GitLab repo. For a comparison of standards in Ethereum, documents are available in the official documentation.

Additional details about the FA2 standard can be found in the TQ Tezos blog.

Further reading

About the authors

Mariano Agüero is a talented full-stack Ethereum DApp developer with 15+ years of experience in software development. He has coding skills in different languages and knowledge of various front- and back-end technologies. Mariano is capable of writing easy-to-digest syntax blocks and possesses great problem-solving skills. He has an in-depth understanding of distributed systems, such as blockchain, and hands-on experience in architecting and developing smart contracts.

Nicolás Dominguez is a Senior Software Engineer at Protofire. With 9+ years in IT, he is now focusing on blockchain-based development with a special interest in applying GraphQL to build production-grade DApps. Nicolás has experience as a full-stack JavaScript developer with a profound knowledge of React and Node.js. He is also enthusiastic about machine learning.

Cristian Malfesi is a Senior Project Manager of Blockchain at Protofire. He has extensive experience in building DApps, working with databases, enabling cloud services, etc. Cristian has worked in different positions as a full stack developer, software architect, server administrator, DevOps expert, and product owner. He likes new challenges and is always searching for continuous self-improvement.

--

--

Protofire.io
Protofire Blog

We help token-based startups with protocol & smart contract engineering, high-performance trusted data feeds (oracles), and awesome developer tools (SDKs/APIs).