# Create user accounts · Decentralized marketplace with FT4 · Learn Chromia

> This course centers on building a marketplace, with token transfers as the core topic, so account creation is kept deliberately simple.

Source: https://chromia.com/learn/marketplace-course/module-ft4/register-account/

Decentralized marketplace with FT4Lesson 5 of 15

1. [01Decentralized marketplace with FT4](https://chromia.com/learn/marketplace-course/introduction/)
2. [02Set up your project](https://chromia.com/learn/marketplace-course/setup/)

Module 1: Registering accounts and assets

1. [03Overview](https://chromia.com/learn/marketplace-course/module-ft4/)
2. [04Register payment token](https://chromia.com/learn/marketplace-course/module-ft4/register-token/)
3. [05Create user accounts](https://chromia.com/learn/marketplace-course/module-ft4/register-account/)

Module 2: Model NFTs in Rell

1. [06Overview](https://chromia.com/learn/marketplace-course/module-nft/)
2. [07Define the NFT model](https://chromia.com/learn/marketplace-course/module-nft/nft/)
3. [08Mint NFTs](https://chromia.com/learn/marketplace-course/module-nft/mint-nfts/)
4. [09Make card attributes random](https://chromia.com/learn/marketplace-course/module-nft/randomness/)

Module 3: Create the marketplace

1. [10Overview](https://chromia.com/learn/marketplace-course/module-assets/)
2. [11Charge a fee for mystery card purchases](https://chromia.com/learn/marketplace-course/module-assets/buy-mystery-card/)
3. [12Put a card up for sale on the marketplace](https://chromia.com/learn/marketplace-course/module-assets/list-card/)
4. [13Buy a card on the marketplace](https://chromia.com/learn/marketplace-course/module-assets/buy-listed-card/)
5. [14Test our marketplace](https://chromia.com/learn/marketplace-course/module-assets/test-marketplace/)
6. [15Test using Chromia CLI](https://chromia.com/learn/marketplace-course/module-assets/test-cli/)

[Learn](https://chromia.com/learn/)[Decentralized marketplace with FT4](https://chromia.com/learn/marketplace-course/)

05 / 15Module 1: Registering accounts and assetsAdvanced

# Create user accounts

This course centers on building a marketplace, with token transfers as the core topic, so account creation is kept deliberately simple.

For a full walkthrough of registering accounts with EVM wallets, see the [account registration lesson in the News feed dapp course](https://chromia.com/learn/my-news-feed/module-one/register-evm-accounts/).

## Configure FT4 account module

To set up FT4 accounts, add the configuration below to the `lib.ft4.core.accounts` module.

chromia.yml

```
blockchains:
  rell_marketplace:
    module: main
    moduleArgs:
      lib.ft4.core.accounts:
        rate_limit:
          max_points: 10
          recovery_time: 5000
          points_at_account_creation: 2
compile:
  rellVersion: 0.14.9
database:
  schema: schema_rell_marketplace
test:
  modules:
    - rell_marketplace_test
libs:
  ft4:
    registry: https://gitlab.com/chromaway/ft4-lib.git
    path: rell/src/lib/ft4
    tagOrBranch: v1.2.0r
    rid: x"E96915FD7C9A5DD4E183D86F4A5B4BB5083A7CC1EDEB1465EDFFC926E67C93F6"
    insecure: false
  iccf:
    registry: https://gitlab.com/chromaway/core/directory-chain
    path: src/lib/iccf
    tagOrBranch: 1.87.0
    rid: x"9C359787B75927733034EA1CEE74EEC8829D2907E4FC94790B5E9ABE4396575D"
    insecure: false
```

With the rate-limit setting `points_at_account_creation` set to 2, a new account starts with 2 points, so it can perform 2 operations before it has to wait for points to recover. The `recovery_time` property controls how long points take to recover and defaults to 5000ms. You can also cap the points an account can hold with `max_points`, or turn rate limiting off entirely by setting `active` to false.

To confirm the configuration file is valid, start the node with `chr node start`, then read the config back with `chr query ft4.get_config`.

## Create a user account

With the configuration in place, you can move on to registering a user account.

You will write an operation that creates an account holding 1000 tokens. First, add these imports to `src/rell_marketplace/module.rell`:

src/rell\_marketplace/module.rell

```nolines
import lib.ft4.core.accounts.{ account, create_account_with_auth, single_sig_auth_descriptor };
```

Then create the file `src/rell_marketplace/accounts.rell` with the following content:

src/rell\_marketplace/accounts.rell

```
operation create_user(pubkey) {
    val account = create_account_with_auth(single_sig_auth_descriptor(pubkey, set(["A", "T"])));
    Unsafe.mint(account, dapp_meta.asset, 1000);
}
```

This operation creates an account for the given pubkey and attaches an auth descriptor carrying the flags `A` and `T`. As a result, the registered key can run administrator commands, such as adding or removing other auth descriptors, and can make transfers. The operation then mints 1000 tokens into the account. This setup exists only for testing and learning, which is why it skips any additional security measures around token and account creation.

To go deeper into working with auth descriptors and accounts, take the course [Build a simple Chromia app with Rell and React](https://chromia.com/learn/my-news-feed/introduction/).

The next lesson covers an NFT model, which represents the asset traded in the marketplace.

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

[← Previous**Register payment token**](https://chromia.com/learn/marketplace-course/module-ft4/register-token/)[Next →**Module 2: Model NFTs in Rell**](https://chromia.com/learn/marketplace-course/module-nft/)

On this page

* [Configure FT4 account module](#configure-ft4-account-module)
* [Create a user account](#create-a-user-account)
