NEM Catapult: Understanding Namespaces and Mosaics

NEM Catapult Namespaces, Mosaics, Aliases

Recent updates in NEM have been implemented to the namespace and mosaic features integral to the NEM blockchain’s operations. These updates will further boost the flexibility and functionality of namespaces and mosaics to satisfy enterprise demands. Of course, before we cover the specifics of the changes from NIS1 (the current version of NEM) to Catapult (next NEM core engine), it may be useful to briefly review how the mosaic and namespace features currently work.

Namespace

A namespace is a text string that points to a NEM account address. One can think of it as a public domain name for a NEM account. For example, “dinosaurs” could be owned by a NEM address, NAAAAA-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXX. The fee to establish or renew a namespace for an account in NIS1 is 100 XEM. (Note that for the rest of this post, the words “addresses” and “accounts” will be used interchangeably, as they are essentially equivalent in the NEM-verse.)

Subnamespace

Continuing with the web domain analogy, subnamespaces resembles website subdomains, e.g. a blog.shop.net, to define separate categories within larger namespaces. For example, the subnamespace “ornithischia” could be established under “dinosaurs,” which would be written out in NEM syntax as “dinosaurs.ornithischia.” In NIS1, subnamespaces can additionally have their own subnamespaces, for up to three levels in total, i.e., “dinosaurs.ornithischia.triceratops.” The fee to establish a subnamespace for an account presently is 10 XEM.

Mosaic

A mosaic is a string-named asset defined on the NEM blockchain that is linked to a namespace. On other blockchains, mosaics are also called “tokens.” or “assets”. The originating location of a mosaic on the NEM blockchain would be written out as namespace: mosaic or namespace.subnamespace:mosaic, i.e. “dinosaurs.ornithischia:fossils.” In NIS1, the namespace needed to be created before the mosaic. The fee to create a mosaic for a namespace is presently 10 XEM.

Catapult builds on the achievements of its previous iteration, adding the newest innovations in blockchain technology. Its emphasis lies on scalability, but Catapult will bring overall improvement to the NEM platform. The following changes to namespaces and mosaics will make NEM more convenient and user-friendly.

Namespace registration

In contrast to NIS1, namespace creators will be able to choose the renting duration in Catapult. In the RegisterNamespaceTransaction, the creator can specify the exact number of blocks of desired ownership. During the renting period, it will also be possible to extend the rental by sending another register transaction with the extra-confirmed block to rent the namespace. When a renting period ends, the namespace will become inactive.

Read more: Namespace

Mosaic registration

Mosaics, now detached from namespaces, have an independent expiration time. Catapult introduces the possibility to create mosaics that never expire, which is not possible in the current version.

Read more: Mosaic

Linking namespaces with accounts and mosaics

In Catapult, users will be able to freely manage the linking of namespace and subnamespace addresses (and consequently, aliases) to NEM accounts and mosaics in a manner that is not possible in NEM1. The management of aliases and namespaces will occur through alias transactions, which will include AddressAliasTransaction or MosaicAliasTransaction functions. The new functions will give users added flexibility within the NEM ecosystem. You can think of an alias transaction as a smart contract that assigns the namespace to a different account so it can be recognized easily by an easily human readable format instead of a random string of characters.

To demonstrate, let’s say John registered the namespaces “dinosaur” and “fossils” and respectively associated them as aliases to an address (NBBBBB-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXX) and mosaic(ID:0dc67fbe1cad29e3). In Catapult, Sally could simply input to send 100 “fossils” to “dinosaur” in the NEM wallet interface rather than send 100 “0dc67fbe1cad29e3” to NBBBBB-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXX.

Alias connections can be easily modified. A mosaic ID may be linked and unlinked with any registered namespace. However, only the creators of the mosaics will be able to edit its alias relations, as is appropriate for basic security reasons. Multiple namespaces may be associated with a single address or mosaic, but each namespace must be unique.

Ultimately, aliases are a defining feature in NEM that will separate public chain Catapult from other blockchains. Aliases and namespaces in Catapult will advance the public blockchain user experience by facilitating easier, less confusing, and more secure transaction processes. It will be easier for users to identify, double-check, and copy-paste recognizable and trusted aliases, rather than lengthy addresses.

Read more: Alias

Examples

Address: SantaFrangelina.2019MunicipalMayoralElection.CandidateGonzales

Address: SantaFrangelina.2019MunicipalMayoralElection.CandidateChoi

A third second-level subnamespace is created and assigned to a mosaic as its alias.

Mosaic: SantaFrangelina.2019MunicipalMayoralElection.Vote

We are now ready to proceed with the election by instantiating and issuing mosaics to accounts of eligible voters. The vote mosaic is created, linked to an appropriate namespace, and handed out systematically to all eligible voters. The voters are given time to choose and vote for their preferred candidate. After the deadline has passed, the votes can be counted by checking the balance of the vote mosaics in the respective candidate’s addresses, and the address with a higher amount of votes will win the election.

For another example of how the adaptability of Catapult aliases can be employed, suppose there is a student named Kelly with a NEM address of NCVG35-ZSPMYP-L2POZQ-JGSVEG-RYOJ3V-BNIU3U-N2E6. For convenience’s sake, Kelly might register the namespace Kelly99 and link it to her address for general use. When she enrolls at UCLA, the school might assign UCLA.ID90703 as another alias to her account.

The UCLA namespace can be used for Kelly to specifically interact in the UCLA ecosystem. When she graduates, the namespace can be set to expire and is free to be used by another incoming student.

With these updates, Catapult continues to realize convenient, powerful, and flexible features for enterprise functionality. The developers intend to keep NEM on its path at the cutting edge of blockchain, and will eagerly receive additional input and suggestions on features expansion and technical implementation of Catapult across NEM’s social media channels. Do stay tuned for further updates and development announcements.

Link to the document can be found: here.

References:

https://nemtech.github.io/concepts/namespace.html https://docs.nem.io/ja/nanowallet/mosaics https://nemtech.github.io/guides/mosaic/creating-a-mosaic.html https://nemtech.github.io/guides/namespace/link-a-namespace-to-an-address.html https://nemtech.github.io/guides/namespace/link-a-namespace-to-a-mosaic.html


Originally published at https://blog.nem.io.

NEM Official

NEM is the world's first Smart Asset blockchain. World class platform for asset management.

NEM Official (Editors)

Written by

NEM is the first Smart Asset Blockchain. World class platform for asset management.

NEM Official

NEM is the world's first Smart Asset blockchain. World class platform for asset management.