Mosaics are part of what makes the Smart Asset System unique and flexible. They are fixed assets that can represent a set of multiple identical things that do not change.
A mosaic could be a token, but it could also be a collection of more specialized assets such as reward points, shares of stock, signatures, status flags, votes or even other currencies.
Each mosaic has a unique identifier represented as a 64-bit unsigned integer and a set of configurable properties and flags that can be defined during the mosaic creation.
Find below the complete list of configurable properties.
Determines the decimal place to which the mosaic can be divided. A divisibility of 3 means that the smallest fraction a mosaic can be divided into will be 0.001. The divisibility must be in the range of 0 and 6.
Indicates the amount of mosaic in circulation.
The total supply must be in the range of 0 and 9,000,000,000,000,000
atomic units.
Mosaic units in Symbol are defined as absolute amounts. To get an absolute amount, multiply the amount of assets you want to create or send by 10divisibility.
For example, if the mosaic has divisibility 2, to create or send 10 units (relative) you should define 1,000 (absolute) instead.
Specifies the number of confirmed blocks the mosaic is rented for.
It is allowed to lie in Symbol’s public network up to 3650
days (10 years), being this maximum parameter editable per network.
Non-expiring mosaics can be created by setting this property to 0
.
Note
Different from namespaces, a mosaic duration cannot be extended after its creation. Before creating one, consider if your use case requires the mosaic to expire or not.
The following formula is used to convert days to blocks approximately:
If set to true, the mosaic supply can change at a later point.
In this case, the mosaic creator is allowed to redefine the total mosaic supply with a MosaicSupplyChangeTransaction.
The transaction increases or decreases the mosaic supply in delta
units.
To decrease the mosaic supply, the mosaic creator account must own at least delta
units.
This means that the mosaic creator cannot remove mosaics from other account balances, even if the supply mutable property is enabled.
If set to false, the mosaic supply remains immutable. However, if the mosaic creator owns all the mosaic supply, this is modifiable even if the mosaic is defined as not mutable.
If set to true, the mosaic can be transferred between arbitrary accounts. Otherwise, the mosaic can only be transferred back to the mosaic creator.
An account willing to create a mosaic has to pay a rental fee in addition to the transaction fee. Both fees will be deducted from the account’s balance after the announcement of a valid MosaicDefinitionTransaction.
The REST Gateway provides an endpoint to get an estimation of how much network currency will cost you to create a mosaic:
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryHttp = new RepositoryFactoryHttp(nodeUrl);
const networkHttp = repositoryHttp.createNetworkRepository();
networkHttp.getRentalFees().subscribe((rentalFees) => {
console.log(rentalFees.effectiveMosaicRentalFee.compact());
});
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryHttp = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const networkHttp = repositoryHttp.createNetworkRepository();
networkHttp.getRentalFees().subscribe((rentalFees) => {
console.log(rentalFees.effectiveMosaicRentalFee.compact());
});
By default, creating a mosaic in Symbol’s public network has an initial cost of 0.0005
symbol.xym
.
However, the network dynamically adjusts the mosaic rental fee over time.
To calculate the effective rental fee, the network multiplies the default value set in the configuration by the median network multiplier over last maxDifficultyBlocks. In case there are zero multipliers, these are replaced by the defaultDynamicFeeMultiplier before the median calculation.
Tokenize an asset using mosaics.
If a mosaic was created with the “Supply Mutable” property, you can make more tokens or reduce the total supply.
Getting the mosaic information
Get the ownership, divisibility, duration, and flags for a given mosaic identifier.
Continue: Namespaces.
Did you find what you were looking for? Give us your feedback.