Learn how to create a custodial account.
Custodial accounts allow you to manage the signer that owns user accounts, allowing you to transact on their behalf.
For a general overview about the custodial approach, see the Private Key Management.
In this guide you'll learn how to create a player, create a custodial smart account and then mint an NFT.
1. Create a player#
Whenever a new user signs up to your game, you'll need to create a player in Openfort.
After creating a player, you'll receive a
playerId that you can use from this point on to interact with the Openfort API.
2. Create a custodial account#
Openfort players are the entity that has smart accounts associated with them. It can have one smart account per chain and will have the same address across all chains.
It's important to note that these accounts are counterfactual (they are not deployed until the first transaction is executed). Nevertheless, this account can already receive tokens and assets to it.
We now have a fully working implementation that allows us to mint assets for a player.
Don't forget that the newly created account will need to have native tokens to pay for the transaction fees.
We can use Openfort policies to sponsor transactions for our users. This way, you can pay for the transaction fees of your users. Learn how to use them at Sponsoring Transactions.
Check out our working working examples of this quickstart: