Mosaic

Mosaics are part of what makes the Smart Asset System unique and flexible. They are fixed assets on the NEM blockchain 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.

Properties

Divisibility

Determines the decimal place to which the mosaic can be divided. 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.

Initial supply

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.

NEM works with 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 1000 (absolute) instead.

Duration

Specifies the number of confirmed blocks the mosaic is rented for. Duration is allowed to lie up to 3650 days (10 years). You can also create non-expiring mosaics setting this property to 0.

Flags

Supply mutable

If set to true, the mosaic supply can change at a later point. Otherwise, the mosaic supply remains immutable.

Transferable

../_images/mosaic-transferable.png

Example of a non-transferable mosaic

If set to true, the mosaic can be transferred between arbitrary accounts. Otherwise, the mosaic can only be transferred back to the mosaic creator.

Restrictable

../_images/mosaic-restriction-delegated.png

Example of a mosaic restriction

If set to true, the mosaic owner can configure custom restrictions.

Rental fee

To create a namespace or to extend its duration, accounts will have to pay a transaction fee to support the network in addition to the rental fee. The fees will be deducted from the account’s balance after the announcement of a valid MosaicDefinitionTransaction.

By default, registering a mosaic has an associated configurable cost of 500 cat.currency. The network dynamically adjusts the mosaic rental fees 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 maxRollbackBlocks. In case there are zero multipliers, these are replaced by the defaultDynamicFeeMultiplier before the median calculation.

Guides

Schemas

Note

Configuration parameters are editable. Public network configuration may differ.

MosaicDefinitionTransaction

Announce a MosaicDefinitionTransaction to create a new mosaic.

Version: 0x01

Entity type: 0x414D

Inlines:

Property Type Description
nonce uint32 Random nonce used to generate the mosaic id.
id MosaicId Identifier of the mosaic.
flags MosaicFlag Mosaic flags.
divisibility uint8 Mosaic divisibility. Maximum divisibility is 6.
duration BlockDuration Mosaic duration expressed in blocks. Duration is allowed to lie up to 3650 days (10 years). If set to 0, the mosaic is non-expiring.

MosaicSupplyChangeTransaction

Announce a supply change transaction to increase or decrease a mosaic’s supply.

Version: 0x01

Entity type: 0x424D

Inlines:

Property Type Description
mosaicId UnresolvedMosaicId Affected mosaic identifier.
direction MosaicSupplyChangeAction Supply change direction.
delta Amount Amount of supply to increase or decrease.

Mosaic

Property Type Description
mosaicId MosaicId Mosaic identifier.
amount Amount Mosaic amount.

UnresolvedMosaic

Property Type Description
mosaicId UnresolvedMosaicId Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier.
amount Amount Mosaic amount.

MosaicFlags

Enumeration: uint8

Id Description
0x00 No flags present.
0x01 Mosaic supports supply changes even when mosaic owner owns partial supply.
0x02 Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner.
0x04 Mosaic owner can add rules to restrict which accounts are enabled to send and receive the mosaic.

MosaicSupplyChangeAction

Enumeration: uint8

Id Description
0x00 Decrease.
0x01 Increase.