Tokens and the Account/Balance Model
Blockchain App Builder supports fungible and non-fungible tokens.
Fungible tokens have an interchangeable value. Any quantity of fungible tokens has the same value as any other equal quantity of the same class of token. Non-fungible tokens are unique. Tokens can also be either whole or fractional. Fractional tokens can be subdivided into smaller parts, based on a specified number of decimal places.
Tokens can also be described by behaviors. Supported behaviors for fungible
tokens include: mintable
, transferable
,
divisible
, holdable
, burnable
,
and roles
(minter
, burner
, and
holder
). Supported behaviors for non-fungible tokens include:
mintable
, transferable
,
singleton
, indivisible
, burnable
, and
roles
(minter
and burner
).
The tokenization feature uses an account/balance model to represent tokenized assets as balances in an account. Accounts are similar to typical banking accounts, where deposits and transfers and other state transitions affect the balance of an account. The balance of every account is tracked globally, to ensure that transaction amounts are valid. The on-hold balance (for fungible tokens) and transaction history are also tracked.
Any user who possesses tokens or completes token-related operations at any
point must have an account on the network. Every account is identified by a unique ID
(account_id
). The account ID is created by combining a user name or
email ID (user_id
) of the instance owner or the user who is logged in
to the instance with the membership service provider ID (org_id
) of the
user in the current network organization. Ready-to-use methods are provided for account
creation. Because the account ID includes the organization ID, users can be supported
across multiple organizations.