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.
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 |
|
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.
|
|
anatomy: |
The
anatomy section has two mandatory
parameters for fungible tokens:
|
|
behavior: |
This section describes the capabilities and restrictions
of the token. The mintable and
transferable behaviors are mandatory for fungible
tokens.
|
|
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.