This is a read note of Mastering Ethereum Ch10: Tokens. Tokens are blockchain-based abstractions that can be owned and that represent assets, currency, or access rights. Blockchain tokens serve multiple purposes globally and can be traded for each other or for other currencies on global liquid markets.

1 Introduction

Tokens have many uses such as currency, resource (CPU, disk), asset (car, oil, real estate), access, equity (shareholder equity in a digital organization or legal entity), voting, collectible, identity (avatar or national ID), attestation (certification or attestation of fact), utility (pay for a service).

Tokens are fungible when we can substitute any single unit of the token for another without any difference in its value or function. Non-fungible tokens (NFT) are tokens that each represent a unique tangible or intangible item and therefore are not interchangeable. Each non-fungible token is associated with a unique identifier, such as a serial number.

Counterparty risk is the risk that the other party in a transaction will fail to meet their obligations. Some tokens represent digital items that are intrinsic to the blockchain. Those digital assets are governed by consensus rules, just like the tokens themselves. This has an important implication: tokens that represent intrinsic assets do not carry additional counterparty risk. Conversely, many tokens are used to represent extrinsic things, such as real estate, corporate voting shares, trademarks, and gold bars. The ownership of these items, which are not “within” the blockchain, is governed by law, custom, and policy, separate from the consensus rules that govern the token. These extrinsic assets carry additional counterparty risk because they are held by custodians, recorded in external registries, or controlled by laws and policies outside the blockchain environment. One of the most important ramifications of blockchain-based tokens is the ability to convert extrinsic assets into intrinsic assets and thereby remove counterparty risk. A good example is moving from equity in a corporation (extrinsic) to an equity or voting token in a DAO or similar (intrinsic) organization.

2 Using Tokens: Utility or Equity

In principle, the use of tokens can be seen as the ultimate management or organization tool. In practice, the integration of blockchain platforms, including Ethereum, into the existing structures of society means that, so far, there are many limitations to their applicability. The majority of projects are using tokens in one of two ways: either as “utility tokens” or as “equity tokens”. Very often, those two roles are conflated.

3 Tokens on Ethereum

Tokens are different from ether because the Ethereum protocol does not know anything about them. Sending ether is an intrinsic action of the Ethereum platform, but sending or even owning tokens is not. The ether balance of Ethereum accounts is handled at the protocol level, whereas the token balance of Ethereum accounts is handled at the smart contract level.

Ethereum Request for Comments 20 (ERC20) defines the first token standard. It became EIP-20 but still referred by ERC20. ERC20 is a standard for fungible tokens, meaning that different units of an ERC20 token are interchangeable and have no unique properties. The ERC20 standard defines a common interface for contracts implementing a token, such that any compatible token can be accessed and used in the same way.

ERC20 allows for two different workflows. The first is a single-transaction, straightforward workflow using the transfer function. This workflow is the one used by wallets to send tokens to other wallets. The vast majority of token transactions happen with the transfer workflow. The second workflow is a two-transaction workflow that uses approve followed by transferFrom. This workflow allows a token owner to delegate their control to another address. It is most often used to delegate control to a contract for distribution of tokens, but it can also be used by exchanges.

The ERC223, ERC777 proposals attempt to solve the problems of ERC20.

The ERC721 proposal is a standard for non-fungible tokens, also known as deeds. Non-fungible tokens track ownership of a unique thing. The ERC721 standard places no limitation or expectation on the nature of the thing whose ownership is tracked by a deed and requires only that it can be uniquely identified, which in the case of this standard is achieved by a 256-bit identifier (deed ID). ERC721 tracks each deed ID and who owns it, with the deed ID being the primary key of the mapping.

4 Using Token Standards

Token standards are the minimum specifications for an implementation. The primary purpose of these standards is to encourage interoperability between contracts. The standards are meant to be descriptive, rather than prescriptive.