Symbol Mosaic Revocation Transaction In Metaverse
Tags: symbol, catapult, blockchain, metaverse
Published: 2021-12-01 10:24:39

---
title: Symbol Mosaic Revocation Transaction In Metaverse
tags: Symbol, Catapult, Blockchain, metaverse
author: AnthonyLaw
slide: false
---

## Introduction

In the new [catapult-client v1.0.3.0](https://github.com/symbol/catapult-client/releases/tag/v1.0.3.0), Symbol has added a **Mosaic Supply Revocation** transaction type and a **Revokable** mosaic flag.

Mosaic Supply Revocation allows the mosaic **creator** to collect back any mosaics flagged as **Revokable** from whoever holds them, at anytime.

## How it works

The Mosaic Supply Revocation transaction only works with Revokable Mosaics.

As an example, imagine a private property in the XYM City metaverse, where you must have access permission from the property owner to enter.

Let's assume a private property called **Bull Fight Club**. Users must own a `BFC.daily-pass` mosaic to enter the club, which can be purchased from the counter.

![BFC Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6435vgnvo8hyt4ww50go.png)

Bull Fight Club will issue one `BFC.daily-pass` revokable mosaic to a user once received the 10 XYM payment.

![Process](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2lhlbk3k0hgxfr3bluab.png)

When daily pass expires, Bull Fight Club can issue a Mosaic Supply Revocation transaction to collect back the `BFC.daily-pass` without user interaction.

![Mosaic Supply Revocation transaction](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jil9l766961umw57u4ro.png)

## Example code
### Create revokable mosaic
I just want to highlight the new code. Refer to the full [example here](https://docs.symbolplatform.com/guides/mosaic/creating-a-mosaic.html#method-02-using-the-sdk).

When creating Revokable mosaics, I suggest you also make Transferable=false to prevent the recipient from transferring the mosaic to another account. Otherwise, recovering the mosaic will be harder.

```ts
const BFC_Operator = Account.createFromPrivateKey(privateKey, networkType);

const isSupplyMutable = true;
const isTransferable = false; <-- prevert recipient trasfer to other
const isRestrictable = true;
const isRevokable = true; <--- New flag

const nonce = MosaicNonce.createRandom();
const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create(
  Deadline.create(epochAdjustment),
  nonce,
  MosaicId.createFromNonce(nonce, BFC_Operator.address),
  MosaicFlags.create(isSupplyMutable, isTransferable, isRestrictable, isRevokable),
  0, // divisibility
  UInt64.fromUint(0), // duration
  networkType,
);
```

### Mosaic Supply Revocation transaction
This transaction allows the mosaic owner to collect back revokable mosaic from the specified holder.

```ts
const mosaicSupplyRevocationTransaction = MosaicSupplyRevocationTransaction.create(
  Deadline.create(epochAdjustment),
  holderAddress,
  new Symbol.Mosaic(new 
    Symbol.MosaicId('revokable_mosaic_id'), 
    Symbol.UInt64.fromUint(1)), // mosaic unit 
  networkType,
  maxFee,
)
```

## Summary

The **Revokable** mosaic flag and the **Mosaic supply revocation** transaction are super handy for the business operator who likes to control supply and reuse mosaics.

In my opinion, the benefit to using it is that the owner of the mosaic can easily control the mosaic supply, and collect back the mosaics without the user paying any fees. The downside is that the holder of the mosaic does not have any control over it.

Just **be cautious**, revokable mosaics are not suitable to represent currency/token or share. When doing any mosaic trading, **always ensure you understand the mosaic flags and purpose**. Keep in mind that any received **revokable mosaics can be reclaimed at any time** without your consent!

If you would like to know more about Symbol, please join the [Discord](https://discord.com/invite/xymcity).

Special thanks to [Xavi](https://twitter.com/sigsegvx) for reviewing this article.