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_authfunction. - Open: The
openstrategy 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 theregister_accountfunction. - Transfer: The
transfer_subscription,transfer_fee, andtransfer_openstrategies 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. Thetransfer_openstrategy 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.