Chromia
Start Building

03 / 05Advanced

Account registration

Most dapps require users to create an account before they can do anything. Registration is handled by the Chromia FT4 library (Flexible Token 4), Chromia's standard for account and token management.

You can choose from three registration types: Custom, Open, and Transfer.

  • Custom: You write the registration logic yourself, using the create_account_with_auth function.
  • Open: The open strategy registers accounts quickly and charges no fee, which makes it a common choice during development. In production, be careful with it, because anyone could abuse it to spam the network. This strategy uses the register_account function.
  • Transfer: The transfer_subscription, transfer_fee, and transfer_open strategies are templates you configure for your dapp. They rely on the transfer function: a sender transfers a designated amount of tokens to a new account and pays a fee, which starts the registration process. If nobody claims the non-activated account within a set period, the sender can recover the tokens. The transfer_open strategy is the exception, as it registers accounts without charging a fee.
Written for this site from Chromia’s public course. Code samples are the course’s own.