What is a Token Smart Contract?

What is a Token Smart Contract?

A token smart contract is a program running in a shared and trust-minimized environment that maintains a ledger on a particular or a category of assets. 

A token smart contract is a specific type of smart contract. It shares general principles with other smart contracts, such as being defined by code, while presenting distinctive characteristics and a foundational role. For clarity, this discussion will focus on smart contracts on public blockchains, such as Ethereum, though the definition may apply to a broader range of contexts.

The Components of Token Smart Contracts

A token smart contract is comprised of four elements:

  • A ledger representing the ownership of assets.
  • Internal logic that ensures the integrity of this ledger.
  • An interface allowing the usage of this token.
  • Static data defining the related financial asset.
Sructure of a Token Smart Contract: ledger, internal logic, interface and static data
The full structure of a token smart contract

Ledger

The ledger is the central element of a token smart contract. It represents assets and their ownership. While public blockchains are commonly perceived as maintaining a ledger, token smart contracts manage a section of the ledger dedicated to a particular asset. 

In token smart contracts representing fungible units, the ledger's data structure associates the identifier of the owner with a number of units. The identifier can be the hash of the user’s public key, providing a pseudonymous identification mechanism. 

This association reflects the current account balance of each user. The history of transactions is also accessible by examining the blockchain's record of this smart contract's previous states.

Depending on the token type, other data structures may be implemented, such as associating an owner with a unique asset identifier or several units of a particular sub-category.

Ledgers internal to a token smart contract
Ledgers internal to token smart contract

Internal Logic

A key characteristic of token smart contracts over a common database is the presence of internal logic and its particular execution environment. The internal logic ensures the digital integrity of an asset. For example, rules over transfer ensure that assets are not duplicated. Each time a transfer is triggered, the internal logic applies controls. 

The execution environment is as important as the code. In most traditional systems, the code is executed by the servers controlled by one legal entity. Banks’ core systems for instance guarantee the integrity of money. In the case of smart contract, the functioning of the public ledger ensures that the code is correctly executed in a trust-minimized manner

Some rules are tied to the governance of the token smart contract. For instance, rules over issuance can provide all participants guarantee on the amounts and processes that could be issued. More technical logic on upgrade mechanisms may have important governance implications too

Example of a token smart contract with its internal logic.
Example of a token smart contract with its internal logic. The logic is presented in a pseudo-code inspired by Solidity and Python.

Interface

The interface is a collection of operations that external programs can use to interact with the token smart contract. This interface acts as a bridge between the smart contract and the outside world, enabling interoperability and integration with other systems and applications.

Primarily, the interface defines functions for reading the ledger. For instance, a function can be utilized to query the current balance of a particular user. The second most important type of method enables the transfer of assets from one user to another. It usually verifies the validity of a signature and updates the ledger accordingly.

Such interfaces must be standardized to facilitate interactions and reduce integration costs. An example is the ERC20 standard in Ethereum, which outlines the fundamental functions of a simple fungible token. As most tokens adhere to these standards, wallets and decentralized protocols can easily interoperate with them.

Some categories of assets, such as Non-Fungible Tokens (NFTs) or security tokens, follow standards more suited to their specific needs. Each public blockchain ecosystem has also established its own standards. This diversity allows for the accommodation of various requirements, but there is a compromise to be made between standardizing essential functions and tailoring for specific needs.

These standards define the logical interface of the smart contract. Other levels of standards, technical or financial, facilitate communication with external programs.

Static Data

Certain data is statically embedded within a smart contract. This data defines the characteristics of the tokens that remain relatively constant over time. 

This information is necessary for the identification of the asset. For instance, fields specifying the name and symbol of the asset are commonly included. Additionally, some data, such as the number of decimals used in the smart contract, serve a more practical purpose.

Initialization of static data for the Link token.
Initialization of static data for the Link token. Source Github

This embedded information can also consist of links to supplementary information. For security tokens, this is commonly used to include legal documentation. For Non-Fungible Tokens (NFTs), it could involve metadata and images. 

Abstract representation of a token smart contract and its external documentation
Abstract representation of a token smart contract and its external documentation

Conversely, a smart contract deployed on public blockchains possesses a unique identifier. This identifier not only serves a technical purpose in distinguishing the smart contract but can also be referenced in legal documents.

Example of financial documentation referencing the address of a token smart contract.
Example of financial documentation referencing the address of a token smart contract. Document source: Backed.fi

The Qualification of Token Smart Contracts

The success of token smart contracts resides in their versatility.  However, this versatility also brings variety in practical, financial, and legal dimensions.

At a fundamental level, a token is technically and practically a digital entry within a ledger. As mentioned earlier, the relevant ledger is situated within the token smart contract, which in turn is part of a more complete ledger at the blockchain level. These ledgers are accessible through any node of the network.

A token is also a social construct, deriving its value from a mutual understanding among developers, promoters and users. Tokens can serve various purposes: they can be used to raise funds with the expectation of returns, enable access to future services, or allow participation in the governance of a project. Essentially, a token facilitates coordination and interaction among different stakeholders.

The original intention was to create new categories outside of established frameworks. However, the past decade has highlighted ambiguities and conflicts arising from these innovations. Legal first principles may offer some guidance. Token smart contracts could be legally interpreted as contracts between parties, as they reflect, along with marketing material, the intentions of the parties and offer an intelligible medium, with each interaction confirmed by a digital signature. Similarly, they can be analysed through property law, representing a form of unincorporated asset.

Additionally, specific regulations govern these tokens, mostly as financial instruments. In the United States, the Securities Exchange Commission has sought to classify them under the Securities Act definition, applying the 'Howey test'. In Europe, the Markets in Crypto-Assets Regulation (MiCA) has provided clarifications, categorizing tokens as E-money tokens, asset-referenced tokens, utility tokens, or financial instruments.

A quadrigatus representing the god Janus that shows several faces simultaneously.

References