# Asset Registration and Minting · Asset management system with React and FT4 · Learn Chromia

> This lesson covers how to register a digital asset and mint its starting supply. Each account can register exactly one asset and mint an initial amount of it.

Source: https://chromia.com/learn/ft4-demo-app/module-blockchain/asset-registration/

Asset management system with React and FT4Lesson 7 of 16

1. [01Create an asset management system using FT4](https://chromia.com/learn/ft4-demo-app/introduction/)

Module 1: Initialize the full-stack application

1. [02Overview](https://chromia.com/learn/ft4-demo-app/module-init/)
2. [03Prepare the full-stack application](https://chromia.com/learn/ft4-demo-app/module-init/setup-application/)

Module 2: The blockchain dapp

1. [04Overview](https://chromia.com/learn/ft4-demo-app/module-blockchain/)
2. [05Part 1: Set up the blockchain dapp](https://chromia.com/learn/ft4-demo-app/module-blockchain/setup/)
3. [06Account management](https://chromia.com/learn/ft4-demo-app/module-blockchain/account-management/)
4. [07Asset Registration and Minting](https://chromia.com/learn/ft4-demo-app/module-blockchain/asset-registration/)
5. [08Test the asset management system](https://chromia.com/learn/ft4-demo-app/module-blockchain/test/)

Module 3: The frontend application

1. [09Overview](https://chromia.com/learn/ft4-demo-app/module-frontend-application/)
2. [10Part 1: Prepare the frontend application](https://chromia.com/learn/ft4-demo-app/module-frontend-application/setup/)
3. [11Part 2: Tools for Chromia development](https://chromia.com/learn/ft4-demo-app/module-frontend-application/tools/)
4. [12Part 3: Registering accounts](https://chromia.com/learn/ft4-demo-app/module-frontend-application/account-regisration/)
5. [13Part 4: Registering and minting](https://chromia.com/learn/ft4-demo-app/module-frontend-application/register-and-mint/)
6. [14Part 5: Burning tokens](https://chromia.com/learn/ft4-demo-app/module-frontend-application/burn/)
7. [15Part 6: Transferring assets](https://chromia.com/learn/ft4-demo-app/module-frontend-application/transfer/)
8. [16Part 7: Deploying onchain](https://chromia.com/learn/ft4-demo-app/module-frontend-application/deploy-onchain/)

[Learn](https://chromia.com/learn/)[Asset management system with React and FT4](https://chromia.com/learn/ft4-demo-app/)

07 / 16Module 2: The blockchain dappIntermediate

# Asset Registration and Minting

This lesson covers how to register a digital asset and mint its starting supply. Each account can register exactly one asset and mint an initial amount of it.

## Asset Registration Operation

The operation below registers a new asset and mints it:

src/main.rell

```
import lib.ft4.external.assets.{ get_asset_balances };
import lib.ft4.assets.{ asset, Unsafe, balance };

operation register_and_mint_asset(
    asset_name: text,
    symbol: text,
    decimals: integer,
    amount: big_integer,
    icon_url: text
) {
    val owner_account = auth.authenticate();
    require(get_asset_balances(owner_account.id, 10, null).data.empty(), "One asset allowed");
    functions.register_and_mint_asset(owner_account, asset_name, symbol, decimals, amount, icon_url);
}
```

What the operation does:

* Verifies that the caller is the account owner
* Enforces the limit of one asset per account
* Registers the asset and mints its initial supply

The registration and minting logic itself lives in the functions [namespace](https://docs.chromia.com/rell/language-features/modules/namespace):

src/main.rell

```
namespace functions {
    function register_and_mint_asset(
        owner_account: account,
        asset_name: name,
        symbol: text,
        decimals: integer,
        amount: big_integer,
        icon_url: text
    ) {
        // Derive asset ID
        val asset_id = (asset_name, chain_context.blockchain_rid).hash();

        // Check if asset exists
        val asset = asset @ ? { .id == asset_id };
        if (not empty(asset)) return;

        // Register and mint
        val asset_created = Unsafe.register_asset(asset_name, symbol, decimals, chain_context.blockchain_rid, icon_url);
        Unsafe.mint(owner_account, asset_created, amount);
    }
}
```

Step by step, this code:

1. Creates a unique ID for the asset
2. Looks for an asset that already exists
3. Registers the new asset
4. Mints the initial supply into the owner's account

Written for this site from Chromia’s public course. Code samples are the course’s own.

[← Previous**Account management**](https://chromia.com/learn/ft4-demo-app/module-blockchain/account-management/)[Next →**Test the asset management system**](https://chromia.com/learn/ft4-demo-app/module-blockchain/test/)

On this page

* [Asset Registration Operation](#asset-registration-operation)
