Input Specification File for Token Taxonomy Framework

The Blockchain App Builder initialization command reads the input specification file and generates the scaffolded project with several tools to assist in the chaincode development process.

You can define standard assets and token assets that are based on the Token Taxonomy Framework in the same specification file. You cannot define token assets based on more than one standard in the same specification file.

For information on including standard assets in the specification file, see Input Specification File.

The following sample specification files for fungible token assets are available in the Blockchain App Builder package:
  • FiatMoneyToken.yml
  • LoyaltyToken-Go.yml

In addition to the standard properties and sections, fungible token assets support the behavior and anatomy sections in the specification file. Fungible token assets also support the standard property. The following example shows the structure of a specification file for a fungible token asset based on the Token Taxonomy Framework:

assets:
    - name: OBPTOK # Asset name
      type: token  # Asset type

      anatomy: 
          type: fungible # Token type
          unit: fractional # Token unit

      behavior: # Token behaviors
          - divisible: 
                decimal: 2  
          - mintable: 
                max_mint_quantity: 1000 
          - transferable
          - burnable 
          - roles: 
                minter_role_name: minter 

      properties:
          - name: currency_name # Custom attribute to represent the token in certain currency. This attribute is helpful for exchanging the tokens with fiat currency.
            type: string

          - name: token_to_currency_ratio # Custom attribute to specify the token to currency ratio. This attribute is helpful for exchanging the tokens with fiat currency.
            type: number

Table 7-5 Parameter Descriptions and Examples for a Fungible Token Specification File

Entry Description Examples
type:

You must specify type: token in the assets section.

assets:
    - name: OBPTOK # Asset name
      type: token  # Asset type
standard: The standard property represents the token standard to follow during chaincode generation. Only the ttf+ value is supported for fungible tokens. If the standard property is not specified for a fungible token, the Token Taxonomy Framework (TTF) standard is followed.

      standard: ttf+ # Token standard
anatomy:
The anatomy section has two mandatory parameters for fungible tokens:
  • type: fungible

    A quantity of fungible tokens has the same value as another equal quantity of the same class of tokens.

  • unit: fractional

    A fractional token can be subdivided into smaller units based on a specified number of decimal places.

anatomy: 
          type: fungible # Token type
          unit: fractional # Token unit
behavior: This section describes the capabilities and restrictions of the token. The mintable and transferable behaviors are mandatory for fungible tokens.
  • mintable: This mandatory behavior supports minting new token instances. The optional max_mint_quantity parameter specifies the total number of tokens that can be minted. If you do not specify the max_mint_quantity parameter, any number of tokens can be minted.
  • transferable: This mandatory behavior supports transferring ownership of tokens.
  • divisible: This optional behavior describes how tokens can be subdivided. The decimal parameter specifies the number of decimal places that can be used. The smallest fraction possible with the number of decimal places is the smallest unit of the token that can be owned. If the decimal parameter is not specified, the default is zero decimal places.
  • burnable: This optional behavior supports deactivating, or burning, tokens. Burning does not delete a token but instead places it in a permanent state where it cannot be used. Burning is not reversible.
  • holdable: This optional behavior indicates whether token balances can be put on hold between a payer and payee.
  • roles: This optional behavior restricts token behaviors to users with specific roles. Currently three roles are available: minter_role_name, burner_role_name, and notary_role_name. If you do not specify roles, then any user can act as a minter, burner, or notary. For example, if the burner role is not specified, any account user implicitly has the burner role. If the burner role is specified, then during the token setup process, the Token Admin user must assign the burner role to other users explicitly.
behavior:
  - mintable:
        max_mint_quantity: 20000
  - transferable
  - divisible:
        decimal: 1
  - burnable
  - holdable
  - roles:
        minter_role_name: minter
        burner_role_name: burner
        notary_role_name: notary

To create multiple fungible token IDs that use different max_mint_quantity parameters, create a separate token asset for each token ID in the specification file, with a 1:1 relationship between token asset and token ID.

To create multiple fungible token IDs that use the same max_mint_quantity parameter or no max_mint_quantity parameter, create a single token asset in the specification file to use for all of the token IDs.